Enhanced material design 3 implementation

This commit is contained in:
2026-03-20 15:15:38 +08:00
parent 27ebb89052
commit 74197c525d
26 changed files with 1345 additions and 515 deletions
+12 -2
View File
@@ -28,6 +28,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
bool _isLoading = false;
bool _obscurePassword = true;
bool _hasValidationError = false;
@override
void initState() {
@@ -56,7 +57,13 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
}
Future<void> _handleEmailSignIn() async {
if (!_formKey.currentState!.validate()) return;
if (!_formKey.currentState!.validate()) {
setState(() {
_hasValidationError = !_hasValidationError;
});
return;
}
setState(() => _hasValidationError = false);
setState(() => _isLoading = true);
final auth = ref.read(authControllerProvider);
@@ -151,7 +158,9 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
const SizedBox(height: 32),
// ── Sign-in card ──
Card(
M3ErrorShake(
hasError: _hasValidationError,
child: Card(
elevation: 0,
color: cs.surfaceContainerLow,
shape: RoundedRectangleBorder(
@@ -245,6 +254,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
),
),
),
), // M3ErrorShake
const SizedBox(height: 20),
// ── Divider ──