@@ -14,63 +14,69 @@ class SignUpPage extends ConsumerWidget {
14
14
15
15
@override
16
16
Widget build (BuildContext context, WidgetRef ref) {
17
- ref.listen (authProvider, (value) {
18
- if (value is AuthState ) {
19
- value.maybeWhen (loggedIn: () {
20
- context.router.popUntilRoot ();
21
- }, orElse: () {
22
- {}
23
- });
17
+ ref.listen (authProvider, (previous, next) {
18
+ if (next is AuthState ) {
19
+ next.maybeWhen (
20
+ loggedIn: () {
21
+ context.router.popUntilRoot ();
22
+ },
23
+ orElse: () {
24
+ {}
25
+ },
26
+ );
24
27
}
25
28
});
26
29
27
30
return Scaffold (
28
31
body: Container (
29
- margin: const EdgeInsets .only (left: 20.0 , right: 20.0 ),
30
- child: Column (
31
- mainAxisAlignment: MainAxisAlignment .start,
32
- children: < Widget > [
33
- const SizedBox (height: 150 ),
34
- Text (context.l10n.sign_up,
35
- style: TextStyle (
36
- color: Colors .grey[800 ],
37
- fontWeight: FontWeight .bold,
38
- fontSize: 40 )),
39
- Form (
40
- child: Column (
41
- children: [
42
- TextFormField (
43
- decoration: InputDecoration (
44
- labelText: context.l10n.name_hint),
45
- controller: _nameController,
46
- ),
47
- TextFormField (
48
- decoration: InputDecoration (
49
- labelText: context.l10n.email_hint),
50
- controller: _emailController,
51
- ),
52
- TextFormField (
53
- decoration: InputDecoration (
54
- labelText: context.l10n.password_hint),
55
- controller: _passwordController,
56
- obscureText: true ,
57
- ),
58
- Column (
59
- crossAxisAlignment: CrossAxisAlignment .stretch,
60
- children: < Widget > [
61
- const SizedBox (height: 30 ),
62
- _widgetSignUpButton (context, ref),
63
- const SizedBox (height: 30 ),
64
- Text (
65
- context.l10n.already_user,
66
- textAlign: TextAlign .center,
67
- ),
68
- _widgetSignInButton (context, ref),
69
- ]),
70
- ],
32
+ margin: const EdgeInsets .only (left: 20 , right: 20 ),
33
+ child: Column (children: < Widget > [
34
+ const SizedBox (height: 150 ),
35
+ Text (
36
+ context.l10n.sign_up,
37
+ style: TextStyle (
38
+ color: Colors .grey[800 ],
39
+ fontWeight: FontWeight .bold,
40
+ fontSize: 40 ),
41
+ ),
42
+ Form (
43
+ child: Column (
44
+ children: [
45
+ TextFormField (
46
+ decoration: InputDecoration (
47
+ labelText: context.l10n.name_hint,
48
+ ),
49
+ controller: _nameController,
50
+ ),
51
+ TextFormField (
52
+ decoration: InputDecoration (
53
+ labelText: context.l10n.email_hint,
54
+ ),
55
+ controller: _emailController,
56
+ ),
57
+ TextFormField (
58
+ decoration: InputDecoration (
59
+ labelText: context.l10n.password_hint,
60
+ ),
61
+ controller: _passwordController,
62
+ obscureText: true ,
71
63
),
72
- )
73
- ])));
64
+ Column (
65
+ crossAxisAlignment: CrossAxisAlignment .stretch,
66
+ children: < Widget > [
67
+ const SizedBox (height: 30 ),
68
+ _widgetSignUpButton (context, ref),
69
+ const SizedBox (height: 30 ),
70
+ Text (
71
+ context.l10n.already_user,
72
+ textAlign: TextAlign .center,
73
+ ),
74
+ _widgetSignInButton (context, ref),
75
+ ]),
76
+ ],
77
+ ),
78
+ )
79
+ ])));
74
80
}
75
81
76
82
Widget _widgetSignInButton (BuildContext context, WidgetRef ref) {
0 commit comments