@@ -30,68 +30,73 @@ class _LoginCardState extends State<LoginCard>
30
30
builder: (context, snapshot) => Form (
31
31
child: Padding (
32
32
padding: const EdgeInsets .all (18.0 ),
33
- child: new Column (
34
- mainAxisAlignment: MainAxisAlignment .center,
35
- children: < Widget > [
36
- new TextField (
37
- onChanged: (phone) => phoneNumber = phone,
38
- enabled: ! snapshot.data,
39
- style: new TextStyle (fontSize: 15.0 , color: Colors .black),
40
- decoration: new InputDecoration (
41
- hintText:
42
- Translations .of (context).text ("enter_code_hint" ),
43
- labelText:
44
- Translations .of (context).text ("enter_code_label" ),
45
- labelStyle: TextStyle (fontWeight: FontWeight .w700)),
46
- ),
47
- new SizedBox (
48
- height: 10.0 ,
49
- ),
50
- snapshot.data == false
51
- ? new Offstage ()
52
- : new TextField (
53
- onChanged: (myotp) => otp = myotp,
54
- keyboardType: TextInputType .number,
55
- style: new TextStyle (
56
- fontSize: 15.0 , color: Colors .black),
57
- decoration: new InputDecoration (
58
- hintText: Translations .of (context)
59
- .text ("enter_otp_hint" ),
60
- labelText: Translations .of (context)
61
- .text ("enter_otp_label" ),
62
- labelStyle:
63
- TextStyle (fontWeight: FontWeight .w700)),
64
- obscureText: true ,
65
- ),
66
- new SizedBox (
67
- height: 30.0 ,
68
- ),
69
- Container (
70
- child: snapshot.data == false
71
- ? new GradientButton (
72
- onPressed: () => phoneNumber? .length == 10
73
- ? loginBloc.otpSink.add (UserLoginViewModel (
74
- phonenumber: phoneNumber))
75
- : showPhoneError (context),
76
- text: Translations .of (context).text ("get_otp" ))
77
- : new GradientButton (
78
- onPressed: () {
79
- otp? .length == 4
80
- ? loginBloc.loginSink.add (
81
- new UserLoginViewModel .withOTP (
82
- phonenumber: phoneNumber, otp: otp))
83
- : showOTPError (context);
84
- },
85
- text: Translations .of (context).text ("login" )),
86
- ),
87
- snapshot.data == true
88
- ? new FlatButton (
89
- child: Text (
90
- Translations .of (context).text ("resend_otp" )),
91
- onPressed: () => loginBloc.resendOtpSink.add (true ),
92
- )
93
- : new Container ()
94
- ],
33
+ child: SingleChildScrollView (
34
+ child: new Column (
35
+ mainAxisAlignment: MainAxisAlignment .spaceEvenly,
36
+ children: < Widget > [
37
+ new TextField (
38
+ onChanged: (phone) => phoneNumber = phone,
39
+ enabled: ! snapshot.data,
40
+ style:
41
+ new TextStyle (fontSize: 15.0 , color: Colors .black),
42
+ decoration: new InputDecoration (
43
+ hintText: Translations .of (context)
44
+ .text ("enter_code_hint" ),
45
+ labelText: Translations .of (context)
46
+ .text ("enter_code_label" ),
47
+ labelStyle: TextStyle (fontWeight: FontWeight .w700)),
48
+ ),
49
+ new SizedBox (
50
+ height: 10.0 ,
51
+ ),
52
+ snapshot.data == false
53
+ ? new Offstage ()
54
+ : new TextField (
55
+ onChanged: (myotp) => otp = myotp,
56
+ keyboardType: TextInputType .number,
57
+ style: new TextStyle (
58
+ fontSize: 15.0 , color: Colors .black),
59
+ decoration: new InputDecoration (
60
+ hintText: Translations .of (context)
61
+ .text ("enter_otp_hint" ),
62
+ labelText: Translations .of (context)
63
+ .text ("enter_otp_label" ),
64
+ labelStyle:
65
+ TextStyle (fontWeight: FontWeight .w700)),
66
+ obscureText: true ,
67
+ ),
68
+ new SizedBox (
69
+ height: 30.0 ,
70
+ ),
71
+ Container (
72
+ child: snapshot.data == false
73
+ ? new GradientButton (
74
+ onPressed: () => phoneNumber? .length == 10
75
+ ? loginBloc.otpSink.add (UserLoginViewModel (
76
+ phonenumber: phoneNumber))
77
+ : showPhoneError (context),
78
+ text: Translations .of (context).text ("get_otp" ))
79
+ : new GradientButton (
80
+ onPressed: () {
81
+ otp? .length == 4
82
+ ? loginBloc.loginSink.add (
83
+ new UserLoginViewModel .withOTP (
84
+ phonenumber: phoneNumber,
85
+ otp: otp))
86
+ : showOTPError (context);
87
+ },
88
+ text: Translations .of (context).text ("login" )),
89
+ ),
90
+ snapshot.data == true
91
+ ? new FlatButton (
92
+ child: Text (
93
+ Translations .of (context).text ("resend_otp" )),
94
+ onPressed: () =>
95
+ loginBloc.resendOtpSink.add (true ),
96
+ )
97
+ : new Container ()
98
+ ],
99
+ ),
95
100
),
96
101
),
97
102
),
0 commit comments