change area to kecamatan and some changes
4
.env
@ -1,2 +1,6 @@
|
|||||||
|
# url = 'http://172.29.85.181:3002/'
|
||||||
|
# api_url = 'http://172.29.85.181:3002/'
|
||||||
|
# url = 'https://caleg_backend.kicap-karan.com/'
|
||||||
|
# api_url = 'https://caleg_backend.kicap-karan.com/'
|
||||||
url = 'http://20.20.20.25:3002/'
|
url = 'http://20.20.20.25:3002/'
|
||||||
api_url = 'http://20.20.20.25:3002/'
|
api_url = 'http://20.20.20.25:3002/'
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 165 KiB |
29
ios/Podfile.lock
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
PODS:
|
||||||
|
- Flutter (1.0.0)
|
||||||
|
- image_picker_ios (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- path_provider_foundation (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
|
|
||||||
|
DEPENDENCIES:
|
||||||
|
- Flutter (from `Flutter`)
|
||||||
|
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||||
|
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
|
|
||||||
|
EXTERNAL SOURCES:
|
||||||
|
Flutter:
|
||||||
|
:path: Flutter
|
||||||
|
image_picker_ios:
|
||||||
|
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||||
|
path_provider_foundation:
|
||||||
|
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||||
|
|
||||||
|
SPEC CHECKSUMS:
|
||||||
|
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||||
|
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||||
|
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||||
|
|
||||||
|
PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189
|
||||||
|
|
||||||
|
COCOAPODS: 1.13.0
|
@ -8,12 +8,14 @@
|
|||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
|
191EFD557D1AA82364065725 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86A2B62E083E1CCEA02C1894 /* Pods_RunnerTests.framework */; };
|
||||||
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
|
52B9F3E2D8CC4B3BDAE30DE7 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 669765FED0FBF3D5A5D095AD /* Pods_Runner.framework */; };
|
||||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@ -42,10 +44,16 @@
|
|||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
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>"; };
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
|
32EAA43DD0EC21E13333CA3F /* 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>"; };
|
||||||
|
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||||
|
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
38FF4C71CB1F6E24EE8AD914 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
|
669765FED0FBF3D5A5D095AD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; 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>"; };
|
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>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
86A2B62E083E1CCEA02C1894 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
@ -53,8 +61,10 @@
|
|||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
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>"; };
|
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>"; };
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
D54A41741A424BA45F116E16 /* 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>"; };
|
||||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
D693721062B1E6271CFEC5FC /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
D9DACFAE8E13C1E8728992E5 /* 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>"; };
|
||||||
|
F7845FB6AB2EEDC69026C811 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -62,12 +72,52 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
52B9F3E2D8CC4B3BDAE30DE7 /* Pods_Runner.framework in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
C7202CB6BB32706C66B62944 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
191EFD557D1AA82364065725 /* Pods_RunnerTests.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
/* End PBXFrameworksBuildPhase section */
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
/* Begin PBXGroup section */
|
||||||
|
1BC4B4463C92C0DB07F5E9AE /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
669765FED0FBF3D5A5D095AD /* Pods_Runner.framework */,
|
||||||
|
86A2B62E083E1CCEA02C1894 /* Pods_RunnerTests.framework */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
||||||
|
);
|
||||||
|
path = RunnerTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
404986265B2A745E0B5EA86D /* Pods */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D54A41741A424BA45F116E16 /* Pods-Runner.debug.xcconfig */,
|
||||||
|
32EAA43DD0EC21E13333CA3F /* Pods-Runner.release.xcconfig */,
|
||||||
|
D9DACFAE8E13C1E8728992E5 /* Pods-Runner.profile.xcconfig */,
|
||||||
|
F7845FB6AB2EEDC69026C811 /* Pods-RunnerTests.debug.xcconfig */,
|
||||||
|
38FF4C71CB1F6E24EE8AD914 /* Pods-RunnerTests.release.xcconfig */,
|
||||||
|
D693721062B1E6271CFEC5FC /* Pods-RunnerTests.profile.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Pods;
|
||||||
|
path = Pods;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@ -79,14 +129,6 @@
|
|||||||
name = Flutter;
|
name = Flutter;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
|
||||||
);
|
|
||||||
path = RunnerTests;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
97C146E51CF9000F007C117D = {
|
97C146E51CF9000F007C117D = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@ -94,6 +136,8 @@
|
|||||||
97C146F01CF9000F007C117D /* Runner */,
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
97C146EF1CF9000F007C117D /* Products */,
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
331C8082294A63A400263BE5 /* RunnerTests */,
|
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||||
|
404986265B2A745E0B5EA86D /* Pods */,
|
||||||
|
1BC4B4463C92C0DB07F5E9AE /* Frameworks */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@ -128,9 +172,10 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
|
E4F3537B38546DAE3F3052CE /* [CP] Check Pods Manifest.lock */,
|
||||||
331C807D294A63A400263BE5 /* Sources */,
|
331C807D294A63A400263BE5 /* Sources */,
|
||||||
331C807E294A63A400263BE5 /* Frameworks */,
|
|
||||||
331C807F294A63A400263BE5 /* Resources */,
|
331C807F294A63A400263BE5 /* Resources */,
|
||||||
|
C7202CB6BB32706C66B62944 /* Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@ -146,12 +191,14 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
|
E86562CDABA920F1E832DA18 /* [CP] Check Pods Manifest.lock */,
|
||||||
9740EEB61CF901F6004384FC /* Run Script */,
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
97C146EA1CF9000F007C117D /* Sources */,
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
97C146EC1CF9000F007C117D /* Resources */,
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
|
AEC0261403AB946B2D5AD936 /* [CP] Embed Pods Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@ -254,6 +301,67 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
};
|
};
|
||||||
|
AEC0261403AB946B2D5AD936 /* [CP] Embed Pods Frameworks */ = {
|
||||||
|
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";
|
||||||
|
outputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
E4F3537B38546DAE3F3052CE /* [CP] Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-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";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
E86562CDABA920F1E832DA18 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
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";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
@ -377,7 +485,7 @@
|
|||||||
};
|
};
|
||||||
331C8088294A63A400263BE5 /* Debug */ = {
|
331C8088294A63A400263BE5 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */;
|
baseConfigurationReference = F7845FB6AB2EEDC69026C811 /* Pods-RunnerTests.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
@ -395,7 +503,7 @@
|
|||||||
};
|
};
|
||||||
331C8089294A63A400263BE5 /* Release */ = {
|
331C8089294A63A400263BE5 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */;
|
baseConfigurationReference = 38FF4C71CB1F6E24EE8AD914 /* Pods-RunnerTests.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
@ -411,7 +519,7 @@
|
|||||||
};
|
};
|
||||||
331C808A294A63A400263BE5 /* Profile */ = {
|
331C808A294A63A400263BE5 /* Profile */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */;
|
baseConfigurationReference = D693721062B1E6271CFEC5FC /* Pods-RunnerTests.profile.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
3
ios/Runner.xcworkspace/contents.xcworkspacedata
generated
@ -4,4 +4,7 @@
|
|||||||
<FileRef
|
<FileRef
|
||||||
location = "group:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
|
<FileRef
|
||||||
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -9,7 +9,6 @@ import '../services/other_function.dart';
|
|||||||
import '../ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart';
|
import '../ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart';
|
||||||
import '../ui/views/admin_index_tracking/admin_index_tracking_view.dart';
|
import '../ui/views/admin_index_tracking/admin_index_tracking_view.dart';
|
||||||
import '../ui/views/admin_index_tracking/detail_suara_bottom_sheet/detail_suara_bottom_sheet_view.dart';
|
import '../ui/views/admin_index_tracking/detail_suara_bottom_sheet/detail_suara_bottom_sheet_view.dart';
|
||||||
import '../ui/views/admin_index_tracking/halaman_area/halaman_area_view.dart';
|
|
||||||
import '../ui/views/admin_index_tracking/halaman_caleg/halaman_caleg_view.dart';
|
import '../ui/views/admin_index_tracking/halaman_caleg/halaman_caleg_view.dart';
|
||||||
import '../ui/views/admin_index_tracking/halaman_caleg/tambah_edit_caleg/tambah_edit_caleg_view.dart';
|
import '../ui/views/admin_index_tracking/halaman_caleg/tambah_edit_caleg/tambah_edit_caleg_view.dart';
|
||||||
import '../ui/views/admin_index_tracking/halaman_pengaturan/halaman_pengaturan_view.dart';
|
import '../ui/views/admin_index_tracking/halaman_pengaturan/halaman_pengaturan_view.dart';
|
||||||
@ -29,9 +28,6 @@ import '../ui/views/splash_screen/splash_screen_view.dart';
|
|||||||
page: AdminFirstPageView,
|
page: AdminFirstPageView,
|
||||||
initial: true,
|
initial: true,
|
||||||
),
|
),
|
||||||
MaterialRoute(
|
|
||||||
page: HalamanAreaView,
|
|
||||||
),
|
|
||||||
MaterialRoute(
|
MaterialRoute(
|
||||||
page: HalamanCalegView,
|
page: HalamanCalegView,
|
||||||
),
|
),
|
||||||
|
@ -9,21 +9,19 @@ import 'package:cek_suara/ui/views/admin_index_tracking/admin_first_page/admin_f
|
|||||||
as _i6;
|
as _i6;
|
||||||
import 'package:cek_suara/ui/views/admin_index_tracking/admin_index_tracking_view.dart'
|
import 'package:cek_suara/ui/views/admin_index_tracking/admin_index_tracking_view.dart'
|
||||||
as _i4;
|
as _i4;
|
||||||
import 'package:cek_suara/ui/views/admin_index_tracking/halaman_area/halaman_area_view.dart'
|
|
||||||
as _i7;
|
|
||||||
import 'package:cek_suara/ui/views/admin_index_tracking/halaman_caleg/halaman_caleg_view.dart'
|
import 'package:cek_suara/ui/views/admin_index_tracking/halaman_caleg/halaman_caleg_view.dart'
|
||||||
as _i8;
|
as _i7;
|
||||||
import 'package:cek_suara/ui/views/admin_index_tracking/halaman_pengaturan/halaman_pengaturan_view.dart'
|
import 'package:cek_suara/ui/views/admin_index_tracking/halaman_pengaturan/halaman_pengaturan_view.dart'
|
||||||
as _i10;
|
|
||||||
import 'package:cek_suara/ui/views/admin_index_tracking/tim_survei/tim_survei_view.dart'
|
|
||||||
as _i9;
|
as _i9;
|
||||||
|
import 'package:cek_suara/ui/views/admin_index_tracking/tim_survei/tim_survei_view.dart'
|
||||||
|
as _i8;
|
||||||
import 'package:cek_suara/ui/views/login_screen/login_screen_view.dart' as _i3;
|
import 'package:cek_suara/ui/views/login_screen/login_screen_view.dart' as _i3;
|
||||||
import 'package:cek_suara/ui/views/splash_screen/splash_screen_view.dart'
|
import 'package:cek_suara/ui/views/splash_screen/splash_screen_view.dart'
|
||||||
as _i2;
|
as _i2;
|
||||||
import 'package:flutter/material.dart' as _i5;
|
import 'package:flutter/material.dart' as _i5;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stacked/stacked.dart' as _i1;
|
import 'package:stacked/stacked.dart' as _i1;
|
||||||
import 'package:stacked_services/stacked_services.dart' as _i11;
|
import 'package:stacked_services/stacked_services.dart' as _i10;
|
||||||
|
|
||||||
class Routes {
|
class Routes {
|
||||||
static const splashScreenView = '/';
|
static const splashScreenView = '/';
|
||||||
@ -86,8 +84,6 @@ class StackedRouter extends _i1.RouterBase {
|
|||||||
class AdminIndexTrackingViewRoutes {
|
class AdminIndexTrackingViewRoutes {
|
||||||
static const adminFirstPageView = '';
|
static const adminFirstPageView = '';
|
||||||
|
|
||||||
static const halamanAreaView = 'halaman-area-view';
|
|
||||||
|
|
||||||
static const halamanCalegView = 'halaman-caleg-view';
|
static const halamanCalegView = 'halaman-caleg-view';
|
||||||
|
|
||||||
static const timSurveiView = 'tim-survei-view';
|
static const timSurveiView = 'tim-survei-view';
|
||||||
@ -96,7 +92,6 @@ class AdminIndexTrackingViewRoutes {
|
|||||||
|
|
||||||
static const all = <String>{
|
static const all = <String>{
|
||||||
adminFirstPageView,
|
adminFirstPageView,
|
||||||
halamanAreaView,
|
|
||||||
halamanCalegView,
|
halamanCalegView,
|
||||||
timSurveiView,
|
timSurveiView,
|
||||||
halamanPengaturanView,
|
halamanPengaturanView,
|
||||||
@ -109,21 +104,17 @@ class AdminIndexTrackingViewRouter extends _i1.RouterBase {
|
|||||||
AdminIndexTrackingViewRoutes.adminFirstPageView,
|
AdminIndexTrackingViewRoutes.adminFirstPageView,
|
||||||
page: _i6.AdminFirstPageView,
|
page: _i6.AdminFirstPageView,
|
||||||
),
|
),
|
||||||
_i1.RouteDef(
|
|
||||||
AdminIndexTrackingViewRoutes.halamanAreaView,
|
|
||||||
page: _i7.HalamanAreaView,
|
|
||||||
),
|
|
||||||
_i1.RouteDef(
|
_i1.RouteDef(
|
||||||
AdminIndexTrackingViewRoutes.halamanCalegView,
|
AdminIndexTrackingViewRoutes.halamanCalegView,
|
||||||
page: _i8.HalamanCalegView,
|
page: _i7.HalamanCalegView,
|
||||||
),
|
),
|
||||||
_i1.RouteDef(
|
_i1.RouteDef(
|
||||||
AdminIndexTrackingViewRoutes.timSurveiView,
|
AdminIndexTrackingViewRoutes.timSurveiView,
|
||||||
page: _i9.TimSurveiView,
|
page: _i8.TimSurveiView,
|
||||||
),
|
),
|
||||||
_i1.RouteDef(
|
_i1.RouteDef(
|
||||||
AdminIndexTrackingViewRoutes.halamanPengaturanView,
|
AdminIndexTrackingViewRoutes.halamanPengaturanView,
|
||||||
page: _i10.HalamanPengaturanView,
|
page: _i9.HalamanPengaturanView,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -134,27 +125,21 @@ class AdminIndexTrackingViewRouter extends _i1.RouterBase {
|
|||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i7.HalamanAreaView: (data) {
|
_i7.HalamanCalegView: (data) {
|
||||||
return _i5.MaterialPageRoute<dynamic>(
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i7.HalamanAreaView(),
|
builder: (context) => const _i7.HalamanCalegView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i8.HalamanCalegView: (data) {
|
_i8.TimSurveiView: (data) {
|
||||||
return _i5.MaterialPageRoute<dynamic>(
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i8.HalamanCalegView(),
|
builder: (context) => const _i8.TimSurveiView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i9.TimSurveiView: (data) {
|
_i9.HalamanPengaturanView: (data) {
|
||||||
return _i5.MaterialPageRoute<dynamic>(
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i9.TimSurveiView(),
|
builder: (context) => const _i9.HalamanPengaturanView(),
|
||||||
settings: data,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
_i10.HalamanPengaturanView: (data) {
|
|
||||||
return _i5.MaterialPageRoute<dynamic>(
|
|
||||||
builder: (context) => const _i10.HalamanPengaturanView(),
|
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -167,7 +152,7 @@ class AdminIndexTrackingViewRouter extends _i1.RouterBase {
|
|||||||
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
|
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
extension NavigatorStateExtension on _i11.NavigationService {
|
extension NavigatorStateExtension on _i10.NavigationService {
|
||||||
Future<dynamic> navigateToSplashScreenView([
|
Future<dynamic> navigateToSplashScreenView([
|
||||||
int? routerId,
|
int? routerId,
|
||||||
bool preventDuplicates = true,
|
bool preventDuplicates = true,
|
||||||
@ -225,21 +210,6 @@ extension NavigatorStateExtension on _i11.NavigationService {
|
|||||||
transition: transition);
|
transition: transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic>
|
|
||||||
navigateToNestedHalamanAreaViewInAdminIndexTrackingViewRouter([
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
]) async {
|
|
||||||
return navigateTo<dynamic>(AdminIndexTrackingViewRoutes.halamanAreaView,
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic>
|
Future<dynamic>
|
||||||
navigateToNestedHalamanCalegViewInAdminIndexTrackingViewRouter([
|
navigateToNestedHalamanCalegViewInAdminIndexTrackingViewRouter([
|
||||||
int? routerId,
|
int? routerId,
|
||||||
@ -342,21 +312,6 @@ extension NavigatorStateExtension on _i11.NavigationService {
|
|||||||
transition: transition);
|
transition: transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic>
|
|
||||||
replaceWithNestedHalamanAreaViewInAdminIndexTrackingViewRouter([
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
]) async {
|
|
||||||
return replaceWith<dynamic>(AdminIndexTrackingViewRoutes.halamanAreaView,
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic>
|
Future<dynamic>
|
||||||
replaceWithNestedHalamanCalegViewInAdminIndexTrackingViewRouter([
|
replaceWithNestedHalamanCalegViewInAdminIndexTrackingViewRouter([
|
||||||
int? routerId,
|
int? routerId,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
@ -11,12 +13,13 @@ import 'app/themes/app_theme.dart';
|
|||||||
|
|
||||||
Future main() async {
|
Future main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await Future.wait([
|
HttpOverrides.global = MyHttpOverrides();
|
||||||
dotenv.load(fileName: ".env"),
|
// await Future.wait([
|
||||||
setupAllLocator(),
|
// dotenv.load(fileName: ".env"),
|
||||||
]);
|
// setupAllLocator(),
|
||||||
// await dotenv.load(fileName: ".env");
|
// ]);
|
||||||
// await setupAllLocator();
|
await dotenv.load(fileName: ".env");
|
||||||
|
await setupAllLocator();
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,3 +46,12 @@ Future<void> setupAllLocator() async {
|
|||||||
setupBottomSheetUi();
|
setupBottomSheetUi();
|
||||||
// setupSnackbarUi();
|
// setupSnackbarUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MyHttpOverrides extends HttpOverrides {
|
||||||
|
@override
|
||||||
|
HttpClient createHttpClient(SecurityContext? context) {
|
||||||
|
return super.createHttpClient(context)
|
||||||
|
..badCertificateCallback =
|
||||||
|
(X509Certificate cert, String host, int port) => true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
class AreaListModel {
|
class KecamatanDetail {
|
||||||
List<AreaModel>? area;
|
List<KecamatanModel>? kecamatan;
|
||||||
int? jumlah;
|
int? jumlah;
|
||||||
|
|
||||||
AreaListModel({this.area, this.jumlah});
|
KecamatanDetail({this.kecamatan, this.jumlah});
|
||||||
|
|
||||||
AreaListModel.fromJson(Map<String, dynamic> json) {
|
KecamatanDetail.fromJson(Map<String, dynamic> json) {
|
||||||
if (json['area'] != null) {
|
if (json['kecamatan'] != null) {
|
||||||
area = <AreaModel>[];
|
kecamatan = <KecamatanModel>[];
|
||||||
json['area'].forEach((v) {
|
json['kecamatan'].forEach((v) {
|
||||||
area!.add(AreaModel.fromJson(v));
|
kecamatan!.add(KecamatanModel.fromJson(v));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
jumlah = json['jumlah'];
|
jumlah = json['jumlah'];
|
||||||
@ -16,29 +16,77 @@ class AreaListModel {
|
|||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
if (area != null) {
|
if (kecamatan != null) {
|
||||||
data['area'] = area!.map((v) => v.toJson()).toList();
|
data['kecamatan'] = kecamatan!.map((v) => v.toJson()).toList();
|
||||||
}
|
}
|
||||||
data['jumlah'] = jumlah;
|
data['jumlah'] = jumlah;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AreaModel {
|
class KecamatanModel {
|
||||||
int? idArea;
|
String? kecamatanId;
|
||||||
String? namaArea;
|
String? name;
|
||||||
|
|
||||||
AreaModel({this.idArea, this.namaArea});
|
KecamatanModel({this.kecamatanId, this.name});
|
||||||
|
|
||||||
AreaModel.fromJson(Map<String, dynamic> json) {
|
KecamatanModel.fromJson(Map<String, dynamic> json) {
|
||||||
idArea = json['id_area'];
|
kecamatanId = json['kecamatan_id'];
|
||||||
namaArea = json['nama_area'];
|
name = json['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
data['id_area'] = idArea;
|
data['kecamatan_id'] = kecamatanId;
|
||||||
data['nama_area'] = namaArea;
|
data['name'] = name;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KelurahanDetail {
|
||||||
|
List<KelurahanModel>? kelurahan;
|
||||||
|
int? jumlah;
|
||||||
|
|
||||||
|
KelurahanDetail({this.kelurahan, this.jumlah});
|
||||||
|
|
||||||
|
KelurahanDetail.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['kelurahan'] != null) {
|
||||||
|
kelurahan = <KelurahanModel>[];
|
||||||
|
json['kelurahan'].forEach((v) {
|
||||||
|
kelurahan!.add(KelurahanModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
jumlah = json['jumlah'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
if (kelurahan != null) {
|
||||||
|
data['kelurahan'] = kelurahan!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['jumlah'] = jumlah;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KelurahanModel {
|
||||||
|
String? kelurahanId;
|
||||||
|
String? kecamatanId;
|
||||||
|
String? name;
|
||||||
|
|
||||||
|
KelurahanModel({this.kelurahanId, this.kecamatanId, this.name});
|
||||||
|
|
||||||
|
KelurahanModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
kelurahanId = json['kelurahan_id'];
|
||||||
|
kecamatanId = json['kecamatan_id'];
|
||||||
|
name = json['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['kelurahan_id'] = kelurahanId;
|
||||||
|
data['kecamatan_id'] = kecamatanId;
|
||||||
|
data['name'] = name;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import '../app/app.locator.dart';
|
import '../app/app.locator.dart';
|
||||||
import '../services/other_function.dart';
|
import '../services/other_function.dart';
|
||||||
|
|
||||||
class PemilihDetailModel {
|
class PemilihDetail {
|
||||||
List<PemilihModel>? pemilihModel;
|
List<PemilihModel>? pemilihModel;
|
||||||
int? jumlah;
|
int? jumlah;
|
||||||
|
|
||||||
PemilihDetailModel({this.pemilihModel, this.jumlah});
|
PemilihDetail({this.pemilihModel, this.jumlah});
|
||||||
|
|
||||||
PemilihDetailModel.fromJson(Map<String, dynamic> json) {
|
PemilihDetail.fromJson(Map<String, dynamic> json) {
|
||||||
if (json['data'] != null) {
|
if (json['data'] != null) {
|
||||||
pemilihModel = <PemilihModel>[];
|
pemilihModel = <PemilihModel>[];
|
||||||
json['data'].forEach((v) {
|
json['data'].forEach((v) {
|
||||||
@ -36,7 +36,9 @@ class PemilihModel {
|
|||||||
String? nikTimSurvei;
|
String? nikTimSurvei;
|
||||||
String? namaTimSurvei;
|
String? namaTimSurvei;
|
||||||
String? namaCaleg;
|
String? namaCaleg;
|
||||||
String? namaArea;
|
String? kecamatan;
|
||||||
|
String? kelurahan;
|
||||||
|
int? tps;
|
||||||
String? createdAt;
|
String? createdAt;
|
||||||
|
|
||||||
PemilihModel(
|
PemilihModel(
|
||||||
@ -46,7 +48,9 @@ class PemilihModel {
|
|||||||
this.nikTimSurvei,
|
this.nikTimSurvei,
|
||||||
this.namaTimSurvei,
|
this.namaTimSurvei,
|
||||||
this.namaCaleg,
|
this.namaCaleg,
|
||||||
this.namaArea,
|
this.kecamatan,
|
||||||
|
this.kelurahan,
|
||||||
|
this.tps,
|
||||||
this.createdAt});
|
this.createdAt});
|
||||||
|
|
||||||
PemilihModel.fromJson(Map<String, dynamic> json) {
|
PemilihModel.fromJson(Map<String, dynamic> json) {
|
||||||
@ -56,7 +60,9 @@ class PemilihModel {
|
|||||||
nikTimSurvei = json['nik_tim_survei'];
|
nikTimSurvei = json['nik_tim_survei'];
|
||||||
namaTimSurvei = json['nama_tim_survei'];
|
namaTimSurvei = json['nama_tim_survei'];
|
||||||
namaCaleg = json['nama_caleg'];
|
namaCaleg = json['nama_caleg'];
|
||||||
namaArea = json['nama_area'];
|
kecamatan = json['kecamatan'];
|
||||||
|
kelurahan = json['kelurahan'];
|
||||||
|
tps = json['tps'];
|
||||||
createdAt = myFunction.convertDateTime(json['created_at']);
|
createdAt = myFunction.convertDateTime(json['created_at']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +74,9 @@ class PemilihModel {
|
|||||||
data['nik_tim_survei'] = nikTimSurvei;
|
data['nik_tim_survei'] = nikTimSurvei;
|
||||||
data['nama_tim_survei'] = namaTimSurvei;
|
data['nama_tim_survei'] = namaTimSurvei;
|
||||||
data['nama_caleg'] = namaCaleg;
|
data['nama_caleg'] = namaCaleg;
|
||||||
data['nama_area'] = namaArea;
|
data['kecamatan'] = kecamatan;
|
||||||
|
data['kelurahan'] = kelurahan;
|
||||||
|
data['tps'] = tps;
|
||||||
data['created_at'] = createdAt;
|
data['created_at'] = createdAt;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -34,143 +34,151 @@ class AdminFirstPageView extends StatelessWidget {
|
|||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(20),
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
TopContainer(
|
children: [
|
||||||
title: 'Jumlah Area',
|
// TopContainer(
|
||||||
value: '${model.jumlahArea} Area',
|
// title: 'Jumlah\nArea',
|
||||||
icon: Icons.place_outlined,
|
// value: '${model.jumlahArea} Area',
|
||||||
background: warningColor,
|
// icon: Icons.place_outlined,
|
||||||
),
|
// background: warningColor,
|
||||||
const SizedBox(height: 10),
|
// ),
|
||||||
TopContainer(
|
// const SizedBox(height: 10),
|
||||||
title: 'Jumlah Caleg',
|
TopContainer(
|
||||||
value: '${model.jumlahCaleg} Caleg',
|
title: 'Jumlah\nCaleg',
|
||||||
icon: Icons.co_present_outlined,
|
value: '${model.jumlahCaleg} Caleg',
|
||||||
background: greenColor,
|
icon: Icons.co_present_outlined,
|
||||||
),
|
background: greenColor,
|
||||||
const SizedBox(height: 10),
|
|
||||||
TopContainer(
|
|
||||||
title: 'Tim Survei',
|
|
||||||
value: '${model.jumlahTimSurvei} Tim Survei',
|
|
||||||
icon: Icons.co_present_outlined,
|
|
||||||
background: orangeColor,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
const TopContainer(
|
|
||||||
title: 'Jumlah Pemilih',
|
|
||||||
value: '10 Pemilih',
|
|
||||||
icon: Icons.people_alt_outlined,
|
|
||||||
background: blueColor,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
if (model.isBusy)
|
|
||||||
const Center(child: CircularProgressIndicator()),
|
|
||||||
if (!model.isBusy && model.status == true)
|
|
||||||
RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
text: 'Selamat Datang, ',
|
|
||||||
style: regularTextStyle,
|
|
||||||
children: [
|
|
||||||
const TextSpan(
|
|
||||||
text: 'Admin\n',
|
|
||||||
style: boldTextStyle,
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text: 'Silahkan tambahkan data ',
|
|
||||||
style: regularTextStyle,
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: 'Area ',
|
|
||||||
style: boldTextStyle.copyWith(
|
|
||||||
color: greenColor,
|
|
||||||
fontStyle: FontStyle.italic,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text: 'terlebih dahulu sebelum menambahkan data ',
|
|
||||||
style: regularTextStyle,
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: 'Caleg',
|
|
||||||
style: boldTextStyle.copyWith(
|
|
||||||
color: greenColor,
|
|
||||||
fontStyle: FontStyle.italic,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text:
|
|
||||||
'.\n\nData Pemilih akan diambil dari data yang dimasukkan oleh tim survei\n\n',
|
|
||||||
style: regularTextStyle,
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text:
|
|
||||||
'Jika terjadi kesalahan pada data, silahkan hubungi ',
|
|
||||||
style: regularTextStyle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
if (!model.isBusy && model.status == false)
|
const SizedBox(height: 10),
|
||||||
RichText(
|
TopContainer(
|
||||||
text: TextSpan(
|
title: 'Tim\nSurvei',
|
||||||
text: 'Selamat Datang, ',
|
value: '${model.jumlahTimSurvei} Tim Survei',
|
||||||
style: regularTextStyle,
|
icon: Icons.co_present_outlined,
|
||||||
children: [
|
background: orangeColor,
|
||||||
const TextSpan(
|
|
||||||
text: 'Admin\n',
|
|
||||||
style: boldTextStyle,
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text: 'Terjadi ',
|
|
||||||
style: regularTextStyle,
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: 'Error ',
|
|
||||||
style: boldTextStyle.copyWith(
|
|
||||||
color: redColor,
|
|
||||||
fontStyle: FontStyle.italic,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text: 'pada saat mengambil data\n',
|
|
||||||
style: regularTextStyle,
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text: 'Silahkan coba lagi dengan menekan icon',
|
|
||||||
style: regularTextStyle,
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: ' Pengaturan\n',
|
|
||||||
style: boldTextStyle.copyWith(
|
|
||||||
color: greenColor,
|
|
||||||
fontStyle: FontStyle.italic,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text: 'di pojok kanan bawah\n',
|
|
||||||
style: regularTextStyle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
const SizedBox(height: 10),
|
||||||
|
const TopContainer(
|
||||||
|
title: 'Jumlah\nPemilih',
|
||||||
|
value: '10 Pemilih',
|
||||||
|
icon: Icons.people_alt_outlined,
|
||||||
|
background: blueColor,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
if (model.isBusy)
|
||||||
|
const Center(child: CircularProgressIndicator()),
|
||||||
|
if (!model.isBusy && model.status == true)
|
||||||
|
RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: 'Selamat Datang, ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
children: [
|
||||||
|
const TextSpan(
|
||||||
|
text: 'Admin\n',
|
||||||
|
style: boldTextStyle,
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text: 'Silahkan tambahkan data ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: 'Area ',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
color: greenColor,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text:
|
||||||
|
'terlebih dahulu sebelum menambahkan data ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: 'Caleg',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
color: greenColor,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text:
|
||||||
|
'.\n\nData Pemilih akan diambil dari data yang dimasukkan oleh tim survei\n\n',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text:
|
||||||
|
'Jika terjadi kesalahan pada data, silahkan hubungi ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (!model.isBusy && model.status == false)
|
||||||
|
RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: 'Selamat Datang, ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
children: [
|
||||||
|
const TextSpan(
|
||||||
|
text: 'Admin\n',
|
||||||
|
style: boldTextStyle,
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text: 'Terjadi ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: 'Error ',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
color: redColor,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text: 'pada saat mengambil data\n',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text: 'Silahkan coba lagi dengan menekan icon',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: ' Pengaturan\n',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
color: greenColor,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text: 'di pojok kanan bawah\n',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// with setting icon
|
// with setting icon
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
|
backgroundColor: warningColor,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// model.gotoSetting();
|
// model.gotoSetting();
|
||||||
|
model.snackbarService.showSnackbar(
|
||||||
|
message: 'Fitur belum tersedia',
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: const Icon(Icons.settings),
|
child: const Icon(Icons.settings, color: fontColor),
|
||||||
),
|
),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.miniEndTop,
|
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import 'package:cek_suara/model/area_model.dart';
|
||||||
|
|
||||||
import '../../../../app/app.logger.dart';
|
import '../../../../app/app.logger.dart';
|
||||||
import '../../../../app/core/custom_base_view_model.dart';
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
import '../../../../model/area_model.dart';
|
|
||||||
import '../../../../model/caleg_model.dart';
|
import '../../../../model/caleg_model.dart';
|
||||||
import '../../../../model/my_response.model.dart';
|
import '../../../../model/my_response.model.dart';
|
||||||
import '../../../../model/tim_survei_model.dart';
|
import '../../../../model/tim_survei_model.dart';
|
||||||
@ -24,11 +25,11 @@ class AdminFirstPageViewModel extends CustomBaseViewModel {
|
|||||||
setBusy(true);
|
setBusy(true);
|
||||||
globalVar.backPressed = 'cantBack';
|
globalVar.backPressed = 'cantBack';
|
||||||
try {
|
try {
|
||||||
var response = await httpService.get('area');
|
var response = await httpService.get('area/kecamatan');
|
||||||
log.i(response.data);
|
log.i(response.data);
|
||||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||||
AreaListModel areaListModel =
|
KecamatanDetail areaListModel =
|
||||||
AreaListModel.fromJson(myResponseModel.data);
|
KecamatanDetail.fromJson(myResponseModel.data);
|
||||||
jumlahArea = areaListModel.jumlah!;
|
jumlahArea = areaListModel.jumlah!;
|
||||||
|
|
||||||
response = await httpService.get('caleg');
|
response = await httpService.get('caleg');
|
||||||
|
@ -26,6 +26,26 @@ class AdminIndexTrackingView extends StatelessWidget {
|
|||||||
) {
|
) {
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(
|
||||||
|
model.header,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: fontColor,
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
backgroundColor: warningColor,
|
||||||
|
elevation: 0,
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
model.logout();
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.logout, color: fontColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
extendBody: false,
|
extendBody: false,
|
||||||
body: ExtendedNavigator(
|
body: ExtendedNavigator(
|
||||||
router: AdminIndexTrackingViewRouter(),
|
router: AdminIndexTrackingViewRouter(),
|
||||||
|
@ -11,13 +11,10 @@ class AdminIndexTrackingViewModel extends IndexTrackingViewModel {
|
|||||||
final log = getLogger('AdminIndexTrackingViewModel');
|
final log = getLogger('AdminIndexTrackingViewModel');
|
||||||
final globalVar = locator<GlobalVar>();
|
final globalVar = locator<GlobalVar>();
|
||||||
final navigationService = locator<NavigationService>();
|
final navigationService = locator<NavigationService>();
|
||||||
|
final dialogService = locator<DialogService>();
|
||||||
|
// final mySharedPrefs = locator<MySharedPrefs>();
|
||||||
|
|
||||||
final _bottomNavBarList = [
|
final _bottomNavBarList = [
|
||||||
{
|
|
||||||
'name': 'Area',
|
|
||||||
'icon': Icons.place_outlined,
|
|
||||||
'header': 'Halaman Area',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'name': 'Caleg',
|
'name': 'Caleg',
|
||||||
'icon': Icons.co_present_outlined,
|
'icon': Icons.co_present_outlined,
|
||||||
@ -40,7 +37,6 @@ class AdminIndexTrackingViewModel extends IndexTrackingViewModel {
|
|||||||
List<Map<String, dynamic>> get bottomNavBarList => _bottomNavBarList;
|
List<Map<String, dynamic>> get bottomNavBarList => _bottomNavBarList;
|
||||||
|
|
||||||
final List<String> _views = [
|
final List<String> _views = [
|
||||||
AdminIndexTrackingViewRoutes.halamanAreaView,
|
|
||||||
AdminIndexTrackingViewRoutes.halamanCalegView,
|
AdminIndexTrackingViewRoutes.halamanCalegView,
|
||||||
AdminIndexTrackingViewRoutes.timSurveiView,
|
AdminIndexTrackingViewRoutes.timSurveiView,
|
||||||
AdminIndexTrackingViewRoutes.halamanPengaturanView,
|
AdminIndexTrackingViewRoutes.halamanPengaturanView,
|
||||||
@ -48,7 +44,7 @@ class AdminIndexTrackingViewModel extends IndexTrackingViewModel {
|
|||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
globalVar.backPressed = 'exitApp';
|
globalVar.backPressed = 'exitApp';
|
||||||
setIndex(3);
|
setIndex(2);
|
||||||
// await super.init();
|
// await super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,4 +61,20 @@ class AdminIndexTrackingViewModel extends IndexTrackingViewModel {
|
|||||||
id: 2,
|
id: 2,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logout() async {
|
||||||
|
dialogService
|
||||||
|
.showConfirmationDialog(
|
||||||
|
title: 'Konfirmasi',
|
||||||
|
description: 'Apakah anda yakin ingin keluar?',
|
||||||
|
cancelTitle: 'Batal',
|
||||||
|
confirmationTitle: 'Keluar',
|
||||||
|
)
|
||||||
|
.then((value) async {
|
||||||
|
if (value!.confirmed) {
|
||||||
|
// await mySharedPrefs.clear();
|
||||||
|
navigationService.clearStackAndShow(Routes.loginScreenView);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import 'package:cek_suara/app/themes/app_colors.dart';
|
|
||||||
import 'package:cek_suara/app/themes/app_text.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
import 'package:stacked_services/stacked_services.dart';
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
|
||||||
|
import '../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../../app/themes/app_text.dart';
|
||||||
import './detail_suara_bottom_sheet_view_model.dart';
|
import './detail_suara_bottom_sheet_view_model.dart';
|
||||||
|
|
||||||
class DetailSuaraBottomSheetView extends StatelessWidget {
|
class DetailSuaraBottomSheetView extends StatelessWidget {
|
||||||
@ -88,13 +88,22 @@ class DetailSuaraBottomSheetView extends StatelessWidget {
|
|||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if (request!.description == 'Caleg')
|
if (request!.description == 'Caleg')
|
||||||
Text(
|
CardWidget(
|
||||||
model.listPemilih[i].namaTimSurvei!,
|
title: 'Tim',
|
||||||
style: italicTextStyle,
|
value: model
|
||||||
),
|
.listPemilih[i].namaTimSurvei!),
|
||||||
Text(
|
CardWidget(
|
||||||
model.listPemilih[i].namaArea!,
|
title: 'Kec',
|
||||||
),
|
value:
|
||||||
|
model.listPemilih[i].kecamatan!),
|
||||||
|
CardWidget(
|
||||||
|
title: 'Kel / Desa',
|
||||||
|
value:
|
||||||
|
model.listPemilih[i].kelurahan!),
|
||||||
|
CardWidget(
|
||||||
|
title: 'TPS',
|
||||||
|
value: model.listPemilih[i].tps!
|
||||||
|
.toString()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
@ -139,3 +148,48 @@ class DetailSuaraBottomSheetView extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CardWidget extends StatelessWidget {
|
||||||
|
const CardWidget({
|
||||||
|
super.key,
|
||||||
|
required this.title,
|
||||||
|
required this.value,
|
||||||
|
});
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
final String value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: italicTextStyle.copyWith(
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Text(
|
||||||
|
' : ',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 6,
|
||||||
|
child: Text(
|
||||||
|
value,
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import 'package:cek_suara/model/pemilih_model.dart';
|
|
||||||
|
|
||||||
import '../../../../app/app.bottomsheets.dart';
|
import '../../../../app/app.bottomsheets.dart';
|
||||||
import '../../../../app/app.logger.dart';
|
import '../../../../app/app.logger.dart';
|
||||||
import '../../../../app/core/custom_base_view_model.dart';
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
import '../../../../model/my_response.model.dart';
|
import '../../../../model/my_response.model.dart';
|
||||||
|
import '../../../../model/pemilih_model.dart';
|
||||||
|
|
||||||
class DetailSuaraBottomSheetViewModel extends CustomBaseViewModel {
|
class DetailSuaraBottomSheetViewModel extends CustomBaseViewModel {
|
||||||
final log = getLogger('DetailSuaraBottomSheetViewModel');
|
final log = getLogger('DetailSuaraBottomSheetViewModel');
|
||||||
@ -23,13 +22,17 @@ class DetailSuaraBottomSheetViewModel extends CustomBaseViewModel {
|
|||||||
setBusy(true);
|
setBusy(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var response = await httpService.get('caleg/suara/$id');
|
// var response = await httpService.get('caleg/suara/$id');
|
||||||
|
var response = await httpService
|
||||||
|
.get('${status == 'Caleg' ? 'caleg' : 'survei'}/suara/$id');
|
||||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||||
PemilihDetailModel pemilihDetailModel =
|
PemilihDetail pemilihDetail =
|
||||||
PemilihDetailModel.fromJson(myResponseModel.data);
|
PemilihDetail.fromJson(myResponseModel.data);
|
||||||
|
|
||||||
listPemilih = pemilihDetailModel.pemilihModel!;
|
log.i(pemilihDetail.pemilihModel!);
|
||||||
counter = pemilihDetailModel.jumlah!;
|
|
||||||
|
listPemilih = pemilihDetail.pemilihModel!;
|
||||||
|
counter = pemilihDetail.jumlah!;
|
||||||
this.status = true;
|
this.status = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.status = false;
|
this.status = false;
|
||||||
|
@ -41,62 +41,83 @@ class DetailSuaraPemilihBottomSheetView extends StatelessWidget {
|
|||||||
topRight: Radius.circular(16.0),
|
topRight: Radius.circular(16.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
children: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
Text(
|
children: [
|
||||||
request.title!,
|
Text(
|
||||||
style: boldTextStyle.copyWith(
|
request.title!,
|
||||||
fontSize: 16,
|
style: boldTextStyle.copyWith(
|
||||||
color: fontColor,
|
fontSize: 16,
|
||||||
|
color: fontColor,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 15),
|
||||||
const SizedBox(height: 15),
|
Container(
|
||||||
Container(
|
height: 100,
|
||||||
height: 100,
|
width: 150,
|
||||||
width: 150,
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
color: mainColor,
|
||||||
color: mainColor,
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
model.showImage(
|
|
||||||
context,
|
|
||||||
dotenv.env['url']! + request.data!.img!,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
child: Image.network(
|
),
|
||||||
dotenv.env['url']! + request.data!.img!,
|
child: GestureDetector(
|
||||||
fit: BoxFit.fill,
|
onTap: () {
|
||||||
errorBuilder: (context, error, stackTrace) {
|
model.showImage(
|
||||||
return const Center(
|
context,
|
||||||
child: Icon(
|
dotenv.env['url']! + request.data!.img!,
|
||||||
Icons.error,
|
);
|
||||||
color: backgroundColor,
|
},
|
||||||
size: 50,
|
child: ClipRRect(
|
||||||
),
|
borderRadius: BorderRadius.circular(10),
|
||||||
);
|
child: Image.network(
|
||||||
},
|
dotenv.env['url']! + request.data!.img!,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return const Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.error,
|
||||||
|
color: backgroundColor,
|
||||||
|
size: 50,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
_DetailChildWidget(
|
||||||
_DetailChildWidget(
|
title: 'Nama',
|
||||||
title: 'Nama',
|
value: request.data!.namaPemilih!,
|
||||||
value: request.data!.namaPemilih!,
|
),
|
||||||
),
|
_DetailChildWidget(
|
||||||
_DetailChildWidget(
|
title: 'No KTP /\nNo HP',
|
||||||
title: 'No KTP /\nNo HP',
|
value: request.data!.nikNomorHp!,
|
||||||
value: request.data!.nikNomorHp!,
|
),
|
||||||
),
|
_DetailChildWidget(
|
||||||
_DetailChildWidget(
|
title: 'Tanggal/\nWaktu',
|
||||||
title: 'Tanggal/\nWaktu',
|
value: model.myFunction
|
||||||
value: request.data!.createdAt!,
|
.convertDateTime2(request.data!.createdAt!),
|
||||||
),
|
),
|
||||||
],
|
_DetailChildWidget(
|
||||||
|
title: 'Caleg', value: request.data!.namaCaleg!),
|
||||||
|
_DetailChildWidget(
|
||||||
|
title: 'Tim Survei',
|
||||||
|
value: request.data!.namaTimSurvei!,
|
||||||
|
),
|
||||||
|
_DetailChildWidget(
|
||||||
|
title: 'Kecamatan',
|
||||||
|
value: request.data!.kecamatan!,
|
||||||
|
),
|
||||||
|
_DetailChildWidget(
|
||||||
|
title: 'Kelurahan',
|
||||||
|
value: request.data!.kelurahan!,
|
||||||
|
),
|
||||||
|
_DetailChildWidget(
|
||||||
|
title: 'TPS',
|
||||||
|
value: request.data!.tps!.toString(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -1,143 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:stacked/stacked.dart';
|
|
||||||
import 'package:validatorless/validatorless.dart';
|
|
||||||
|
|
||||||
import '../../../../app/themes/app_colors.dart';
|
|
||||||
import '../../../widgets/my_button.dart';
|
|
||||||
import '../../../widgets/my_textformfield.dart';
|
|
||||||
import './halaman_area_view_model.dart';
|
|
||||||
|
|
||||||
class HalamanAreaView extends StatelessWidget {
|
|
||||||
const HalamanAreaView({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return ViewModelBuilder<HalamanAreaViewModel>.reactive(
|
|
||||||
viewModelBuilder: () => HalamanAreaViewModel(),
|
|
||||||
onViewModelReady: (HalamanAreaViewModel model) async {
|
|
||||||
await model.init();
|
|
||||||
},
|
|
||||||
builder: (
|
|
||||||
BuildContext context,
|
|
||||||
HalamanAreaViewModel model,
|
|
||||||
Widget? child,
|
|
||||||
) {
|
|
||||||
return Scaffold(
|
|
||||||
body: WillPopScope(
|
|
||||||
onWillPop: () async {
|
|
||||||
// model.log.i('backPressed: ${model.globalVar.backPressed}');
|
|
||||||
if (model.globalVar.backPressed == 'exitApp') {
|
|
||||||
// model.back();
|
|
||||||
model.quitApp(context);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
child: SafeArea(
|
|
||||||
child: Container(
|
|
||||||
height: MediaQuery.of(context).size.height,
|
|
||||||
padding: const EdgeInsets.all(20),
|
|
||||||
child: Form(
|
|
||||||
key: model.formKey,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
MyTextFormField(
|
|
||||||
hintText: 'Nama Area',
|
|
||||||
labelText: 'Nama Area',
|
|
||||||
controller: model.namaAreaController,
|
|
||||||
validator: Validatorless.required(
|
|
||||||
'Nama Area tidak boleh kosong'),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
SizedBox(
|
|
||||||
width: 250,
|
|
||||||
child: MyButton(
|
|
||||||
text: 'Tambah Area',
|
|
||||||
onPressed: () async {
|
|
||||||
if (model.formKey.currentState!.validate()) {
|
|
||||||
// close keyboard
|
|
||||||
FocusScope.of(context).unfocus();
|
|
||||||
bool res = await model.addArea();
|
|
||||||
model.log.i('res: $res');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Expanded(
|
|
||||||
flex: 3,
|
|
||||||
child: Container(
|
|
||||||
height: double.infinity,
|
|
||||||
width: double.infinity,
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(color: Colors.grey),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
color: warningColor,
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Jumlah Area: ${model.jumlahArea} area',
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
if (model.isBusy)
|
|
||||||
const Center(
|
|
||||||
child: CircularProgressIndicator()),
|
|
||||||
if (!model.isBusy)
|
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
if (model.jumlahArea == 0)
|
|
||||||
Center(
|
|
||||||
child: model.status == true
|
|
||||||
? const Text(
|
|
||||||
'Belum ada area diinput')
|
|
||||||
: const Text(
|
|
||||||
'Gagal mengambil data'),
|
|
||||||
),
|
|
||||||
if (model.jumlahArea > 0)
|
|
||||||
for (var i = 0;
|
|
||||||
i < model.jumlahArea;
|
|
||||||
i++)
|
|
||||||
Card(
|
|
||||||
child: ListTile(
|
|
||||||
leading: Text('${i + 1}'),
|
|
||||||
title: Text(
|
|
||||||
'${model.listAreaModel[i].namaArea}'),
|
|
||||||
trailing: IconButton(
|
|
||||||
// trash bin icon
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.delete,
|
|
||||||
color: Colors.red,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
model.deleteArea(model
|
|
||||||
.listAreaModel[i]
|
|
||||||
.idArea!);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,110 +0,0 @@
|
|||||||
import 'package:dio/dio.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import '../../../../app/app.logger.dart';
|
|
||||||
import '../../../../app/core/custom_base_view_model.dart';
|
|
||||||
import '../../../../app/themes/app_colors.dart';
|
|
||||||
import '../../../../model/area_model.dart';
|
|
||||||
import '../../../../model/my_response.model.dart';
|
|
||||||
|
|
||||||
class HalamanAreaViewModel extends CustomBaseViewModel {
|
|
||||||
final log = getLogger('HalamanAreaViewModel');
|
|
||||||
|
|
||||||
// variabel
|
|
||||||
List<AreaModel> listAreaModel = [];
|
|
||||||
int jumlahArea = 0;
|
|
||||||
bool status = false;
|
|
||||||
|
|
||||||
// add area form
|
|
||||||
final formKey = GlobalKey<FormState>();
|
|
||||||
TextEditingController namaAreaController = TextEditingController();
|
|
||||||
|
|
||||||
Future<void> init() async {
|
|
||||||
globalVar.backPressed = 'exitApp';
|
|
||||||
await getData();
|
|
||||||
}
|
|
||||||
|
|
||||||
getData() async {
|
|
||||||
log.i('getData');
|
|
||||||
setBusy(true);
|
|
||||||
globalVar.backPressed = 'cantBack';
|
|
||||||
try {
|
|
||||||
var response = await httpService.get('area');
|
|
||||||
log.i(response.data);
|
|
||||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
|
||||||
AreaListModel areaListModel =
|
|
||||||
AreaListModel.fromJson(myResponseModel.data);
|
|
||||||
listAreaModel = areaListModel.area!;
|
|
||||||
jumlahArea = areaListModel.jumlah!;
|
|
||||||
|
|
||||||
log.i('listAreaModel: $listAreaModel');
|
|
||||||
log.i('jumlahArea: $jumlahArea');
|
|
||||||
status = true;
|
|
||||||
} catch (e) {
|
|
||||||
status = false;
|
|
||||||
log.e(e);
|
|
||||||
} finally {
|
|
||||||
globalVar.backPressed = 'exitApp';
|
|
||||||
setBusy(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<bool> addArea() async {
|
|
||||||
log.i('addArea');
|
|
||||||
setBusy(true);
|
|
||||||
globalVar.backPressed = 'cantBack';
|
|
||||||
easyLoading.customLoading('Tambah Area..');
|
|
||||||
|
|
||||||
var formData = FormData.fromMap({
|
|
||||||
'area': namaAreaController.text,
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
|
||||||
var response = await httpService.postWithFormData('area', formData);
|
|
||||||
log.i(response.data);
|
|
||||||
await getData();
|
|
||||||
// reset form
|
|
||||||
namaAreaController.clear();
|
|
||||||
return true;
|
|
||||||
} catch (e) {
|
|
||||||
log.e(e);
|
|
||||||
return false;
|
|
||||||
} finally {
|
|
||||||
easyLoading.dismissLoading();
|
|
||||||
globalVar.backPressed = 'exitApp';
|
|
||||||
setBusy(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteArea(int idArea) {
|
|
||||||
dialogService
|
|
||||||
.showDialog(
|
|
||||||
title: 'Hapus Area',
|
|
||||||
description: 'Apakah Anda yakin ingin menghapus area ini?',
|
|
||||||
buttonTitle: 'Hapus',
|
|
||||||
cancelTitle: 'Batal',
|
|
||||||
buttonTitleColor: dangerColor,
|
|
||||||
cancelTitleColor: mainColor,
|
|
||||||
)
|
|
||||||
.then((value) async {
|
|
||||||
if (value!.confirmed) {
|
|
||||||
log.i('deleteArea id_area: $idArea');
|
|
||||||
setBusy(true);
|
|
||||||
globalVar.backPressed = 'cantBack';
|
|
||||||
easyLoading.customLoading('Hapus Area..');
|
|
||||||
|
|
||||||
try {
|
|
||||||
var response = await httpService.delete('area/$idArea');
|
|
||||||
log.i(response.data);
|
|
||||||
await getData();
|
|
||||||
} catch (e) {
|
|
||||||
log.e(e);
|
|
||||||
} finally {
|
|
||||||
easyLoading.dismissLoading();
|
|
||||||
globalVar.backPressed = 'exitApp';
|
|
||||||
setBusy(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -47,6 +47,11 @@ class HalamanCalegView extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
// flex: 3,
|
// flex: 3,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
alignment: model.isBusy
|
||||||
|
? Alignment.center
|
||||||
|
: (model.listCalegModel.isNotEmpty
|
||||||
|
? Alignment.topCenter
|
||||||
|
: Alignment.center),
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
@ -66,9 +71,11 @@ class HalamanCalegView extends StatelessWidget {
|
|||||||
: MainAxisAlignment.center),
|
: MainAxisAlignment.center),
|
||||||
children: [
|
children: [
|
||||||
if (model.isBusy)
|
if (model.isBusy)
|
||||||
const LinearProgressIndicator(
|
const Center(
|
||||||
minHeight: 5,
|
child: LinearProgressIndicator(
|
||||||
color: mainColor,
|
minHeight: 5,
|
||||||
|
color: mainColor,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
if (!model.isBusy &&
|
if (!model.isBusy &&
|
||||||
model.listCalegModel.isNotEmpty)
|
model.listCalegModel.isNotEmpty)
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import 'package:cek_suara/app/themes/app_colors.dart';
|
|
||||||
|
|
||||||
// import '../../../../app/app.bottomsheets.dart';
|
|
||||||
import '../../../../app/app.dialogs.dart';
|
import '../../../../app/app.dialogs.dart';
|
||||||
import '../../../../app/app.logger.dart';
|
import '../../../../app/app.logger.dart';
|
||||||
import '../../../../app/core/custom_base_view_model.dart';
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
|
import '../../../../app/themes/app_colors.dart';
|
||||||
import '../../../../model/caleg_model.dart';
|
import '../../../../model/caleg_model.dart';
|
||||||
import '../../../../model/my_response.model.dart';
|
import '../../../../model/my_response.model.dart';
|
||||||
|
|
||||||
@ -58,7 +56,8 @@ class HalamanCalegViewModel extends CustomBaseViewModel {
|
|||||||
|
|
||||||
if (res!.confirmed) {
|
if (res!.confirmed) {
|
||||||
snackbarService.showSnackbar(
|
snackbarService.showSnackbar(
|
||||||
message: 'Caleg berhasil ditambahkan',
|
message:
|
||||||
|
'Caleg berhasil ditambahkan\nPassword default caleg : 12345678',
|
||||||
title: 'Berhasil',
|
title: 'Berhasil',
|
||||||
duration: const Duration(seconds: 3),
|
duration: const Duration(seconds: 3),
|
||||||
);
|
);
|
||||||
|
@ -136,27 +136,39 @@ class TambahEditCalegView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (model.calegModel == null) const SizedBox(height: 10),
|
// if (model.calegModel == null) const SizedBox(height: 10),
|
||||||
if (model.calegModel == null)
|
// if (model.calegModel == null)
|
||||||
MyTextFormField(
|
// MyTextFormField(
|
||||||
hintText: 'Area',
|
// hintText: 'Area',
|
||||||
labelText: 'Pencarian Area',
|
// labelText: 'Pencarian Area',
|
||||||
controller: model.cariAreaController,
|
// controller: model.cariAreaController,
|
||||||
suffixIcon: GestureDetector(
|
// // suffixIcon: GestureDetector(
|
||||||
onTap: () {
|
// // onTap: () {
|
||||||
// remove keyboard focus
|
// // // remove keyboard focus
|
||||||
FocusScope.of(context).unfocus();
|
// // FocusScope.of(context).unfocus();
|
||||||
model.cariArea();
|
// // model.cariArea();
|
||||||
},
|
// // },
|
||||||
child: const Icon(Icons.search),
|
// // child: const Icon(Icons.search),
|
||||||
),
|
// // ),
|
||||||
|
|
||||||
// controller: model.partaiController,
|
// // controller: model.partaiController,
|
||||||
),
|
// ),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 20),
|
||||||
SizedBox(
|
// create a horizontal divider
|
||||||
|
|
||||||
|
const Text("Pilih Kecamatan"),
|
||||||
|
|
||||||
|
Container(
|
||||||
height: MediaQuery.of(context).size.height * 0.3,
|
height: MediaQuery.of(context).size.height * 0.3,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
// create a border
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.grey,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
|
||||||
// create 10 random checkbox
|
// create 10 random checkbox
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
@ -175,18 +187,19 @@ class TambahEditCalegView extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Checkbox(
|
Checkbox(
|
||||||
value: model.listAreaId.contains(
|
value: model.listAreaId.contains(model
|
||||||
model.listAreaModel[index].idArea!),
|
.listAreaModel[index].kecamatanId!),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (model.calegModel != null) return;
|
if (model.calegModel != null) return;
|
||||||
model.tambahHapusArea(
|
model.tambahHapusArea(
|
||||||
model.listAreaModel[index].idArea!,
|
model.listAreaModel[index]
|
||||||
|
.kecamatanId!,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
model.listAreaModel[index].namaArea!,
|
model.listAreaModel[index].name!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -19,15 +19,15 @@ class TambahEditCalegViewModel extends CustomBaseViewModel {
|
|||||||
final log = getLogger('TambahEditCalegViewModel');
|
final log = getLogger('TambahEditCalegViewModel');
|
||||||
|
|
||||||
// variabel list area
|
// variabel list area
|
||||||
List<AreaModel> listAreaModel = [];
|
List<KecamatanModel> listAreaModel = [];
|
||||||
List<AreaModel> allListAreaModel = [];
|
List<KecamatanModel> allListAreaModel = [];
|
||||||
|
|
||||||
// form variable
|
// form variable
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
TextEditingController namaController = TextEditingController();
|
TextEditingController namaController = TextEditingController();
|
||||||
TextEditingController cariAreaController = TextEditingController();
|
TextEditingController cariAreaController = TextEditingController();
|
||||||
TextEditingController nomorUrutController = TextEditingController();
|
TextEditingController nomorUrutController = TextEditingController();
|
||||||
List<int> listAreaId = [];
|
List<String> listAreaId = [];
|
||||||
|
|
||||||
// image picker
|
// image picker
|
||||||
String? _imagePath;
|
String? _imagePath;
|
||||||
@ -58,13 +58,13 @@ class TambahEditCalegViewModel extends CustomBaseViewModel {
|
|||||||
var response = await httpService.get('caleg/relasi_area/$idCaleg');
|
var response = await httpService.get('caleg/relasi_area/$idCaleg');
|
||||||
log.i(response.data);
|
log.i(response.data);
|
||||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||||
var data = myResponseModel.data['area'];
|
var data = myResponseModel.data['kecamatan'];
|
||||||
for (var item in data) {
|
for (var item in data) {
|
||||||
listAreaId.add(item['id_area']);
|
listAreaId.add(item['kecamatan_id']);
|
||||||
}
|
}
|
||||||
listAreaModel = [];
|
listAreaModel = [];
|
||||||
for (var item in allListAreaModel) {
|
for (var item in allListAreaModel) {
|
||||||
if (listAreaId.contains(item.idArea)) {
|
if (listAreaId.contains(item.kecamatanId)) {
|
||||||
listAreaModel.add(item);
|
listAreaModel.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,16 +85,19 @@ class TambahEditCalegViewModel extends CustomBaseViewModel {
|
|||||||
setBusy(true);
|
setBusy(true);
|
||||||
globalVar.backPressed = 'cantBack';
|
globalVar.backPressed = 'cantBack';
|
||||||
try {
|
try {
|
||||||
var response = await httpService.get('area');
|
var response = await httpService.get('area/kecamatan');
|
||||||
log.i(response.data);
|
log.i(response.data);
|
||||||
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||||
AreaListModel areaListModel =
|
// log.i(myResponseModel.data);
|
||||||
AreaListModel.fromJson(myResponseModel.data);
|
KecamatanDetail areaListModel =
|
||||||
listAreaModel = areaListModel.area!;
|
KecamatanDetail.fromJson(myResponseModel.data);
|
||||||
allListAreaModel = areaListModel.area!;
|
listAreaModel = areaListModel.kecamatan!;
|
||||||
|
allListAreaModel = areaListModel.kecamatan!;
|
||||||
|
// listAreaModel = areaListModel.area!;
|
||||||
|
// allListAreaModel = areaListModel.area!;
|
||||||
// jumlahArea = areaListModel.jumlah!;
|
// jumlahArea = areaListModel.jumlah!;
|
||||||
|
|
||||||
log.i('listAreaModel: $listAreaModel');
|
// log.i('listAreaModel: $listAreaModel');
|
||||||
// log.i('jumlahArea: $jumlahArea');
|
// log.i('jumlahArea: $jumlahArea');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.e(e);
|
log.e(e);
|
||||||
@ -120,33 +123,33 @@ class TambahEditCalegViewModel extends CustomBaseViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tambahHapusArea(int idArea) {
|
tambahHapusArea(String kecamatanId) {
|
||||||
log.i('tambahHapusArea');
|
log.i('tambahHapusArea');
|
||||||
if (listAreaId.contains(idArea)) {
|
if (listAreaId.contains(kecamatanId)) {
|
||||||
listAreaId.remove(idArea);
|
listAreaId.remove(kecamatanId);
|
||||||
} else {
|
} else {
|
||||||
listAreaId.add(idArea);
|
listAreaId.add(kecamatanId);
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
cariArea() {
|
// cariArea() {
|
||||||
log.i('cariArea ${cariAreaController.text}');
|
// log.i('cariArea ${cariAreaController.text}');
|
||||||
|
|
||||||
if (cariAreaController.text.isEmpty) {
|
// if (cariAreaController.text.isEmpty) {
|
||||||
listAreaModel = allListAreaModel;
|
// listAreaModel = allListAreaModel;
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
listAreaModel = allListAreaModel
|
// listAreaModel = allListAreaModel
|
||||||
.where((element) => element.namaArea!
|
// .where((element) => element.namaArea!
|
||||||
.toLowerCase()
|
// .toLowerCase()
|
||||||
.contains(cariAreaController.text.toLowerCase()))
|
// .contains(cariAreaController.text.toLowerCase()))
|
||||||
.toList();
|
// .toList();
|
||||||
|
|
||||||
notifyListeners();
|
// notifyListeners();
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future<bool> addCaleg() async {
|
Future<bool> addCaleg() async {
|
||||||
log.i('addCaleg');
|
log.i('addCaleg');
|
||||||
@ -157,7 +160,7 @@ class TambahEditCalegViewModel extends CustomBaseViewModel {
|
|||||||
var formData = FormData.fromMap({
|
var formData = FormData.fromMap({
|
||||||
'nama': namaController.text,
|
'nama': namaController.text,
|
||||||
'nomor_urut': nomorUrutController.text,
|
'nomor_urut': nomorUrutController.text,
|
||||||
'area': const JsonEncoder().convert(listAreaId),
|
'kecamatan': const JsonEncoder().convert(listAreaId),
|
||||||
'foto': await MultipartFile.fromFile(
|
'foto': await MultipartFile.fromFile(
|
||||||
imageFile!.path,
|
imageFile!.path,
|
||||||
filename: imageFile!.name,
|
filename: imageFile!.name,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:cek_suara/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import '../admin_first_page/admin_first_page_view.dart';
|
||||||
import './halaman_pengaturan_view_model.dart';
|
import './halaman_pengaturan_view_model.dart';
|
||||||
|
|
||||||
class HalamanPengaturanView extends StatelessWidget {
|
class HalamanPengaturanView extends StatelessWidget {
|
||||||
|
@ -76,71 +76,70 @@ class TambahDetailTimSurveiView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
if (model.timSurveiModel == null)
|
if (model.timSurveiModel == null)
|
||||||
Column(
|
const Align(
|
||||||
children: [
|
alignment: Alignment.centerLeft,
|
||||||
const Align(
|
child: Text(
|
||||||
alignment: Alignment.centerLeft,
|
' Pilih Caleg',
|
||||||
child: Text(
|
),
|
||||||
' Pilih Caleg',
|
),
|
||||||
),
|
if (model.isBusy && model.timSurveiModel == null)
|
||||||
|
const LinearProgressIndicator(
|
||||||
|
minHeight: 5,
|
||||||
|
color: mainColor,
|
||||||
|
),
|
||||||
|
if (!model.isBusy && model.listCalegModel.isNotEmpty)
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 60,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(25),
|
||||||
|
border: Border.all(
|
||||||
|
color: sixthGrey,
|
||||||
),
|
),
|
||||||
if (model.isBusy)
|
),
|
||||||
const LinearProgressIndicator(
|
child: DropdownButtonHideUnderline(
|
||||||
minHeight: 5,
|
child: DropdownButton<String>(
|
||||||
color: mainColor,
|
isExpanded: true,
|
||||||
),
|
value: model.selectedCaleg!,
|
||||||
if (!model.isBusy && model.listCalegModel.isNotEmpty)
|
icon: const Icon(Icons.arrow_drop_down),
|
||||||
Container(
|
iconSize: 24,
|
||||||
width: double.infinity,
|
elevation: 16,
|
||||||
height: 60,
|
style: const TextStyle(color: Colors.black),
|
||||||
padding:
|
onChanged: (String? newValue) {
|
||||||
const EdgeInsets.symmetric(horizontal: 10),
|
model.log.i(newValue);
|
||||||
decoration: BoxDecoration(
|
model.selectedCaleg = newValue!;
|
||||||
borderRadius: BorderRadius.circular(25),
|
model.selectedCalegId = model.listCalegModel
|
||||||
border: Border.all(
|
.firstWhere((element) =>
|
||||||
color: sixthGrey,
|
element.namaCaleg ==
|
||||||
),
|
model.selectedCaleg)
|
||||||
),
|
.idCaleg;
|
||||||
child: Expanded(
|
|
||||||
child: DropdownButtonHideUnderline(
|
|
||||||
child: DropdownButton<String>(
|
|
||||||
isExpanded: true,
|
|
||||||
value: model.selectedCaleg!,
|
|
||||||
icon: const Icon(Icons.arrow_drop_down),
|
|
||||||
iconSize: 24,
|
|
||||||
elevation: 16,
|
|
||||||
style:
|
|
||||||
const TextStyle(color: Colors.black),
|
|
||||||
onChanged: (String? newValue) {
|
|
||||||
model.log.i(newValue);
|
|
||||||
model.selectedCaleg = newValue!;
|
|
||||||
model.selectedCalegId = model
|
|
||||||
.listCalegModel
|
|
||||||
.firstWhere((element) =>
|
|
||||||
element.namaCaleg ==
|
|
||||||
model.selectedCaleg)
|
|
||||||
.idCaleg;
|
|
||||||
|
|
||||||
model.log.i(model.selectedCalegId);
|
model.log.i(model.selectedCalegId);
|
||||||
|
|
||||||
model.notifyListeners();
|
model.notifyListeners();
|
||||||
},
|
},
|
||||||
items: model.listCalegString
|
items: model.listCalegString
|
||||||
.map<DropdownMenuItem<String>>(
|
.map<DropdownMenuItem<String>>(
|
||||||
(String value) {
|
(String value) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: value,
|
value: value,
|
||||||
child: Text(value,
|
child: Text(value,
|
||||||
overflow: TextOverflow.ellipsis),
|
overflow: TextOverflow.ellipsis),
|
||||||
);
|
);
|
||||||
}).toList()),
|
}).toList()),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
if (model.timSurveiModel == null)
|
if (model.timSurveiModel == null)
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
// Column(
|
||||||
|
// mainAxisSize: MainAxisSize.min,
|
||||||
|
// children: [
|
||||||
|
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
if (model.timSurveiModel == null &&
|
||||||
|
request.title! == 'Tambah Tim Survei')
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 200,
|
width: 200,
|
||||||
child: MyButton(
|
child: MyButton(
|
||||||
@ -169,6 +168,7 @@ class TambahDetailTimSurveiView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (model.timSurveiModel != null)
|
if (model.timSurveiModel != null)
|
||||||
Column(
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
MyTextFormField(
|
MyTextFormField(
|
||||||
labelText: 'Caleg',
|
labelText: 'Caleg',
|
||||||
@ -185,11 +185,13 @@ class TambahDetailTimSurveiView extends StatelessWidget {
|
|||||||
width: 50,
|
width: 50,
|
||||||
height: 50,
|
height: 50,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: mainColor.withOpacity(0.5),
|
color: mainColor,
|
||||||
borderRadius: BorderRadius.circular(50),
|
borderRadius: BorderRadius.circular(50),
|
||||||
),
|
),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {},
|
onPressed: () {
|
||||||
|
model.checkSuara(model.timSurveiModel!);
|
||||||
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.list_alt_outlined,
|
Icons.list_alt_outlined,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../../../app/app.bottomsheets.dart';
|
||||||
import '../../../../../app/app.logger.dart';
|
import '../../../../../app/app.logger.dart';
|
||||||
import '../../../../../app/core/custom_base_view_model.dart';
|
import '../../../../../app/core/custom_base_view_model.dart';
|
||||||
import '../../../../../model/caleg_model.dart';
|
import '../../../../../model/caleg_model.dart';
|
||||||
@ -83,4 +84,16 @@ class TambahDetailTimSurveiViewModel extends CustomBaseViewModel {
|
|||||||
setBusy(false);
|
setBusy(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkSuara(TimSurveiModel timSurveiModel) async {
|
||||||
|
await bottomSheetService.showCustomSheet(
|
||||||
|
data: timSurveiModel.nik,
|
||||||
|
barrierDismissible: true,
|
||||||
|
isScrollControlled: true,
|
||||||
|
title: 'Detail Suara Tim Survei ${timSurveiModel.nama}',
|
||||||
|
description: 'Tim Survei',
|
||||||
|
ignoreSafeArea: false,
|
||||||
|
variant: BottomSheetType.detailSuaraBottomSheetView,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import 'package:cek_suara/app/themes/app_text.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
import '../../../../app/themes/app_colors.dart';
|
import '../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../../app/themes/app_text.dart';
|
||||||
import '../../../widgets/top_container.dart';
|
import '../../../widgets/top_container.dart';
|
||||||
import './tim_survei_view_model.dart';
|
import './tim_survei_view_model.dart';
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import 'package:cek_suara/app/themes/app_colors.dart';
|
|
||||||
import 'package:cek_suara/ui/widgets/my_button.dart';
|
|
||||||
import 'package:cek_suara/ui/widgets/my_textformfield.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
import 'package:validatorless/validatorless.dart';
|
||||||
|
|
||||||
|
import '../../../app/themes/app_colors.dart';
|
||||||
|
import '../../widgets/my_button.dart';
|
||||||
|
import '../../widgets/my_textformfield.dart';
|
||||||
import './login_screen_view_model.dart';
|
import './login_screen_view_model.dart';
|
||||||
|
|
||||||
class LoginScreenView extends StatelessWidget {
|
class LoginScreenView extends StatelessWidget {
|
||||||
@ -37,59 +38,80 @@ class LoginScreenView extends StatelessWidget {
|
|||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Form(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
key: model.formKey,
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
const SizedBox(
|
mainAxisSize: MainAxisSize.min,
|
||||||
height: 50,
|
children: [
|
||||||
),
|
const SizedBox(
|
||||||
Center(
|
height: 50,
|
||||||
child: Image.asset(
|
|
||||||
'assets/logo.png',
|
|
||||||
width: 200,
|
|
||||||
height: 200,
|
|
||||||
),
|
),
|
||||||
),
|
Center(
|
||||||
const SizedBox(
|
child: Image.asset(
|
||||||
height: 10,
|
'assets/logo.png',
|
||||||
),
|
width: 200,
|
||||||
const Text(
|
height: 200,
|
||||||
'Halaman Login',
|
),
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
const MyTextFormField(
|
|
||||||
// controller: model.usernameController,
|
|
||||||
hintText: 'Username',
|
|
||||||
// prefixIcon: Icons.person,
|
|
||||||
obscureText: false,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 15,
|
|
||||||
),
|
|
||||||
const MyTextFormField(
|
|
||||||
// controller: model.passwordController,
|
|
||||||
hintText: 'Password',
|
|
||||||
suffixIcon: Icon(Icons.lock),
|
|
||||||
obscureText: true,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 250,
|
|
||||||
child: MyButton(
|
|
||||||
// theBackgroundColor: lightColor,
|
|
||||||
textColor: fontColor,
|
|
||||||
text: 'Login',
|
|
||||||
onPressed: () {
|
|
||||||
model.login();
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(
|
||||||
],
|
height: 10,
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
'Halaman Login',
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
MyTextFormField(
|
||||||
|
controller: model.usernameController,
|
||||||
|
hintText: 'Username',
|
||||||
|
validator: Validatorless.required(
|
||||||
|
'Username tidak boleh kosong'),
|
||||||
|
// prefixIcon: Icons.person,
|
||||||
|
obscureText: false,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
MyTextFormField(
|
||||||
|
controller: model.passwordController,
|
||||||
|
hintText: 'Password',
|
||||||
|
validator: Validatorless.required(
|
||||||
|
'Password tidak boleh kosong'),
|
||||||
|
suffixIcon: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
model.isPasswordVisible =
|
||||||
|
!model.isPasswordVisible;
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
model.isPasswordVisible
|
||||||
|
? Icons.visibility
|
||||||
|
: Icons.visibility_off,
|
||||||
|
color: fontColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
obscureText: true,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 250,
|
||||||
|
child: MyButton(
|
||||||
|
// theBackgroundColor: lightColor,
|
||||||
|
textColor: fontColor,
|
||||||
|
text: 'Login',
|
||||||
|
onPressed: () {
|
||||||
|
if (model.formKey.currentState!.validate()) {
|
||||||
|
model.login();
|
||||||
|
}
|
||||||
|
// model.login();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../../app/app.router.dart';
|
import '../../../app/app.router.dart';
|
||||||
|
|
||||||
import '../../../app/app.logger.dart';
|
import '../../../app/app.logger.dart';
|
||||||
import '../../../app/core/custom_base_view_model.dart';
|
import '../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
class LoginScreenViewModel extends CustomBaseViewModel {
|
class LoginScreenViewModel extends CustomBaseViewModel {
|
||||||
|
bool isPasswordVisible = true;
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
|
TextEditingController usernameController = TextEditingController();
|
||||||
|
TextEditingController passwordController = TextEditingController();
|
||||||
|
|
||||||
final log = getLogger('LoginScreenViewModel');
|
final log = getLogger('LoginScreenViewModel');
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
globalVar.backPressed = 'backNormal';
|
globalVar.backPressed = 'backNormal';
|
||||||
@ -11,11 +18,22 @@ class LoginScreenViewModel extends CustomBaseViewModel {
|
|||||||
|
|
||||||
login() async {
|
login() async {
|
||||||
easyLoading.customLoading('Login..');
|
easyLoading.customLoading('Login..');
|
||||||
globalVar.backPressed = 'cantBack';
|
if (usernameController.text == 'admin' &&
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
passwordController.text == 'admin123') {
|
||||||
easyLoading.dismissLoading();
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
globalVar.backPressed = 'backNormal';
|
easyLoading.dismissLoading();
|
||||||
// navigationService.pushNamedAndRemoveUntil('/home-screen');
|
globalVar.backPressed = 'backNormal';
|
||||||
await navigationService.navigateToAdminIndexTrackingView();
|
// navigationService.pushNamedAndRemoveUntil('/home-screen');
|
||||||
|
await navigationService.navigateToAdminIndexTrackingView();
|
||||||
|
} else {
|
||||||
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
easyLoading.dismissLoading();
|
||||||
|
globalVar.backPressed = 'backNormal';
|
||||||
|
snackbarService.showSnackbar(
|
||||||
|
message: 'Username atau Password salah',
|
||||||
|
title: 'Login Gagal',
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|