Browse Source

fix: bug #317, #319, #322

undefined
tranleanhquoc 6 months ago
parent
commit
c322707396
9 changed files with 95 additions and 72 deletions
  1. +50
    -37
      ios/Runner.xcodeproj/project.pbxproj
  2. +21
    -19
      lib/presentation/screens/actions/sc_action.dart
  3. +1
    -1
      lib/presentation/screens/notification/sc_notification.dart
  4. +1
    -1
      lib/presentation/screens/plot_detail/sc_plot_history.dart
  5. +3
    -11
      lib/presentation/screens/plot_detail/sc_plot_information.dart
  6. +1
    -1
      lib/presentation/screens/plot_detail/sc_plot_parameter.dart
  7. +8
    -1
      lib/services/firebase_notification_service.dart
  8. +9
    -0
      lib/utils/formatter.dart
  9. +1
    -1
      pubspec.yaml

+ 50
- 37
ios/Runner.xcodeproj/project.pbxproj View File

@@ -8,10 +8,10 @@

/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
28BA40FE80B56A14B0D9CD11 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B548275770BC6D3B4CF786E0 /* Pods_Runner.framework */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
57039D382BEF24AA002F4393 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 57039D372BEF24AA002F4393 /* GoogleService-Info.plist */; };
57EDCFFA2BBC55CE005E5B0A /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 57EDCFF92BBC55CE005E5B0A /* PrivacyInfo.xcprivacy */; };
5A19B8D253A88BC5E5EDE8D2 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DCE1C984F2603EE87603F8E /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -35,9 +35,11 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
4A9923954A102F75F089DEB2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
57039D372BEF24AA002F4393 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
57CB5602257E19450029CFCB /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
57EDCFF92BBC55CE005E5B0A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
59505A69743F2F8D63E32074 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -48,10 +50,8 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9DCE1C984F2603EE87603F8E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CB75B9327ED21CDF069689B1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
DC9B91632732EDCE8495DB9E /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
FEE7765B87F81514E88B2DA2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
A721EE1634DF0272D5F66D0A /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
B548275770BC6D3B4CF786E0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
@@ -59,13 +59,21 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5A19B8D253A88BC5E5EDE8D2 /* Pods_Runner.framework in Frameworks */,
28BA40FE80B56A14B0D9CD11 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
27A241DF7FF8DCCE69323071 /* Frameworks */ = {
isa = PBXGroup;
children = (
B548275770BC6D3B4CF786E0 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
@@ -85,7 +93,7 @@
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
DB97C68FAB84AB5AA161781D /* Pods */,
BDBCD4E4EDD972DED4A1A04D /* Frameworks */,
27A241DF7FF8DCCE69323071 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -114,20 +122,12 @@
path = Runner;
sourceTree = "<group>";
};
BDBCD4E4EDD972DED4A1A04D /* Frameworks */ = {
isa = PBXGroup;
children = (
9DCE1C984F2603EE87603F8E /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
DB97C68FAB84AB5AA161781D /* Pods */ = {
isa = PBXGroup;
children = (
FEE7765B87F81514E88B2DA2 /* Pods-Runner.debug.xcconfig */,
CB75B9327ED21CDF069689B1 /* Pods-Runner.release.xcconfig */,
DC9B91632732EDCE8495DB9E /* Pods-Runner.profile.xcconfig */,
59505A69743F2F8D63E32074 /* Pods-Runner.debug.xcconfig */,
A721EE1634DF0272D5F66D0A /* Pods-Runner.release.xcconfig */,
4A9923954A102F75F089DEB2 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -139,14 +139,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
2F621941790601A10C8F165B /* [CP] Check Pods Manifest.lock */,
B0E181500D99EDAA32A810B2 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
AAEB855F9F40189D2B019299 /* [CP] Embed Pods Frameworks */,
218F0E56B9A2D546B7825C6F /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -207,26 +207,25 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
2F621941790601A10C8F165B /* [CP] Check Pods Manifest.lock */ = {
218F0E56B9A2D546B7825C6F /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
@@ -260,21 +259,26 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
AAEB855F9F40189D2B019299 /* [CP] Embed Pods Frameworks */ = {
B0E181500D99EDAA32A810B2 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -315,6 +319,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -366,11 +371,12 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 32;
CURRENT_PROJECT_VERSION = 36;
DEVELOPMENT_TEAM = C3DTD2JH94;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -378,6 +384,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -386,7 +393,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.1.12;
MARKETING_VERSION = 1.1.16;
PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.farmdemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -400,6 +407,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -455,6 +463,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -508,11 +517,12 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 32;
CURRENT_PROJECT_VERSION = 36;
DEVELOPMENT_TEAM = C3DTD2JH94;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -520,6 +530,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -528,7 +539,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.1.12;
MARKETING_VERSION = 1.1.16;
PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.farmdemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -544,11 +555,12 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 32;
CURRENT_PROJECT_VERSION = 36;
DEVELOPMENT_TEAM = C3DTD2JH94;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -556,6 +568,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -564,7 +577,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.1.12;
MARKETING_VERSION = 1.1.16;
PRODUCT_BUNDLE_IDENTIFIER = vn.azteam.farmdemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

+ 21
- 19
lib/presentation/screens/actions/sc_action.dart View File

@@ -113,7 +113,7 @@ class _ActionScreenState extends State<ActionScreen> {
_validateInputs();
}
break;
case 'ACTIVE_TYPE_PLANTING':
// case 'ACTIVE_TYPE_PLANTING':
case 'ACTIVE_TYPE_FERTILIZE':
case 'ACTIVE_TYPE_SPRAYING_PESTICIDES':
if (Get.find<ChangeFieldFormSupply>().isChanged ?? false) {
@@ -186,7 +186,8 @@ class _ActionScreenState extends State<ActionScreen> {
//CHECK NURSERY
if (widget.activityType == 'ACTIVE_TYPE_NURSERY') {
_requestActivity.tbNurseryDetailsDTOList = _nurseryDetails;
} else if (widget.activityType == 'ACTIVE_TYPE_PLANTING' ||
} else if (
// widget.activityType == 'ACTIVE_TYPE_PLANTING' ||
widget.activityType == 'ACTIVE_TYPE_FERTILIZE' ||
widget.activityType == 'ACTIVE_TYPE_SPRAYING_PESTICIDES') {
_requestActivity.tbSuppliesUsingDetailsDTOs = _supplyUsings;
@@ -428,22 +429,22 @@ class _ActionScreenState extends State<ActionScreen> {
_nurseryDetails = nurseryDetails;
});
break;
case 'ACTIVE_TYPE_PLANTING':
return Column(
children: [
Container(
width: double.infinity,
height: 16,
color: Colors.grey[200],
),
WidgetPlantSupply(
currentItems: [],
onChangeSupplies: (value) {
_supplyUsings = value;
}),
],
);
break;
// case 'ACTIVE_TYPE_PLANTING':
// return Column(
// children: [
// Container(
// width: double.infinity,
// height: 16,
// color: Colors.grey[200],
// ),
// WidgetPlantSupply(
// currentItems: [],
// onChangeSupplies: (value) {
// _supplyUsings = value;
// }),
// ],
// );
// break;
case 'ACTIVE_TYPE_FERTILIZE':
return Column(
children: [
@@ -499,7 +500,8 @@ class _ActionScreenState extends State<ActionScreen> {
}

SchedulerBinding.instance.addPostFrameCallback((_) {
if (widget.activityType == 'ACTIVE_TYPE_PLANTING' ||
if (
// widget.activityType == 'ACTIVE_TYPE_PLANTING' ||
widget.activityType == 'ACTIVE_TYPE_FERTILIZE' ||
widget.activityType == 'ACTIVE_TYPE_SPRAYING_PESTICIDES') {
//list supply

+ 1
- 1
lib/presentation/screens/notification/sc_notification.dart View File

@@ -209,7 +209,7 @@ class ItemInfinityWidget extends StatelessWidget {
SizedBox(
width: 4,
),
Text(item.sendDate?.format_DDMMYY_HHmm() ?? '', style: TextStyle(color: item.isRead == 1 ? Colors.grey : Colors.blue))
Text(item.sendDate?.fromUtcToLocal() ?? '', style: TextStyle(color: item.isRead == 1 ? Colors.grey : Colors.blue))
]),
],
),

+ 1
- 1
lib/presentation/screens/plot_detail/sc_plot_history.dart View File

@@ -166,7 +166,7 @@ class ItemInfinityWidget extends StatelessWidget {
child: WidgetRowPlotInfo(
color: index % 2 == 0 ? AppColors.DEFAULT.withOpacity(0.3) : AppColors.DEFAULT.withOpacity(0.1),
name: '${item.activityTypeDescription ?? ''}',
value: item.executeDate?.format_DDMMYY_HHmm() ?? ''),
value: item.executeDate?.fromUtcToLocal() ?? ''),
onTap: () {
if (item.activityTypeName == 'ACTIVE_TYPE_UPDATE_ENV') {
Get.to(EditActionEnvironmentUpdate(

+ 3
- 11
lib/presentation/screens/plot_detail/sc_plot_information.dart View File

@@ -141,15 +141,7 @@ class _PlotInformationScreenState extends State<PlotInformationScreen> with Auto
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.1),
name: 'Ngày gieo trồng',
value: cropPlot.tbCropDTO?.tbCropTypeId == 0 ? '${cropPlot.plantingDate?.format_DDMMYY_HHmm() ?? '--'}' : '--'),
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.3),
name: 'Ngày vô khây ươm',
value: cropPlot.tbCropDTO?.tbCropTypeId == 1 ? '${cropPlot.sowingDate?.format_DDMMYY_HHmm() ?? '--'}' : '--'),
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.1),
name: 'Thời gian ngâm hạt',
value: '${cropPlot.seedIncubationTime ?? '--'} ngày'),
value: '${cropPlot.plantingDate?.fromUtcToLocal() ?? '--'}'),
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.3), name: 'Số lượng cây trồng', value: '${cropPlot.numberPlants ?? '--'}'),
WidgetRowPlotInfo(
@@ -159,12 +151,12 @@ class _PlotInformationScreenState extends State<PlotInformationScreen> with Auto
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.3),
name: 'Ngày kết thúc canh tác',
value: '${cropPlot.tbCropDTO?.endDate?.format_DDMMYY_HHmm() ?? '--'}'),
value: '${cropPlot.tbCropDTO?.endDate?.fromUtcToLocal() ?? '--'}'),
WidgetRowPlotInfo(color: AppColors.DEFAULT.withOpacity(0.1), name: 'Kỹ sư trực tiếp', value: '$technicians'),
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.3),
name: 'Diện tích (m\u00B2)',
value: '${cropPlot.tbCropDTO?.areaM2?.formatNumtoStringDecimal()}'),
value: '${cropPlot.tbCropDTO?.areaM2 == null ? '--' : cropPlot.tbCropDTO!.areaM2!.formatNumtoStringDecimal()}'),
SizedBox(
height: 8,
),

+ 1
- 1
lib/presentation/screens/plot_detail/sc_plot_parameter.dart View File

@@ -126,7 +126,7 @@ class ItemInfinityWidget extends StatelessWidget {
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
),
),
Text(item.executeDate?.format_DDMMYY_HHmm() ?? '', style: TextStyle(fontSize: 13, color: Colors.grey))
Text(item.executeDate?.fromUtcToLocal() ?? '', style: TextStyle(fontSize: 13, color: Colors.grey))
],
),
);

+ 8
- 1
lib/services/firebase_notification_service.dart View File

@@ -1,6 +1,8 @@
import 'dart:convert';
import 'dart:io';

import 'package:farm_tpf/presentation/screens/task/task_detail_page.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:get/get.dart';
import '../presentation/screens/plot_detail/sc_plot_detail.dart';
@@ -13,7 +15,12 @@ class FirebaseNotificationService {
static final _pref = LocalPref();

static void initService() async {
var token = await messaging.getToken() ?? '';
var token = '';
if (kDebugMode && Platform.isIOS) {
token = await messaging.getAPNSToken() ?? '';
} else {
token = await messaging.getToken() ?? '';
}
await _pref.saveString(PrefKey.push_key, token);
print('pushKey: $token');


+ 9
- 0
lib/utils/formatter.dart View File

@@ -74,6 +74,15 @@ extension ddMM_HHmm on String {
return "";
}
}

String fromUtcToLocal({String pattern = 'dd/MM/yyyy HH:mm'}) {
try {
final dateTimeConvert = DateTime.parse(this).toLocal();
return DateFormat(pattern).format(dateTimeConvert);
} catch (_) {
return '';
}
}
}

extension numToString on num {

+ 1
- 1
pubspec.yaml View File

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

publish_to: 'none'
version: 1.1.13+32
version: 1.1.16+36

environment:
sdk: ">=3.0.0 <4.0.0"

Loading…
Cancel
Save