Open martinsellergren opened 3 months ago
I've just tested on the auth example app, I think there is a problem with your setup as I logged in/out without issue on web.
I get the same error in my Android app using ProfileScreen. For me the error is triggered when SignedOutAction has a callback function that tries to do anything else than just navigate to a new screen.
Example1 works fine, no error:
return ProfileScreen(
providers: providers,
actions: [
SignedOutAction((context) {
Navigator.pushReplacementNamed(context, '/');
}),
],
);
while Example2 throws the Unexpected null value. error:
return ProfileScreen(
providers: providers,
actions: [
SignedOutAction((context) {
handleUserSignedOut();
Navigator.pushReplacementNamed(context, '/');
}),
],
);
I find this confusing as the following example with SignInScreen works just fine:
return SignInScreen(
providers: providers,
actions: [
AuthStateChangeAction<SignedIn>((context, state) {
handleUserSignedIn();
Navigator.pushReplacementNamed(context, '/');
}),
],
);
Is there an existing issue for this?
What plugin is this bug for?
Firebase UI Auth
What platform(s) does this bug affect?
Web
List of dependencies used.
flutter pub deps -s list
Steps to reproduce
Expected Behavior
No error thrown.
Actual Behavior
Error thrown:
Additional Information
ProfileScreen created like this:
Doctor summary (to see all details, run flutter doctor -v): [β] Flutter (Channel stable, 3.19.1, on macOS 14.2.1 23C71 darwin-arm64, locale en-US) [β] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [β] Xcode - develop for iOS and macOS (Xcode 15.0) [β] Chrome - develop for the web [β] Android Studio (version 2023.1) [β] VS Code (version 1.87.1) [β] Connected device (3 available) [β] Network resources
β’ No issues found!