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
+2 -1
View File
@@ -370,7 +370,8 @@ class _GeofenceTestScreenState extends ConsumerState<GeofenceTestScreen> {
right: 12,
top: 12,
child: Card(
elevation: 2,
elevation: 0,
shadowColor: Colors.transparent,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10.0,
+4 -3
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';
@@ -153,7 +154,7 @@ class _OfficesScreenState extends ConsumerState<OfficesScreen> {
right: 16,
bottom: 16,
child: SafeArea(
child: FloatingActionButton.extended(
child: M3ExpandedFab(
onPressed: () => _showOfficeDialog(context, ref),
icon: const Icon(Icons.add),
label: const Text('New Office'),
@@ -172,7 +173,7 @@ class _OfficesScreenState extends ConsumerState<OfficesScreen> {
final nameController = TextEditingController(text: office?.name ?? '');
String? selectedServiceId = office?.serviceId;
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
bool saving = false;
@@ -298,7 +299,7 @@ class _OfficesScreenState extends ConsumerState<OfficesScreen> {
WidgetRef ref,
Office office,
) async {
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
return AlertDialog(
+21 -12
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';
@@ -306,7 +307,7 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
}
if (!context.mounted) return;
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
return StatefulBuilder(
@@ -314,8 +315,8 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
return AlertDialog(
shape: AppSurfaces.of(context).dialogShape,
title: const Text('Update user'),
content: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 520),
content: SizedBox(
width: 520,
child: SingleChildScrollView(
child: _buildUserForm(
context,
@@ -442,10 +443,17 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
const SizedBox(height: 8),
if (offices.isEmpty) const Text('No offices available.'),
if (offices.isNotEmpty)
Column(
children: offices
.map(
(office) => CheckboxListTile(
Container(
height: 240,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).dividerColor),
borderRadius: BorderRadius.circular(4),
),
child: SingleChildScrollView(
child: Column(
children: offices.map((office) {
return CheckboxListTile(
value: _selectedOfficeIds.contains(office.id),
onChanged: _isSaving
? null
@@ -460,10 +468,11 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
},
title: Text(office.name),
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.zero,
),
)
.toList(),
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
);
}).toList(),
),
),
),
const SizedBox(height: 16),
Row(
@@ -559,7 +568,7 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
final controller = TextEditingController();
final formKey = GlobalKey<FormState>();
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
return AlertDialog(
+247 -86
View File
@@ -7,7 +7,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart';
import '../../providers/auth_provider.dart';
import '../../widgets/responsive_body.dart';
import '../../theme/m3_motion.dart';
import '../../utils/snackbar.dart';
class LoginScreen extends ConsumerStatefulWidget {
@@ -17,15 +17,39 @@ class LoginScreen extends ConsumerStatefulWidget {
ConsumerState<LoginScreen> createState() => _LoginScreenState();
}
class _LoginScreenState extends ConsumerState<LoginScreen> {
class _LoginScreenState extends ConsumerState<LoginScreen>
with SingleTickerProviderStateMixin {
final _formKey = GlobalKey<FormState>();
final _emailController = TextEditingController();
final _passwordController = TextEditingController();
late final AnimationController _entranceController;
late final Animation<double> _fadeIn;
late final Animation<Offset> _slideIn;
bool _isLoading = false;
bool _obscurePassword = true;
@override
void initState() {
super.initState();
_entranceController = AnimationController(
vsync: this,
duration: M3Motion.long,
);
_fadeIn = CurvedAnimation(
parent: _entranceController,
curve: M3Motion.emphasizedEnter,
);
_slideIn = Tween<Offset>(
begin: const Offset(0, 0.06),
end: Offset.zero,
).animate(_fadeIn);
_entranceController.forward();
}
@override
void dispose() {
_entranceController.dispose();
_emailController.dispose();
_passwordController.dispose();
super.dispose();
@@ -83,93 +107,230 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
final tt = Theme.of(context).textTheme;
return Scaffold(
appBar: AppBar(title: const Text('Sign In')),
body: ResponsiveBody(
maxWidth: 480,
padding: const EdgeInsets.symmetric(vertical: 24),
child: Form(
key: _formKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Center(
child: Column(
children: [
Image.asset('assets/tasq_ico.png', height: 72, width: 72),
const SizedBox(height: 12),
Text(
'TasQ',
style: Theme.of(context).textTheme.headlineSmall,
),
],
body: SafeArea(
child: Center(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 32),
child: FadeTransition(
opacity: _fadeIn,
child: SlideTransition(
position: _slideIn,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 420),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// ── Branding ──
Hero(
tag: 'tasq-logo',
child: Image.asset(
'assets/tasq_ico.png',
height: 80,
width: 80,
),
),
const SizedBox(height: 16),
Text(
'TasQ',
style: tt.headlineMedium?.copyWith(
fontWeight: FontWeight.w700,
color: cs.primary,
),
),
const SizedBox(height: 4),
Text(
'Task management, simplified',
style: tt.bodyMedium?.copyWith(
color: cs.onSurfaceVariant,
),
),
const SizedBox(height: 32),
// ── Sign-in card ──
Card(
elevation: 0,
color: cs.surfaceContainerLow,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(28),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 28,
),
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'Sign in',
style: tt.titleLarge?.copyWith(
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 20),
TextFormField(
controller: _emailController,
decoration: const InputDecoration(
labelText: 'Email',
prefixIcon: Icon(Icons.email_outlined),
),
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.trim().isEmpty) {
return 'Email is required.';
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
controller: _passwordController,
decoration: InputDecoration(
labelText: 'Password',
prefixIcon: const Icon(Icons.lock_outlined),
suffixIcon: IconButton(
icon: Icon(
_obscurePassword
? Icons.visibility_outlined
: Icons.visibility_off_outlined,
),
onPressed: () => setState(
() => _obscurePassword =
!_obscurePassword,
),
),
),
obscureText: _obscurePassword,
textInputAction: TextInputAction.done,
onFieldSubmitted: (_) {
if (!_isLoading) _handleEmailSignIn();
},
validator: (value) {
if (value == null || value.isEmpty) {
return 'Password is required.';
}
return null;
},
),
const SizedBox(height: 24),
M3AnimatedSwitcher(
child: _isLoading
? const SizedBox(
key: ValueKey('loading'),
height: 48,
child: Center(
child: CircularProgressIndicator(),
),
)
: FilledButton(
key: const ValueKey('sign-in'),
onPressed: _handleEmailSignIn,
style: FilledButton.styleFrom(
minimumSize: const Size.fromHeight(
48,
),
),
child: const Text('Sign In'),
),
),
],
),
),
),
),
const SizedBox(height: 20),
// ── Divider ──
Row(
children: [
Expanded(child: Divider(color: cs.outlineVariant)),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
'or continue with',
style: tt.labelMedium?.copyWith(
color: cs.onSurfaceVariant,
),
),
),
Expanded(child: Divider(color: cs.outlineVariant)),
],
),
const SizedBox(height: 20),
// ── OAuth buttons ──
Row(
children: [
Expanded(
child: OutlinedButton.icon(
onPressed: _isLoading
? null
: () => _handleOAuthSignIn(google: true),
icon: const FaIcon(
FontAwesomeIcons.google,
size: 18,
),
label: const Text('Google'),
style: OutlinedButton.styleFrom(
minimumSize: const Size.fromHeight(48),
),
),
),
const SizedBox(width: 12),
Expanded(
child: OutlinedButton.icon(
onPressed: _isLoading
? null
: () => _handleOAuthSignIn(google: false),
icon: const FaIcon(
FontAwesomeIcons.facebook,
size: 18,
),
label: const Text('Meta'),
style: OutlinedButton.styleFrom(
minimumSize: const Size.fromHeight(48),
),
),
),
],
),
const SizedBox(height: 24),
// ── Create account link ──
TextButton(
onPressed: _isLoading
? null
: () => context.go('/signup'),
child: Text.rich(
TextSpan(
text: "Don't have an account? ",
style: tt.bodyMedium?.copyWith(
color: cs.onSurfaceVariant,
),
children: [
TextSpan(
text: 'Sign up',
style: TextStyle(
color: cs.primary,
fontWeight: FontWeight.w600,
),
),
],
),
),
),
],
),
),
),
const SizedBox(height: 24),
TextFormField(
controller: _emailController,
decoration: const InputDecoration(labelText: 'Email'),
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.trim().isEmpty) {
return 'Email is required.';
}
return null;
},
),
const SizedBox(height: 12),
TextFormField(
controller: _passwordController,
decoration: const InputDecoration(labelText: 'Password'),
obscureText: true,
textInputAction: TextInputAction.done,
onFieldSubmitted: (_) {
if (!_isLoading) {
_handleEmailSignIn();
}
},
validator: (value) {
if (value == null || value.isEmpty) {
return 'Password is required.';
}
return null;
},
),
const SizedBox(height: 24),
FilledButton(
onPressed: _isLoading ? null : _handleEmailSignIn,
child: _isLoading
? const SizedBox(
height: 18,
width: 18,
child: CircularProgressIndicator(strokeWidth: 2),
)
: const Text('Sign In'),
),
const SizedBox(height: 12),
OutlinedButton.icon(
onPressed: _isLoading
? null
: () => _handleOAuthSignIn(google: true),
icon: const FaIcon(FontAwesomeIcons.google, size: 18),
label: const Text('Continue with Google'),
),
const SizedBox(height: 8),
OutlinedButton.icon(
onPressed: _isLoading
? null
: () => _handleOAuthSignIn(google: false),
icon: const FaIcon(FontAwesomeIcons.facebook, size: 18),
label: const Text('Continue with Meta'),
),
const SizedBox(height: 16),
TextButton(
onPressed: _isLoading ? null : () => context.go('/signup'),
child: const Text('Create account'),
),
],
),
),
),
),
+399 -187
View File
@@ -4,7 +4,7 @@ import 'package:go_router/go_router.dart';
import '../../providers/auth_provider.dart';
import '../../providers/tickets_provider.dart';
import '../../widgets/responsive_body.dart';
import '../../theme/m3_motion.dart';
import '../../utils/snackbar.dart';
class SignUpScreen extends ConsumerStatefulWidget {
@@ -14,28 +14,49 @@ class SignUpScreen extends ConsumerStatefulWidget {
ConsumerState<SignUpScreen> createState() => _SignUpScreenState();
}
class _SignUpScreenState extends ConsumerState<SignUpScreen> {
class _SignUpScreenState extends ConsumerState<SignUpScreen>
with SingleTickerProviderStateMixin {
final _formKey = GlobalKey<FormState>();
final _fullNameController = TextEditingController();
final _emailController = TextEditingController();
final _passwordController = TextEditingController();
final _confirmPasswordController = TextEditingController();
late final AnimationController _entranceController;
late final Animation<double> _fadeIn;
late final Animation<Offset> _slideIn;
final Set<String> _selectedOfficeIds = {};
double _passwordStrength = 0.0;
String _passwordStrengthLabel = 'Very weak';
Color _passwordStrengthColor = Colors.red;
bool _isLoading = false;
bool _obscurePassword = true;
bool _obscureConfirm = true;
@override
void initState() {
super.initState();
_passwordController.addListener(_updatePasswordStrength);
_entranceController = AnimationController(
vsync: this,
duration: M3Motion.long,
);
_fadeIn = CurvedAnimation(
parent: _entranceController,
curve: M3Motion.emphasizedEnter,
);
_slideIn = Tween<Offset>(
begin: const Offset(0, 0.06),
end: Offset.zero,
).animate(_fadeIn);
_entranceController.forward();
}
@override
void dispose() {
_entranceController.dispose();
_passwordController.removeListener(_updatePasswordStrength);
_fullNameController.dispose();
_emailController.dispose();
@@ -76,196 +97,377 @@ class _SignUpScreenState extends ConsumerState<SignUpScreen> {
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
final tt = Theme.of(context).textTheme;
final officesAsync = ref.watch(officesOnceProvider);
return Scaffold(
appBar: AppBar(title: const Text('Create Account')),
body: ResponsiveBody(
maxWidth: 480,
padding: const EdgeInsets.symmetric(vertical: 24),
child: SingleChildScrollView(
child: Form(
key: _formKey,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Center(
body: SafeArea(
child: Center(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 32),
child: FadeTransition(
opacity: _fadeIn,
child: SlideTransition(
position: _slideIn,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 420),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset('assets/tasq_ico.png', height: 72, width: 72),
const SizedBox(height: 12),
// ── Branding ──
Hero(
tag: 'tasq-logo',
child: Image.asset(
'assets/tasq_ico.png',
height: 80,
width: 80,
),
),
const SizedBox(height: 16),
Text(
'TasQ',
style: Theme.of(context).textTheme.headlineSmall,
style: tt.headlineMedium?.copyWith(
fontWeight: FontWeight.w700,
color: cs.primary,
),
),
const SizedBox(height: 4),
Text(
'Create your account',
style: tt.bodyMedium?.copyWith(
color: cs.onSurfaceVariant,
),
),
const SizedBox(height: 32),
// ── Sign-up card ──
Card(
elevation: 0,
color: cs.surfaceContainerLow,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(28),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 28,
),
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'Sign up',
style: tt.titleLarge?.copyWith(
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 20),
TextFormField(
controller: _fullNameController,
decoration: const InputDecoration(
labelText: 'Full name',
prefixIcon: Icon(Icons.person_outlined),
),
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.trim().isEmpty) {
return 'Full name is required.';
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
controller: _emailController,
decoration: const InputDecoration(
labelText: 'Email',
prefixIcon: Icon(Icons.email_outlined),
),
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.trim().isEmpty) {
return 'Email is required.';
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
controller: _passwordController,
decoration: InputDecoration(
labelText: 'Password',
prefixIcon: const Icon(Icons.lock_outlined),
suffixIcon: IconButton(
icon: Icon(
_obscurePassword
? Icons.visibility_outlined
: Icons.visibility_off_outlined,
),
onPressed: () => setState(
() => _obscurePassword =
!_obscurePassword,
),
),
),
obscureText: _obscurePassword,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Password is required.';
}
if (value.length < 6) {
return 'Use at least 6 characters.';
}
return null;
},
),
const SizedBox(height: 8),
// ── Password strength (AnimatedSize) ──
AnimatedSize(
duration: M3Motion.short,
curve: M3Motion.standard_,
child: _passwordController.text.isEmpty
? const SizedBox.shrink()
: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
'Strength: ',
style: tt.labelSmall
?.copyWith(
color:
cs.onSurfaceVariant,
),
),
Text(
_passwordStrengthLabel,
style: tt.labelSmall?.copyWith(
color:
_passwordStrengthColor,
fontWeight: FontWeight.w600,
),
),
],
),
const SizedBox(height: 6),
ClipRRect(
borderRadius:
BorderRadius.circular(8),
child: LinearProgressIndicator(
value: _passwordStrength,
minHeight: 6,
color: _passwordStrengthColor,
backgroundColor:
cs.surfaceContainerHighest,
),
),
const SizedBox(height: 8),
],
),
),
TextFormField(
controller: _confirmPasswordController,
decoration: InputDecoration(
labelText: 'Confirm password',
prefixIcon: const Icon(Icons.lock_outlined),
suffixIcon: IconButton(
icon: Icon(
_obscureConfirm
? Icons.visibility_outlined
: Icons.visibility_off_outlined,
),
onPressed: () => setState(
() =>
_obscureConfirm = !_obscureConfirm,
),
),
),
obscureText: _obscureConfirm,
textInputAction: TextInputAction.done,
onFieldSubmitted: (_) {
if (!_isLoading) _handleSignUp();
},
validator: (value) {
if (value == null || value.isEmpty) {
return 'Confirm your password.';
}
if (value != _passwordController.text) {
return 'Passwords do not match.';
}
return null;
},
),
const SizedBox(height: 20),
// ── Office selection ──
Text('Offices', style: tt.titleSmall),
const SizedBox(height: 8),
officesAsync.when(
data: (offices) {
if (offices.isEmpty) {
return Text(
'No offices available.',
style: tt.bodySmall?.copyWith(
color: cs.onSurfaceVariant,
),
);
}
final officeNameById = <String, String>{
for (final o in offices) o.id: o.name,
};
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
FilledButton.tonalIcon(
onPressed: _isLoading
? null
: () =>
_showOfficeSelectionDialog(
offices,
),
icon: const Icon(
Icons.place_outlined,
),
label: const Text('Select Offices'),
),
const SizedBox(height: 8),
AnimatedSize(
duration: M3Motion.short,
curve: M3Motion.standard_,
child: _selectedOfficeIds.isEmpty
? Padding(
padding:
const EdgeInsets.only(
top: 4,
),
child: Text(
'No office selected.',
style: tt.bodySmall
?.copyWith(
color: cs
.onSurfaceVariant,
),
),
)
: Builder(
builder: (context) {
final sortedIds =
List<String>.from(
_selectedOfficeIds,
)..sort(
(
a,
b,
) => (officeNameById[a] ?? a)
.toLowerCase()
.compareTo(
(officeNameById[b] ??
b)
.toLowerCase(),
),
);
return Wrap(
spacing: 8,
runSpacing: 8,
children: sortedIds.map((
id,
) {
final name =
officeNameById[id] ??
id;
return Chip(
label: Text(name),
onDeleted: _isLoading
? null
: () {
setState(
() => _selectedOfficeIds
.remove(
id,
),
);
},
);
}).toList(),
);
},
),
),
],
);
},
loading: () =>
const LinearProgressIndicator(),
error: (error, _) =>
Text('Failed to load offices: $error'),
),
const SizedBox(height: 24),
M3AnimatedSwitcher(
child: _isLoading
? const SizedBox(
key: ValueKey('loading'),
height: 48,
child: Center(
child: CircularProgressIndicator(),
),
)
: FilledButton(
key: const ValueKey('sign-up'),
onPressed: _handleSignUp,
style: FilledButton.styleFrom(
minimumSize: const Size.fromHeight(
48,
),
),
child: const Text('Create Account'),
),
),
],
),
),
),
),
const SizedBox(height: 24),
// ── Back to sign in ──
TextButton(
onPressed: _isLoading
? null
: () => context.go('/login'),
child: Text.rich(
TextSpan(
text: 'Already have an account? ',
style: tt.bodyMedium?.copyWith(
color: cs.onSurfaceVariant,
),
children: [
TextSpan(
text: 'Sign in',
style: TextStyle(
color: cs.primary,
fontWeight: FontWeight.w600,
),
),
],
),
),
),
],
),
),
const SizedBox(height: 24),
TextFormField(
controller: _fullNameController,
decoration: const InputDecoration(labelText: 'Full name'),
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.trim().isEmpty) {
return 'Full name is required.';
}
return null;
},
),
const SizedBox(height: 12),
TextFormField(
controller: _emailController,
decoration: const InputDecoration(labelText: 'Email'),
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.trim().isEmpty) {
return 'Email is required.';
}
return null;
},
),
const SizedBox(height: 12),
TextFormField(
controller: _passwordController,
decoration: const InputDecoration(labelText: 'Password'),
obscureText: true,
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Password is required.';
}
if (value.length < 6) {
return 'Use at least 6 characters.';
}
return null;
},
),
const SizedBox(height: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Password strength: $_passwordStrengthLabel',
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: 6),
LinearProgressIndicator(
value: _passwordStrength,
minHeight: 8,
borderRadius: BorderRadius.circular(8),
color: _passwordStrengthColor,
backgroundColor: Theme.of(
context,
).colorScheme.surfaceContainerHighest,
),
],
),
const SizedBox(height: 12),
TextFormField(
controller: _confirmPasswordController,
decoration: const InputDecoration(
labelText: 'Confirm password',
),
obscureText: true,
textInputAction: TextInputAction.done,
onFieldSubmitted: (_) {
if (!_isLoading) {
_handleSignUp();
}
},
validator: (value) {
if (value == null || value.isEmpty) {
return 'Confirm your password.';
}
if (value != _passwordController.text) {
return 'Passwords do not match.';
}
return null;
},
),
const SizedBox(height: 12),
Text('Offices', style: Theme.of(context).textTheme.titleSmall),
const SizedBox(height: 8),
officesAsync.when(
data: (offices) {
if (offices.isEmpty) {
return const Text('No offices available.');
}
final officeNameById = <String, String>{
for (final o in offices) o.id: o.name,
};
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ElevatedButton.icon(
onPressed: _isLoading
? null
: () => _showOfficeSelectionDialog(offices),
icon: const Icon(Icons.place),
label: const Text('Select Offices'),
),
const SizedBox(height: 8),
if (_selectedOfficeIds.isEmpty)
const Text('No office selected.')
else
Builder(
builder: (context) {
final sortedIds =
List<String>.from(_selectedOfficeIds)..sort(
(a, b) => (officeNameById[a] ?? a)
.toLowerCase()
.compareTo(
(officeNameById[b] ?? b)
.toLowerCase(),
),
);
return Wrap(
spacing: 8,
runSpacing: 8,
children: sortedIds.map((id) {
final name = officeNameById[id] ?? id;
return Chip(
label: Text(name),
onDeleted: _isLoading
? null
: () {
setState(
() =>
_selectedOfficeIds.remove(id),
);
},
);
}).toList(),
);
},
),
],
);
},
loading: () => const LinearProgressIndicator(),
error: (error, _) => Text('Failed to load offices: $error'),
),
const SizedBox(height: 24),
FilledButton(
onPressed: _isLoading ? null : _handleSignUp,
child: _isLoading
? const SizedBox(
height: 18,
width: 18,
child: CircularProgressIndicator(strokeWidth: 2),
)
: const Text('Create Account'),
),
const SizedBox(height: 12),
TextButton(
onPressed: _isLoading ? null : () => context.go('/login'),
child: const Text('Back to sign in'),
),
],
),
),
),
),
@@ -274,16 +476,26 @@ class _SignUpScreenState extends ConsumerState<SignUpScreen> {
}
Future<void> _showOfficeSelectionDialog(List<dynamic> offices) async {
final cs = Theme.of(context).colorScheme;
final tempSelected = Set<String>.from(_selectedOfficeIds);
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogCtx) => StatefulBuilder(
builder: (ctx2, setStateDialog) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(28),
),
title: const Text('Select Offices'),
content: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 480),
content: Container(
width: 480,
height: 400,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: cs.surfaceContainerLowest,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
@@ -303,7 +515,7 @@ class _SignUpScreenState extends ConsumerState<SignUpScreen> {
},
title: Text(name),
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.zero,
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
);
}).toList(),
),
@@ -314,7 +526,7 @@ class _SignUpScreenState extends ConsumerState<SignUpScreen> {
onPressed: () => Navigator.of(dialogCtx).pop(),
child: const Text('Cancel'),
),
ElevatedButton(
FilledButton(
onPressed: () {
setState(() {
_selectedOfficeIds
+31 -20
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:permission_handler/permission_handler.dart';
@@ -319,7 +320,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
final seen = prefs.getBool('has_seen_notif_showcase') ?? false;
if (!seen) {
if (!mounted) return;
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (context) => AlertDialog(
title: const Text('Never miss an update'),
@@ -469,9 +470,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
padding: const EdgeInsets.only(bottom: 12),
child: Text(
title,
style: Theme.of(
context,
).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w700),
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w700,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
);
}
@@ -571,6 +573,7 @@ class _MetricCard extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final cs = Theme.of(context).colorScheme;
// Only watch the single string value for this card so unrelated metric
// updates don't rebuild the whole card. This makes updates feel much
// smoother and avoids full-page refreshes.
@@ -584,37 +587,42 @@ class _MetricCard extends ConsumerWidget {
),
);
// M3 Expressive: tonal surface container with 16 dp radius, no hard border.
return AnimatedContainer(
duration: const Duration(milliseconds: 220),
padding: const EdgeInsets.all(16),
duration: const Duration(milliseconds: 400),
curve: Curves.easeOutCubic,
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: Theme.of(context).colorScheme.outlineVariant),
color: cs.surfaceContainerLow,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: Theme.of(
context,
).textTheme.labelLarge?.copyWith(fontWeight: FontWeight.w600),
style: Theme.of(context).textTheme.labelLarge?.copyWith(
fontWeight: FontWeight.w600,
color: cs.onSurfaceVariant,
),
),
const SizedBox(height: 10),
const SizedBox(height: 12),
// Animate only the metric text (not the whole card) for a
// subtle, smooth update.
AnimatedSwitcher(
duration: const Duration(milliseconds: 220),
duration: const Duration(milliseconds: 400),
switchInCurve: Curves.easeOutCubic,
switchOutCurve: Curves.easeInCubic,
transitionBuilder: (child, anim) =>
FadeTransition(opacity: anim, child: child),
child: MonoText(
value,
key: ValueKey(value),
style: Theme.of(
context,
).textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.w700),
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w700,
color: cs.onSurface,
),
),
),
],
@@ -628,12 +636,15 @@ class _StaffTable extends StatelessWidget {
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
// M3 Expressive: tonal surface container, 28 dp radius for large containers.
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(AppSurfaces.of(context).cardRadius),
border: Border.all(color: Theme.of(context).colorScheme.outlineVariant),
color: cs.surfaceContainerLow,
borderRadius: BorderRadius.circular(
AppSurfaces.of(context).containerRadius,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -124,11 +124,9 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
final title = _notificationTitle(item.type, actorName);
final icon = _notificationIcon(item.type);
// Use a slightly more compact card for dense notification lists
// — 12px radius, subtle shadow so the list remains readable.
// M3 Expressive: compact card shape, no shadow.
return Card(
shape: AppSurfaces.of(context).compactShape,
shadowColor: AppSurfaces.of(context).compactShadowColor,
child: ListTile(
leading: Icon(icon),
title: Text(title),
+3 -3
View File
@@ -105,7 +105,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
const SizedBox(height: 12),
Row(
children: [
ElevatedButton(
FilledButton(
onPressed: _savingDetails ? null : _onSaveDetails,
child: Text(
_savingDetails ? 'Saving...' : 'Save details',
@@ -176,7 +176,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
const SizedBox(height: 12),
Row(
children: [
ElevatedButton(
FilledButton(
onPressed: _changingPassword
? null
: _onChangePassword,
@@ -224,7 +224,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
const SizedBox(height: 12),
Row(
children: [
ElevatedButton(
FilledButton(
onPressed: _savingOffices
? null
: _onSaveOffices,
+2 -1
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../providers/reports_provider.dart';
@@ -50,7 +51,7 @@ class ReportDateFilter extends ConsumerWidget {
}
void _showDateFilterDialog(BuildContext context, WidgetRef ref) {
showDialog(
m3ShowDialog(
context: context,
builder: (ctx) => _DateFilterDialog(
current: ref.read(reportDateRangeProvider),
@@ -91,7 +91,10 @@ class ReportCardWrapper extends StatelessWidget {
);
final card = Card(
// Rely on CardTheme for elevation (M2 exception in hybrid system).
elevation: 0,
shadowColor: Colors.transparent,
color: colors.surfaceContainerLow,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
child: cardContent,
);
@@ -1,4 +1,4 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -84,8 +84,7 @@ class _RequestTypeChartState extends ConsumerState<RequestTypeChart> {
child: PieChart(
PieChartData(
pieTouchData: PieTouchData(
touchCallback:
(FlTouchEvent event, pieTouchResponse) {
touchCallback: (FlTouchEvent event, pieTouchResponse) {
setState(() {
if (!event.isInterestedForInteractions ||
pieTouchResponse == null ||
@@ -93,9 +92,8 @@ class _RequestTypeChartState extends ConsumerState<RequestTypeChart> {
_touchedIndex = -1;
return;
}
_touchedIndex = pieTouchResponse
.touchedSection!
.touchedSectionIndex;
_touchedIndex =
pieTouchResponse.touchedSection!.touchedSectionIndex;
});
},
),
@@ -217,8 +215,7 @@ class _RequestCategoryChartState extends ConsumerState<RequestCategoryChart> {
child: PieChart(
PieChartData(
pieTouchData: PieTouchData(
touchCallback:
(FlTouchEvent event, pieTouchResponse) {
touchCallback: (FlTouchEvent event, pieTouchResponse) {
setState(() {
if (!event.isInterestedForInteractions ||
pieTouchResponse == null ||
@@ -226,9 +223,8 @@ class _RequestCategoryChartState extends ConsumerState<RequestCategoryChart> {
_touchedIndex = -1;
return;
}
_touchedIndex = pieTouchResponse
.touchedSection!
.touchedSectionIndex;
_touchedIndex =
pieTouchResponse.touchedSection!.touchedSectionIndex;
});
},
),
@@ -274,7 +270,7 @@ class _RequestCategoryChartState extends ConsumerState<RequestCategoryChart> {
}
}
// Shared helpers
// Shared helpers
class _HoverLegendItem extends StatelessWidget {
const _HoverLegendItem({
+7 -16
View File
@@ -1,4 +1,4 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -58,8 +58,7 @@ class _TicketsByStatusChartState extends ConsumerState<TicketsByStatusChart> {
child: PieChart(
PieChartData(
pieTouchData: PieTouchData(
touchCallback:
(FlTouchEvent event, pieTouchResponse) {
touchCallback: (FlTouchEvent event, pieTouchResponse) {
setState(() {
if (!event.isInterestedForInteractions ||
pieTouchResponse == null ||
@@ -85,10 +84,7 @@ class _TicketsByStatusChartState extends ConsumerState<TicketsByStatusChart> {
radius: isTouched ? 60 : 50,
color: _ticketStatusColor(context, e.status),
borderSide: isTouched
? const BorderSide(
color: Colors.white,
width: 2,
)
? const BorderSide(color: Colors.white, width: 2)
: BorderSide.none,
);
}).toList(),
@@ -140,8 +136,7 @@ class TasksByStatusChart extends ConsumerStatefulWidget {
final GlobalKey? repaintKey;
@override
ConsumerState<TasksByStatusChart> createState() =>
_TasksByStatusChartState();
ConsumerState<TasksByStatusChart> createState() => _TasksByStatusChartState();
}
class _TasksByStatusChartState extends ConsumerState<TasksByStatusChart> {
@@ -187,8 +182,7 @@ class _TasksByStatusChartState extends ConsumerState<TasksByStatusChart> {
child: PieChart(
PieChartData(
pieTouchData: PieTouchData(
touchCallback:
(FlTouchEvent event, pieTouchResponse) {
touchCallback: (FlTouchEvent event, pieTouchResponse) {
setState(() {
if (!event.isInterestedForInteractions ||
pieTouchResponse == null ||
@@ -214,10 +208,7 @@ class _TasksByStatusChartState extends ConsumerState<TasksByStatusChart> {
radius: isTouched ? 60 : 50,
color: _taskStatusColor(context, e.status),
borderSide: isTouched
? const BorderSide(
color: Colors.white,
width: 2,
)
? const BorderSide(color: Colors.white, width: 2)
: BorderSide.none,
);
}).toList(),
@@ -280,7 +271,7 @@ class _TasksByStatusChartState extends ConsumerState<TasksByStatusChart> {
}
}
// Shared helpers
// Shared helpers
class _LegendItem extends StatelessWidget {
const _LegendItem({
+3 -2
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:permission_handler/permission_handler.dart';
@@ -84,10 +85,10 @@ class _PermissionsScreenState extends ConsumerState<PermissionsScreen> {
);
},
),
floatingActionButton: FloatingActionButton(
floatingActionButton: M3Fab(
onPressed: _refreshStatuses,
tooltip: 'Refresh',
child: const Icon(Icons.refresh),
icon: const Icon(Icons.refresh),
),
);
}
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import '../../theme/app_surfaces.dart';
import '../../widgets/responsive_body.dart';
class UnderDevelopmentScreen extends StatelessWidget {
@@ -17,34 +16,28 @@ class UnderDevelopmentScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
return ResponsiveBody(
maxWidth: 720,
padding: const EdgeInsets.symmetric(vertical: 32),
child: Center(
// M3 Expressive: elevated card with tonal fill, 28 dp radius.
child: Card(
child: Padding(
padding: const EdgeInsets.all(32),
padding: const EdgeInsets.all(40),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 72,
height: 72,
width: 80,
height: 80,
decoration: BoxDecoration(
color: Theme.of(
context,
).colorScheme.primaryContainer.withValues(alpha: 0.7),
borderRadius: BorderRadius.circular(
AppSurfaces.of(context).dialogRadius,
),
),
child: Icon(
icon,
size: 36,
color: Theme.of(context).colorScheme.primary,
color: cs.primaryContainer,
borderRadius: BorderRadius.circular(28),
),
child: Icon(icon, size: 40, color: cs.onPrimaryContainer),
),
const SizedBox(height: 20),
const SizedBox(height: 24),
Text(
title,
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
@@ -55,26 +48,27 @@ class UnderDevelopmentScreen extends StatelessWidget {
const SizedBox(height: 8),
Text(
subtitle,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
style: Theme.of(
context,
).textTheme.bodyMedium?.copyWith(color: cs.onSurfaceVariant),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 8,
horizontal: 20,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(999),
color: Theme.of(
context,
).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(28),
color: cs.secondaryContainer,
),
child: Text(
'Under development',
style: Theme.of(context).textTheme.labelLarge,
style: Theme.of(context).textTheme.labelLarge?.copyWith(
color: cs.onSecondaryContainer,
fontWeight: FontWeight.w600,
),
),
),
],
+10 -8
View File
@@ -1,5 +1,6 @@
// ignore_for_file: use_build_context_synchronously
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -1919,7 +1920,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
onPressed: () async {
final urlCtrl =
TextEditingController();
final res = await showDialog<String?>(
final res = await m3ShowDialog<String?>(
context:
context,
builder: (ctx) => AlertDialog(
@@ -2234,7 +2235,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
onPressed: () async {
final urlCtrl =
TextEditingController();
final res = await showDialog<String?>(
final res = await m3ShowDialog<String?>(
context:
context,
builder: (ctx) => AlertDialog(
@@ -2848,7 +2849,8 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
child: SizedBox(
width: 280,
child: Card(
elevation: 4,
elevation: 0,
shadowColor: Colors.transparent,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
@@ -3779,7 +3781,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
Timer? titleTypingTimer;
try {
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
var saving = false;
@@ -3999,7 +4001,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
: () => Navigator.of(dialogContext).pop(),
child: const Text('Cancel'),
),
ElevatedButton(
FilledButton(
onPressed: saving
? null
: () async {
@@ -4174,7 +4176,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
// If cancelling, require a reason — show dialog with spinner.
if (value == 'cancelled') {
final reasonCtrl = TextEditingController();
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
var isSaving = false;
@@ -4399,7 +4401,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
if (!mounted) return;
// Show loading dialog
showDialog(
m3ShowDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext dialogContext) {
@@ -4543,7 +4545,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
Future<void> _deleteTaskAttachment(String taskId, String fileName) async {
try {
final confirmed = await showDialog<bool>(
final confirmed = await m3ShowDialog<bool>(
context: context,
builder: (ctx) => AlertDialog(
title: const Text('Delete Attachment?'),
+2 -1
View File
@@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter_quill/flutter_quill.dart' as quill;
import 'package:pdf/widgets.dart' as pw;
@@ -495,7 +496,7 @@ Future<void> showTaskPdfPreview(
List<TaskAssignment> assignments,
List<Profile> profiles,
) async {
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (ctx) => TaskPdfDialog(
task: task,
+6 -2
View File
@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
@@ -554,7 +555,7 @@ class _TasksListScreenState extends ConsumerState<TasksListScreen>
right: 16,
bottom: 16,
child: SafeArea(
child: FloatingActionButton.extended(
child: M3ExpandedFab(
onPressed: () => _showCreateTaskDialog(context, ref),
icon: const Icon(Icons.add),
label: const Text('New Task'),
@@ -588,7 +589,7 @@ class _TasksListScreenState extends ConsumerState<TasksListScreen>
var showTitleGemini = false;
Timer? titleTypingTimer;
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
bool saving = false;
@@ -1099,8 +1100,11 @@ class _StatusSummaryCard extends StatelessWidget {
_ => scheme.onSurfaceVariant,
};
// M3 Expressive: filled card with semantic tonal color, no shadow.
return Card(
color: background,
elevation: 0,
shadowColor: Colors.transparent,
// summary cards are compact — use compact token for consistent density
shape: AppSurfaces.of(context).compactShape,
child: Padding(
+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'),
),
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:tasq/utils/app_time.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
@@ -858,7 +859,7 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
}
Future<void> _showTimelineDialog(BuildContext context, Ticket ticket) async {
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
return AlertDialog(
@@ -897,7 +898,7 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
final descCtrl = TextEditingController(text: ticket.description);
String? selectedOffice = ticket.officeId;
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
var saving = false;
@@ -967,7 +968,7 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
: () => Navigator.of(dialogContext).pop(),
child: const Text('Cancel'),
),
ElevatedButton(
FilledButton(
onPressed: saving
? null
: () async {
+6 -2
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:tasq/utils/app_time.dart';
import 'package:go_router/go_router.dart';
@@ -341,7 +342,7 @@ class _TicketsListScreenState extends ConsumerState<TicketsListScreen> {
right: 16,
bottom: 16,
child: SafeArea(
child: FloatingActionButton.extended(
child: M3ExpandedFab(
onPressed: () => _showCreateTicketDialog(context, ref),
icon: const Icon(Icons.add),
label: const Text('New Ticket'),
@@ -361,7 +362,7 @@ class _TicketsListScreenState extends ConsumerState<TicketsListScreen> {
final descriptionController = TextEditingController();
Office? selectedOffice;
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
bool saving = false;
@@ -644,8 +645,11 @@ class _StatusSummaryCard extends StatelessWidget {
_ => scheme.onSurfaceVariant,
};
// M3 Expressive: filled card with semantic tonal color, no shadow.
return Card(
color: background,
elevation: 0,
shadowColor: Colors.transparent,
// summary cards are compact — use compact token for consistent density
shape: AppSurfaces.of(context).compactShape,
child: Padding(
+6 -5
View File
@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/material.dart';
import '../../theme/m3_motion.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:tasq/utils/app_time.dart';
import 'package:geolocator/geolocator.dart';
@@ -451,7 +452,7 @@ class _ScheduleTile extends ConsumerWidget {
List<DutySchedule> recipientShifts = [];
String? selectedTargetShiftId;
final confirmed = await showDialog<bool>(
final confirmed = await m3ShowDialog<bool>(
context: context,
builder: (dialogContext) {
return StatefulBuilder(
@@ -614,7 +615,7 @@ class _ScheduleTile extends ConsumerWidget {
required String title,
required String message,
}) async {
await showDialog<void>(
await m3ShowDialog<void>(
context: context,
builder: (dialogContext) {
return AlertDialog(
@@ -633,7 +634,7 @@ class _ScheduleTile extends ConsumerWidget {
Future<BuildContext> _showCheckInProgress(BuildContext context) {
final completer = Completer<BuildContext>();
showDialog<void>(
m3ShowDialog<void>(
context: context,
barrierDismissible: false,
builder: (dialogContext) {
@@ -1140,7 +1141,7 @@ class _ScheduleGeneratorPanelState
existing?.endTime ?? start.add(const Duration(hours: 8)),
);
final result = await showDialog<_DraftSchedule>(
final result = await m3ShowDialog<_DraftSchedule>(
context: context,
builder: (dialogContext) {
return StatefulBuilder(
@@ -2002,7 +2003,7 @@ class _SwapRequestsPanel extends ConsumerWidget {
}
Profile? choice = eligible.first;
final selected = await showDialog<Profile?>(
final selected = await m3ShowDialog<Profile?>(
context: context,
builder: (context) {
return AlertDialog(