Skip to content

Commit c77ec44

Browse files
committed
edit email text field
1 parent d090973 commit c77ec44

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

lib/presentation/screens/login/widgets/login_form.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:e_commerce_app/presentation/common_blocs/auth/auth.dart';
12
import 'package:e_commerce_app/presentation/common_blocs/auth/bloc.dart';
23
import 'package:e_commerce_app/configs/config.dart';
34
import 'package:e_commerce_app/constants/constants.dart';
@@ -7,7 +8,10 @@ import 'package:e_commerce_app/utils/utils.dart';
78
import 'package:flutter/material.dart';
89
import 'package:flutter_bloc/flutter_bloc.dart';
910

11+
// ignore: must_be_immutable
1012
class LoginForm extends StatefulWidget {
13+
late AuthBase authBase ;
14+
1115
@override
1216
_LoginFormState createState() => _LoginFormState();
1317
}
@@ -91,7 +95,12 @@ class _LoginFormState extends State<LoginForm> {
9195
SizedBox(height: SizeConfig.defaultSize * 2),
9296
_buildTextOr(),
9397
SizedBox(height: SizeConfig.defaultSize * 2),
98+
99+
ElevatedButton(
100+
onPressed: (){},
101+
child:
94102
_buildNoAccountText(),
103+
),
95104
],
96105
),
97106
),
@@ -119,8 +128,15 @@ class _LoginFormState extends State<LoginForm> {
119128
hintText: Translate.of(context).translate('email'),
120129
suffixIcon: Icon(Icons.email_outlined),
121130
),
131+
textInputAction: TextInputAction.next, // thay nút enter thành next
132+
onEditingComplete:_emailEditingComplete,
122133
);
123134
}
135+
final FocusNode _passwordFocusNode = FocusNode();
136+
void _emailEditingComplete() {
137+
FocusScope.of(context).requestFocus(_passwordFocusNode);
138+
}
139+
124140

125141
_buildTextFieldPassword() {
126142
return TextFormField(
@@ -147,6 +163,8 @@ class _LoginFormState extends State<LoginForm> {
147163
},
148164
),
149165
),
166+
focusNode: _passwordFocusNode,
167+
onEditingComplete: onLogin,
150168
);
151169
}
152170

pubspec.lock

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ packages:
4242
name: built_collection
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "4.3.2"
45+
version: "5.0.0"
4646
built_value:
4747
dependency: transitive
4848
description:
4949
name: built_value
5050
url: "https://pub.dartlang.org"
5151
source: hosted
52-
version: "7.1.0"
52+
version: "8.0.4"
5353
carousel_slider:
5454
dependency: "direct main"
5555
description:
@@ -224,7 +224,7 @@ packages:
224224
name: fixnum
225225
url: "https://pub.dartlang.org"
226226
source: hosted
227-
version: "0.10.11"
227+
version: "1.0.0"
228228
flutter:
229229
dependency: "direct main"
230230
description: flutter
@@ -322,6 +322,27 @@ packages:
322322
url: "https://pub.dartlang.org"
323323
source: hosted
324324
version: "0.0.20-nullsafety.4"
325+
google_sign_in:
326+
dependency: "direct main"
327+
description:
328+
name: google_sign_in
329+
url: "https://pub.dartlang.org"
330+
source: hosted
331+
version: "5.0.0"
332+
google_sign_in_platform_interface:
333+
dependency: transitive
334+
description:
335+
name: google_sign_in_platform_interface
336+
url: "https://pub.dartlang.org"
337+
source: hosted
338+
version: "2.0.1"
339+
google_sign_in_web:
340+
dependency: transitive
341+
description:
342+
name: google_sign_in_web
343+
url: "https://pub.dartlang.org"
344+
source: hosted
345+
version: "0.10.0"
325346
http:
326347
dependency: transitive
327348
description:
@@ -510,7 +531,7 @@ packages:
510531
name: quiver
511532
url: "https://pub.dartlang.org"
512533
source: hosted
513-
version: "2.1.5"
534+
version: "3.0.1"
514535
rxdart:
515536
dependency: "direct main"
516537
description:
@@ -585,7 +606,7 @@ packages:
585606
name: square_in_app_payments
586607
url: "https://pub.dartlang.org"
587608
source: hosted
588-
version: "1.6.0"
609+
version: "1.7.1"
589610
stack_trace:
590611
dependency: transitive
591612
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
cloud_firestore: ^1.0.0
2323
firebase_storage: ^8.0.0
2424
firebase_auth: ^1.0.0
25-
# google_sign_in: ^5.0.1
25+
google_sign_in: 5.0.0
2626
#image
2727
image_picker: ^0.7.2
2828
image_gallery_saver: ^1.6.8

0 commit comments

Comments
 (0)