From d2ff26e89c3364b1b426826062b90e20a70f3038 Mon Sep 17 00:00:00 2001 From: suvaysov Date: Tue, 19 Apr 2022 22:11:15 +0600 Subject: [PATCH] fixes 41 build --- lib/views/bank_setting/bank_setting_view.dart | 9 +- lib/views/payment/payment_view.dart | 85 ++++++++----------- pubspec.yaml | 2 +- 3 files changed, 43 insertions(+), 53 deletions(-) diff --git a/lib/views/bank_setting/bank_setting_view.dart b/lib/views/bank_setting/bank_setting_view.dart index 452ace4..2b8069a 100644 --- a/lib/views/bank_setting/bank_setting_view.dart +++ b/lib/views/bank_setting/bank_setting_view.dart @@ -12,6 +12,8 @@ import 'package:aman_kassa_flutter/shared/ui_helpers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import '../../core/services/navigator_service.dart'; + class BankSettingView extends StatefulWidget { BankSettingView(); @@ -22,7 +24,7 @@ class BankSettingView extends StatefulWidget { class _BankSettingViewState extends State { late TextEditingController _emailController; late TextEditingController _passwordController; - final BankService _bankService = locator(); + final NavigatorService _navigatorService = locator(); final DialogService _dialogService = locator(); @override @@ -54,6 +56,7 @@ class _BankSettingViewState extends State { FocusScope.of(_context).unfocus(); await Redux.store!.dispatch(saveData(_emailController.text, _passwordController.text)); _dialogService.showDialog(description: 'Данные сохранены'); + _navigatorService.pop(); } @@ -72,7 +75,7 @@ class _BankSettingViewState extends State { children: [ verticalSpaceTiny, Text( - 'Необходимо указать почту и пароль для подключения к системе проведения платежей', + 'Необходимо указать почту/номер и пароль для подключения к системе проведения платежей', style: TextStyle(fontSize: 15.0), textAlign: TextAlign.center, ), @@ -80,7 +83,7 @@ class _BankSettingViewState extends State { TextField( controller: _emailController, decoration: InputDecoration( - labelText: 'E-Mail', hintText: "Введите адрес почты"), + labelText: 'E-Mail / Номер телефона ', hintText: "Введите адрес почты"), keyboardType: TextInputType.emailAddress, ), TextField( diff --git a/lib/views/payment/payment_view.dart b/lib/views/payment/payment_view.dart index f37e337..f8b922a 100644 --- a/lib/views/payment/payment_view.dart +++ b/lib/views/payment/payment_view.dart @@ -212,20 +212,23 @@ class _PaymentViewState extends State { _total = double.parse(value); } - if (state.password == null || state.login == null || state.password!.length < 1 || state.login!.length < 1) { + if (state.password == null || state.login == null || + state.password!.length < 1 || state.login!.length < 1) { return Container(); } return InkWell( - onTap: isBusy ? null : () async { - - + onTap: isBusy ? + () {} : + () async { var today = new DateTime.now(); var yesterday = today.subtract(new Duration(days: 1)); - if( Redux.store!.state.userState == null + if (Redux.store!.state.userState == null || Redux.store!.state.userState!.smena == null || Redux.store!.state.userState!.smena!.startedAt == null - || yesterday.isAfter(Redux.store!.state.userState!.smena!.startedAt!)) { - _dialogService.showDialog(description: 'Текущая смена открыта более 24 ч. Необходимо закрыть смену и открыть ее заново.'); + || yesterday.isAfter( + Redux.store!.state.userState!.smena!.startedAt!)) { + _dialogService.showDialog( + description: 'Текущая смена открыта более 24 ч. Необходимо закрыть смену и открыть ее заново.'); return; } setState(() { @@ -250,46 +253,27 @@ class _PaymentViewState extends State { splashColor: halykColor.withOpacity(0.4), borderRadius: BorderRadius.circular(10.0), highlightColor: halykColor.withOpacity(0.1), - child: Container( - width: ScreenUtil().setSp(100.0), - padding: const EdgeInsets.symmetric(vertical: 8.0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0) - ), - child: Column( - children: [ - Container( - width: ScreenUtil().setSp(80.0), - height: ScreenUtil().setSp(80.0), - margin: const EdgeInsets.only(bottom: 8.0), - decoration: BoxDecoration( - border: Border.all(color: Colors.white), - borderRadius: BorderRadius.circular(10.0), - image: DecorationImage( - image: AssetImage('assets/images/halykpos.png'), fit: BoxFit.fitWidth - ), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 7, - offset: Offset(0, 3), // changes position of shadow - ), - ], - ), + child: SizedBox( + width: ScreenUtil().setSp(80.0), + height: ScreenUtil().setSp(80.0), + child: Container( + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.white), + borderRadius: BorderRadius.circular(10.0), + image: DecorationImage( + image: AssetImage('assets/images/halykpos.png'), + fit: BoxFit.fitWidth ), - // Row( - // mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // Icon( - // MdiIcons.nfc, - // color: halykColor, - // size: ScreenUtil().setSp(20.0), - // ), - // Text('Tap2Phone',style: TextStyle(fontSize: ScreenUtil().setSp(10.0), color: halykColor, fontWeight: FontWeight.bold ),), - // ], - // ), - ], + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), ), ), ); @@ -343,10 +327,12 @@ class _PaymentViewState extends State { _navigatorService.pop(); _navigatorService.push(ImageShowRoute, arguments: ImageShowModel(data: new CheckImageModal( - base64Data: check, textData: checkText != null ? jsonEncode(checkText) : null), + base64Data: check, + textData: checkText != null ? jsonEncode(checkText) : null), title: message, url: url)); - } else if (!response.operation && ![401, 402, 403, 412, 500].contains(response.status)) { + } else if (!response.operation && + ![401, 402, 403, 412, 500].contains(response.status)) { Navigator.of(_keyLoader.currentContext!, rootNavigator: true).pop(); _dialogService.showDialog(description: response.body['message']); } else if (!response.operation && response.body['message'] != null) { @@ -398,5 +384,6 @@ class PaymentModel { Voucher? voucher; CardData? cardData; - PaymentModel({required this.mode, required this.operationType, this.voucher, this.cardData}); + PaymentModel( + {required this.mode, required this.operationType, this.voucher, this.cardData}); } diff --git a/pubspec.yaml b/pubspec.yaml index e2eae4e..7c42fea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: aman_kassa_flutter description: A new Flutter project. -version: 1.3.0+40 +version: 1.3.0+41 environment: sdk: '>=2.15.0 <3.0.0' dependencies: