M3 Overhaul

This commit is contained in:
2026-03-06 20:03:32 +08:00
parent 82fe619f22
commit 73dc735cce
32 changed files with 1940 additions and 682 deletions
+9 -9
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../models/office.dart';
import '../../models/profile.dart';
@@ -257,10 +258,10 @@ class _TeamsScreenState extends ConsumerState<TeamsScreen> {
loading: () => const Center(child: CircularProgressIndicator()),
error: (err, stack) => Center(child: Text('Error: $err')),
),
floatingActionButton: FloatingActionButton(
floatingActionButton: M3Fab(
onPressed: () => _showTeamDialog(context),
tooltip: 'Add Team',
child: const Icon(Icons.add),
icon: const Icon(Icons.add),
),
);
}
@@ -520,10 +521,9 @@ class _TeamsScreenState extends ConsumerState<TeamsScreen> {
if (isMobileDialog) {
// Mobile: bottom sheet presentation
await showModalBottomSheet<void>(
await m3ShowBottomSheet<void>(
context: context,
isScrollControlled: true,
shape: AppSurfaces.of(context).dialogShape,
builder: (sheetContext) {
return StatefulBuilder(
builder: (sheetContext, setState) {
@@ -555,7 +555,7 @@ class _TeamsScreenState extends ConsumerState<TeamsScreen> {
child: const Text('Cancel'),
),
const SizedBox(width: 8),
ElevatedButton(
FilledButton(
onPressed: () => onSave(setState, navigator),
child: Text(isEdit ? 'Save' : 'Add'),
),
@@ -571,7 +571,7 @@ class _TeamsScreenState extends ConsumerState<TeamsScreen> {
);
} else {
// Desktop / Tablet: centered fixed-width AlertDialog
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
return Center(
@@ -589,7 +589,7 @@ class _TeamsScreenState extends ConsumerState<TeamsScreen> {
onPressed: () => navigator.pop(),
child: const Text('Cancel'),
),
ElevatedButton(
FilledButton(
onPressed: () => onSave(setState, navigator),
child: Text(isEdit ? 'Save' : 'Add'),
),
@@ -605,7 +605,7 @@ class _TeamsScreenState extends ConsumerState<TeamsScreen> {
}
void _deleteTeam(BuildContext context, String teamId) async {
final confirmed = await showDialog<bool?>(
final confirmed = await m3ShowDialog<bool?>(
context: context,
builder: (dialogContext) => AlertDialog(
shape: AppSurfaces.of(dialogContext).dialogShape,
@@ -619,7 +619,7 @@ class _TeamsScreenState extends ConsumerState<TeamsScreen> {
onPressed: () => Navigator.of(dialogContext).pop(false),
child: const Text('Cancel'),
),
ElevatedButton(
FilledButton(
onPressed: () => Navigator.of(dialogContext).pop(true),
child: const Text('Delete'),
),