Closed Kublick closed 1 year ago
Hi @Kublick Because AuthNotifier extends AutoDisposeAsyncNotifier<User?>, therefore, i think login functions should be:
Future<void> login(String email, String password) async {
state = await AsyncValue.guard<User?>(() async{
return Future.delayed(
networkRoundTripTime,
() =>
);
});
}
Oddly enough, while this makes sense, this should be a compile-time error, which I don't have. Moreover, the example runs fine to me.
@Kublick please try out @leedeblade 's fix and let us know if it works.
Indeed adding ? does the trick.
Got the complete example in order to check how it works but as soon you tap the login button it will throw an error on this function
in the console I can see
Removing after guard resolves the issue.