Browse Source

fix Bug #7797

master
daivph 5 years ago
parent
commit
c37f1da210
8 changed files with 69 additions and 10 deletions
  1. +1
    -1
      ios/Flutter/.last_build_id
  2. +3
    -3
      ios/Runner.xcodeproj/project.pbxproj
  3. +28
    -1
      lib/presentation/custom_widgets/widget_utils.dart
  4. +9
    -1
      lib/presentation/screens/actions/dung/sc_edit_action_dung.dart
  5. +9
    -1
      lib/presentation/screens/actions/harvest_process/sc_edit_action_harvest_process.dart
  6. +9
    -1
      lib/presentation/screens/actions/plant/sc_edit_action_plant.dart
  7. +9
    -1
      lib/presentation/screens/actions/spraying/sc_edit_action_spraying.dart
  8. +1
    -1
      pubspec.yaml

+ 1
- 1
ios/Flutter/.last_build_id View File

@@ -1 +1 @@
440505e9ea1eee7043d2cbfeb318f6bc
af0eb765f94aecba228edd3e3fe3c4f4

+ 3
- 3
ios/Runner.xcodeproj/project.pbxproj View File

@@ -391,7 +391,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.7.0;
PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.tpfarm;
PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -533,7 +533,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.7.0;
PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.tpfarm;
PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -567,7 +567,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.7.0;
PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.tpfarm;
PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

+ 28
- 1
lib/presentation/custom_widgets/widget_utils.dart View File

@@ -32,7 +32,34 @@ class Utils {
color: Colors.yellow,
),
snackPosition: SnackPosition.BOTTOM,
duration: Duration(seconds: 30),
backgroundColor: Colors.yellow[50]);
}

static void showDialog(
{@required String title,
@required String message,
@required String textConfirm,
@required String textCancel,
@required Function() onConfirm}) {
if (Get.isDialogOpen) Get.back();
Get.defaultDialog(
title: title,
middleText: message,
textConfirm: textConfirm,
textCancel: textCancel,
confirmTextColor: Colors.white,
onConfirm: onConfirm,
);
}

static void showDialogConfirmSupply({@required Function() onConfirm}) {
if (Get.isDialogOpen) Get.back();
Get.defaultDialog(
title: "Vật tư chưa được thêm",
middleText: "Bạn có muốn cập nhật?",
textConfirm: "Tiếp tục",
textCancel: "Xem lại",
confirmTextColor: Colors.white,
onConfirm: onConfirm);
}
}

+ 9
- 1
lib/presentation/screens/actions/dung/sc_edit_action_dung.dart View File

@@ -13,6 +13,7 @@ import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.da
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
import 'package:farm_tpf/presentation/screens/actions/dung/widget_dung_supply.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_supply.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/const_string.dart';
import 'package:farm_tpf/utils/const_style.dart';
@@ -227,7 +228,14 @@ class _EditActionDungScreenState extends State<EditActionDungScreen> {
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
_validateInputs();
if (Get.find<ChangeSupply>().selectedSupplyId > 0) {
Utils.showDialogConfirmSupply(onConfirm: () {
Get.back();
_validateInputs();
});
} else {
_validateInputs();
}
},
);
return <Widget>[iconButton];

+ 9
- 1
lib/presentation/screens/actions/harvest_process/sc_edit_action_harvest_process.dart View File

@@ -14,6 +14,7 @@ import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.da
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
import 'package:farm_tpf/presentation/screens/actions/harvest_process/widget_harvest_process_supply.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_supply.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/const_string.dart';
import 'package:farm_tpf/utils/const_style.dart';
@@ -298,7 +299,14 @@ class _EditActionHarvestProcessScreenState
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
_validateInputs();
if (Get.find<ChangeSupply>().selectedSupplyId > 0) {
Utils.showDialogConfirmSupply(onConfirm: () {
Get.back();
_validateInputs();
});
} else {
_validateInputs();
}
},
);
return <Widget>[iconButton];

+ 9
- 1
lib/presentation/screens/actions/plant/sc_edit_action_plant.dart View File

@@ -13,6 +13,7 @@ import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.da
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
import 'package:farm_tpf/presentation/screens/actions/plant/widget_plant_supply.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_supply.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/const_string.dart';
import 'package:farm_tpf/utils/const_style.dart';
@@ -215,7 +216,14 @@ class _EditActionPlantScreenState extends State<EditActionPlantScreen> {
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
_validateInputs();
if (Get.find<ChangeSupply>().selectedSupplyId > 0) {
Utils.showDialogConfirmSupply(onConfirm: () {
Get.back();
_validateInputs();
});
} else {
_validateInputs();
}
},
);
return <Widget>[iconButton];

+ 9
- 1
lib/presentation/screens/actions/spraying/sc_edit_action_spraying.dart View File

@@ -13,6 +13,7 @@ import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.da
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
import 'package:farm_tpf/presentation/screens/actions/spraying/widget_spraying_supply.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_supply.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/const_string.dart';
import 'package:farm_tpf/utils/const_style.dart';
@@ -265,7 +266,14 @@ class _EditActionSprayingScreenState extends State<EditActionSprayingScreen> {
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
_validateInputs();
if (Get.find<ChangeSupply>().selectedSupplyId > 0) {
Utils.showDialogConfirmSupply(onConfirm: () {
Get.back();
_validateInputs();
});
} else {
_validateInputs();
}
},
);
return <Widget>[iconButton];

+ 1
- 1
pubspec.yaml View File

@@ -2,7 +2,7 @@ name: farm_tpf
description: A new Flutter project.

publish_to: 'none'
version: 0.6.0+1
version: 0.7.0+1

environment:
sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save