diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 83139e1..fbf1f74 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -392,7 +392,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_TEAM = 94BM6VL7L8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -531,7 +531,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_TEAM = 94BM6VL7L8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -563,7 +563,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_TEAM = 94BM6VL7L8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 01b9c8c..cf1a759 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -27,7 +27,7 @@ LSRequiresIPhoneOS NSCameraUsageDescription - Camera permission is required for barcode and qr-code scanning. + Требуется доступ к камере для сканирования QR-кодов и штрих-кодов UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/lib/core/services/dialog_service.dart b/lib/core/services/dialog_service.dart index b979113..bdb495b 100644 --- a/lib/core/services/dialog_service.dart +++ b/lib/core/services/dialog_service.dart @@ -9,6 +9,8 @@ class DialogService { Function(DialogRequest) _showDialogInputListener; Completer _dialogCompleter; + Completer get completer => this._dialogCompleter; + GlobalKey get dialogNavigationKey => _dialogNavigationKey; /// Registers a callback function. Typically to show the dialog @@ -67,4 +69,6 @@ class DialogService { _dialogCompleter.complete(response); _dialogCompleter = null; } + + } diff --git a/lib/views/home/components/popup_menu.dart b/lib/views/home/components/popup_menu.dart index b9c7f8c..9ce80a0 100644 --- a/lib/views/home/components/popup_menu.dart +++ b/lib/views/home/components/popup_menu.dart @@ -6,12 +6,14 @@ const List choices = const [ //const Choice(title: 'Обновить номенклатуру', icon: Icons.update, command: 'update'), //const Choice(title: 'Помощь', icon: Icons.help, command: 'help'), const Choice( - title: 'Информацио о ККМ', icon: Icons.info_outline, command: 'infokkm'), + title: 'Информация о ККМ', icon: Icons.info_outline, command: 'infokkm'), + //const Choice(title: 'Язык', icon: Icons.language, command: 'language'), const Choice(title: 'Bank', icon: Icons.text_fields, command: 'bank'), const Choice(title: 'Выйти', icon: Icons.exit_to_app, command: 'exit') ]; class PopupMenu extends StatelessWidget { + final void Function(Choice value) onSelectChoice; PopupMenu({this.onSelectChoice}); @@ -28,18 +30,11 @@ class PopupMenu extends StatelessWidget { return choices.map((Choice choice) { return PopupMenuItem( value: choice, - child: Row( - children: [ - Icon( - choice.icon, - color: primaryColor, - ), - SizedBox( - width: 5, - ), - Text(choice.title) - ], - ), + child: Row(children: [ + Icon(choice.icon, color: primaryColor,), + SizedBox(width: 5,), + Text(choice.title) + ], ), ); }).toList(); }, diff --git a/lib/views/home/tabs/AdditionalTab.dart b/lib/views/home/tabs/AdditionalTab.dart index 579cfd2..6683efa 100644 --- a/lib/views/home/tabs/AdditionalTab.dart +++ b/lib/views/home/tabs/AdditionalTab.dart @@ -212,11 +212,10 @@ class _AdditionalTabState extends State { @override Widget build(BuildContext context) { return Container( - padding: const EdgeInsets.symmetric(vertical: 15), child: ListView( children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), + padding: const EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), child: StoreConnector( converter: (store) => store.state.settingState, builder: (context, vm) { @@ -358,21 +357,29 @@ class _AdditionalTabState extends State { ], ), verticalSpaceMedium, - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - BusyButton( - title: 'Взнос наличных', - onPressed: _deposit, - busy: depositBusy, - ), - BusyButton( - title: 'Снятие наличных', - onPressed: _withdrawal, - mainColor: redColor, - busy: withdrawalBusy, - ), - ], + Container( + margin: const EdgeInsets.symmetric(horizontal: 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: BusyButton( + title: 'Взнос наличных', + onPressed: _deposit, + busy: depositBusy, + ), + ), + horizontalSpaceSmall, + Expanded( + child: BusyButton( + title: 'Снятие наличных', + onPressed: _withdrawal, + mainColor: redColor, + busy: withdrawalBusy, + ), + ), + ], + ), ), ], ), diff --git a/lib/widgets/dialog_manager.dart b/lib/widgets/dialog_manager.dart index 6395604..115d682 100644 --- a/lib/widgets/dialog_manager.dart +++ b/lib/widgets/dialog_manager.dart @@ -14,7 +14,7 @@ class DialogManager extends StatefulWidget { } class _DialogManagerState extends State { - DialogService _dialogService = locator(); + final DialogService _dialogService = locator(); TextEditingController controller; @override @@ -78,7 +78,7 @@ class _DialogManagerState extends State { void _showDialogInput(DialogRequest request) { var isConfirmationDialog = request.cancelTitle != null; controller.clear(); - showDialog( + var dialogController = showDialog( context: context, builder: (context) => AlertDialog( shape: RoundedRectangleBorder( @@ -143,5 +143,11 @@ class _DialogManagerState extends State { ), ], )); + dialogController.whenComplete(() { + //hook when press overlay and response not completed + if (_dialogService.completer != null) { + _dialogService.completer.complete(DialogResponse(confirmed: false)); + } + }); } } diff --git a/lib/widgets/fields/aman_icon_button.dart b/lib/widgets/fields/aman_icon_button.dart index 0099a36..852c96a 100644 --- a/lib/widgets/fields/aman_icon_button.dart +++ b/lib/widgets/fields/aman_icon_button.dart @@ -1,3 +1,4 @@ +import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; /// A button that shows a busy indicator in place of title @@ -52,7 +53,7 @@ class _AmanIconButtonState extends State { : CircularProgressIndicator( strokeWidth: 3, valueColor: AlwaysStoppedAnimation(widget.mainColor))), - Text(widget.title, overflow: TextOverflow.fade, maxLines: 2, style: TextStyle(color: widget.mainColor, fontSize: 14, fontWeight: FontWeight.w800, ), textAlign: TextAlign.center,) + AutoSizeText(widget.title, overflow: TextOverflow.fade, maxLines: 2, style: TextStyle(color: widget.mainColor, fontSize: 14, fontWeight: FontWeight.w800, ), textAlign: TextAlign.center,) ], ), ), diff --git a/lib/widgets/fields/aman_icon_button_horizontal.dart b/lib/widgets/fields/aman_icon_button_horizontal.dart index 9dd4ea5..937923b 100644 --- a/lib/widgets/fields/aman_icon_button_horizontal.dart +++ b/lib/widgets/fields/aman_icon_button_horizontal.dart @@ -1,4 +1,5 @@ import 'package:aman_kassa_flutter/shared/app_colors.dart'; +import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; /// A button that shows a busy indicator in place of title @@ -36,7 +37,7 @@ class _AmanIconButtonHorizontalState extends State { color: widget.selected ? widget.activeColor : widget.inactiveColor), - Text(widget.title, + AutoSizeText(widget.title, style: TextStyle( color: widget.selected ? widget.activeColor diff --git a/lib/widgets/fields/busy_button.dart b/lib/widgets/fields/busy_button.dart index 06a67bb..96a782b 100644 --- a/lib/widgets/fields/busy_button.dart +++ b/lib/widgets/fields/busy_button.dart @@ -11,6 +11,7 @@ class BusyButton extends StatefulWidget { final bool enabled; final Color mainColor; final IconData icon; + const BusyButton( {@required this.title, this.busy = false, @@ -50,19 +51,27 @@ class _BusyButtonState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - widget.icon != null - ? Container( - child: (Icon( - widget.icon, - color: whiteColor, - )), - margin: const EdgeInsets.only(right: 10.0), - ) - : (Container()), !widget.busy - ? AutoSizeText( - widget.title, - style: buttonTitleTextStyle, + ? Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + widget.icon != null + ? Container( + child: (Icon( + widget.icon, + color: whiteColor, + )), + margin: const EdgeInsets.only(right: 10.0), + ) + : (Container()), + AutoSizeText( + widget.title, + textAlign: TextAlign.center, + style: buttonTitleTextStyle, + ), + ], + ), ) : CircularProgressIndicator( strokeWidth: 2, diff --git a/pubspec.lock b/pubspec.lock index b332fb0..a2cf305 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -141,7 +141,7 @@ packages: name: get_it url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.0.2" google_fonts: dependency: "direct main" description: @@ -184,6 +184,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.9.1" + mask_text_input_formatter: + dependency: "direct main" + description: + name: mask_text_input_formatter + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.7" matcher: dependency: transitive description: @@ -302,7 +309,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.1.3" + version: "4.3.0" pub_semver: dependency: transitive description: @@ -365,7 +372,7 @@ packages: name: responsive_builder url: "https://pub.dartlang.org" source: hosted - version: "0.1.9" + version: "0.2.0+2" shared_preferences: dependency: transitive description: @@ -475,7 +482,14 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.4.11" + version: "5.5.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+1" url_launcher_macos: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 9525a53..65ac430 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,20 +6,20 @@ environment: dependencies: flutter: sdk: flutter - cupertino_icons: ^0.1.2 + cupertino_icons: ^0.1.3 redux: ^4.0.0 flutter_redux: ^0.6.0 redux_thunk: ^0.3.0 redux_persist: ^0.8.4 redux_persist_flutter: ^0.8.2 - responsive_builder: ^0.1.4 - provider: ^4.1.2 + responsive_builder: ^0.2.0+2 + provider: ^4.3.0 logger: ^0.9.1 - get_it: ^3.0.3 - equatable: ^1.1.1 + get_it: ^4.0.2 + equatable: ^1.2.0 http: ^0.12.1 - sqflite: ^1.3.0 - path_provider: ^1.6.9 + sqflite: ^1.3.1 + path_provider: ^1.6.11 google_fonts: ^1.1.0 material_design_icons_flutter: ^4.0.5345 intl: ^0.16.1 @@ -27,8 +27,9 @@ dependencies: device_info: ^0.4.2+4 esys_flutter_share: ^1.0.2 auto_size_text: ^2.1.0 - url_launcher: ^5.4.11 + url_launcher: ^5.5.0 qr_flutter: ^3.2.0 + mask_text_input_formatter: ^1.0.7 dev_dependencies: flutter_test: sdk: flutter