فهرست منبع

feat: show progress while verifying a PIN

Krasimir Kazakov 1 هفته پیش
والد
کامیت
d6e4c81429
2فایلهای تغییر یافته به همراه67 افزوده شده و 22 حذف شده
  1. 34 13
      lib/features/lock/lock_screen.dart
  2. 33 9
      lib/features/lock/pin_setup_screen.dart

+ 34 - 13
lib/features/lock/lock_screen.dart

@@ -149,19 +149,40 @@ class _LockScreenState extends State<LockScreen>
                       const SizedBox(height: 14),
                       SizedBox(
                         height: 42,
-                        child: AnimatedSwitcher(
-                          duration: const Duration(milliseconds: 160),
-                          child: Text(
-                            error ?? 'Enter your four-digit PIN',
-                            key: ValueKey(error ?? 'hint'),
-                            textAlign: TextAlign.center,
-                            style: theme.textTheme.bodySmall?.copyWith(
-                              color: error == null
-                                  ? colors.inkFaint
-                                  : colors.danger,
-                            ),
-                          ),
-                        ),
+                        child: _busy
+                            ? Row(
+                                mainAxisAlignment: MainAxisAlignment.center,
+                                children: [
+                                  SizedBox(
+                                    width: 16,
+                                    height: 16,
+                                    child: CircularProgressIndicator(
+                                      strokeWidth: 2,
+                                      color: colors.accent,
+                                    ),
+                                  ),
+                                  const SizedBox(width: 9),
+                                  Text(
+                                    'Checking…',
+                                    style: theme.textTheme.bodySmall?.copyWith(
+                                      color: colors.inkMuted,
+                                    ),
+                                  ),
+                                ],
+                              )
+                            : AnimatedSwitcher(
+                                duration: const Duration(milliseconds: 160),
+                                child: Text(
+                                  error ?? 'Enter your four-digit PIN',
+                                  key: ValueKey(error ?? 'hint'),
+                                  textAlign: TextAlign.center,
+                                  style: theme.textTheme.bodySmall?.copyWith(
+                                    color: error == null
+                                        ? colors.inkFaint
+                                        : colors.danger,
+                                  ),
+                                ),
+                              ),
                       ),
                       const SizedBox(height: 12),
                       PinKeypad(

+ 33 - 9
lib/features/lock/pin_setup_screen.dart

@@ -306,15 +306,39 @@ class _PinSetupScreenState extends State<PinSetupScreen>
                             const SizedBox(height: 14),
                             SizedBox(
                               height: 42,
-                              child: Text(
-                                error ?? 'Four digits',
-                                textAlign: TextAlign.center,
-                                style: theme.textTheme.bodySmall?.copyWith(
-                                  color: error == null
-                                      ? colors.inkFaint
-                                      : colors.danger,
-                                ),
-                              ),
+                              child: _busy
+                                  ? Row(
+                                      mainAxisAlignment:
+                                          MainAxisAlignment.center,
+                                      children: [
+                                        SizedBox(
+                                          width: 16,
+                                          height: 16,
+                                          child: CircularProgressIndicator(
+                                            strokeWidth: 2,
+                                            color: colors.accent,
+                                          ),
+                                        ),
+                                        const SizedBox(width: 9),
+                                        Text(
+                                          'Checking…',
+                                          style: theme.textTheme.bodySmall
+                                              ?.copyWith(
+                                                color: colors.inkMuted,
+                                              ),
+                                        ),
+                                      ],
+                                    )
+                                  : Text(
+                                      error ?? 'Four digits',
+                                      textAlign: TextAlign.center,
+                                      style: theme.textTheme.bodySmall
+                                          ?.copyWith(
+                                            color: error == null
+                                                ? colors.inkFaint
+                                                : colors.danger,
+                                          ),
+                                    ),
                             ),
                             const SizedBox(height: 6),
                             PinKeypad(