From 9dc209bda7fa6a9b98033d5b9c54da4eef42d904 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 8 Aug 2023 11:24:06 +0800 Subject: [PATCH] fix: loading status widget on the signup page flickers. --- .../lib/user/presentation/sign_in_screen.dart | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/appflowy_flutter/lib/user/presentation/sign_in_screen.dart b/frontend/appflowy_flutter/lib/user/presentation/sign_in_screen.dart index 8548a483a8..0616e91455 100644 --- a/frontend/appflowy_flutter/lib/user/presentation/sign_in_screen.dart +++ b/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().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().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) ], ), );