up version all libs.

fix dialog_manager.dart when touch overflow
4.4
Serik.Uvaissov 2020-07-10 20:25:33 +06:00
parent 12621e42ac
commit 5024fe2f21
8 changed files with 88 additions and 45 deletions

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

@ -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,22 +357,30 @@ class _AdditionalTabState extends State<AdditionalTab> {
],
),
verticalSpaceMedium,
Row(
Container(
margin: const EdgeInsets.symmetric(horizontal: 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
BusyButton(
Expanded(
child: BusyButton(
title: 'Взнос наличных',
onPressed: _deposit,
busy: depositBusy,
),
BusyButton(
),
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,
@ -47,6 +48,11 @@ class _BusyButtonState extends State<BusyButton> {
margin: EdgeInsets.symmetric(
horizontal: widget.busy ? 10 : 25,
vertical: widget.busy ? 10 : 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
!widget.busy
? Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
@ -59,10 +65,13 @@ class _BusyButtonState extends State<BusyButton> {
margin: const EdgeInsets.only(right: 10.0),
)
: (Container()),
!widget.busy
? AutoSizeText(
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