Skip to content

Instantly share code, notes, and snippets.

@marcossevilla
Created February 17, 2021 16:40
Show Gist options
  • Save marcossevilla/67bb3248eea8afb74ca92c443665c176 to your computer and use it in GitHub Desktop.
Save marcossevilla/67bb3248eea8afb74ca92c443665c176 to your computer and use it in GitHub Desktop.
final tokenProvider = StateProvider<String>((_) => '');
final authenticateUser = FutureProvider<void>(
(ref) async {
final authResult = await ref.read(authProvider).login();
ref.read(tokenProvider).state = authResult.token;
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment