Created
August 26, 2022 15:03
-
-
Save salihgueler/f5137deacab6006b45a349fd5d979728 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Widget build(BuildContext context) { | |
return AppBackground( | |
child: AnimatedSize( | |
duration: const Duration(milliseconds: 250), | |
(1) | |
child: FutureBuilder<AuthSession>( | |
(2) | |
future: Amplify.Auth.fetchAuthSession(), | |
builder: (context, snapshot) { | |
(3) | |
if (snapshot.hasData) { | |
if (snapshot.data!.isSignedIn) { | |
context.go('/home'); | |
} | |
// Update the UI on next step | |
return const SizedBox.shrink(); | |
} else { | |
(4) | |
return const SizedBox( | |
height: 100, | |
child: Center( | |
child: CircularProgressIndicator(), | |
), | |
); | |
} | |
}, | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment