Skip to content

Commit 7fbd693

Browse files
committed
Добавил проверку корректности email. Тестируем
1 parent 898b405 commit 7fbd693

15 files changed

+45
-18
lines changed
Binary file not shown.
Binary file not shown.
6.35 KB
Binary file not shown.
0 Bytes
Binary file not shown.
553 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
1008 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

lib/generated_plugin_registrant.dart

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: directives_ordering
66
// ignore_for_file: lines_longer_than_80_chars
7+
// ignore_for_file: depend_on_referenced_packages
78

89
import 'package:url_launcher_web/url_launcher_web.dart';
910

lib/views/LoginSignupPage.dart

+19-9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ import '../models/Api.dart';
77
import '../models/CustomTextFields.dart';
88
import 'Cabinet.dart';
99

10+
String? validateEmail(value) {
11+
var regemail = RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
12+
if (regemail.hasMatch(value)) {
13+
print("Корректная почта");
14+
} else {
15+
print("Некорректная почта");
16+
}
17+
18+
return value.isEmpty ? 'Адрес электронной почты не должен быть пустым' : null;
19+
}
20+
1021
class LoginSignupPage extends StatefulWidget {
1122
LoginSignupPage(
1223
{Key? key,
@@ -92,41 +103,40 @@ class _LoginSignupPageState extends State<LoginSignupPage> {
92103
Widget _nameWidget() {
93104
return Padding(
94105
padding: const EdgeInsets.fromLTRB(0.0, 100.0, 0.0, 0.0),
95-
child:
96-
AuthFormTextField(
106+
child: AuthFormTextField(
97107
focusColor: focusColor,
98108
labelText: 'Имя пользователя',
99109
icon: Icons.person_pin_rounded,
100110
saver: (value) => _name = value.trim(),
101-
validator: (value) => value.isEmpty ? 'Имя пользователя не должно быть пустым' : null,
111+
validator: (value) =>
112+
value.isEmpty ? 'Имя пользователя не должно быть пустым' : null,
102113
),
103114
);
104115
}
105116

106117
Widget _emailWidget() {
107118
return Padding(
108119
padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
109-
child:
110-
AuthFormTextField(
120+
child: AuthFormTextField(
111121
focusColor: focusColor,
112122
labelText: 'Адрес электронной почты',
113123
icon: Icons.mail,
114124
saver: (value) => _email = value.trim(),
115-
validator: (value) => value.isEmpty ? 'Адрес электронной почты не должен быть пустым' : null,
125+
validator: (value) => validateEmail(value),
116126
),
117127
);
118128
}
119129

120130
Widget _passwordWidget() {
121131
return Padding(
122132
padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
123-
child:
124-
AuthFormTextField(
133+
child: AuthFormTextField(
125134
focusColor: focusColor,
126135
labelText: 'Пароль',
127136
icon: Icons.lock,
128137
saver: (value) => _password = value.trim(),
129-
validator: (value) => value.isEmpty ? 'Пароль не должен быть пустым' : null,
138+
validator: (value) =>
139+
value.isEmpty ? 'Пароль не должен быть пустым' : null,
130140
),
131141
);
132142
}

linux/flutter/generated_plugins.cmake

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
66
url_launcher_linux
77
)
88

9+
list(APPEND FLUTTER_FFI_PLUGIN_LIST
10+
)
11+
912
set(PLUGIN_BUNDLED_LIBRARIES)
1013

1114
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
1417
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
1518
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
1619
endforeach(plugin)
20+
21+
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
23+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24+
endforeach(ffi_plugin)

pubspec.lock

+9-9
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ packages:
7777
name: collection
7878
url: "https://pub.dartlang.org"
7979
source: hosted
80-
version: "1.15.0"
80+
version: "1.16.0"
8181
crypto:
8282
dependency: transitive
8383
description:
@@ -105,7 +105,7 @@ packages:
105105
name: fake_async
106106
url: "https://pub.dartlang.org"
107107
source: hosted
108-
version: "1.2.0"
108+
version: "1.3.0"
109109
ffi:
110110
dependency: transitive
111111
description:
@@ -174,7 +174,7 @@ packages:
174174
name: js
175175
url: "https://pub.dartlang.org"
176176
source: hosted
177-
version: "0.6.3"
177+
version: "0.6.4"
178178
lints:
179179
dependency: transitive
180180
description:
@@ -195,7 +195,7 @@ packages:
195195
name: material_color_utilities
196196
url: "https://pub.dartlang.org"
197197
source: hosted
198-
version: "0.1.3"
198+
version: "0.1.4"
199199
meta:
200200
dependency: transitive
201201
description:
@@ -209,7 +209,7 @@ packages:
209209
name: path
210210
url: "https://pub.dartlang.org"
211211
source: hosted
212-
version: "1.8.0"
212+
version: "1.8.1"
213213
pedantic:
214214
dependency: transitive
215215
description:
@@ -263,7 +263,7 @@ packages:
263263
name: source_span
264264
url: "https://pub.dartlang.org"
265265
source: hosted
266-
version: "1.8.1"
266+
version: "1.8.2"
267267
sqflite:
268268
dependency: "direct main"
269269
description:
@@ -319,7 +319,7 @@ packages:
319319
name: test_api
320320
url: "https://pub.dartlang.org"
321321
source: hosted
322-
version: "0.4.8"
322+
version: "0.4.9"
323323
typed_data:
324324
dependency: transitive
325325
description:
@@ -403,7 +403,7 @@ packages:
403403
name: vector_math
404404
url: "https://pub.dartlang.org"
405405
source: hosted
406-
version: "2.1.1"
406+
version: "2.1.2"
407407
yandex_mapkit:
408408
dependency: "direct main"
409409
description:
@@ -412,5 +412,5 @@ packages:
412412
source: hosted
413413
version: "2.0.6"
414414
sdks:
415-
dart: ">=2.16.2 <3.0.0"
415+
dart: ">=2.17.0-0 <3.0.0"
416416
flutter: ">=2.10.0"

windows/flutter/generated_plugins.cmake

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
66
url_launcher_windows
77
)
88

9+
list(APPEND FLUTTER_FFI_PLUGIN_LIST
10+
)
11+
912
set(PLUGIN_BUNDLED_LIBRARIES)
1013

1114
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
1417
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
1518
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
1619
endforeach(plugin)
20+
21+
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24+
endforeach(ffi_plugin)

0 commit comments

Comments
 (0)