Skip to content

Instantly share code, notes, and snippets.

@alperefesahin
Created February 2, 2022 07:09
Show Gist options
  • Save alperefesahin/23b0e6d1b7232ac40d961bfc121fbe7c to your computer and use it in GitHub Desktop.
Save alperefesahin/23b0e6d1b7232ac40d961bfc121fbe7c to your computer and use it in GitHub Desktop.
class LandingPage extends StatelessWidget {
const LandingPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return FlowBuilder<AuthState>(
state: context.select((AuthCubit cubit) => cubit.state),
onGeneratePages: (authState, pages) {
if (authState.isSignedIn) {
return [HomePage.page()];
} else {
return [SignInPage.page()];
}
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment