浏览代码

fix: loading status widget on the signup page flickers.

Lucas.Xu 1 年之前
父节点
当前提交
9dc209bda7
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 14 6
      frontend/appflowy_flutter/lib/user/presentation/sign_in_screen.dart

+ 14 - 6
frontend/appflowy_flutter/lib/user/presentation/sign_in_screen.dart

@@ -71,6 +71,8 @@ class SignInForm extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
+    final isSubmitting = context.read<SignInBloc>().state.isSubmitting;
+    const indicatorMinHeight = 4.0;
     return Align(
       alignment: Alignment.center,
       child: AuthFormContainer(
@@ -104,13 +106,19 @@ class SignInForm extends StatelessWidget {
           const VSpace(10),
           const ThirdPartySignInButtons(),
           const VSpace(20),
-
           // loading status
-          if (context.read<SignInBloc>().state.isSubmitting) ...[
-            const SizedBox(height: 8),
-            const LinearProgressIndicator(value: null),
-            const VSpace(20),
-          ],
+          ...isSubmitting
+              ? [
+                  const VSpace(indicatorMinHeight),
+                  const LinearProgressIndicator(
+                    value: null,
+                    minHeight: indicatorMinHeight,
+                  ),
+                ]
+              : [
+                  const VSpace(indicatorMinHeight * 2.0)
+                ], // add the same space when there's no loading status.
+          const VSpace(20)
         ],
       ),
     );