Merge branch 'master' into nfc-android

# Conflicts:
#	lib/views/home/components/popup_menu.dart
backend_nfc
Serik.Uvaissov 2020-07-10 20:27:34 +06:00
commit f8f646279f
11 changed files with 100 additions and 62 deletions

View File

@ -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 = (

View File

@ -27,7 +27,7 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode and qr-code scanning.</string>
<string>Требуется доступ к камере для сканирования QR-кодов и штрих-кодов</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>

View File

@ -9,6 +9,8 @@ class DialogService {
Function(DialogRequest) _showDialogInputListener;
Completer<DialogResponse> _dialogCompleter;
Completer<DialogResponse> get completer => this._dialogCompleter;
GlobalKey<NavigatorState> get dialogNavigationKey => _dialogNavigationKey;
/// Registers a callback function. Typically to show the dialog
@ -67,4 +69,6 @@ class DialogService {
_dialogCompleter.complete(response);
_dialogCompleter = null;
}
}

View File

@ -6,12 +6,14 @@ const List<Choice> choices = const <Choice>[
//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<Choice>(
value: choice,
child: Row(
children: <Widget>[
Icon(
choice.icon,
color: primaryColor,
),
SizedBox(
width: 5,
),
Text(choice.title)
],
),
child: Row(children: <Widget>[
Icon(choice.icon, color: primaryColor,),
SizedBox(width: 5,),
Text(choice.title)
], ),
);
}).toList();
},

View File

@ -212,11 +212,10 @@ class _AdditionalTabState extends State<AdditionalTab> {
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 15),
child: ListView(
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
padding: const EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: StoreConnector<AppState, SettingState>(
converter: (store) => store.state.settingState,
builder: (context, vm) {
@ -358,21 +357,29 @@ class _AdditionalTabState extends State<AdditionalTab> {
],
),
verticalSpaceMedium,
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
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: <Widget>[
Expanded(
child: BusyButton(
title: 'Взнос наличных',
onPressed: _deposit,
busy: depositBusy,
),
),
horizontalSpaceSmall,
Expanded(
child: BusyButton(
title: 'Снятие наличных',
onPressed: _withdrawal,
mainColor: redColor,
busy: withdrawalBusy,
),
),
],
),
),
],
),

View File

@ -14,7 +14,7 @@ class DialogManager extends StatefulWidget {
}
class _DialogManagerState extends State<DialogManager> {
DialogService _dialogService = locator<DialogService>();
final DialogService _dialogService = locator<DialogService>();
TextEditingController controller;
@override
@ -78,7 +78,7 @@ class _DialogManagerState extends State<DialogManager> {
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<DialogManager> {
),
],
));
dialogController.whenComplete(() {
//hook when press overlay and response not completed
if (_dialogService.completer != null) {
_dialogService.completer.complete(DialogResponse(confirmed: false));
}
});
}
}

View File

@ -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<AmanIconButton> {
: CircularProgressIndicator(
strokeWidth: 3,
valueColor: AlwaysStoppedAnimation<Color>(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,)
],
),
),

View File

@ -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<AmanIconButtonHorizontal> {
color: widget.selected
? widget.activeColor
: widget.inactiveColor),
Text(widget.title,
AutoSizeText(widget.title,
style: TextStyle(
color: widget.selected
? widget.activeColor

View File

@ -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<BusyButton> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
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>[
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,

View File

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

View File

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