Not sure what the issue is here but getting a basic login page setup functionally and after the page switches my sign in or signout buttons dont work (but the FAB button does). Here is my signin code for the button:
RaisedButton(
splashColor: Colors.grey,
onPressed: isLoading
? null
: () => _signInWithGoogle(context),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)),
highlightElevation: 0,
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image(
Image: AssetImage("images/google_logo.png"),
height: 35.0),
Padding(
padding: const EdgeInsets.only(left: 10),
child: Text(
'Sign in with Google',
style: TextStyle(
fontSize: 20,
color: Colors.grey,
),
),
)
],
),
),
),
My main class:
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
Provider<AuthService>(
create: (_) => AuthServiceAdapter(
initialAuthServiceType: AuthServiceType.firebase,
),
dispose: (_, AuthService authService) => authService.dispose(),
),
],
child: AuthWidgetBuilder(
builder:
(BuildContext context, AsyncSnapshot<FirebaseUser> userSnapshot) {
return MaterialApp(
home: AuthWidget(userSnapshot: userSnapshot),
routes: {
HomeScreen.id: (context) => HomeScreen(
title: 'Mythero',
),
},
debugShowCheckedModeBanner: false,
);
},
),
);
}
}
The auth widget:
class AuthWidget extends StatelessWidget {
const AuthWidget({Key key, @required this.userSnapshot}) : super(key: key);
final AsyncSnapshot<FirebaseUser> userSnapshot;
@override
Widget build(BuildContext context) {
if (userSnapshot.connectionState == ConnectionState.active) {
return userSnapshot.hasData
? HomeScreen(
title: 'Mythero',
)
: SignInPageBuilder();
}
return Scaffold(
body: Center(
child: CircularProgressIndicator(),
),
);
}
}
My signout button
child: RaisedButton(
onPressed: () async {
await auth.signOut();
},
child: Text(
'Sign Out',
),
),
The login and sign out code works but when it navigates to another and then I press one of the buttons it just prints 'Dw' in the terminal output. If I refresh the page then it works just fine.