Skip to content

Commit cc6ad7d

Browse files
committed
bugfix + clean
1 parent 3e0bcf6 commit cc6ad7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+301
-497
lines changed

.flutter-plugins

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
# This is a generated file; do not edit or check into version control.
2-
file_picker=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\file_picker-5.0.1\\
3-
file_selector_windows=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\file_selector_windows-0.8.2+2\\
4-
flutter_plugin_android_lifecycle=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_plugin_android_lifecycle-2.0.7\\
5-
image_picker=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker-0.8.5+3\\
6-
image_picker_android=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_android-0.8.5+3\\
7-
image_picker_for_web=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_for_web-2.1.8\\
8-
image_picker_ios=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_ios-0.8.6\\
9-
image_picker_windows=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_windows-0.1.0+2\\
10-
package_info_plus=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus-1.4.3+1\\
11-
package_info_plus_linux=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus_linux-1.0.5\\
12-
package_info_plus_macos=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus_macos-1.3.0\\
13-
package_info_plus_web=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus_web-1.0.5\\
14-
package_info_plus_windows=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus_windows-2.1.0\\
15-
path_provider_linux=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-2.1.0\\
16-
path_provider_windows=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-2.1.3\\
17-
share_plus=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus-4.1.0\\
18-
share_plus_linux=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus_linux-3.0.0\\
19-
share_plus_macos=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus_macos-3.0.1\\
20-
share_plus_web=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus_web-3.0.1\\
21-
share_plus_windows=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus_windows-3.0.1\\
22-
shared_preferences=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences-2.0.8\\
23-
shared_preferences_linux=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_linux-2.0.2\\
24-
shared_preferences_macos=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_macos-2.0.2\\
25-
shared_preferences_web=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_web-2.0.2\\
26-
shared_preferences_windows=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_windows-2.0.2\\
27-
url_launcher=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher-6.1.5\\
28-
url_launcher_android=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_android-6.0.19\\
29-
url_launcher_ios=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_ios-6.0.17\\
30-
url_launcher_linux=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_linux-3.0.1\\
31-
url_launcher_macos=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_macos-3.0.1\\
32-
url_launcher_web=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_web-2.0.13\\
33-
url_launcher_windows=E:\\Program Files\\Microsoft VS Code\\flutter sdk\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_windows-3.0.1\\
2+
file_picker=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\file_picker-5.0.1\\
3+
file_selector_windows=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\file_selector_windows-0.8.2+2\\
4+
flutter_plugin_android_lifecycle=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_plugin_android_lifecycle-2.0.7\\
5+
image_picker=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker-0.8.5+3\\
6+
image_picker_android=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_android-0.8.5+3\\
7+
image_picker_for_web=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_for_web-2.1.8\\
8+
image_picker_ios=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_ios-0.8.6\\
9+
image_picker_windows=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\image_picker_windows-0.1.0+2\\
10+
package_info_plus=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus-1.4.3+1\\
11+
package_info_plus_linux=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus_linux-1.0.5\\
12+
package_info_plus_macos=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus_macos-1.3.0\\
13+
package_info_plus_web=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus_web-1.0.5\\
14+
package_info_plus_windows=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\package_info_plus_windows-2.1.0\\
15+
path_provider_linux=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-2.0.0\\
16+
path_provider_windows=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-2.1.3\\
17+
share_plus=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus-4.1.0\\
18+
share_plus_linux=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus_linux-3.0.0\\
19+
share_plus_macos=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus_macos-3.0.1\\
20+
share_plus_web=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus_web-3.0.1\\
21+
share_plus_windows=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\share_plus_windows-3.0.1\\
22+
shared_preferences=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences-2.0.6\\
23+
shared_preferences_linux=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_linux-2.0.0\\
24+
shared_preferences_macos=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_macos-2.0.0\\
25+
shared_preferences_web=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_web-2.0.0\\
26+
shared_preferences_windows=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_windows-2.0.0\\
27+
url_launcher=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher-6.1.5\\
28+
url_launcher_android=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_android-6.0.19\\
29+
url_launcher_ios=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_ios-6.0.17\\
30+
url_launcher_linux=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_linux-3.0.1\\
31+
url_launcher_macos=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_macos-3.0.1\\
32+
url_launcher_web=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_web-2.0.13\\
33+
url_launcher_windows=X:\\flutter_sdk\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\url_launcher_windows-3.0.1\\

.flutter-plugins-dependencies

+1-1
Large diffs are not rendered by default.

analysis_options.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
# Additional information about this file can be found at
4+
# https://dart.dev/guides/language/analysis-options

lib/authorize/nsgPhoneLoginPage.dart

+33-31
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
// ignore_for_file: file_names
2+
13
import 'dart:async';
24
import 'dart:io';
5+
import 'package:flutter/foundation.dart';
36
import 'package:flutter/material.dart';
47
import 'package:flutter_multi_formatter/flutter_multi_formatter.dart';
58
import 'package:get/get.dart';
6-
import 'package:nsg_controls/nsg_border.dart';
79
import 'package:nsg_controls/nsg_button.dart';
810
import 'package:nsg_controls/nsg_checkbox.dart';
911
import 'package:nsg_data/authorize/nsgPhoneLoginParams.dart';
@@ -13,7 +15,7 @@ import '../nsg_data_provider.dart';
1315
class NsgPhoneLoginPage extends StatelessWidget {
1416
final NsgDataProvider provider;
1517
final NsgPhoneLoginParams widgetParams;
16-
NsgPhoneLoginPage(this.provider, {required this.widgetParams}) : super();
18+
NsgPhoneLoginPage(this.provider, {super.key, required this.widgetParams});
1719

1820
@override
1921
Widget build(BuildContext context) {
@@ -25,11 +27,11 @@ class NsgPhoneLoginPage extends StatelessWidget {
2527
}
2628

2729
AppBar getAppBar(BuildContext context) {
28-
return AppBar(title: Text(''), centerTitle: true);
30+
return AppBar(title: const Text(''), centerTitle: true);
2931
}
3032

3133
Widget getLogo() {
32-
var logo = Image(
34+
var logo = const Image(
3335
image: AssetImage('lib/assets/logo-wfrs.png', package: 'nsg_data'),
3436
width: 140.0,
3537
height: 140.0,
@@ -42,7 +44,7 @@ class NsgPhoneLoginPage extends StatelessWidget {
4244
bool initialValue = true;
4345
var checkbox = NsgCheckBox(
4446
simple: true,
45-
margin: EdgeInsets.only(top: 5, bottom: 5),
47+
margin: const EdgeInsets.only(top: 5, bottom: 5),
4648
label: 'Запомнить пользователя',
4749
onPressed: () {},
4850
value: initialValue,
@@ -68,7 +70,7 @@ class NsgPhoneLoginPage extends StatelessWidget {
6870
}
6971

7072
Widget getButtons() {
71-
return NsgButton(
73+
return const NsgButton(
7274
margin: EdgeInsets.zero,
7375
onPressed: null,
7476
text: 'you need to override getButtons',
@@ -99,7 +101,7 @@ class NsgPhoneLoginWidget extends StatefulWidget {
99101
final NsgPhoneLoginParams? widgetParams;
100102
final NsgDataProvider provider;
101103

102-
NsgPhoneLoginWidget(this.loginPage, this.provider, {this.widgetParams}) : super();
104+
const NsgPhoneLoginWidget(this.loginPage, this.provider, {super.key, this.widgetParams});
103105
}
104106

105107
class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
@@ -173,7 +175,7 @@ class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
173175
TextEditingController? _captchaController;
174176
Widget _getContext(BuildContext context) {
175177
if (isLoginSuccessfull) {
176-
Future.delayed(Duration(seconds: 2)).then((e) {
178+
Future.delayed(const Duration(seconds: 2)).then((e) {
177179
if (widget.widgetParams != null && widget.widgetParams!.mainPage != null) {
178180
Get.offAndToNamed(widget.widgetParams!.mainPage!);
179181
} else {
@@ -186,13 +188,13 @@ class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
186188
return Form(
187189
key: _formKey,
188190
child: Container(
189-
decoration: BoxDecoration(
191+
decoration: const BoxDecoration(
190192
color: Colors.white,
191193
borderRadius: BorderRadius.all(Radius.circular(20.0)),
192194
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.15), offset: Offset(0.0, 4.0), blurRadius: 4.0, spreadRadius: 2.0)],
193195
),
194-
margin: EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0),
195-
padding: EdgeInsets.all(15.0),
196+
margin: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0),
197+
padding: const EdgeInsets.all(15.0),
196198
width: widget.widgetParams!.cardSize,
197199
child: Row(
198200
mainAxisAlignment: MainAxisAlignment.center,
@@ -205,14 +207,14 @@ class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
205207
children: <Widget>[
206208
widget.widgetParams!.headerMessageVisible == true
207209
? Padding(
208-
padding: EdgeInsets.symmetric(vertical: 5.0),
210+
padding: const EdgeInsets.symmetric(vertical: 5.0),
209211
child: Text(
210212
widget.widgetParams!.headerMessage,
211213
style: widget.widgetParams!.headerMessageStyle,
212214
textAlign: TextAlign.center,
213215
),
214216
)
215-
: SizedBox(),
217+
: const SizedBox(),
216218
SizedBox(height: widget.widgetParams!.headerMessageVisible == true ? 5.0 : 0.0),
217219
TextFormField(
218220
cursorColor: Colors.black,
@@ -221,39 +223,39 @@ class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
221223
style: widget.widgetParams!.textPhoneField,
222224
textAlign: TextAlign.center,
223225
decoration: InputDecoration(
224-
contentPadding: EdgeInsets.only(left: 10, top: 10, right: 10),
226+
contentPadding: const EdgeInsets.only(left: 10, top: 10, right: 10),
225227
border: OutlineInputBorder(
226228
borderRadius: BorderRadius.circular(5.0),
227229
),
228230
filled: true,
229231
fillColor: widget.widgetParams!.phoneFieldColor,
230-
focusedBorder: OutlineInputBorder(
231-
borderSide: const BorderSide(color: Colors.black, width: 1.0),
232+
focusedBorder: const OutlineInputBorder(
233+
borderSide: BorderSide(color: Colors.black, width: 1.0),
232234
),
233-
errorStyle: TextStyle(fontSize: 12),
235+
errorStyle: const TextStyle(fontSize: 12),
234236
hintText: widget.widgetParams!.textEnterPhone,
235237
),
236238
onChanged: (value) => phoneNumber = value,
237239
validator: (value) => isPhoneValid(value!) && value.length >= 16 ? null : widget.widgetParams!.textEnterCorrectPhone,
238240
),
239-
if (!Platform.isAndroid && !Platform.isIOS) widget.loginPage.getRememberMeCheckbox(),
241+
if (kIsWeb || (!Platform.isAndroid && !Platform.isIOS)) widget.loginPage.getRememberMeCheckbox(),
240242
if (widget.widgetParams!.useCaptcha)
241243
Row(
242244
mainAxisAlignment: MainAxisAlignment.center,
243245
children: [
244-
Container(
246+
SizedBox(
245247
width: 160,
246248
child: getcaptchaImage(),
247249
),
248-
Container(
250+
SizedBox(
249251
height: 50,
250252
width: 40,
251253
child: Stack(
252254
children: [
253255
Align(
254256
alignment: Alignment.topCenter,
255257
child: IconButton(
256-
padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
258+
padding: const EdgeInsets.fromLTRB(0, 0, 0, 20),
257259
icon: Icon(
258260
Icons.cached,
259261
color: widget.widgetParams!.phoneIconColor,
@@ -269,7 +271,7 @@ class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
269271
child: Text(
270272
secondsLeft.toString(),
271273
textAlign: TextAlign.center,
272-
style: TextStyle(fontSize: 14),
274+
style: const TextStyle(fontSize: 14),
273275
),
274276
),
275277
],
@@ -279,26 +281,26 @@ class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
279281
),
280282
if (widget.widgetParams!.useCaptcha)
281283
Container(
282-
decoration: BoxDecoration(
284+
decoration: const BoxDecoration(
283285
//color: widget.widgetParams!.phoneFieldColor,
284286
//borderRadius: BorderRadius.circular(5.0),
285287
),
286288
child: Padding(
287-
padding: EdgeInsets.symmetric(horizontal: 0.0, vertical: 10.0),
289+
padding: const EdgeInsets.symmetric(horizontal: 0.0, vertical: 10.0),
288290
child: TextFormField(
289291
controller: _captchaController,
290292
textAlign: TextAlign.center,
291293
decoration: InputDecoration(
292-
contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
294+
contentPadding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
293295
border: OutlineInputBorder(
294296
borderRadius: BorderRadius.circular(5.0),
295297
),
296298
filled: true,
297299
fillColor: widget.widgetParams!.phoneFieldColor,
298-
focusedBorder: OutlineInputBorder(
299-
borderSide: const BorderSide(color: Colors.black, width: 1.0),
300+
focusedBorder: const OutlineInputBorder(
301+
borderSide: BorderSide(color: Colors.black, width: 1.0),
300302
),
301-
errorStyle: TextStyle(fontSize: 12),
303+
errorStyle: const TextStyle(fontSize: 12),
302304
hintText: widget.widgetParams!.textEnterCaptcha,
303305
),
304306
style: widget.widgetParams!.textPhoneField,
@@ -392,7 +394,7 @@ class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
392394
updateTimer!.cancel();
393395
}
394396
secondsLeft = 120;
395-
updateTimer = Timer.periodic(Duration(seconds: 1), (Timer t) => captchaTimer(t));
397+
updateTimer = Timer.periodic(const Duration(seconds: 1), (Timer t) => captchaTimer(t));
396398
}));
397399
}
398400

@@ -425,13 +427,13 @@ class _NsgPhoneLoginWidgetState extends State<NsgPhoneLoginWidget> {
425427
Widget _getContextSuccessful(BuildContext context) {
426428
return Center(
427429
child: Card(
428-
margin: EdgeInsets.symmetric(horizontal: 15.0),
430+
margin: const EdgeInsets.symmetric(horizontal: 15.0),
429431
color: widget.widgetParams!.cardColor,
430432
shape: RoundedRectangleBorder(
431433
borderRadius: BorderRadius.circular(10.0),
432434
),
433435
child: Padding(
434-
padding: EdgeInsets.symmetric(horizontal: 15.0, vertical: 15.0),
436+
padding: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 15.0),
435437
child: Row(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
436438
Expanded(
437439
child: Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[

0 commit comments

Comments
 (0)