| @@ -11,7 +11,7 @@ | |||
| <uses-permission android:name="android.permission.CAMERA" /> | |||
| <application | |||
| android:name=".Application" | |||
| android:label="Smart Farm" | |||
| android:label="Aztrace - Nhật ký canh tác" | |||
| android:icon="@mipmap/ic_launcher" | |||
| android:requestLegacyExternalStorage="true"> | |||
| <meta-data | |||
| @@ -21,6 +21,6 @@ | |||
| <key>CFBundleVersion</key> | |||
| <string>1.0</string> | |||
| <key>MinimumOSVersion</key> | |||
| <string>9.0</string> | |||
| <string>11.0</string> | |||
| </dict> | |||
| </plist> | |||
| @@ -133,8 +133,9 @@ PODS: | |||
| - SDWebImageWebPCoder (0.14.0): | |||
| - libwebp (~> 1.0) | |||
| - SDWebImage/Core (~> 5.17) | |||
| - shared_preferences (0.0.1): | |||
| - shared_preferences_foundation (0.0.1): | |||
| - Flutter | |||
| - FlutterMacOS | |||
| - sqflite (0.0.3): | |||
| - Flutter | |||
| - FMDB (>= 2.7.5) | |||
| @@ -150,7 +151,7 @@ DEPENDENCIES: | |||
| - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) | |||
| - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) | |||
| - qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`) | |||
| - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) | |||
| - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`) | |||
| - sqflite (from `.symlinks/plugins/sqflite/ios`) | |||
| SPEC REPOS: | |||
| @@ -193,8 +194,8 @@ EXTERNAL SOURCES: | |||
| :path: ".symlinks/plugins/path_provider_foundation/ios" | |||
| qr_code_scanner: | |||
| :path: ".symlinks/plugins/qr_code_scanner/ios" | |||
| shared_preferences: | |||
| :path: ".symlinks/plugins/shared_preferences/ios" | |||
| shared_preferences_foundation: | |||
| :path: ".symlinks/plugins/shared_preferences_foundation/ios" | |||
| sqflite: | |||
| :path: ".symlinks/plugins/sqflite/ios" | |||
| @@ -225,7 +226,7 @@ SPEC CHECKSUMS: | |||
| qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e | |||
| SDWebImage: 96e0c18ef14010b7485210e92fac888587ebb958 | |||
| SDWebImageWebPCoder: 3027af94522d94df79c21c070894c8a2128927ff | |||
| shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d | |||
| shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 | |||
| sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a | |||
| SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f | |||
| @@ -363,7 +363,9 @@ | |||
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
| CLANG_ENABLE_MODULES = YES; | |||
| CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | |||
| CURRENT_PROJECT_VERSION = 14; | |||
| CODE_SIGN_IDENTITY = "Apple Development"; | |||
| CODE_SIGN_STYLE = Automatic; | |||
| CURRENT_PROJECT_VERSION = 20; | |||
| DEVELOPMENT_TEAM = C3DTD2JH94; | |||
| ENABLE_BITCODE = NO; | |||
| FRAMEWORK_SEARCH_PATHS = ( | |||
| @@ -379,9 +381,10 @@ | |||
| "$(inherited)", | |||
| "$(PROJECT_DIR)/Flutter", | |||
| ); | |||
| MARKETING_VERSION = 1.1.1; | |||
| MARKETING_VERSION = 1.1.5; | |||
| PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.farmdemo; | |||
| PRODUCT_NAME = "$(TARGET_NAME)"; | |||
| PROVISIONING_PROFILE_SPECIFIER = ""; | |||
| SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | |||
| SWIFT_VERSION = 5.0; | |||
| VERSIONING_SYSTEM = "apple-generic"; | |||
| @@ -504,7 +507,7 @@ | |||
| CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | |||
| CODE_SIGN_IDENTITY = "Apple Development"; | |||
| CODE_SIGN_STYLE = Automatic; | |||
| CURRENT_PROJECT_VERSION = 14; | |||
| CURRENT_PROJECT_VERSION = 20; | |||
| DEVELOPMENT_TEAM = C3DTD2JH94; | |||
| ENABLE_BITCODE = NO; | |||
| FRAMEWORK_SEARCH_PATHS = ( | |||
| @@ -520,7 +523,7 @@ | |||
| "$(inherited)", | |||
| "$(PROJECT_DIR)/Flutter", | |||
| ); | |||
| MARKETING_VERSION = 1.1.1; | |||
| MARKETING_VERSION = 1.1.5; | |||
| PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.farmdemo; | |||
| PRODUCT_NAME = "$(TARGET_NAME)"; | |||
| PROVISIONING_PROFILE_SPECIFIER = ""; | |||
| @@ -538,7 +541,9 @@ | |||
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
| CLANG_ENABLE_MODULES = YES; | |||
| CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | |||
| CURRENT_PROJECT_VERSION = 14; | |||
| CODE_SIGN_IDENTITY = "Apple Development"; | |||
| CODE_SIGN_STYLE = Automatic; | |||
| CURRENT_PROJECT_VERSION = 20; | |||
| DEVELOPMENT_TEAM = C3DTD2JH94; | |||
| ENABLE_BITCODE = NO; | |||
| FRAMEWORK_SEARCH_PATHS = ( | |||
| @@ -554,9 +559,10 @@ | |||
| "$(inherited)", | |||
| "$(PROJECT_DIR)/Flutter", | |||
| ); | |||
| MARKETING_VERSION = 1.1.1; | |||
| MARKETING_VERSION = 1.1.5; | |||
| PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.farmdemo; | |||
| PRODUCT_NAME = "$(TARGET_NAME)"; | |||
| PROVISIONING_PROFILE_SPECIFIER = ""; | |||
| SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | |||
| SWIFT_VERSION = 5.0; | |||
| VERSIONING_SYSTEM = "apple-generic"; | |||
| @@ -27,8 +27,6 @@ | |||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | |||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | |||
| shouldUseLaunchSchemeArgsEnv = "YES"> | |||
| <Testables> | |||
| </Testables> | |||
| <MacroExpansion> | |||
| <BuildableReference | |||
| BuildableIdentifier = "primary" | |||
| @@ -38,8 +36,8 @@ | |||
| ReferencedContainer = "container:Runner.xcodeproj"> | |||
| </BuildableReference> | |||
| </MacroExpansion> | |||
| <AdditionalOptions> | |||
| </AdditionalOptions> | |||
| <Testables> | |||
| </Testables> | |||
| </TestAction> | |||
| <LaunchAction | |||
| buildConfiguration = "Debug" | |||
| @@ -61,8 +59,6 @@ | |||
| ReferencedContainer = "container:Runner.xcodeproj"> | |||
| </BuildableReference> | |||
| </BuildableProductRunnable> | |||
| <AdditionalOptions> | |||
| </AdditionalOptions> | |||
| </LaunchAction> | |||
| <ProfileAction | |||
| buildConfiguration = "Profile" | |||
| @@ -2,6 +2,8 @@ | |||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |||
| <plist version="1.0"> | |||
| <dict> | |||
| <key>CADisableMinimumFrameDurationOnPhone</key> | |||
| <true/> | |||
| <key>CFBundleDevelopmentRegion</key> | |||
| <string>$(DEVELOPMENT_LANGUAGE)</string> | |||
| <key>CFBundleExecutable</key> | |||
| @@ -11,7 +13,7 @@ | |||
| <key>CFBundleInfoDictionaryVersion</key> | |||
| <string>6.0</string> | |||
| <key>CFBundleName</key> | |||
| <string>Smart Farm</string> | |||
| <string>Aztrace - Nhật ký canh tác</string> | |||
| <key>CFBundlePackageType</key> | |||
| <string>APPL</string> | |||
| <key>CFBundleShortVersionString</key> | |||
| @@ -30,6 +32,8 @@ | |||
| <string>Ứng dụng Smart Farm cần quay video để sử dụng cho hoạt động canh tác</string> | |||
| <key>NSPhotoLibraryUsageDescription</key> | |||
| <string>Ứng dụng Smart Farm cần truy cập thư viện ảnh để sử dụng cho các hoạt động canh tác.</string> | |||
| <key>UIApplicationSupportsIndirectInputEvents</key> | |||
| <true/> | |||
| <key>UIBackgroundModes</key> | |||
| <array> | |||
| <string>fetch</string> | |||
| @@ -54,9 +58,5 @@ | |||
| </array> | |||
| <key>UIViewControllerBasedStatusBarAppearance</key> | |||
| <false/> | |||
| <key>CADisableMinimumFrameDurationOnPhone</key> | |||
| <true/> | |||
| <key>UIApplicationSupportsIndirectInputEvents</key> | |||
| <true/> | |||
| </dict> | |||
| </plist> | |||
| @@ -6,10 +6,12 @@ import 'package:dio/adapter.dart'; | |||
| import 'package:dio/dio.dart'; | |||
| import 'package:dio/native_imp.dart'; | |||
| import 'package:flutter_bloc/flutter_bloc.dart'; | |||
| import 'package:get/get.dart' as getx; | |||
| import '../../app.dart'; | |||
| import '../../authentication/bloc/authentication_bloc.dart'; | |||
| import '../../environment/app_config.dart'; | |||
| import '../../presentation/screens/login/login_page.dart'; | |||
| import '../../utils/const_enum.dart'; | |||
| import '../../utils/local_storage.dart'; | |||
| @@ -118,6 +120,7 @@ class UnauthorizedInterceptor extends InterceptorsWrapper { | |||
| err.type == DioErrorType.response && err.response?.statusCode == HttpStatus.unauthorized && !err.requestOptions.path.contains('authenticate'); | |||
| if (checkUnauthorized) { | |||
| LocalStorage.clearUserInfo(); | |||
| getx.Get.offAll(() => const LoginPage()); | |||
| BlocProvider.of<AuthenticationBloc>(globalNavigator.currentContext!).add( | |||
| const AuthenticationStatusChanged(AuthenticationStatus.unauthenticated), | |||
| ); | |||
| @@ -14,15 +14,16 @@ class DropdownSupplyWidget extends StatefulWidget { | |||
| final String? invalidMessage; | |||
| final String tag; | |||
| final String tbSupply; | |||
| DropdownSupplyWidget( | |||
| {this.titleName, | |||
| required this.hint, | |||
| required this.tag, | |||
| this.value, | |||
| required this.condition, | |||
| required this.onPressed, | |||
| this.invalidMessage, | |||
| required this.tbSupply}); | |||
| DropdownSupplyWidget({ | |||
| this.titleName, | |||
| required this.hint, | |||
| required this.tag, | |||
| this.value, | |||
| required this.condition, | |||
| required this.onPressed, | |||
| this.invalidMessage, | |||
| required this.tbSupply, | |||
| }); | |||
| @override | |||
| _DropdownSupplyWidgetState createState() => _DropdownSupplyWidgetState(); | |||
| @@ -38,86 +39,94 @@ class _DropdownSupplyWidgetState extends State<DropdownSupplyWidget> { | |||
| @override | |||
| Widget build(BuildContext context) { | |||
| // return Container(); | |||
| return GetBuilder<ChangeDropdownController>( | |||
| tag: widget.tag, | |||
| tag: 's', | |||
| init: controller, | |||
| builder: (data) { | |||
| return SizedBox( | |||
| width: double.infinity, | |||
| height: Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') ? 85 : 65, | |||
| child: Column( | |||
| crossAxisAlignment: CrossAxisAlignment.start, | |||
| children: [ | |||
| Validators.stringNotNullOrEmpty(data?.currentData?.name ?? '') | |||
| ? Text( | |||
| widget.hint ?? '', | |||
| style: TextStyle( | |||
| color: Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') ? Colors.red : Colors.black54, fontSize: 13.0), | |||
| ) | |||
| : Text( | |||
| '', | |||
| style: TextStyle( | |||
| color: Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') ? Colors.red : Colors.black54, fontSize: 13.0), | |||
| ), | |||
| SizedBox( | |||
| width: double.infinity, | |||
| height: 44, | |||
| child: TextButton( | |||
| onPressed: () { | |||
| Navigator.of(context) | |||
| .push(MaterialPageRoute( | |||
| builder: (_) => CommonDataHelperScreen( | |||
| titleName: widget.titleName ?? '', | |||
| tbSupply: widget.tbSupply ?? '', | |||
| condition: widget.condition ?? '', | |||
| selectedId: data?.selectedId ?? -1, | |||
| currentItems: [], | |||
| currentEditId: -1), | |||
| fullscreenDialog: false)) | |||
| .then((value) { | |||
| if (value != null) { | |||
| var result = value as CommonData; | |||
| controller?.change(result); | |||
| widget.onPressed(result); | |||
| } | |||
| }); | |||
| }, | |||
| child: Column( | |||
| crossAxisAlignment: CrossAxisAlignment.start, | |||
| children: [ | |||
| Container( | |||
| padding: EdgeInsets.only(top: 0.0, right: 0.0, bottom: 10.5, left: 0.0), | |||
| decoration: BoxDecoration( | |||
| border: Border( | |||
| bottom: BorderSide( | |||
| width: 0.5, | |||
| color: Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') ? Colors.red : Colors.black54)), | |||
| ), | |||
| child: Row( | |||
| children: [ | |||
| Expanded( | |||
| child: Validators.stringNotNullOrEmpty(data?.currentData?.name ?? '') | |||
| ? Text(data?.currentData?.name ?? '', style: TextStyle(fontSize: 16.0, color: Colors.black)) | |||
| : Text(widget.hint, style: TextStyle(fontSize: 16.0, color: Colors.black54)), | |||
| ), | |||
| Icon( | |||
| Icons.arrow_drop_down, | |||
| color: Colors.grey, | |||
| ), | |||
| ], | |||
| )) | |||
| ], | |||
| )), | |||
| ), | |||
| Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') | |||
| ? Text( | |||
| widget.invalidMessage ?? '', | |||
| style: TextStyle(fontSize: 12.0, color: Colors.red, fontWeight: FontWeight.normal), | |||
| textAlign: TextAlign.left, | |||
| ) | |||
| : SizedBox(), | |||
| ], | |||
| ), | |||
| ); | |||
| return Container(); | |||
| }); | |||
| // return GetBuilder<ChangeDropdownController>( | |||
| // tag: widget.tag, | |||
| // builder: (data) { | |||
| // return Container(); | |||
| // return SizedBox( | |||
| // width: double.infinity, | |||
| // height: Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') ? 85 : 65, | |||
| // child: Column( | |||
| // crossAxisAlignment: CrossAxisAlignment.start, | |||
| // children: [ | |||
| // Validators.stringNotNullOrEmpty(data?.currentData?.name ?? '') | |||
| // ? Text( | |||
| // widget.hint ?? '', | |||
| // style: TextStyle( | |||
| // color: Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') ? Colors.red : Colors.black54, fontSize: 13.0), | |||
| // ) | |||
| // : Text( | |||
| // '', | |||
| // style: TextStyle( | |||
| // color: Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') ? Colors.red : Colors.black54, fontSize: 13.0), | |||
| // ), | |||
| // SizedBox( | |||
| // width: double.infinity, | |||
| // height: 44, | |||
| // child: TextButton( | |||
| // onPressed: () { | |||
| // Navigator.of(context) | |||
| // .push(MaterialPageRoute( | |||
| // builder: (_) => CommonDataHelperScreen( | |||
| // titleName: widget.titleName ?? '', | |||
| // tbSupply: widget.tbSupply ?? '', | |||
| // condition: widget.condition ?? '', | |||
| // selectedId: data?.selectedId ?? -1, | |||
| // currentItems: [], | |||
| // currentEditId: -1), | |||
| // fullscreenDialog: false)) | |||
| // .then((value) { | |||
| // if (value != null) { | |||
| // var result = value as CommonData; | |||
| // controller?.change(result); | |||
| // widget.onPressed(result); | |||
| // } | |||
| // }); | |||
| // }, | |||
| // child: Column( | |||
| // crossAxisAlignment: CrossAxisAlignment.start, | |||
| // children: [ | |||
| // Container( | |||
| // padding: EdgeInsets.only(top: 0.0, right: 0.0, bottom: 10.5, left: 0.0), | |||
| // decoration: BoxDecoration( | |||
| // border: Border( | |||
| // bottom: BorderSide( | |||
| // width: 0.5, | |||
| // color: Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') ? Colors.red : Colors.black54)), | |||
| // ), | |||
| // child: Row( | |||
| // children: [ | |||
| // Expanded( | |||
| // child: Validators.stringNotNullOrEmpty(data?.currentData?.name ?? '') | |||
| // ? Text(data?.currentData?.name ?? '', style: TextStyle(fontSize: 16.0, color: Colors.black)) | |||
| // : Text(widget.hint, style: TextStyle(fontSize: 16.0, color: Colors.black54)), | |||
| // ), | |||
| // Icon( | |||
| // Icons.arrow_drop_down, | |||
| // color: Colors.grey, | |||
| // ), | |||
| // ], | |||
| // )) | |||
| // ], | |||
| // )), | |||
| // ), | |||
| // Validators.stringNotNullOrEmpty(widget.invalidMessage ?? '') | |||
| // ? Text( | |||
| // widget.invalidMessage ?? '', | |||
| // style: TextStyle(fontSize: 12.0, color: Colors.red, fontWeight: FontWeight.normal), | |||
| // textAlign: TextAlign.left, | |||
| // ) | |||
| // : SizedBox(), | |||
| // ], | |||
| // ), | |||
| // ); | |||
| // }); | |||
| } | |||
| } | |||
| @@ -4,7 +4,7 @@ import 'package:get/get.dart'; | |||
| class Utils { | |||
| static void showSnackBarSuccess({String? message}) { | |||
| if (Get.isSnackbarOpen) Get.back(); | |||
| Get.snackbar(null, message, | |||
| Get.snackbar('Thành công', message ?? '', | |||
| icon: Icon( | |||
| Icons.done, | |||
| color: Colors.white, | |||
| @@ -15,7 +15,7 @@ class Utils { | |||
| static void showSnackBarError({String? message}) { | |||
| if (Get.isSnackbarOpen) Get.back(); | |||
| Get.snackbar(null, message, | |||
| Get.snackbar('Lỗi', message ?? '', | |||
| icon: Icon( | |||
| Icons.error, | |||
| color: Colors.white, | |||
| @@ -26,7 +26,7 @@ class Utils { | |||
| static void showSnackBarWarning({String? message}) { | |||
| if (Get.isSnackbarOpen) Get.back(); | |||
| Get.snackbar(null, message, | |||
| Get.snackbar('Cảnh báo', message ?? '', | |||
| icon: Icon( | |||
| Icons.warning, | |||
| color: Colors.yellow, | |||
| @@ -37,7 +37,7 @@ class Utils { | |||
| static void showDialog( | |||
| {required String title, required String message, required String textConfirm, required String textCancel, required Function() onConfirm}) { | |||
| if (Get.isDialogOpen) Get.back(); | |||
| if (Get.isDialogOpen ?? false) Get.back(); | |||
| Get.defaultDialog( | |||
| title: title, | |||
| middleText: message, | |||
| @@ -49,7 +49,7 @@ class Utils { | |||
| } | |||
| static void showDialogConfirmSupply({required Function() onConfirm}) { | |||
| if (Get.isDialogOpen) Get.back(); | |||
| if (Get.isDialogOpen ?? false) Get.back(); | |||
| Get.defaultDialog( | |||
| title: "Vật tư chưa được thêm", | |||
| middleText: "Bạn có muốn cập nhật?", | |||
| @@ -68,6 +68,7 @@ class _ActionScreenState extends State<ActionScreen> { | |||
| final _executeByController = TextEditingController(); | |||
| DateTime executeTime = DateTime.now(); | |||
| List<String> filePaths = <String>[]; | |||
| var controller = Get.put(ChangeDropdownController()); | |||
| var changeFileController = Get.put(ChangeFileController()); | |||
| Map<String, TextEditingController> textFieldControllers = {}; | |||
| Map<String, String> valueObjects = {}; | |||
| @@ -359,16 +360,17 @@ class _ActionScreenState extends State<ActionScreen> { | |||
| children: [ | |||
| groupName(field.groupName ?? ''), | |||
| DropdownSupplyWidget( | |||
| titleName: field.description ?? '', | |||
| tbSupply: field.tbActivityExtendTypeExternalTable ?? '', | |||
| tag: field.name ?? '', | |||
| value: field.description, | |||
| hint: '${field.description} ${(field.isMandatory ?? false) ? '*' : ''}', | |||
| condition: field.tbActivityExtendTypeCondition ?? '', | |||
| invalidMessage: '', | |||
| onPressed: (commonData) { | |||
| valueObjects[field.id.toString()] = commonData.id.toString(); | |||
| }), | |||
| titleName: field.description ?? '', | |||
| tbSupply: field.tbActivityExtendTypeExternalTable ?? '', | |||
| tag: field.name ?? '', | |||
| value: field.description, | |||
| hint: '${field.description} ${(field.isMandatory ?? false) ? '*' : ''}', | |||
| condition: field.tbActivityExtendTypeCondition ?? '', | |||
| invalidMessage: '', | |||
| onPressed: (commonData) { | |||
| valueObjects[field.id.toString()] = commonData.id.toString(); | |||
| }, | |||
| ), | |||
| ], | |||
| ); | |||
| } else if (field.tbControlTypeName == 'radiobutton') { | |||
| @@ -1,5 +1,6 @@ | |||
| import 'package:get/get_state_manager/get_state_manager.dart'; | |||
| // import 'package:get/get_state_manager/get_state_manager.dart'; | |||
| import 'package:farm_tpf/custom_model/action_form/CommonData.dart'; | |||
| import 'package:get/get.dart'; | |||
| class ChangeDropdownController extends GetxController { | |||
| CommonData? currentData; | |||
| @@ -25,8 +25,12 @@ class _ControlDeviceScreenState extends State<ControlDeviceScreen> { | |||
| Widget build(BuildContext context) { | |||
| _blocContext = context; | |||
| return Scaffold( | |||
| backgroundColor: Colors.white, | |||
| body: BlocProvider<DeviceBloc>(create: (context) => DeviceBloc(repository: Repository())..add(OpenScreen()), child: _buildContent())); | |||
| backgroundColor: Colors.white, | |||
| body: BlocProvider<DeviceBloc>( | |||
| create: (context) => DeviceBloc(repository: Repository())..add(OpenScreen()), | |||
| child: _buildContent(), | |||
| ), | |||
| ); | |||
| } | |||
| Widget _buildContent() { | |||
| @@ -56,16 +60,19 @@ class _ControlDeviceScreenState extends State<ControlDeviceScreen> { | |||
| child: BlocBuilder<DeviceBloc, DeviceState>( | |||
| bloc: _deviceBloc, | |||
| builder: (context, state) { | |||
| print(state.toString()); | |||
| if (state is DisplayDevice) { | |||
| if (state.loading ?? false) { | |||
| return Container( | |||
| child: Center( | |||
| child: CircularProgressIndicator(), | |||
| ), | |||
| ); | |||
| } | |||
| // if (state.loading ?? false) { | |||
| // print('loading'); | |||
| // return Container( | |||
| // child: Center( | |||
| // child: CircularProgressIndicator(), | |||
| // ), | |||
| // ); | |||
| // } | |||
| if (state.devices != null) { | |||
| print('devices'); | |||
| return Container( | |||
| child: WidgetDeviceList( | |||
| devices: state.devices ?? [], | |||
| @@ -35,7 +35,7 @@ class _LoginPageState extends State<LoginPage> { | |||
| void initState() { | |||
| super.initState(); | |||
| if (kDebugMode) { | |||
| loginBloc.usernameCtl.text = 'lecaoanhquoc'; | |||
| loginBloc.usernameCtl.text = 'quanly2'; | |||
| loginBloc.passwordCtl.text = '123456'; | |||
| } | |||
| } | |||
| @@ -234,7 +234,7 @@ class DescriptionChangeControler extends GetxController { | |||
| } else { | |||
| isChanged = false; | |||
| } | |||
| if (oldValue.isNullOrBlank && newValue.isEmpty) { | |||
| if (newValue.isEmpty) { | |||
| isChanged = false; | |||
| } | |||
| update(); | |||
| @@ -42,8 +42,8 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| final changeTabbar = Get.put(TabbarSelected()); | |||
| List<TabbarItem> itemsTabbar = [ | |||
| TabbarItem(icon: AppIcons.icPlot, title: 'Lô trồng', index: TabBarIndex.plot), | |||
| // TabbarItem(icon: AppIcons.icDevice, title: 'Thiết bị', index: TabBarIndex.device), | |||
| TabbarItem(icon: AppIcons.icQrManage, title: 'Quản lý QR', index: TabBarIndex.qrManage), | |||
| TabbarItem(icon: AppIcons.icDevice, title: 'Thiết bị', index: TabBarIndex.device), | |||
| // TabbarItem(icon: AppIcons.icQrManage, title: 'Quản lý QR', index: TabBarIndex.qrManage), | |||
| TabbarItem(icon: AppIcons.icQr, title: 'Quét QR', index: TabBarIndex.qr), | |||
| TabbarItem(icon: AppIcons.icNotification, title: 'Thông báo', index: TabBarIndex.notification), | |||
| TabbarItem(icon: AppIcons.icPerson, title: 'Cá nhân', index: TabBarIndex.account) | |||
| @@ -207,12 +207,12 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| case TabBarIndex.plot: | |||
| return PlotListScreen(); | |||
| break; | |||
| // case TabBarIndex.device: | |||
| // return ControlDeviceScreen(); | |||
| // break; | |||
| case TabBarIndex.qrManage: | |||
| return CodePage(); | |||
| case TabBarIndex.device: | |||
| return ControlDeviceScreen(); | |||
| break; | |||
| // case TabBarIndex.qrManage: | |||
| // return CodePage(); | |||
| // break; | |||
| case TabBarIndex.qr: | |||
| return Container(); | |||
| break; | |||
| @@ -282,7 +282,7 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| // scan(context); | |||
| Get.to( | |||
| QrCodeScannerScreen(), | |||
| ).then((value) { | |||
| )?.then((value) { | |||
| if (value != null) { | |||
| _showAlertCheckCropCode(value); | |||
| } | |||
| @@ -305,7 +305,7 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| try { | |||
| await repository.getPlotDetailByCode(cropCode).then((value) { | |||
| print("ok"); | |||
| if (Get.isDialogOpen) Get.back(); | |||
| if (Get.isDialogOpen ?? false) Get.back(); | |||
| Get.to(PlotDetailScreen(cropId: value.tbCropDTO?.id ?? -1, cropType: value.tbCropDTO?.tbCropTypeId ?? -1, initialIndex: 0)); | |||
| }).catchError((onError) { | |||
| Utils.showDialog( | |||
| @@ -347,8 +347,8 @@ class TabbarSelected extends GetxController { | |||
| enum TabBarIndex { | |||
| plot, | |||
| // device, | |||
| qrManage, | |||
| device, | |||
| // qrManage, | |||
| qr, | |||
| notification, | |||
| account, | |||
| @@ -10,7 +10,7 @@ class LocalPref extends Pref { | |||
| @override | |||
| Future<String> getString(String key) async { | |||
| final prefs = await SharedPreferences.getInstance(); | |||
| return prefs.getString(key); | |||
| return prefs.getString(key) ?? ''; | |||
| } | |||
| } | |||
| @@ -508,10 +508,10 @@ packages: | |||
| dependency: "direct main" | |||
| description: | |||
| name: get | |||
| sha256: e476dffba6f181fd7f48e9785fe000923392644ecd2b10365b631eef440ee833 | |||
| sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" | |||
| url: "https://pub.dev" | |||
| source: hosted | |||
| version: "3.26.0" | |||
| version: "4.6.5" | |||
| glob: | |||
| dependency: transitive | |||
| description: | |||
| @@ -868,34 +868,58 @@ packages: | |||
| dependency: "direct main" | |||
| description: | |||
| name: shared_preferences | |||
| sha256: "08d8df06bf32ab574b6dee0b09f6df7e37a04022b5660492c3993efc38b46d97" | |||
| sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" | |||
| url: "https://pub.dev" | |||
| source: hosted | |||
| version: "0.5.7+3" | |||
| shared_preferences_macos: | |||
| version: "2.2.2" | |||
| shared_preferences_android: | |||
| dependency: transitive | |||
| description: | |||
| name: shared_preferences_macos | |||
| sha256: "1e66de5365055e1c7a47ea10d77bcc96330041f168bbbdf7a2bfdd4381667901" | |||
| name: shared_preferences_android | |||
| sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" | |||
| url: "https://pub.dev" | |||
| source: hosted | |||
| version: "0.0.1+11" | |||
| version: "2.2.1" | |||
| shared_preferences_foundation: | |||
| dependency: transitive | |||
| description: | |||
| name: shared_preferences_foundation | |||
| sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" | |||
| url: "https://pub.dev" | |||
| source: hosted | |||
| version: "2.3.4" | |||
| shared_preferences_linux: | |||
| dependency: transitive | |||
| description: | |||
| name: shared_preferences_linux | |||
| sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" | |||
| url: "https://pub.dev" | |||
| source: hosted | |||
| version: "2.3.2" | |||
| shared_preferences_platform_interface: | |||
| dependency: transitive | |||
| description: | |||
| name: shared_preferences_platform_interface | |||
| sha256: "10958ff09d5b0caaf199fdc436b3433cb9f7491e5f71e4b3d98b451edfee34f4" | |||
| sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a | |||
| url: "https://pub.dev" | |||
| source: hosted | |||
| version: "1.0.4" | |||
| version: "2.3.1" | |||
| shared_preferences_web: | |||
| dependency: transitive | |||
| description: | |||
| name: shared_preferences_web | |||
| sha256: "345b8f659aa4aedaabc3665a63f563c62b08dc209dd23304bc155d69ebcd388d" | |||
| sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf | |||
| url: "https://pub.dev" | |||
| source: hosted | |||
| version: "2.2.1" | |||
| shared_preferences_windows: | |||
| dependency: transitive | |||
| description: | |||
| name: shared_preferences_windows | |||
| sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" | |||
| url: "https://pub.dev" | |||
| source: hosted | |||
| version: "0.1.2+7" | |||
| version: "2.3.2" | |||
| shimmer: | |||
| dependency: "direct main" | |||
| description: | |||
| @@ -2,7 +2,7 @@ name: farm_tpf | |||
| description: A new Flutter project. | |||
| publish_to: 'none' | |||
| version: 1.1.1+8 | |||
| version: 1.1.5+20 | |||
| environment: | |||
| sdk: ">=2.17.0 <=3.0.0" | |||
| @@ -19,7 +19,7 @@ dependencies: | |||
| cupertino_icons: ^1.0.6 | |||
| meta: ^1.1.8 | |||
| shared_preferences: any | |||
| shared_preferences: ^2.0.5 | |||
| flutter_bloc: ^7.0.0 | |||
| equatable: ^2.0.5 | |||
| dio: ^4.0.0 | |||
| @@ -36,7 +36,7 @@ dependencies: | |||
| change_app_package_name: ^1.1.0 | |||
| #flutter pub run change_app_package_name:main vn.azteam.farmdemo | |||
| firebase_messaging: ^14.7.0 | |||
| get: ^3.8.0 | |||
| get: ^4.1.2 | |||
| intl: ^0.18.1 | |||
| flutter_datetime_picker: ^1.5.1 | |||
| # http: ^1.1.0 | |||