fixes 41 build

master
suvaysov 2022-04-19 22:11:15 +06:00
parent b343d433e9
commit d2ff26e89c
3 changed files with 43 additions and 53 deletions

View File

@ -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<BankSettingView> {
late TextEditingController _emailController;
late TextEditingController _passwordController;
final BankService _bankService = locator<BankService>();
final NavigatorService _navigatorService = locator<NavigatorService>();
final DialogService _dialogService = locator<DialogService>();
@override
@ -54,6 +56,7 @@ class _BankSettingViewState extends State<BankSettingView> {
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<BankSettingView> {
children: <Widget>[
verticalSpaceTiny,
Text(
'Необходимо указать почту и пароль для подключения к системе проведения платежей',
'Необходимо указать почту/номер и пароль для подключения к системе проведения платежей',
style: TextStyle(fontSize: 15.0),
textAlign: TextAlign.center,
),
@ -80,7 +83,7 @@ class _BankSettingViewState extends State<BankSettingView> {
TextField(
controller: _emailController,
decoration: InputDecoration(
labelText: 'E-Mail', hintText: "Введите адрес почты"),
labelText: 'E-Mail / Номер телефона ', hintText: "Введите адрес почты"),
keyboardType: TextInputType.emailAddress,
),
TextField(

View File

@ -212,20 +212,23 @@ class _PaymentViewState extends State<PaymentView> {
_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<PaymentView> {
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<PaymentView> {
_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});
}

View File

@ -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: