Move loading into fab button of login

This commit is contained in:
Brandon Presley 2023-12-29 15:12:10 +13:00
parent e478552587
commit 9c93ea1008

View File

@ -32,6 +32,7 @@ class _LoginPageState extends State<LoginPage> {
print("Error signing in $error"); print("Error signing in $error");
setState(() { setState(() {
failedMessage = error.toString(); failedMessage = error.toString();
loggingIn = false;
}); });
Future.delayed(const Duration(seconds: 10), () { Future.delayed(const Duration(seconds: 10), () {
@ -99,14 +100,13 @@ class _LoginPageState extends State<LoginPage> {
), ),
), ),
), ),
floatingActionButton: loggingIn floatingActionButton: FloatingActionButton(
? const CircularProgressIndicator() onPressed: loggingIn ? null : connectMatrix,
: FloatingActionButton(
onPressed: connectMatrix,
tooltip: 'Log in', tooltip: 'Log in',
child: const Icon(Icons.login), child: loggingIn
), ? const CircularProgressIndicator()
), : const Icon(Icons.login),
)),
); );
} }
} }