Skip to content

Instantly share code, notes, and snippets.

@anubhav11803451
Created February 28, 2021 16:38
Show Gist options
  • Save anubhav11803451/2fc6c8e7486e54eb3ff9933c736254f7 to your computer and use it in GitHub Desktop.
Save anubhav11803451/2fc6c8e7486e54eb3ff9933c736254f7 to your computer and use it in GitHub Desktop.
Widget build(BuildContext context) {
return StoreConnector<AppState, AuthViewModel>(
onInit: (store) {
store.dispatch(getAuthStateThunk());
SecureStorage.readSecureStorage('token').then((value) => token = value);
},
converter: (store) => AuthViewModel.fromStore(store),
builder: (context, viewModel) =>
token != null ? MyWorkspacesPage() : GettingStartedScreen(),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment