@@ -3,10 +3,14 @@ import 'package:firebase_auth/firebase_auth.dart';
3
3
import 'package:google_sign_in/google_sign_in.dart' ;
4
4
5
5
class LoginPage extends StatefulWidget {
6
- const LoginPage ({super .key});
6
+ final Function ()? onTap;
7
+ const LoginPage ({super .key, required this .onTap});
8
+
9
+
7
10
8
11
@override
9
12
_LoginPageState createState () => _LoginPageState ();
13
+
10
14
}
11
15
12
16
@@ -84,136 +88,141 @@ class _LoginPageState extends State<LoginPage> {
84
88
return Scaffold (
85
89
body: SafeArea (
86
90
child: Center (
87
- child: Column (
88
- mainAxisAlignment: MainAxisAlignment .center,
89
- children: [
90
- const SizedBox (height: 50 ,),
91
- Padding (
92
- padding: EdgeInsets .all (30 ),
93
- child: Center (
94
- child: Container (
95
- width: 100 ,
96
- height: 100 ,
97
- child: Image .asset ('image/user.png' ),
91
+ child: SingleChildScrollView (
92
+ child: Column (
93
+ mainAxisAlignment: MainAxisAlignment .center,
94
+ children: [
95
+ const SizedBox (height: 50 ,),
96
+ Padding (
97
+ padding: EdgeInsets .all (30 ),
98
+ child: Center (
99
+ child: Container (
100
+ width: 100 ,
101
+ height: 100 ,
102
+ child: Image .asset ('image/user.png' ),
103
+ ),
98
104
),
99
105
),
100
- ),
101
- Padding (
102
- padding : EdgeInsets . all ( 20 ),
103
- child : TextField (
104
- controller : correo,
105
- decoration : InputDecoration (
106
- border : OutlineInputBorder (
107
- borderRadius : BorderRadius . circular ( 10 )) ,
108
- labelText : 'Correo ' ,
109
- hintText : 'Digite su correo electronico' ,
110
- prefixIcon : Icon ( Icons .email ),
106
+ Padding (
107
+ padding : EdgeInsets . all ( 20 ),
108
+ child : TextField (
109
+ controller : correo,
110
+ decoration : InputDecoration (
111
+ border : OutlineInputBorder (
112
+ borderRadius : BorderRadius . circular ( 10 )),
113
+ labelText : 'Correo' ,
114
+ hintText : 'Digite su correo electronico ' ,
115
+ prefixIcon : Icon ( Icons .email) ,
116
+ ),
111
117
),
112
118
),
113
- ),
114
- Padding (
115
- padding: EdgeInsets .all (20 ),
116
- child: TextField (
117
- controller: pass,
118
- obscureText: ! _mostrarContrasena,
119
- decoration: InputDecoration (
120
- border: OutlineInputBorder (
121
- borderRadius: BorderRadius .circular (10 )),
122
- labelText: 'Contraseña' ,
123
- prefixIcon: Icon (Icons .password),
124
- suffixIcon: IconButton (
125
- icon: Icon (
126
- _mostrarContrasena
127
- ? Icons .visibility
128
- : Icons .visibility_off,
119
+ Padding (
120
+ padding: EdgeInsets .all (20 ),
121
+ child: TextField (
122
+ controller: pass,
123
+ obscureText: ! _mostrarContrasena,
124
+ decoration: InputDecoration (
125
+ border: OutlineInputBorder (
126
+ borderRadius: BorderRadius .circular (10 )),
127
+ labelText: 'Contraseña' ,
128
+ prefixIcon: Icon (Icons .password),
129
+ suffixIcon: IconButton (
130
+ icon: Icon (
131
+ _mostrarContrasena
132
+ ? Icons .visibility
133
+ : Icons .visibility_off,
134
+ ),
135
+ onPressed: () {
136
+ _toggleMostrarContrasena (! _mostrarContrasena);
137
+ },
129
138
),
130
- onPressed: () {
131
- _toggleMostrarContrasena (! _mostrarContrasena);
132
- },
139
+ hintText: 'Digite su contraseña' ,
133
140
),
134
- hintText: 'Digite su contraseña' ,
135
141
),
136
142
),
137
- ),
138
- Padding (
139
- padding: const EdgeInsets .symmetric (horizontal: 25.0 ),
140
- child: Row (
141
- mainAxisAlignment: MainAxisAlignment .end,
142
- children: [
143
- Text (
144
- '¿Olvidaste tu contraseña?' ,
145
- style: TextStyle (color: Colors .grey[600 ]),
146
- ),
147
- ],
148
- ),
149
- ),
150
- Padding (
151
- padding: const EdgeInsets .only (left: 20 , top: 50 , right: 10 ),
152
- child: Center (
153
- child: ElevatedButton (
154
- onPressed: () {
155
- print ('Ingresando...' );
156
- signUserIn ();
157
- },
158
- child: Text ('Ingresar' ),
143
+ Padding (
144
+ padding: const EdgeInsets .symmetric (horizontal: 25.0 ),
145
+ child: Row (
146
+ mainAxisAlignment: MainAxisAlignment .end,
147
+ children: [
148
+ Text (
149
+ '¿Olvidaste tu contraseña?' ,
150
+ style: TextStyle (color: Colors .grey[600 ]),
151
+ ),
152
+ ],
159
153
),
160
154
),
161
- ),
162
- const SizedBox (height: 50 ,),
163
- //Continua con
164
- Padding (
165
- padding: const EdgeInsets .symmetric (horizontal: 25.0 ),
166
- child: Row (children: [
167
- Expanded (child: Divider (
168
- thickness: 0.5 ,
169
- color: Colors .grey[400 ],
170
- ),
171
- ),
172
- Padding (
173
- padding: const EdgeInsets .symmetric (horizontal: 10.0 ),
174
- child: Text (
175
- 'O inicia sesión con:' ,
176
- style: TextStyle (color: Colors .grey[700 ]),
155
+ Padding (
156
+ padding: const EdgeInsets .only (left: 20 , top: 50 , right: 10 ),
157
+ child: Center (
158
+ child: ElevatedButton (
159
+ onPressed: () {
160
+ print ('Ingresando...' );
161
+ signUserIn ();
162
+ },
163
+ child: Text ('Ingresar' ),
177
164
),
178
165
),
179
- Expanded (child: Divider (
180
- thickness: 0.5 ,
181
- color: Colors .grey[400 ],
182
- ))
183
- ],),
184
- ),
166
+ ),
167
+ const SizedBox (height: 50 ,),
168
+ //Continua con
169
+ Padding (
170
+ padding: const EdgeInsets .symmetric (horizontal: 25.0 ),
171
+ child: Row (children: [
172
+ Expanded (child: Divider (
173
+ thickness: 0.5 ,
174
+ color: Colors .grey[400 ],
175
+ ),
176
+ ),
177
+ Padding (
178
+ padding: const EdgeInsets .symmetric (horizontal: 10.0 ),
179
+ child: Text (
180
+ 'O inicia sesión con:' ,
181
+ style: TextStyle (color: Colors .grey[700 ]),
182
+ ),
183
+ ),
184
+ Expanded (child: Divider (
185
+ thickness: 0.5 ,
186
+ color: Colors .grey[400 ],
187
+ ))
188
+ ],),
189
+ ),
185
190
186
- const SizedBox (height: 50 ,),
187
- //Google sign in button
188
- Row (
189
- mainAxisAlignment: MainAxisAlignment .center,
190
- children: [
191
- Image .asset (
192
- 'lib/Images/google_logo.png' ,
193
- height: 40 ,),
194
- const SizedBox (),
195
- ],),
191
+ const SizedBox (height: 50 ,),
192
+ //Google sign in button
193
+ Row (
194
+ mainAxisAlignment: MainAxisAlignment .center,
195
+ children: [
196
+ Image .asset (
197
+ 'lib/Images/google_logo.png' ,
198
+ height: 40 ,),
199
+ const SizedBox (),
200
+ ],),
196
201
197
- const SizedBox (height: 50 ,),
202
+ const SizedBox (height: 50 ,),
198
203
199
- //Registrate
200
- Row (
201
- mainAxisAlignment: MainAxisAlignment .center,
202
- children: [
203
- Text (
204
- 'No estás registrado?' ,
205
- style: TextStyle (color: Colors .grey[700 ]),
206
- ),
207
- const SizedBox (width: 4 ,),
208
- Text (
209
- 'Registrate!' ,
210
- style: TextStyle (
211
- color: Colors .blue, fontWeight: FontWeight .bold
204
+ //Registrate
205
+ Row (
206
+ mainAxisAlignment: MainAxisAlignment .center,
207
+ children: [
208
+ Text (
209
+ 'No estás registrado?' ,
210
+ style: TextStyle (color: Colors .grey[700 ]),
212
211
),
213
- )
214
- ],
215
- )
216
- ]
212
+ const SizedBox (width: 4 ,),
213
+ GestureDetector (
214
+ onTap: widget.onTap,
215
+ child: const Text (
216
+ 'Registrate!' ,
217
+ style: TextStyle (
218
+ color: Colors .blue, fontWeight: FontWeight .bold
219
+ ),
220
+ ),
221
+ )
222
+ ],
223
+ )
224
+ ]
225
+ ),
217
226
),
218
227
),
219
228
),
0 commit comments