parent
d2ff26e89c
commit
2e255fa8a2
|
|
@ -63,9 +63,6 @@ android {
|
|||
}
|
||||
}
|
||||
buildTypes {
|
||||
// all {
|
||||
// buildConfigField ("String[]", "SUPPORTED_DEVICES", collectSupportedDevicesToArray())
|
||||
// }
|
||||
debug {
|
||||
shrinkResources false
|
||||
minifyEnabled false
|
||||
|
|
@ -90,6 +87,11 @@ android {
|
|||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
exclude "META-INF/library_release.kotlin_module"
|
||||
exclude "META-INF/com.android.tools/proguard/coroutines.pro"
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
}
|
||||
|
|
@ -114,15 +116,10 @@ dependencies {
|
|||
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
|
||||
|
||||
|
||||
implementation 'com.android.support:multidex:1.0.3'
|
||||
//implementation 'com.android.support:multidex:2.0.1'
|
||||
//m4bank dependencies
|
||||
|
||||
}
|
||||
|
||||
//def collectSupportedDevicesToArray() {
|
||||
// return '{' + rootProject.ext."supportedDevices${getProject().name}".collect {
|
||||
// "\"${it}\""
|
||||
// }.join(",") + '}'
|
||||
//}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,18 +2,20 @@ import 'package:aman_kassa_flutter/core/models/card_data.dart';
|
|||
import 'package:aman_kassa_flutter/core/models/check_item.dart';
|
||||
|
||||
class CheckData {
|
||||
final String ?type;
|
||||
final String? type;
|
||||
num? card;
|
||||
String? contragent;
|
||||
final List<CheckItem>? items;
|
||||
CardData? cardData;
|
||||
CheckData({this.type, this.card, this.items, this.cardData});
|
||||
CheckData({this.type, this.card, this.items, this.cardData, this.contragent});
|
||||
|
||||
static CheckData fromJson(Map<String, dynamic> json) {
|
||||
return CheckData(
|
||||
type: json['type'],
|
||||
card: json['card'],
|
||||
type: json['type'] as String?,
|
||||
card: json['card'] as num?,
|
||||
items: (json['items'] as List).map((e) => CheckItem.fromJson(e)).toList(),
|
||||
cardData: CardData.fromJson(json['cardData'])
|
||||
cardData: CardData.fromJson(json['cardData']),
|
||||
contragent: json['type'] as String?,
|
||||
);
|
||||
}
|
||||
Map<String, dynamic> toJson() =>
|
||||
|
|
@ -21,6 +23,7 @@ class CheckData {
|
|||
'type': type,
|
||||
'card': card,
|
||||
'items': items?.map((e) => e.toJson()).toList(),
|
||||
'cardData': cardData?.toJson()
|
||||
'cardData': cardData?.toJson(),
|
||||
'contragent': contragent,
|
||||
};
|
||||
}
|
||||
|
|
@ -186,6 +186,7 @@ class DataService extends BaseService {
|
|||
Future<Response<dynamic>?> sellOrReturn(
|
||||
{String? paymentType,
|
||||
String? tradeType,
|
||||
String? contragent,
|
||||
required String token,
|
||||
required List<ProductDao> kassaItems,
|
||||
required List<CalcModel> calcItems,
|
||||
|
|
@ -198,11 +199,13 @@ class DataService extends BaseService {
|
|||
CheckData checkData = _transformProductsToCheckData(
|
||||
paymentType: paymentType, tradeType: tradeType, items: kassaItems);
|
||||
checkData.cardData = cardData;
|
||||
checkData.contragent = contragent;
|
||||
data = jsonEncode(checkData.toJson());
|
||||
} else if (mode == SettingModeCalc) {
|
||||
CheckData checkData = _transformCalcModelToCheckData(
|
||||
paymentType: paymentType, tradeType: tradeType, items: calcItems);
|
||||
checkData.cardData = cardData;
|
||||
checkData.contragent = contragent;
|
||||
data = jsonEncode(checkData.toJson());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class MainApplication extends StatelessWidget {
|
|||
411.43,
|
||||
683.43,
|
||||
),
|
||||
builder: () => MaterialApp(
|
||||
builder: (context, child) => MaterialApp(
|
||||
theme: ThemeData(
|
||||
backgroundColor: backgroundColor,
|
||||
primaryColor: primaryColor,
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class _HomeViewState extends State<HomeView> with WidgetsBindingObserver {
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance!.addObserver(this);
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
selectedTabIndex = 0;
|
||||
pageController = new PageController(initialPage: selectedTabIndex);
|
||||
Redux.store!.dispatch(checkSmena);
|
||||
|
|
@ -135,7 +135,7 @@ class _HomeViewState extends State<HomeView> with WidgetsBindingObserver {
|
|||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance!.removeObserver(this);
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
pageController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import 'package:aman_kassa_flutter/shared/ui_helpers.dart';
|
|||
import 'package:aman_kassa_flutter/views/check/image_show_container.dart';
|
||||
import 'package:aman_kassa_flutter/widgets/components/calculator/calculator.dart';
|
||||
import 'package:aman_kassa_flutter/widgets/fields/busy_button.dart';
|
||||
import 'package:aman_kassa_flutter/widgets/fields/input_field.dart';
|
||||
import 'package:aman_kassa_flutter/widgets/loader/Dialogs.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
|
|
@ -52,9 +53,12 @@ class _PaymentViewState extends State<PaymentView> {
|
|||
final DialogService _dialogService = locator<DialogService>();
|
||||
BankService _bankService = locator<BankService>();
|
||||
final NavigatorService _navigatorService = locator<NavigatorService>();
|
||||
final TextEditingController _iinController = new TextEditingController();
|
||||
late bool isBusy;
|
||||
late bool isBankApiAccess;
|
||||
|
||||
var height = AppBar().preferredSize.height;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
|
@ -63,6 +67,12 @@ class _PaymentViewState extends State<PaymentView> {
|
|||
_bankInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_iinController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
_bankInit() async {
|
||||
int version = await _bankService.version();
|
||||
if (version >= _bankService.sdkVersion) {
|
||||
|
|
@ -94,22 +104,27 @@ class _PaymentViewState extends State<PaymentView> {
|
|||
style: TextStyle(color: Colors.black87),
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
dataText(),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black26,
|
||||
fontSize: 15),
|
||||
body: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
height: ScreenUtil().screenHeight - ScreenUtil().statusBarHeight - height,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
dataText(),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black26,
|
||||
fontSize: 15),
|
||||
),
|
||||
buildStoreConnector(),
|
||||
verticalSpaceLarge,
|
||||
_buildBodyContent(),
|
||||
],
|
||||
),
|
||||
buildStoreConnector(),
|
||||
verticalSpaceLarge,
|
||||
_buildBodyContent(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -151,6 +166,13 @@ class _PaymentViewState extends State<PaymentView> {
|
|||
return Expanded(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
controller: _iinController,
|
||||
maxLength: 12,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'ИИН Покупателя', hintText: "Введите ИИН покупателя"),
|
||||
),
|
||||
Container(
|
||||
height: 150,
|
||||
child: Row(
|
||||
|
|
@ -165,6 +187,15 @@ class _PaymentViewState extends State<PaymentView> {
|
|||
mainColor: primaryColor,
|
||||
)),
|
||||
horizontalSpaceSmall,
|
||||
Expanded(
|
||||
child: BusyButton(
|
||||
title: 'Мобильный',
|
||||
onPressed: () {
|
||||
pressPayment('mobile', null);
|
||||
},
|
||||
mainColor: redColor,
|
||||
)),
|
||||
horizontalSpaceSmall,
|
||||
Expanded(
|
||||
child: BusyButton(
|
||||
title: 'Наличными',
|
||||
|
|
@ -304,7 +335,8 @@ class _PaymentViewState extends State<PaymentView> {
|
|||
tradeType: _tradeType,
|
||||
calcItems: calcItems,
|
||||
mode: _mode,
|
||||
cardData: cardData
|
||||
cardData: cardData,
|
||||
contragent: _iinController.text
|
||||
);
|
||||
setState(() {
|
||||
isBusy = false;
|
||||
|
|
|
|||
82
pubspec.lock
82
pubspec.lock
|
|
@ -28,7 +28,7 @@ packages:
|
|||
name: barcode_scan2
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.2.0"
|
||||
version: "4.2.1"
|
||||
bluetooth_print:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -77,7 +77,7 @@ packages:
|
|||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.16.0"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -105,7 +105,7 @@ packages:
|
|||
name: cupertino_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
version: "1.0.5"
|
||||
device_info:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -140,7 +140,7 @@ packages:
|
|||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.0"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -194,14 +194,14 @@ packages:
|
|||
name: flutter_redux
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.8.2"
|
||||
version: "0.10.0"
|
||||
flutter_screenutil:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_screenutil
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.3.1"
|
||||
version: "5.5.3+2"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
|
@ -232,7 +232,7 @@ packages:
|
|||
name: google_fonts
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
version: "3.0.1"
|
||||
hex:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -253,7 +253,7 @@ packages:
|
|||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.13.4"
|
||||
version: "0.13.5"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -281,7 +281,7 @@ packages:
|
|||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.3"
|
||||
version: "0.6.4"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -295,7 +295,35 @@ packages:
|
|||
name: local_auth
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.11"
|
||||
version: "2.1.2"
|
||||
local_auth_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: local_auth_android
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.11"
|
||||
local_auth_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: local_auth_ios
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.9"
|
||||
local_auth_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: local_auth_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
local_auth_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: local_auth_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
logger:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -309,7 +337,7 @@ packages:
|
|||
name: mask_text_input_formatter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.4.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -323,14 +351,14 @@ packages:
|
|||
name: material_color_utilities
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
version: "0.1.4"
|
||||
material_design_icons_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: material_design_icons_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.0.6595"
|
||||
version: "5.0.6996"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -351,14 +379,14 @@ packages:
|
|||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.8.1"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.9"
|
||||
version: "2.0.11"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -456,7 +484,7 @@ packages:
|
|||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.2"
|
||||
version: "6.0.3"
|
||||
qr:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -519,7 +547,7 @@ packages:
|
|||
name: shared_preferences
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.13"
|
||||
version: "2.0.15"
|
||||
shared_preferences_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -580,21 +608,21 @@ packages:
|
|||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.8.2"
|
||||
sqflite:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: sqflite
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.0.3+1"
|
||||
sqflite_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqflite_common
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.2.1+1"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -636,7 +664,7 @@ packages:
|
|||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.8"
|
||||
version: "0.4.9"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -650,7 +678,7 @@ packages:
|
|||
name: url_launcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.20"
|
||||
version: "6.1.5"
|
||||
url_launcher_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -685,7 +713,7 @@ packages:
|
|||
name: url_launcher_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
version: "2.1.0"
|
||||
url_launcher_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -706,14 +734,14 @@ packages:
|
|||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
vocsy_esys_flutter_share:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: vocsy_esys_flutter_share
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.1"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -736,5 +764,5 @@ packages:
|
|||
source: hosted
|
||||
version: "5.3.1"
|
||||
sdks:
|
||||
dart: ">=2.15.0 <3.0.0"
|
||||
flutter: ">=2.10.0-0"
|
||||
dart: ">=2.17.0-0 <3.0.0"
|
||||
flutter: ">=3.0.0"
|
||||
|
|
|
|||
34
pubspec.yaml
34
pubspec.yaml
|
|
@ -1,42 +1,42 @@
|
|||
name: aman_kassa_flutter
|
||||
description: A new Flutter project.
|
||||
version: 1.3.0+41
|
||||
version: 1.4.0+42
|
||||
environment:
|
||||
sdk: '>=2.15.0 <3.0.0'
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
cupertino_icons: ^1.0.4
|
||||
cupertino_icons: ^1.0.5
|
||||
redux: ^5.0.0
|
||||
flutter_redux: ^0.8.2
|
||||
flutter_redux: ^0.10.0
|
||||
redux_thunk: ^0.4.0
|
||||
redux_persist: ^0.9.0
|
||||
redux_persist_flutter: ^0.9.0
|
||||
responsive_builder: ^0.4.2
|
||||
provider: ^6.0.2
|
||||
provider: ^6.0.3
|
||||
logger: ^1.1.0
|
||||
get_it: ^7.2.0
|
||||
equatable: ^2.0.3
|
||||
http: ^0.13.4
|
||||
sqflite: ^2.0.2
|
||||
path_provider: ^2.0.9
|
||||
google_fonts: ^2.3.1
|
||||
material_design_icons_flutter: ^5.0.6595
|
||||
http: ^0.13.5
|
||||
sqflite: ^2.0.3+1
|
||||
path_provider: ^2.0.11
|
||||
google_fonts: ^3.0.1
|
||||
material_design_icons_flutter: ^5.0.6996
|
||||
intl: ^0.17.0
|
||||
barcode_scan2: ^4.2.0
|
||||
barcode_scan2: ^4.2.1
|
||||
device_info: ^2.0.3
|
||||
vocsy_esys_flutter_share: ^1.0.0
|
||||
vocsy_esys_flutter_share: ^1.0.1
|
||||
auto_size_text: ^3.0.0
|
||||
url_launcher: ^6.0.20
|
||||
url_launcher: ^6.1.5
|
||||
qr_flutter: ^4.0.0
|
||||
mask_text_input_formatter: ^2.1.0
|
||||
flutter_screenutil: ^5.3.1
|
||||
shared_preferences: ^2.0.13
|
||||
mask_text_input_formatter: ^2.4.0
|
||||
flutter_screenutil: ^5.5.3+2
|
||||
shared_preferences: ^2.0.15
|
||||
flutter_lock_screen: ^2.0.1
|
||||
local_auth: ^1.1.11
|
||||
local_auth: ^2.1.2
|
||||
#esc_pos_bluetooth: ^0.4.1
|
||||
esc_pos_utils: ^1.1.0
|
||||
charset_converter: ^2.0.0
|
||||
charset_converter: ^2.1.0
|
||||
permission_handler: ^8.3.0
|
||||
bluetooth_print:
|
||||
path: ../bluetooth_print
|
||||
|
|
|
|||
Loading…
Reference in New Issue