Skip to content

Commit 9bd799b

Browse files
committed
Implement autologin
1 parent 8c23145 commit 9bd799b

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

lib/page/Auth/selectAuthMethod.dart

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,31 @@ import 'package:provider/provider.dart';
66
import '../homePage.dart';
77
import 'signin.dart';
88

9-
class SelectAuthMethod extends StatefulWidget{
9+
class SelectAuthMethod extends StatefulWidget {
1010
@override
1111
State<StatefulWidget> createState() => _SelectAuthMethodState();
12-
1312
}
13+
1414
class _SelectAuthMethodState extends State<SelectAuthMethod> {
1515
@override
1616
void initState() {
17-
var state = Provider.of<AuthState>(context,listen: false);
18-
state.authStatus = AuthStatus.NOT_DETERMINED;
19-
// state.getCurrentUser();
17+
var state = Provider.of<AuthState>(context, listen: false);
18+
state.authStatus = AuthStatus.NOT_DETERMINED;
19+
state.getCurrentUser();
2020
super.initState();
2121
}
22+
2223
@override
2324
Widget build(BuildContext context) {
2425
var state = Provider.of<AuthState>(context);
2526
return Scaffold(
26-
body:
27-
// state.authStatus == AuthStatus.NOT_DETERMINED ?
28-
// SignIn() :
29-
state.authStatus == AuthStatus.NOT_DETERMINED?
30-
SignIn(loginCallback: state.getCurrentUser,)
31-
: state.authStatus == AuthStatus.NOT_LOGGED_IN ?
32-
Signup(loginCallback: state.getCurrentUser)
33-
: HomePage()
34-
27+
body: state.authStatus == AuthStatus.NOT_DETERMINED
28+
? SignIn(
29+
loginCallback: state.getCurrentUser,
30+
)
31+
: state.authStatus == AuthStatus.NOT_LOGGED_IN
32+
? Signup(loginCallback: state.getCurrentUser)
33+
: HomePage(),
3534
);
3635
}
37-
}
36+
}

0 commit comments

Comments
 (0)