optimized
@ -0,0 +1,6 @@
|
|||||||
|
package com.dvox.rog_app
|
||||||
|
|
||||||
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
class MainActivity: FlutterActivity() {
|
||||||
|
}
|
||||||
@ -16,14 +16,6 @@ PODS:
|
|||||||
- Flutter
|
- Flutter
|
||||||
- geolocator_apple (1.2.0):
|
- geolocator_apple (1.2.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- google_maps_flutter_ios (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- GoogleMaps (< 8.0)
|
|
||||||
- GoogleMaps (5.2.0):
|
|
||||||
- GoogleMaps/Maps (= 5.2.0)
|
|
||||||
- GoogleMaps/Base (5.2.0)
|
|
||||||
- GoogleMaps/Maps (5.2.0):
|
|
||||||
- GoogleMaps/Base
|
|
||||||
- image_picker_ios (0.0.1):
|
- image_picker_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- isar_flutter_libs (1.0.0):
|
- isar_flutter_libs (1.0.0):
|
||||||
@ -51,7 +43,6 @@ DEPENDENCIES:
|
|||||||
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
|
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
|
||||||
- gallery_saver (from `.symlinks/plugins/gallery_saver/ios`)
|
- gallery_saver (from `.symlinks/plugins/gallery_saver/ios`)
|
||||||
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
|
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
|
||||||
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
|
|
||||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||||
- isar_flutter_libs (from `.symlinks/plugins/isar_flutter_libs/ios`)
|
- isar_flutter_libs (from `.symlinks/plugins/isar_flutter_libs/ios`)
|
||||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
@ -63,7 +54,6 @@ DEPENDENCIES:
|
|||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
- FMDB
|
- FMDB
|
||||||
- GoogleMaps
|
|
||||||
- ReachabilitySwift
|
- ReachabilitySwift
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
@ -81,8 +71,6 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/gallery_saver/ios"
|
:path: ".symlinks/plugins/gallery_saver/ios"
|
||||||
geolocator_apple:
|
geolocator_apple:
|
||||||
:path: ".symlinks/plugins/geolocator_apple/ios"
|
:path: ".symlinks/plugins/geolocator_apple/ios"
|
||||||
google_maps_flutter_ios:
|
|
||||||
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
|
|
||||||
image_picker_ios:
|
image_picker_ios:
|
||||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||||
isar_flutter_libs:
|
isar_flutter_libs:
|
||||||
@ -107,8 +95,6 @@ SPEC CHECKSUMS:
|
|||||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||||
gallery_saver: 9fc173c9f4fcc48af53b2a9ebea1b643255be542
|
gallery_saver: 9fc173c9f4fcc48af53b2a9ebea1b643255be542
|
||||||
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
|
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
|
||||||
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
|
|
||||||
GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693
|
|
||||||
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||||
isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073
|
isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073
|
||||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||||
|
|||||||
@ -7,13 +7,13 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
084EA8A81CF8B34528999293 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D7C4F924DD034151EFC15038 /* Pods_Runner.framework */; };
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
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 */; };
|
||||||
EAFC0FFB27C8DC9071E67D5D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 853FC5087A11FEE54BE443C8 /* Pods_Runner.framework */; };
|
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
@ -30,14 +30,14 @@
|
|||||||
/* End PBXCopyFilesBuildPhase section */
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
13E5CD9612AF4CC8B90A74C3 /* 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>"; };
|
|
||||||
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>"; };
|
||||||
|
37AC108B2188F1C5AA1C2C9E /* 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>"; };
|
||||||
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>"; };
|
||||||
|
4310B59AA1289CC3AE4DBA82 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
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>"; };
|
||||||
853FC5087A11FEE54BE443C8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.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; };
|
||||||
@ -45,8 +45,8 @@
|
|||||||
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>"; };
|
||||||
BEC4F75C6B655CA90D5B5E18 /* 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>"; };
|
D464128FC0D5DAEBC1011C26 /* 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>"; };
|
||||||
F1D3FD8F51C2EAF6C3A7EE25 /* 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>"; };
|
D7C4F924DD034151EFC15038 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -54,7 +54,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
EAFC0FFB27C8DC9071E67D5D /* Pods_Runner.framework in Frameworks */,
|
084EA8A81CF8B34528999293 /* Pods_Runner.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -64,9 +64,9 @@
|
|||||||
6C3C11D7BE49E5BED7989712 /* Pods */ = {
|
6C3C11D7BE49E5BED7989712 /* Pods */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
BEC4F75C6B655CA90D5B5E18 /* Pods-Runner.debug.xcconfig */,
|
4310B59AA1289CC3AE4DBA82 /* Pods-Runner.debug.xcconfig */,
|
||||||
13E5CD9612AF4CC8B90A74C3 /* Pods-Runner.release.xcconfig */,
|
37AC108B2188F1C5AA1C2C9E /* Pods-Runner.release.xcconfig */,
|
||||||
F1D3FD8F51C2EAF6C3A7EE25 /* Pods-Runner.profile.xcconfig */,
|
D464128FC0D5DAEBC1011C26 /* Pods-Runner.profile.xcconfig */,
|
||||||
);
|
);
|
||||||
path = Pods;
|
path = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -89,7 +89,7 @@
|
|||||||
97C146F01CF9000F007C117D /* Runner */,
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
97C146EF1CF9000F007C117D /* Products */,
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
6C3C11D7BE49E5BED7989712 /* Pods */,
|
6C3C11D7BE49E5BED7989712 /* Pods */,
|
||||||
E6F2437A5B5AAF08D2998197 /* Frameworks */,
|
D3D7A1CBA3FB0154A6C84903 /* Frameworks */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@ -116,10 +116,10 @@
|
|||||||
path = Runner;
|
path = Runner;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
E6F2437A5B5AAF08D2998197 /* Frameworks */ = {
|
D3D7A1CBA3FB0154A6C84903 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
853FC5087A11FEE54BE443C8 /* Pods_Runner.framework */,
|
D7C4F924DD034151EFC15038 /* Pods_Runner.framework */,
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -131,15 +131,14 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
6B25D2836FC6A82461E36025 /* [CP] Check Pods Manifest.lock */,
|
9ACF47601C5E8A391157E87A /* [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 */,
|
||||||
ED4E40E6FE1C0A73CAC736F8 /* [CP] Embed Pods Frameworks */,
|
CD1CB185AC38B6B245F9A672 /* [CP] Embed Pods Frameworks */,
|
||||||
FE7C2E909403F98AB3140FE6 /* [CP] Copy Pods Resources */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@ -214,7 +213,22 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||||
};
|
};
|
||||||
6B25D2836FC6A82461E36025 /* [CP] Check Pods Manifest.lock */ = {
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Run Script";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
|
};
|
||||||
|
9ACF47601C5E8A391157E87A /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
@ -236,22 +250,7 @@
|
|||||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
shellScript = "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;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
CD1CB185AC38B6B245F9A672 /* [CP] Embed Pods Frameworks */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
alwaysOutOfDate = 1;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Run Script";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
|
||||||
};
|
|
||||||
ED4E40E6FE1C0A73CAC736F8 /* [CP] Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
@ -268,23 +267,6 @@
|
|||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
FE7C2E909403F98AB3140FE6 /* [CP] Copy Pods Resources */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
|
|
||||||
);
|
|
||||||
name = "[CP] Copy Pods Resources";
|
|
||||||
outputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
@ -362,6 +344,7 @@
|
|||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = iphoneos;
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
@ -490,6 +473,7 @@
|
|||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = iphoneos;
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
SWIFT_COMPILATION_MODE = wholemodule;
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
import Flutter
|
import Flutter
|
||||||
import GoogleMaps
|
|
||||||
|
|
||||||
@UIApplicationMain
|
@UIApplicationMain
|
||||||
@objc class AppDelegate: FlutterAppDelegate {
|
@objc class AppDelegate: FlutterAppDelegate {
|
||||||
@ -8,7 +7,6 @@ import GoogleMaps
|
|||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
GMSServices.provideAPIKey("AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE")
|
|
||||||
GeneratedPluginRegistrant.register(with: self)
|
GeneratedPluginRegistrant.register(with: self)
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
}
|
}
|
||||||
|
|||||||
12
ios/RunnerTests/RunnerTests.swift
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import Flutter
|
||||||
|
import UIKit
|
||||||
|
import XCTest
|
||||||
|
|
||||||
|
class RunnerTests: XCTestCase {
|
||||||
|
|
||||||
|
func testExample() {
|
||||||
|
// If you add code to the Runner application, consider adding tests here.
|
||||||
|
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
138
lib/main.dart
@ -3,26 +3,29 @@ import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||||
import 'package:rogapp/pages/index/index_binding.dart';
|
import 'package:rogapp/pages/index/index_binding.dart';
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
|
||||||
import 'package:rogapp/routes/app_pages.dart';
|
import 'package:rogapp/routes/app_pages.dart';
|
||||||
import 'package:rogapp/utils/string_values.dart';
|
import 'package:rogapp/utils/string_values.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
// import 'package:is_lock_screen/is_lock_screen.dart';
|
// import 'package:is_lock_screen/is_lock_screen.dart';
|
||||||
|
|
||||||
void saveGameState() async {
|
void saveGameState() async {
|
||||||
DestinationController destinationController = Get.find<DestinationController>();
|
DestinationController destinationController =
|
||||||
SharedPreferences pref = await SharedPreferences.getInstance();
|
Get.find<DestinationController>();
|
||||||
pref.setBool("is_in_rog", destinationController.is_in_rog.value);
|
SharedPreferences pref = await SharedPreferences.getInstance();
|
||||||
pref.setBool("rogaining_counted", destinationController.rogaining_counted.value);
|
pref.setBool("is_in_rog", destinationController.isInRog.value);
|
||||||
}
|
pref.setBool(
|
||||||
|
"rogaining_counted", destinationController.rogainingCounted.value);
|
||||||
|
}
|
||||||
|
|
||||||
void restoreGame() async{
|
void restoreGame() async {
|
||||||
SharedPreferences pref = await SharedPreferences.getInstance();
|
SharedPreferences pref = await SharedPreferences.getInstance();
|
||||||
DestinationController destinationController = Get.find<DestinationController>();
|
DestinationController destinationController =
|
||||||
destinationController.skip_gps = false;
|
Get.find<DestinationController>();
|
||||||
destinationController.is_in_rog.value = pref.getBool("is_in_rog") ?? false;
|
destinationController.skipGps = false;
|
||||||
destinationController.rogaining_counted.value = pref.getBool("rogaining_counted") ?? false;
|
destinationController.isInRog.value = pref.getBool("is_in_rog") ?? false;
|
||||||
}
|
destinationController.rogainingCounted.value =
|
||||||
|
pref.getBool("rogaining_counted") ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
@ -61,8 +64,6 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
@ -76,35 +77,36 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
// pref.setBool("rogaining_counted", destinationController.rogaining_counted.value);
|
// pref.setBool("rogaining_counted", destinationController.rogaining_counted.value);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@override
|
||||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
DestinationController destinationController = Get.find<DestinationController>();
|
DestinationController destinationController =
|
||||||
switch (state) {
|
Get.find<DestinationController>();
|
||||||
case AppLifecycleState.resumed:
|
switch (state) {
|
||||||
print("RESUMED");
|
case AppLifecycleState.resumed:
|
||||||
restoreGame();
|
//print("RESUMED");
|
||||||
if(destinationController.positionStream == null){
|
restoreGame();
|
||||||
destinationController.startGPSTimer();
|
if (destinationController.positionStream == null) {
|
||||||
//destinationController.startGame();
|
//destinationController.startGPSTimer();
|
||||||
}
|
//destinationController.startGame();
|
||||||
break;
|
}
|
||||||
case AppLifecycleState.inactive:
|
break;
|
||||||
print("INACTIVE");
|
case AppLifecycleState.inactive:
|
||||||
break;
|
//print("INACTIVE");
|
||||||
case AppLifecycleState.paused:
|
break;
|
||||||
print("PAUSED");
|
case AppLifecycleState.paused:
|
||||||
saveGameState();
|
//print("PAUSED");
|
||||||
break;
|
saveGameState();
|
||||||
case AppLifecycleState.detached:
|
break;
|
||||||
print("DETACHED");
|
case AppLifecycleState.detached:
|
||||||
saveGameState();
|
//print("DETACHED");
|
||||||
break;
|
saveGameState();
|
||||||
case AppLifecycleState.hidden:
|
break;
|
||||||
print("DETACHED");
|
case AppLifecycleState.hidden:
|
||||||
saveGameState();
|
//print("DETACHED");
|
||||||
break;
|
saveGameState();
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -115,8 +117,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
fallbackLocale: const Locale('en', 'US'),
|
fallbackLocale: const Locale('en', 'US'),
|
||||||
title: 'ROGAINING',
|
title: 'ROGAINING',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorScheme:
|
colorScheme: ColorScheme.fromSeed(
|
||||||
ColorScheme.fromSeed(seedColor: Color.fromARGB(255, 36, 135, 221)),
|
seedColor: const Color.fromARGB(255, 36, 135, 221)),
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
),
|
),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
@ -131,51 +133,3 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// class MyApp extends StatelessWidget {
|
|
||||||
// MyApp({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
// // This widget is the root of your application.
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return MaterialApp(
|
|
||||||
// title: 'Flutter Demo',
|
|
||||||
// theme: ThemeData(
|
|
||||||
// primaryColor: Color(0xfff00B074),
|
|
||||||
// textTheme: const TextTheme(
|
|
||||||
// bodyText1: TextStyle(
|
|
||||||
// fontSize: 18.0,
|
|
||||||
// fontFamily: 'Barlow-Medium',
|
|
||||||
// color: Color(0xff464255)),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// home: PermissionHandlerScreen(),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// class SplashScreen extends StatelessWidget {
|
|
||||||
// const SplashScreen({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return WillPopScope(
|
|
||||||
// onWillPop: () async {
|
|
||||||
// SystemNavigator.pop();
|
|
||||||
// return true;
|
|
||||||
// },
|
|
||||||
// child: Scaffold(
|
|
||||||
// body: Center(
|
|
||||||
// child: Text(
|
|
||||||
// "Splash Screen",
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|||||||
61
lib/main_nrog.dart
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:rogapp/nrog/pages/permission_page.dart';
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
|
await FlutterMapTileCaching.initialise();
|
||||||
|
final StoreDirectory instanceA = FMTC.instance('OpenStreetMap (A)');
|
||||||
|
await instanceA.manage.createAsync();
|
||||||
|
await instanceA.metadata.addAsync(
|
||||||
|
key: 'sourceURL',
|
||||||
|
value: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
|
||||||
|
);
|
||||||
|
await instanceA.metadata.addAsync(
|
||||||
|
key: 'validDuration',
|
||||||
|
value: '14',
|
||||||
|
);
|
||||||
|
await instanceA.metadata.addAsync(
|
||||||
|
key: 'behaviour',
|
||||||
|
value: 'cacheFirst',
|
||||||
|
);
|
||||||
|
runApp(
|
||||||
|
const ProviderScope(child: MyApp()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyApp extends StatefulWidget {
|
||||||
|
const MyApp({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MyApp> createState() => _MyAppState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
|
debugShowCheckedModeBanner: false,
|
||||||
|
title: 'Flutter Demo',
|
||||||
|
theme: ThemeData(
|
||||||
|
colorScheme: ColorScheme.fromSeed(
|
||||||
|
seedColor: const Color.fromARGB(255, 124, 156, 9)),
|
||||||
|
useMaterial3: true,
|
||||||
|
),
|
||||||
|
home: const PermissionPage());
|
||||||
|
}
|
||||||
|
}
|
||||||
24
lib/model/auth_user.dart
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
class AuthUser {
|
||||||
|
AuthUser();
|
||||||
|
|
||||||
|
//AuthUser.from({required this.id, required this.email, required this.is_rogaining, required this.group, required this.zekken_number, required this.event_code, required this.team_name});
|
||||||
|
|
||||||
|
AuthUser.fromMap(Map<String, dynamic> map)
|
||||||
|
: id = int.parse(map["id"].toString()),
|
||||||
|
email = map["email"].toString(),
|
||||||
|
is_rogaining = bool.parse(map["is_rogaining"].toString()),
|
||||||
|
group = map["group"].toString(),
|
||||||
|
zekken_number = map["zekken_number"].toString(),
|
||||||
|
event_code = map["event_code"].toString(),
|
||||||
|
team_name = map["team_name"].toString(),
|
||||||
|
auth_token = map["token"];
|
||||||
|
|
||||||
|
int? id;
|
||||||
|
String? email;
|
||||||
|
bool? is_rogaining;
|
||||||
|
String? group;
|
||||||
|
String? zekken_number;
|
||||||
|
String? event_code;
|
||||||
|
String? team_name;
|
||||||
|
String? auth_token;
|
||||||
|
}
|
||||||
@ -1,131 +1,124 @@
|
|||||||
|
|
||||||
|
|
||||||
class Destination {
|
class Destination {
|
||||||
String? name;
|
String? name;
|
||||||
String? address;
|
String? address;
|
||||||
String? phone;
|
String? phone;
|
||||||
String? email;
|
String? email;
|
||||||
String? webcontents;
|
String? webcontents;
|
||||||
String? videos;
|
String? videos;
|
||||||
String? category;
|
String? category;
|
||||||
int? series;
|
int? series;
|
||||||
double? lat;
|
double? lat;
|
||||||
double? lon;
|
double? lon;
|
||||||
String? sub_loc_id;
|
String? sub_loc_id;
|
||||||
int? location_id;
|
int? location_id;
|
||||||
int? list_order;
|
int? list_order;
|
||||||
String? photos;
|
String? photos;
|
||||||
double? checkin_radious;
|
double? checkin_radious;
|
||||||
int? auto_checkin;
|
int? auto_checkin;
|
||||||
bool? selected = false;
|
bool? selected = false;
|
||||||
bool? checkedin = false;
|
bool? checkedin = false;
|
||||||
double? cp;
|
double? cp;
|
||||||
double? checkin_point;
|
double? checkin_point;
|
||||||
double? buy_point;
|
double? buy_point;
|
||||||
int? hidden_location;
|
int? hidden_location;
|
||||||
String? checkin_image;
|
String? checkin_image;
|
||||||
String? buypoint_image;
|
String? buypoint_image;
|
||||||
bool forced_checkin = false;
|
bool forced_checkin = false;
|
||||||
int recipt_times = 0;
|
int recipt_times = 0;
|
||||||
|
|
||||||
Destination({
|
Destination(
|
||||||
this.name,
|
{this.name,
|
||||||
this.address,
|
this.address,
|
||||||
this.phone,
|
this.phone,
|
||||||
this.email,
|
this.email,
|
||||||
this.webcontents,
|
this.webcontents,
|
||||||
this.videos,
|
this.videos,
|
||||||
this.category,
|
this.category,
|
||||||
this.series,
|
this.series,
|
||||||
this.lat,
|
this.lat,
|
||||||
this.lon,
|
this.lon,
|
||||||
this.sub_loc_id,
|
this.sub_loc_id,
|
||||||
this.location_id,
|
this.location_id,
|
||||||
this.list_order,
|
this.list_order,
|
||||||
this.photos,
|
this.photos,
|
||||||
this.checkin_radious,
|
this.checkin_radious,
|
||||||
this.auto_checkin,
|
this.auto_checkin,
|
||||||
this.selected,
|
this.selected,
|
||||||
this.checkedin,
|
this.checkedin,
|
||||||
this.cp,
|
this.cp,
|
||||||
this.checkin_point,
|
this.checkin_point,
|
||||||
this.buy_point,
|
this.buy_point,
|
||||||
this.hidden_location,
|
this.hidden_location,
|
||||||
this.checkin_image,
|
this.checkin_image,
|
||||||
this.buypoint_image,
|
this.buypoint_image,
|
||||||
this.forced_checkin = false,
|
this.forced_checkin = false,
|
||||||
this.recipt_times = 0
|
this.recipt_times = 0});
|
||||||
});
|
|
||||||
|
|
||||||
factory Destination.fromMap(Map<String, dynamic> json) {
|
factory Destination.fromMap(Map<String, dynamic> json) {
|
||||||
|
bool selec = json['selected'] == 0 ? false : true;
|
||||||
bool selec = json['selected'] == 0 ? false : true;
|
bool checkin = json['checkedin'] == 0 ? false : true;
|
||||||
bool checkin = json['checkedin'] == 0 ? false : true;
|
bool forcedCheckin = json['forced_checkin'] == 0 ? false : true;
|
||||||
bool _forced_checkin = json['forced_checkin'] == 0 ? false : true;
|
|
||||||
|
|
||||||
return Destination(
|
|
||||||
name: json['name'],
|
|
||||||
address: json['address'],
|
|
||||||
phone: json['phone'],
|
|
||||||
email: json['email'],
|
|
||||||
webcontents: json['webcontents'],
|
|
||||||
videos: json['videos'],
|
|
||||||
category: json['category'],
|
|
||||||
series: json['series'],
|
|
||||||
lat: json['lat'],
|
|
||||||
lon: json['lon'],
|
|
||||||
sub_loc_id : json['sub_loc_id'],
|
|
||||||
location_id: json['location_id'],
|
|
||||||
list_order: json['list_order'],
|
|
||||||
photos: json['photos'],
|
|
||||||
checkin_radious: json['checkin_radious'],
|
|
||||||
auto_checkin:json['auto_checkin'],
|
|
||||||
selected: selec,
|
|
||||||
checkedin: checkin,
|
|
||||||
cp: json['cp'],
|
|
||||||
checkin_point: json['checkin_point'],
|
|
||||||
buy_point: json['buy_point'],
|
|
||||||
hidden_location: json['hidden_location'],
|
|
||||||
checkin_image: json['checkin_image'],
|
|
||||||
buypoint_image: json["buypoint_image"],
|
|
||||||
forced_checkin: _forced_checkin,
|
|
||||||
recipt_times: json["recipt_times"]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toMap(){
|
|
||||||
int sel = selected == false ? 0 : 1;
|
|
||||||
int check = checkedin == false ? 0 : 1;
|
|
||||||
int _forced_checkin = forced_checkin == false ? 0 : 1;
|
|
||||||
return {
|
|
||||||
'name':name,
|
|
||||||
'address': address,
|
|
||||||
'phone': phone,
|
|
||||||
'email': email,
|
|
||||||
'webcontents': webcontents,
|
|
||||||
'videos': videos,
|
|
||||||
'category':category,
|
|
||||||
'series':series,
|
|
||||||
'lat':lat,
|
|
||||||
'lon':lon,
|
|
||||||
'sub_loc_id': sub_loc_id,
|
|
||||||
'location_id':location_id,
|
|
||||||
'list_order':list_order,
|
|
||||||
'photos':photos,
|
|
||||||
'checkin_radious': checkin_radious,
|
|
||||||
'auto_checkin': auto_checkin,
|
|
||||||
'selected': sel,
|
|
||||||
'checkedin': check,
|
|
||||||
'cp' : cp,
|
|
||||||
'checkin_point' : checkin_point,
|
|
||||||
'buy_point' : buy_point,
|
|
||||||
'hidden_location' : hidden_location,
|
|
||||||
'checkin_image': checkin_image,
|
|
||||||
'buypoint_image' : buypoint_image,
|
|
||||||
'forced_checkin' : _forced_checkin,
|
|
||||||
'recipt_times' : recipt_times
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return Destination(
|
||||||
|
name: json['name'],
|
||||||
|
address: json['address'],
|
||||||
|
phone: json['phone'],
|
||||||
|
email: json['email'],
|
||||||
|
webcontents: json['webcontents'],
|
||||||
|
videos: json['videos'],
|
||||||
|
category: json['category'],
|
||||||
|
series: json['series'],
|
||||||
|
lat: json['lat'],
|
||||||
|
lon: json['lon'],
|
||||||
|
sub_loc_id: json['sub_loc_id'],
|
||||||
|
location_id: json['location_id'],
|
||||||
|
list_order: json['list_order'],
|
||||||
|
photos: json['photos'],
|
||||||
|
checkin_radious: json['checkin_radious'],
|
||||||
|
auto_checkin: json['auto_checkin'],
|
||||||
|
selected: selec,
|
||||||
|
checkedin: checkin,
|
||||||
|
cp: json['cp'],
|
||||||
|
checkin_point: json['checkin_point'],
|
||||||
|
buy_point: json['buy_point'],
|
||||||
|
hidden_location: json['hidden_location'],
|
||||||
|
checkin_image: json['checkin_image'],
|
||||||
|
buypoint_image: json["buypoint_image"],
|
||||||
|
forced_checkin: forcedCheckin,
|
||||||
|
recipt_times: json["recipt_times"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toMap() {
|
||||||
|
int sel = selected == false ? 0 : 1;
|
||||||
|
int check = checkedin == false ? 0 : 1;
|
||||||
|
int forcedCheckin = forced_checkin == false ? 0 : 1;
|
||||||
|
return {
|
||||||
|
'name': name,
|
||||||
|
'address': address,
|
||||||
|
'phone': phone,
|
||||||
|
'email': email,
|
||||||
|
'webcontents': webcontents,
|
||||||
|
'videos': videos,
|
||||||
|
'category': category,
|
||||||
|
'series': series,
|
||||||
|
'lat': lat,
|
||||||
|
'lon': lon,
|
||||||
|
'sub_loc_id': sub_loc_id,
|
||||||
|
'location_id': location_id,
|
||||||
|
'list_order': list_order,
|
||||||
|
'photos': photos,
|
||||||
|
'checkin_radious': checkin_radious,
|
||||||
|
'auto_checkin': auto_checkin,
|
||||||
|
'selected': sel,
|
||||||
|
'checkedin': check,
|
||||||
|
'cp': cp,
|
||||||
|
'checkin_point': checkin_point,
|
||||||
|
'buy_point': buy_point,
|
||||||
|
'hidden_location': hidden_location,
|
||||||
|
'checkin_image': checkin_image,
|
||||||
|
'buypoint_image': buypoint_image,
|
||||||
|
'forced_checkin': forcedCheckin,
|
||||||
|
'recipt_times': recipt_times
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,18 +0,0 @@
|
|||||||
enum LocationState {
|
|
||||||
noGps,
|
|
||||||
notInCheckin,
|
|
||||||
withinCheckin
|
|
||||||
}
|
|
||||||
|
|
||||||
enum GameState {
|
|
||||||
notStarted,
|
|
||||||
startedNotCounted,
|
|
||||||
startedCounted,
|
|
||||||
nodeGoal
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class GameInstanceState{
|
|
||||||
LocationState locationState = LocationState.noGps;
|
|
||||||
GameState gameState = GameState.notStarted;
|
|
||||||
}
|
|
||||||
8
lib/model/game_state_instance.dart
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
enum LocationState { noGps, notInCheckin, withinCheckin }
|
||||||
|
|
||||||
|
enum GameState { notStarted, startedNotCounted, startedCounted, nodeGoal }
|
||||||
|
|
||||||
|
class GameInsStatetance {
|
||||||
|
LocationState locationState = LocationState.noGps;
|
||||||
|
GameState gameState = GameState.notStarted;
|
||||||
|
}
|
||||||
6
lib/model/map_state_instance.dart
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:flutter_map/flutter_map.dart';
|
||||||
|
|
||||||
|
class MapStateInstance {
|
||||||
|
MapController? mapController;
|
||||||
|
LatLngBounds? currentBounds;
|
||||||
|
}
|
||||||
229
lib/nrog/pages/auth_page.dart
Normal file
@ -0,0 +1,229 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
|
import 'package:keyboard_dismisser/keyboard_dismisser.dart';
|
||||||
|
import 'package:rogapp/model/auth_user.dart';
|
||||||
|
import 'package:rogapp/nrog/pages/home_page.dart';
|
||||||
|
import 'package:rogapp/provider/auth_provider.dart';
|
||||||
|
import 'package:rogapp/services/auth_service.dart';
|
||||||
|
import 'package:rogapp/widgets/c_form_text_field.dart';
|
||||||
|
import 'package:rogapp/widgets/c_password_text_filed.dart';
|
||||||
|
|
||||||
|
class AuthPage extends ConsumerStatefulWidget {
|
||||||
|
const AuthPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
ConsumerState<AuthPage> createState() => _AuthPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AuthPageState extends ConsumerState<AuthPage> {
|
||||||
|
final _formkey = GlobalKey<FormState>();
|
||||||
|
final FocusNode focusEmail = FocusNode();
|
||||||
|
final FocusNode focusPwd = FocusNode();
|
||||||
|
var _authMode = 'login';
|
||||||
|
bool _isLoginProgress = false;
|
||||||
|
|
||||||
|
final TextEditingController _emailTextEditingController =
|
||||||
|
TextEditingController();
|
||||||
|
final TextEditingController _passwordTextEditingController =
|
||||||
|
TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_emailTextEditingController.addListener(() => setState(() {}));
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
checkUser();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _submit() async {
|
||||||
|
setState(() {
|
||||||
|
_isLoginProgress = true;
|
||||||
|
});
|
||||||
|
if (_formkey.currentState!.validate()) {
|
||||||
|
AuthService authService = AuthService();
|
||||||
|
AuthUser? user = await authService.userLogin(
|
||||||
|
_emailTextEditingController.text,
|
||||||
|
_passwordTextEditingController.text);
|
||||||
|
if (user != null) {
|
||||||
|
setState(() {
|
||||||
|
ref.read(authUserStateProvider.notifier).addLogin(user);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
_isLoginProgress = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _submitToken(String token) async {
|
||||||
|
setState(() {
|
||||||
|
_isLoginProgress = true;
|
||||||
|
});
|
||||||
|
AuthService authService = AuthService();
|
||||||
|
AuthUser? user = await authService.userFromToken(token);
|
||||||
|
//////////////print("---user is ${user} ---");
|
||||||
|
if (user != null) {
|
||||||
|
setState(() {
|
||||||
|
_isLoginProgress = false;
|
||||||
|
ref.read(authUserStateProvider.notifier).addLogin(user);
|
||||||
|
});
|
||||||
|
} else {}
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkUser() async {
|
||||||
|
String? token =
|
||||||
|
await ref.read(authUserStateProvider.notifier).tokenFromDevice();
|
||||||
|
//////////////print("--- red token is ${token} ---");
|
||||||
|
if (token != null) {
|
||||||
|
await _submitToken(token);
|
||||||
|
final id = ref.read(authUserStateProvider).id;
|
||||||
|
if (id != null) {
|
||||||
|
if (context.mounted) {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push(MaterialPageRoute(builder: (ctx) => const HomePage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (ref.read(authUserStateProvider).id != null) {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push(MaterialPageRoute(builder: (ctx) => const HomePage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
resizeToAvoidBottomInset: true,
|
||||||
|
body: KeyboardDismisser(
|
||||||
|
gestures: const [
|
||||||
|
GestureType.onTap,
|
||||||
|
//GestureType.onVerticalDragDown
|
||||||
|
],
|
||||||
|
child: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
child: Stack(
|
||||||
|
clipBehavior: Clip.none,
|
||||||
|
children: [
|
||||||
|
buildAuthCard(),
|
||||||
|
buildLogo(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Positioned buildLogo() {
|
||||||
|
return Positioned(
|
||||||
|
top: -170,
|
||||||
|
left: MediaQuery.of(context).size.width / 2 - 100,
|
||||||
|
child: Center(
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
width: 200,
|
||||||
|
height: 200,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/appicon.png'),
|
||||||
|
fit: BoxFit.fill),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildAuthCard() {
|
||||||
|
return Card(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Form(
|
||||||
|
key: _formkey,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 40, bottom: 10, left: 12, right: 12),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(10.0),
|
||||||
|
child: CFormTextField(
|
||||||
|
cFocus: focusEmail,
|
||||||
|
cController: _emailTextEditingController),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
child: CPasswordTextField(
|
||||||
|
cController: _passwordTextEditingController,
|
||||||
|
cFocusNode: focusPwd,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
buildControlls(),
|
||||||
|
// SizedBox(height: MediaQuery.of(context).viewInsets.bottom,)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildControlls() {
|
||||||
|
if (_isLoginProgress) {
|
||||||
|
return const Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final usr = ref.read(authUserStateProvider);
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 12.0),
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: _submit,
|
||||||
|
child: Text(_authMode == "login" ? "Submit" : "Register",
|
||||||
|
style: GoogleFonts.lato(
|
||||||
|
color: Theme.of(context).colorScheme.secondary))),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
if (_authMode == 'login') {
|
||||||
|
_authMode = 'register';
|
||||||
|
} else {
|
||||||
|
_authMode = 'login';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
_authMode == "login"
|
||||||
|
? "${usr.id} Dont have account, please Register"
|
||||||
|
: "Already Registered, Login",
|
||||||
|
style: GoogleFonts.lato(
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
decoration: TextDecoration.underline,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
119
lib/nrog/pages/home_page.dart
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_map/plugin_api.dart';
|
||||||
|
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:latlong2/latlong.dart';
|
||||||
|
import 'package:rogapp/provider/map_state_provider.dart';
|
||||||
|
import 'package:rogapp/widgets/base_layer_widget.dart';
|
||||||
|
|
||||||
|
class HomePage extends ConsumerStatefulWidget {
|
||||||
|
const HomePage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
ConsumerState<HomePage> createState() => _HomePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HomePageState extends ConsumerState<HomePage> {
|
||||||
|
StreamSubscription? subscription;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final mapStateInstance = ref.watch(mapStateNotifierProvider);
|
||||||
|
return Scaffold(
|
||||||
|
//drawer: DrawerPage(),
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text("Rogaining"),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
//Get.toNamed(AppPages.HISTORY);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.history)),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
// final tk = indexController.currentUser[0]["token"];
|
||||||
|
// if (tk != null) {
|
||||||
|
// destinationController.fixMapBound(tk);
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.refresh)),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
//Get.toNamed(AppPages.SEARCH);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 32,
|
||||||
|
width: 75,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blue,
|
||||||
|
borderRadius: BorderRadius.circular(25),
|
||||||
|
),
|
||||||
|
child: const Center(
|
||||||
|
child: Icon(Icons.search),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
//CatWidget(indexController: indexController,),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
child: FlutterMap(
|
||||||
|
mapController: mapStateInstance.mapController,
|
||||||
|
options: MapOptions(
|
||||||
|
maxZoom: 18.4,
|
||||||
|
onMapReady: () {
|
||||||
|
// indexController.is_mapController_loaded.value = true;
|
||||||
|
subscription = mapStateInstance.mapController?.mapEventStream
|
||||||
|
.listen((MapEvent mapEvent) {
|
||||||
|
if (mapEvent is MapEventMoveStart) {
|
||||||
|
//print(DateTime.now().toString() + ' [MapEventMoveStart] START');
|
||||||
|
// do something
|
||||||
|
}
|
||||||
|
// if (mapEvent is MapEventMoveEnd &&
|
||||||
|
// indexController.currentUser.isEmpty) {
|
||||||
|
//print(DateTime.now().toString() + ' [MapEventMoveStart] END');
|
||||||
|
// indexController.loadLocationsBound();
|
||||||
|
//indexController.rogMapController!.move(c.center, c.zoom);
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
},
|
||||||
|
center: LatLng(37.15319600454702, 139.58765950528198),
|
||||||
|
//bounds:
|
||||||
|
zoom: 18,
|
||||||
|
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
|
||||||
|
|
||||||
|
onPositionChanged: (MapPosition pos, isvalue) {
|
||||||
|
//indexController.currentBound = [pos.bounds!];
|
||||||
|
},
|
||||||
|
// onTap: (_, __) => popupController
|
||||||
|
// .hideAllPopups(), // Hide popup when the map is tapped.
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
const BaseLayer(),
|
||||||
|
CurrentLocationLayer(
|
||||||
|
followOnLocationUpdate: FollowOnLocationUpdate.once,
|
||||||
|
turnOnHeadingUpdate: TurnOnHeadingUpdate.never,
|
||||||
|
style: const LocationMarkerStyle(
|
||||||
|
marker: DefaultLocationMarker(
|
||||||
|
child: Icon(
|
||||||
|
Icons.navigation,
|
||||||
|
color: Colors.yellowAccent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
markerSize: Size(27, 27),
|
||||||
|
markerDirection: MarkerDirection.heading,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const MarkerLayer(markers: [])
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
126
lib/nrog/pages/permission_page.dart
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
import 'package:rogapp/nrog/pages/auth_page.dart';
|
||||||
|
|
||||||
|
class PermissionPage extends StatefulWidget {
|
||||||
|
const PermissionPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PermissionPage> createState() => _PermissionPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PermissionPageState extends State<PermissionPage> {
|
||||||
|
bool hasNavigated = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
_checkPermissionStatus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_checkPermissionStatus() async {
|
||||||
|
PermissionStatus status = await Permission.location.status;
|
||||||
|
|
||||||
|
if (status.isGranted == false) {
|
||||||
|
if (context.mounted) {
|
||||||
|
showAlert(context);
|
||||||
|
}
|
||||||
|
} else if (status.isPermanentlyDenied) {
|
||||||
|
await requestPermission();
|
||||||
|
} else {
|
||||||
|
if (mounted) {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push(MaterialPageRoute(builder: (_) => const AuthPage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return const Scaffold(
|
||||||
|
body: Text(""),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void showAlert(BuildContext context) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => AlertDialog(
|
||||||
|
title: const Text('ロケーション許可'),
|
||||||
|
content: const SingleChildScrollView(
|
||||||
|
child: ListBody(
|
||||||
|
children: <Widget>[
|
||||||
|
Text('このアプリでは、位置情報の収集を行います。'),
|
||||||
|
Text(
|
||||||
|
'岐阜ナビアプリではチェックポイントの自動チェックインの機能を可能にするために、現在地のデータが収集されます。アプリを閉じている時や、使用していないときにも収集されます。位置情報は、個人を特定できない統計的な情報として、ユーザーの個人情報とは一切結びつかない形で送信されます。お知らせの配信、位置情報の利用を許可しない場合は、この後表示されるダイアログで「許可しない」を選択してください。'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
ElevatedButton(
|
||||||
|
child: const Text('OK'),
|
||||||
|
onPressed: () {
|
||||||
|
requestPermission();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> requestPermission() async {
|
||||||
|
PermissionStatus permission = await Permission.location.status;
|
||||||
|
if (permission == PermissionStatus.permanentlyDenied) {
|
||||||
|
showPermanentAlert();
|
||||||
|
} else {
|
||||||
|
PermissionStatus newPermission = await Permission.location.request();
|
||||||
|
if (newPermission != PermissionStatus.granted) {
|
||||||
|
exit(0);
|
||||||
|
} else {
|
||||||
|
if (context.mounted) {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push(MaterialPageRoute(builder: (_) => const AuthPage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showPermanentAlert() {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => AlertDialog(
|
||||||
|
title: const Text('無効'),
|
||||||
|
content: const SingleChildScrollView(
|
||||||
|
child: ListBody(
|
||||||
|
children: <Widget>[
|
||||||
|
Text('位置情報が無効になっています'),
|
||||||
|
Text(
|
||||||
|
'このアプリケーションへの位置情報アクセスが無効になっています。続行するには設定>プライバシーとセキュリティ>位置情報サービス>岐阜ナビ で有効にしてください。'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
ElevatedButton(
|
||||||
|
child: const Text('OK'),
|
||||||
|
onPressed: () async {
|
||||||
|
await openAppSettings().then(
|
||||||
|
(value) async {
|
||||||
|
if (value) {
|
||||||
|
if (await Permission
|
||||||
|
.location.status.isPermanentlyDenied ==
|
||||||
|
true &&
|
||||||
|
await Permission.location.status.isGranted ==
|
||||||
|
false) {
|
||||||
|
requestPermission(); /* opens app settings until permission is granted */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -57,9 +57,9 @@ class CameraPage extends StatelessWidget {
|
|||||||
await destinationController.makeCheckin(destination, true,
|
await destinationController.makeCheckin(destination, true,
|
||||||
destinationController.photos[0].path);
|
destinationController.photos[0].path);
|
||||||
Get.back();
|
Get.back();
|
||||||
destinationController.rogaining_counted.value = true;
|
destinationController.rogainingCounted.value = true;
|
||||||
destinationController.skip_gps = false;
|
destinationController.skipGps = false;
|
||||||
destinationController.is_photo_shoot.value = false;
|
destinationController.isPhotoShoot.value = false;
|
||||||
Get.snackbar("チェックインしました。",
|
Get.snackbar("チェックインしました。",
|
||||||
"${destination.sub_loc_id} : ${destination.name}");
|
"${destination.sub_loc_id} : ${destination.name}");
|
||||||
},
|
},
|
||||||
@ -69,8 +69,8 @@ class CameraPage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destinationController.is_at_goal.value &&
|
if (destinationController.isAtGoal.value &&
|
||||||
destinationController.is_in_rog.value) {
|
destinationController.isInRog.value) {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
@ -87,21 +87,21 @@ class CameraPage extends StatelessWidget {
|
|||||||
style:
|
style:
|
||||||
ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
print(
|
// print(
|
||||||
"----- user isss ${indexController.currentUser[0]} -----");
|
// "----- user isss ${indexController.currentUser[0]} -----");
|
||||||
|
|
||||||
settingGoal.value = true;
|
settingGoal.value = true;
|
||||||
try {
|
try {
|
||||||
int userId =
|
int userId =
|
||||||
indexController.currentUser[0]["user"]["id"];
|
indexController.currentUser[0]["user"]["id"];
|
||||||
//print("--- Pressed -----");
|
//print("--- Pressed -----");
|
||||||
String _team = indexController.currentUser[0]["user"]
|
String team = indexController.currentUser[0]["user"]
|
||||||
['team_name'];
|
['team_name'];
|
||||||
//print("--- _team : ${_team}-----");
|
//print("--- _team : ${_team}-----");
|
||||||
String _event_code = indexController.currentUser[0]
|
String eventCode = indexController.currentUser[0]
|
||||||
["user"]["event_code"];
|
["user"]["event_code"];
|
||||||
//print("--- _event_code : ${_event_code}-----");
|
//print("--- _event_code : ${_event_code}-----");
|
||||||
String _token =
|
String token =
|
||||||
indexController.currentUser[0]["token"];
|
indexController.currentUser[0]["token"];
|
||||||
//print("--- _token : ${_token}-----");
|
//print("--- _token : ${_token}-----");
|
||||||
DateTime now = DateTime.now();
|
DateTime now = DateTime.now();
|
||||||
@ -111,21 +111,21 @@ class CameraPage extends StatelessWidget {
|
|||||||
await ExternalService()
|
await ExternalService()
|
||||||
.makeGoal(
|
.makeGoal(
|
||||||
userId,
|
userId,
|
||||||
_token,
|
token,
|
||||||
_team,
|
team,
|
||||||
destinationController.photos[0].path,
|
destinationController.photos[0].path,
|
||||||
formattedDate,
|
formattedDate,
|
||||||
_event_code)
|
eventCode)
|
||||||
.then((value) {
|
.then((value) {
|
||||||
print(
|
// print(
|
||||||
"---called ext api ${value['status']} ------");
|
// "---called ext api ${value['status']} ------");
|
||||||
if (value['status'] == 'OK') {
|
if (value['status'] == 'OK') {
|
||||||
Get.back();
|
Get.back();
|
||||||
destinationController.skip_gps = false;
|
destinationController.skipGps = false;
|
||||||
Get.snackbar("目標が保存されました", "目標が正常に追加されました");
|
Get.snackbar("目標が保存されました", "目標が正常に追加されました");
|
||||||
destinationController.resetRogaining();
|
destinationController.resetRogaining();
|
||||||
} else {
|
} else {
|
||||||
print("---- status ${value['status']} ---- ");
|
//print("---- status ${value['status']} ---- ");
|
||||||
Get.snackbar("目標が追加されていません", "please_try_again");
|
Get.snackbar("目標が追加されていません", "please_try_again");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -136,15 +136,13 @@ class CameraPage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text("finish_goal".tr))
|
child: Text("finish_goal".tr))
|
||||||
: Container(
|
: const Center(
|
||||||
child: const Center(
|
child: CircularProgressIndicator(),
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
: Container())
|
: Container())
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else if (destinationController.is_in_rog.value &&
|
} else if (destinationController.isInRog.value &&
|
||||||
dbDest?.checkedin != null &&
|
dbDest?.checkedin != null &&
|
||||||
dbDest?.checkedin == true) {
|
dbDest?.checkedin == true) {
|
||||||
//make buypoint image
|
//make buypoint image
|
||||||
@ -162,16 +160,16 @@ class CameraPage extends StatelessWidget {
|
|||||||
? ElevatedButton(
|
? ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
print(
|
// print(
|
||||||
"##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
|
// "##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
|
||||||
await destinationController.makeBuyPoint(
|
await destinationController.makeBuyPoint(
|
||||||
destination!, destinationController.photos[0].path);
|
destination, destinationController.photos[0].path);
|
||||||
Get.back();
|
Get.back();
|
||||||
destinationController.rogaining_counted.value = true;
|
destinationController.rogainingCounted.value = true;
|
||||||
destinationController.skip_gps = false;
|
destinationController.skipGps = false;
|
||||||
destinationController.is_photo_shoot.value = false;
|
destinationController.isPhotoShoot.value = false;
|
||||||
Get.snackbar("お買い物加点を行いました。",
|
Get.snackbar("お買い物加点を行いました。",
|
||||||
"${destination!.sub_loc_id} : ${destination!.name}");
|
"${destination.sub_loc_id} : ${destination.name}");
|
||||||
},
|
},
|
||||||
child: const Text("レシートの写真を撮る"))
|
child: const Text("レシートの写真を撮る"))
|
||||||
: Container())
|
: Container())
|
||||||
@ -192,16 +190,16 @@ class CameraPage extends StatelessWidget {
|
|||||||
? ElevatedButton(
|
? ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
print(
|
// print(
|
||||||
"##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
|
// "##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
|
||||||
await destinationController.makeCheckin(
|
await destinationController.makeCheckin(
|
||||||
indexController.currentDestinationFeature[0],
|
indexController.currentDestinationFeature[0],
|
||||||
true,
|
true,
|
||||||
destinationController.photos[0].path);
|
destinationController.photos[0].path);
|
||||||
Get.back();
|
Get.back();
|
||||||
destinationController.rogaining_counted.value = true;
|
destinationController.rogainingCounted.value = true;
|
||||||
destinationController.skip_gps = false;
|
destinationController.skipGps = false;
|
||||||
destinationController.is_photo_shoot.value = false;
|
destinationController.isPhotoShoot.value = false;
|
||||||
Get.snackbar("チェックインした", "正常にチェックインしました");
|
Get.snackbar("チェックインした", "正常にチェックインしました");
|
||||||
},
|
},
|
||||||
child: const Text("チェックイン"))
|
child: const Text("チェックイン"))
|
||||||
@ -218,13 +216,13 @@ class CameraPage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (buyPointPhoto == true) {
|
if (buyPointPhoto == true) {
|
||||||
print("--- buy point camera ${destination.toString()}");
|
//print("--- buy point camera ${destination.toString()}");
|
||||||
return BuyPointCamera(destination: destination);
|
return BuyPointCamera(destination: destination);
|
||||||
} else if (destinationController.is_in_rog.value) {
|
} else if (destinationController.isInRog.value) {
|
||||||
print("--- in normal camera ${destination.toString()}");
|
//print("--- in normal camera ${destination.toString()}");
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: destinationController.is_in_rog.value &&
|
appBar: destinationController.isInRog.value &&
|
||||||
destinationController.rogaining_counted.value == true
|
destinationController.rogainingCounted.value == true
|
||||||
? AppBar(
|
? AppBar(
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: destination.cp == -1
|
title: destination.cp == -1
|
||||||
@ -297,25 +295,23 @@ class StartRogaining extends StatelessWidget {
|
|||||||
"Not started yet".tr,
|
"Not started yet".tr,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Container(
|
body: Center(
|
||||||
child: Center(
|
child: Column(
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: [
|
||||||
children: [
|
Text("You have not started rogaining yet.".tr,
|
||||||
Text("You have not started rogaining yet.".tr,
|
style: const TextStyle(fontSize: 24)),
|
||||||
style: const TextStyle(fontSize: 24)),
|
const SizedBox(
|
||||||
const SizedBox(
|
height: 40.0,
|
||||||
height: 40.0,
|
),
|
||||||
),
|
ElevatedButton(
|
||||||
ElevatedButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
Get.back();
|
||||||
Get.back();
|
destinationController.skipGps = false;
|
||||||
destinationController.skip_gps = false;
|
},
|
||||||
},
|
child: const Text("Back"),
|
||||||
child: const Text("Back"),
|
),
|
||||||
),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -404,7 +400,7 @@ class BuyPointCamera extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Obx(() => Row(
|
Obx(() => Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@ -414,17 +410,17 @@ class BuyPointCamera extends StatelessWidget {
|
|||||||
child: destinationController.photos.isNotEmpty
|
child: destinationController.photos.isNotEmpty
|
||||||
? const Text("再撮影")
|
? const Text("再撮影")
|
||||||
: const Text("撮影")),
|
: const Text("撮影")),
|
||||||
const SizedBox(width: 10,),
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await destinationController.cancelBuyPoint(
|
await destinationController
|
||||||
destination);
|
.cancelBuyPoint(destination);
|
||||||
Get.back();
|
Get.back();
|
||||||
destinationController.rogaining_counted.value =
|
destinationController.rogainingCounted.value = true;
|
||||||
true;
|
destinationController.skipGps = false;
|
||||||
destinationController.skip_gps = false;
|
destinationController.isPhotoShoot.value = false;
|
||||||
destinationController.is_photo_shoot.value =
|
|
||||||
false;
|
|
||||||
},
|
},
|
||||||
child: const Text("買い物なし"))
|
child: const Text("買い物なし"))
|
||||||
],
|
],
|
||||||
@ -449,11 +445,10 @@ class BuyPointCamera extends StatelessWidget {
|
|||||||
destination,
|
destination,
|
||||||
destinationController.photos[0].path);
|
destinationController.photos[0].path);
|
||||||
Get.back();
|
Get.back();
|
||||||
destinationController.rogaining_counted.value =
|
destinationController.rogainingCounted.value =
|
||||||
true;
|
true;
|
||||||
destinationController.skip_gps = false;
|
destinationController.skipGps = false;
|
||||||
destinationController.is_photo_shoot.value =
|
destinationController.isPhotoShoot.value = false;
|
||||||
false;
|
|
||||||
Get.snackbar("お買い物加点を行いました",
|
Get.snackbar("お買い物加点を行いました",
|
||||||
"${destination.sub_loc_id} : ${destination.name}");
|
"${destination.sub_loc_id} : ${destination.name}");
|
||||||
},
|
},
|
||||||
|
|||||||
@ -13,150 +13,170 @@ class ChangePasswordPage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
leading:
|
leading: IconButton(
|
||||||
IconButton( onPressed: (){
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.arrow_back_ios,
|
||||||
|
size: 20,
|
||||||
|
color: Colors.black,
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
body:
|
body: SizedBox(
|
||||||
SizedBox(
|
width: double.infinity,
|
||||||
width: double.infinity,
|
child: Column(
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
children: [
|
||||||
children: [
|
Column(
|
||||||
Column(
|
children: [
|
||||||
children: [
|
Column(
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
child: Text("change_password".tr, style: const TextStyle(fontSize: 24.0),),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 30,),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 40
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
makeInput(label: "old_password".tr, controller: oldPasswordController),
|
Text(
|
||||||
makeInput(label: "new_password".tr, controller: newPasswordController, obsureText: true),
|
"change_password".tr,
|
||||||
|
style: const TextStyle(fontSize: 24.0),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 30,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
Padding(
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
child: Column(
|
||||||
child: Container(
|
children: [
|
||||||
padding: const EdgeInsets.only(top: 3,left: 3),
|
makeInput(
|
||||||
decoration: BoxDecoration(
|
label: "old_password".tr,
|
||||||
borderRadius: BorderRadius.circular(40),
|
controller: oldPasswordController),
|
||||||
),
|
makeInput(
|
||||||
child: Obx((() =>
|
label: "new_password".tr,
|
||||||
indexController.is_loading == true ? MaterialButton(
|
controller: newPasswordController,
|
||||||
minWidth: double.infinity,
|
obsureText: true),
|
||||||
height:60,
|
],
|
||||||
onPressed: (){
|
|
||||||
|
|
||||||
},
|
|
||||||
color: Colors.grey[400],
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(40)
|
|
||||||
),
|
|
||||||
child: const CircularProgressIndicator(),
|
|
||||||
) :
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
MaterialButton(
|
|
||||||
minWidth: double.infinity,
|
|
||||||
height:60,
|
|
||||||
onPressed: (){
|
|
||||||
if(oldPasswordController.text.isEmpty || newPasswordController.text.isEmpty){
|
|
||||||
Get.snackbar(
|
|
||||||
"no_values".tr,
|
|
||||||
"values_required".tr,
|
|
||||||
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
|
||||||
snackPosition: SnackPosition.TOP,
|
|
||||||
duration: const Duration(milliseconds: 800),
|
|
||||||
backgroundColor: Colors.yellow,
|
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
indexController.is_loading.value = true;
|
|
||||||
indexController.changePassword(oldPasswordController.text, newPasswordController.text, context);
|
|
||||||
//indexController.login(oldPasswordController.text, newPasswordController.text, context);
|
|
||||||
},
|
|
||||||
color: Colors.indigoAccent[400],
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(40)
|
|
||||||
),
|
|
||||||
child: const Text("ログイン",style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0,),
|
|
||||||
|
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
Padding(
|
||||||
),
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
const SizedBox(height: 20,),
|
child: Container(
|
||||||
const Row(
|
padding: const EdgeInsets.only(top: 3, left: 3),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
decoration: BoxDecoration(
|
||||||
children: [
|
borderRadius: BorderRadius.circular(40),
|
||||||
|
),
|
||||||
],
|
child: Obx(
|
||||||
)
|
(() => indexController.isLoading.value == true
|
||||||
],
|
? MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
),
|
height: 60,
|
||||||
],
|
onPressed: () {},
|
||||||
),
|
color: Colors.grey[400],
|
||||||
)
|
shape: RoundedRectangleBorder(
|
||||||
);
|
borderRadius: BorderRadius.circular(40)),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
)
|
||||||
|
: Column(
|
||||||
|
children: [
|
||||||
|
MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 60,
|
||||||
|
onPressed: () {
|
||||||
|
if (oldPasswordController
|
||||||
|
.text.isEmpty ||
|
||||||
|
newPasswordController
|
||||||
|
.text.isEmpty) {
|
||||||
|
Get.snackbar(
|
||||||
|
"no_values".tr,
|
||||||
|
"values_required".tr,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.assistant_photo_outlined,
|
||||||
|
size: 40.0,
|
||||||
|
color: Colors.blue),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
duration: const Duration(
|
||||||
|
milliseconds: 800),
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
indexController.isLoading.value = true;
|
||||||
|
indexController.changePassword(
|
||||||
|
oldPasswordController.text,
|
||||||
|
newPasswordController.text,
|
||||||
|
context);
|
||||||
|
//indexController.login(oldPasswordController.text, newPasswordController.text, context);
|
||||||
|
},
|
||||||
|
color: Colors.indigoAccent[400],
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: const Text(
|
||||||
|
"ログイン",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white70),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10.0,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
const Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget makeInput({label, required TextEditingController controller, obsureText = false}){
|
Widget makeInput(
|
||||||
return Column(
|
{label, required TextEditingController controller, obsureText = false}) {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
return Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Text(label,style:const TextStyle(
|
children: [
|
||||||
fontSize: 15,
|
Text(
|
||||||
fontWeight: FontWeight.w400,
|
label,
|
||||||
color: Colors.black87
|
style: const TextStyle(
|
||||||
),),
|
fontSize: 15, fontWeight: FontWeight.w400, color: Colors.black87),
|
||||||
const SizedBox(height: 5,),
|
),
|
||||||
TextField(
|
const SizedBox(
|
||||||
controller: controller,
|
height: 5,
|
||||||
obscureText: obsureText,
|
),
|
||||||
decoration: InputDecoration(
|
TextField(
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
|
controller: controller,
|
||||||
enabledBorder: OutlineInputBorder(
|
obscureText: obsureText,
|
||||||
borderSide: BorderSide(
|
decoration: InputDecoration(
|
||||||
color: (Colors.grey[400])!,
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: (Colors.grey[400])!,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: (Colors.grey[400])!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: (Colors.grey[400])!
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(
|
||||||
),
|
height: 30.0,
|
||||||
const SizedBox(height: 30.0,)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -10,10 +9,11 @@ import 'package:rogapp/pages/index/index_controller.dart';
|
|||||||
import 'package:rogapp/routes/app_pages.dart';
|
import 'package:rogapp/routes/app_pages.dart';
|
||||||
import 'package:rogapp/widgets/destination_widget.dart';
|
import 'package:rogapp/widgets/destination_widget.dart';
|
||||||
|
|
||||||
class DestnationPage extends StatelessWidget {
|
class XDestnationPage extends StatelessWidget {
|
||||||
DestnationPage({Key? key}) : super(key: key);
|
XDestnationPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
final DestinationController destinationController = Get.find<DestinationController>();
|
final DestinationController destinationController =
|
||||||
|
Get.find<DestinationController>();
|
||||||
|
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
|
|
||||||
@ -26,33 +26,49 @@ class DestnationPage extends StatelessWidget {
|
|||||||
permission = await Geolocator.requestPermission();
|
permission = await Geolocator.requestPermission();
|
||||||
}
|
}
|
||||||
Position position = await Geolocator.getCurrentPosition(
|
Position position = await Geolocator.getCurrentPosition(
|
||||||
desiredAccuracy: LocationAccuracy.high, forceAndroidLocationManager: true);
|
desiredAccuracy: LocationAccuracy.high,
|
||||||
indexController.rogMapController.move(LatLng(position.latitude, position.longitude), 14);
|
forceAndroidLocationManager: true);
|
||||||
|
indexController.rogMapController
|
||||||
|
.move(LatLng(position.latitude, position.longitude), 14);
|
||||||
}
|
}
|
||||||
|
|
||||||
Image getImage(int index){
|
Image getImage(int index) {
|
||||||
if(destinationController.destinations[index].photos == null || destinationController.destinations[index].photos == ""){
|
if (destinationController.destinations[index].photos == null ||
|
||||||
|
destinationController.destinations[index].photos == "") {
|
||||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||||
}
|
} else {
|
||||||
else{
|
return Image(
|
||||||
return Image(image: NetworkImage(destinationController.destinations[index].photos!));
|
image:
|
||||||
|
NetworkImage(destinationController.destinations[index].photos!));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getRoutingImage(int route){
|
Widget getRoutingImage(int route) {
|
||||||
switch (route) {
|
switch (route) {
|
||||||
case 0:
|
case 0:
|
||||||
return const Image(image: AssetImage('assets/images/p4_9_man.png'), width: 35.0,);
|
return const Image(
|
||||||
|
image: AssetImage('assets/images/p4_9_man.png'),
|
||||||
|
width: 35.0,
|
||||||
|
);
|
||||||
case 1:
|
case 1:
|
||||||
return const Image(image: AssetImage('assets/images/p4_8_car.png'), width: 35.0,);
|
return const Image(
|
||||||
|
image: AssetImage('assets/images/p4_8_car.png'),
|
||||||
|
width: 35.0,
|
||||||
|
);
|
||||||
case 2:
|
case 2:
|
||||||
return const Image(image: AssetImage('assets/images/p4_10_train.png'), width: 35.0,);
|
return const Image(
|
||||||
|
image: AssetImage('assets/images/p4_10_train.png'),
|
||||||
|
width: 35.0,
|
||||||
|
);
|
||||||
default:
|
default:
|
||||||
return const Image(image: AssetImage('assets/images/p4_9_man.png'), width: 35.0,);
|
return const Image(
|
||||||
|
image: AssetImage('assets/images/p4_9_man.png'),
|
||||||
|
width: 35.0,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
@ -60,149 +76,177 @@ class DestnationPage extends StatelessWidget {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
drawer: DrawerPage(),
|
drawer: DrawerPage(),
|
||||||
bottomNavigationBar: BottomAppBar(
|
bottomNavigationBar: BottomAppBar(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left:13.0),
|
padding: const EdgeInsets.only(left: 13.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
child: Obx((() => getRoutingImage(destinationController.travelMode.value))),
|
child: Obx((() => getRoutingImage(
|
||||||
onTap: (){
|
destinationController.travelMode.value))),
|
||||||
Get.bottomSheet(
|
onTap: () {
|
||||||
Obx(() =>
|
Get.bottomSheet(
|
||||||
ListView(
|
Obx(
|
||||||
children: [
|
() => ListView(
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.only(top:30.0, bottom: 30),
|
Padding(
|
||||||
child: Center(child: Text("select_travel_mode".tr, style: const TextStyle(fontSize: 22.0, color:Colors.red, fontWeight:FontWeight.bold),),),
|
padding: const EdgeInsets.only(
|
||||||
),
|
top: 30.0, bottom: 30),
|
||||||
ListTile(
|
child: Center(
|
||||||
selected: destinationController.travelMode == 0 ? true : false,
|
child: Text(
|
||||||
selectedTileColor: Colors.amber.shade200,
|
"select_travel_mode".tr,
|
||||||
leading: const Image(image: AssetImage('assets/images/p4_9_man.png'),),
|
style: const TextStyle(
|
||||||
title: Text("walking".tr),
|
fontSize: 22.0,
|
||||||
onTap:(){
|
color: Colors.red,
|
||||||
destinationController.travelMode.value = 0;
|
fontWeight: FontWeight.bold),
|
||||||
destinationController.PopulateDestinations();
|
),
|
||||||
Get.back();
|
),
|
||||||
},
|
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
selected: destinationController.travelMode == 1 ? true : false,
|
selected:
|
||||||
selectedTileColor: Colors.amber.shade200,
|
destinationController.travelMode.value ==
|
||||||
leading: const Image(image: AssetImage('assets/images/p4_8_car.png'),),
|
0
|
||||||
title: Text("driving".tr),
|
? true
|
||||||
onTap:(){
|
: false,
|
||||||
destinationController.travelMode.value = 1;
|
selectedTileColor: Colors.amber.shade200,
|
||||||
destinationController.PopulateDestinations();
|
leading: const Image(
|
||||||
Get.back();
|
image: AssetImage(
|
||||||
},
|
'assets/images/p4_9_man.png'),
|
||||||
|
),
|
||||||
|
title: Text("walking".tr),
|
||||||
|
onTap: () {
|
||||||
|
destinationController.travelMode.value = 0;
|
||||||
|
destinationController
|
||||||
|
.populateDestinations();
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
// ListTile(
|
ListTile(
|
||||||
// selected: destinationController.travelMode == 2 ? true : false,
|
selected:
|
||||||
// selectedTileColor: Colors.amber.shade200,
|
destinationController.travelMode.value ==
|
||||||
// leading: Image(image: AssetImage('assets/images/p4_10_train.png'),),
|
1
|
||||||
// title: Text("transit".tr),
|
? true
|
||||||
// onTap:(){
|
: false,
|
||||||
// destinationController.travelMode.value = 2;
|
selectedTileColor: Colors.amber.shade200,
|
||||||
// destinationController.PopulateDestinations();
|
leading: const Image(
|
||||||
// Get.back();
|
image: AssetImage(
|
||||||
// },
|
'assets/images/p4_8_car.png'),
|
||||||
// ),
|
),
|
||||||
],
|
title: Text("driving".tr),
|
||||||
|
onTap: () {
|
||||||
|
destinationController.travelMode.value = 1;
|
||||||
|
destinationController
|
||||||
|
.populateDestinations();
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// ListTile(
|
||||||
|
// selected: destinationController.travelMode == 2 ? true : false,
|
||||||
|
// selectedTileColor: Colors.amber.shade200,
|
||||||
|
// leading: Image(image: AssetImage('assets/images/p4_10_train.png'),),
|
||||||
|
// title: Text("transit".tr),
|
||||||
|
// onTap:(){
|
||||||
|
// destinationController.travelMode.value = 2;
|
||||||
|
// destinationController.PopulateDestinations();
|
||||||
|
// Get.back();
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
isScrollControlled: false,
|
||||||
isScrollControlled:false,
|
backgroundColor: Colors.white,
|
||||||
backgroundColor: Colors.white,
|
);
|
||||||
);
|
//destinationController.PopulateDestinations();
|
||||||
//destinationController.PopulateDestinations();
|
}),
|
||||||
}
|
|
||||||
),
|
|
||||||
)
|
|
||||||
,
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.travel_explore, size: 35,),
|
|
||||||
onPressed: (){
|
|
||||||
indexController.switchPage(AppPages.INITIAL);
|
|
||||||
}
|
|
||||||
),
|
),
|
||||||
],
|
IconButton(
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.travel_explore,
|
||||||
|
size: 35,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
indexController.switchPage(AppPages.INITIAL);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
floatingActionButton: FloatingActionButton(
|
||||||
floatingActionButton: FloatingActionButton(
|
onPressed: () {
|
||||||
onPressed: (){
|
|
||||||
//print("######");
|
//print("######");
|
||||||
indexController.toggleDestinationMode();
|
indexController.toggleDestinationMode();
|
||||||
},
|
},
|
||||||
tooltip: 'Increment',
|
tooltip: 'Increment',
|
||||||
child: Obx(() =>
|
|
||||||
indexController.desination_mode == 1 ?
|
|
||||||
const Image(image: AssetImage('assets/images/list2.png'))
|
|
||||||
:
|
|
||||||
const Image(image: AssetImage('assets/images/map.png'))
|
|
||||||
),
|
|
||||||
elevation: 4.0,
|
elevation: 4.0,
|
||||||
|
child: Obx(() => indexController.desinationMode.value == 1
|
||||||
|
? const Image(image: AssetImage('assets/images/list2.png'))
|
||||||
|
: const Image(image: AssetImage('assets/images/map.png'))),
|
||||||
),
|
),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
floatingActionButtonLocation:
|
||||||
appBar:AppBar(
|
FloatingActionButtonLocation.centerDocked,
|
||||||
automaticallyImplyLeading: true,
|
appBar: AppBar(
|
||||||
title: Text("app_title".tr),
|
automaticallyImplyLeading: true,
|
||||||
actions: [
|
title: Text("app_title".tr),
|
||||||
InkWell(
|
actions: [
|
||||||
onTap: (){
|
InkWell(
|
||||||
Get.toNamed(AppPages.CAMERA_PAGE);
|
onTap: () {
|
||||||
},
|
Get.toNamed(AppPages.CAMERA_PAGE);
|
||||||
child: destinationController.is_in_rog == true ?
|
},
|
||||||
Image.asset("assets/images/basic-walking.gif",height: 10.0,)
|
child: destinationController.isInRog.value == true
|
||||||
:
|
? Image.asset(
|
||||||
destinationController.is_at_goal == true ?
|
"assets/images/basic-walking.gif",
|
||||||
IconButton(
|
height: 10.0,
|
||||||
onPressed:(){Get.toNamed(AppPages.CAMERA_PAGE);},
|
)
|
||||||
icon: const Icon(Icons.assistant_photo),
|
: destinationController.isAtGoal.value == true
|
||||||
)
|
? IconButton(
|
||||||
:
|
onPressed: () {
|
||||||
IconButton(
|
Get.toNamed(AppPages.CAMERA_PAGE);
|
||||||
onPressed:(){Get.toNamed(AppPages.CAMERA_PAGE);},
|
},
|
||||||
icon: const Icon(Icons.accessibility),
|
icon: const Icon(Icons.assistant_photo),
|
||||||
),
|
)
|
||||||
),
|
: IconButton(
|
||||||
// Obx(() =>
|
onPressed: () {
|
||||||
// Text(indexController.connectionStatusName.value)
|
Get.toNamed(AppPages.CAMERA_PAGE);
|
||||||
// ),
|
},
|
||||||
Obx(() =>
|
icon: const Icon(Icons.accessibility),
|
||||||
ToggleButtons(
|
),
|
||||||
|
),
|
||||||
|
// Obx(() =>
|
||||||
|
// Text(indexController.connectionStatusName.value)
|
||||||
|
// ),
|
||||||
|
Obx(
|
||||||
|
() => ToggleButtons(
|
||||||
disabledColor: Colors.grey.shade200,
|
disabledColor: Colors.grey.shade200,
|
||||||
selectedColor: Colors.red,
|
selectedColor: Colors.red,
|
||||||
children: const <Widget>[
|
onPressed: (int index) {
|
||||||
Icon(Icons.explore, size: 35.0,
|
destinationController.isGpsSelected.value =
|
||||||
)],
|
!destinationController.isGpsSelected.value;
|
||||||
onPressed: (int index) {
|
if (destinationController.isGpsSelected.value) {
|
||||||
destinationController.is_gps_selected.value = !destinationController.is_gps_selected.value;
|
destinationController.chekcs = 0;
|
||||||
if(destinationController.is_gps_selected.value){
|
destinationController.skipGps = false;
|
||||||
destinationController.chekcs = 0;
|
//destinationController.resetRogaining();
|
||||||
destinationController.skip_gps = false;
|
}
|
||||||
//destinationController.resetRogaining();
|
},
|
||||||
}
|
isSelected: [destinationController.isGpsSelected.value],
|
||||||
},
|
children: const <Widget>[
|
||||||
isSelected: [destinationController.is_gps_selected.value],
|
Icon(
|
||||||
|
Icons.explore,
|
||||||
|
size: 35.0,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
// IconButton(onPressed: (){
|
||||||
// IconButton(onPressed: (){
|
// showCurrentPosition();
|
||||||
// showCurrentPosition();
|
// },
|
||||||
// },
|
// icon: Icon(Icons.location_on_outlined))
|
||||||
// icon: Icon(Icons.location_on_outlined))
|
],
|
||||||
],
|
),
|
||||||
),
|
body: Obx(() => indexController.desinationMode.value == 0
|
||||||
body: Obx(() =>
|
? DestinationWidget()
|
||||||
indexController.desination_mode.value == 0 ?
|
: DestinationMapPage())),
|
||||||
DestinationWidget():
|
|
||||||
DestinationMapPage()
|
|
||||||
)
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class DestinationMapPage extends StatelessWidget {
|
|||||||
final PopupController _popupLayerController = PopupController();
|
final PopupController _popupLayerController = PopupController();
|
||||||
|
|
||||||
List<LatLng>? getPoints() {
|
List<LatLng>? getPoints() {
|
||||||
print("##### --- route point ${indexController.routePoints.length}");
|
//print("##### --- route point ${indexController.routePoints.length}");
|
||||||
List<LatLng> pts = [];
|
List<LatLng> pts = [];
|
||||||
for (PointLatLng p in indexController.routePoints) {
|
for (PointLatLng p in indexController.routePoints) {
|
||||||
LatLng l = LatLng(p.latitude, p.longitude);
|
LatLng l = LatLng(p.latitude, p.longitude);
|
||||||
@ -39,14 +39,14 @@ class DestinationMapPage extends StatelessWidget {
|
|||||||
int index = -1;
|
int index = -1;
|
||||||
for (int i = 0; i < destinationController.destinations.length; i++) {
|
for (int i = 0; i < destinationController.destinations.length; i++) {
|
||||||
Destination d = destinationController.destinations[i];
|
Destination d = destinationController.destinations[i];
|
||||||
print("^^^^ $d ^^^^");
|
//print("^^^^ $d ^^^^");
|
||||||
Marker m = Marker(
|
Marker m = Marker(
|
||||||
point: LatLng(d.lat!, d.lon!),
|
point: LatLng(d.lat!, d.lon!),
|
||||||
anchorPos: AnchorPos.align(AnchorAlign.center),
|
anchorPos: AnchorPos.align(AnchorAlign.center),
|
||||||
builder: (cts) {
|
builder: (cts) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
print("-- Destination is --- ${d.name} ------");
|
//print("-- Destination is --- ${d.name} ------");
|
||||||
if (indexController.currentDestinationFeature.isNotEmpty) {
|
if (indexController.currentDestinationFeature.isNotEmpty) {
|
||||||
indexController.currentDestinationFeature.clear();
|
indexController.currentDestinationFeature.clear();
|
||||||
}
|
}
|
||||||
@ -58,9 +58,11 @@ class DestinationMapPage extends StatelessWidget {
|
|||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
constraints: BoxConstraints.loose(
|
constraints: BoxConstraints.loose(
|
||||||
Size(Get.width, Get.height * 0.75)),
|
Size(Get.width, Get.height * 0.75)),
|
||||||
builder: ((context) => BottomSheetNew(destination: d,))).whenComplete(() {
|
builder: ((context) => BottomSheetNew(
|
||||||
print("---- set skip gps to false -----");
|
destination: d,
|
||||||
destinationController.skip_gps = false;
|
))).whenComplete(() {
|
||||||
|
//print("---- set skip gps to false -----");
|
||||||
|
destinationController.skipGps = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -118,18 +120,18 @@ class DestinationMapPage extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 0.0),
|
padding: const EdgeInsets.only(top: 0.0),
|
||||||
//child: TravelMap(),
|
//child: TravelMap(),
|
||||||
child: TravelMap(),
|
child: travelMap(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
FlutterMap TravelMap() {
|
FlutterMap travelMap() {
|
||||||
return FlutterMap(
|
return FlutterMap(
|
||||||
mapController: indexController.rogMapController,
|
mapController: indexController.rogMapController,
|
||||||
options: MapOptions(
|
options: MapOptions(
|
||||||
onMapReady: () {
|
onMapReady: () {
|
||||||
indexController.is_rog_mapcontroller_loaded.value = true;
|
indexController.isRogMapcontrollerLoaded.value = true;
|
||||||
subscription = indexController.rogMapController.mapEventStream
|
subscription = indexController.rogMapController.mapEventStream
|
||||||
.listen((MapEvent mapEvent) {
|
.listen((MapEvent mapEvent) {
|
||||||
if (mapEvent is MapEventMoveStart) {}
|
if (mapEvent is MapEventMoveStart) {}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class DrawerPage extends StatelessWidget {
|
|||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
|
|
||||||
void _launchURL(url) async {
|
void _launchURL(url) async {
|
||||||
if (!await launch(url)) throw 'Could not launch $url';
|
if (!await launchUrl(url)) throw 'Could not launch $url';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -115,8 +115,8 @@ class DrawerPage extends StatelessWidget {
|
|||||||
leading: const Icon(Icons.delete_forever),
|
leading: const Icon(Icons.delete_forever),
|
||||||
title: Text("delete_account".tr),
|
title: Text("delete_account".tr),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
String _token = indexController.currentUser[0]['token'];
|
String token = indexController.currentUser[0]['token'];
|
||||||
AuthService.deleteUser(_token).then((value) {
|
AuthService.deleteUser(token).then((value) {
|
||||||
if (value.isNotEmpty) {
|
if (value.isNotEmpty) {
|
||||||
indexController.logout();
|
indexController.logout();
|
||||||
Get.toNamed(AppPages.TRAVEL);
|
Get.toNamed(AppPages.TRAVEL);
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class _HistoryPageState extends State<HistoryPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text("通過履歴"),
|
title: const Text("通過履歴"),
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -32,37 +32,45 @@ class _HistoryPageState extends State<HistoryPage> {
|
|||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${snapshot.error} occurred',
|
'${snapshot.error} occurred',
|
||||||
style: TextStyle(fontSize: 18),
|
style: const TextStyle(fontSize: 18),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (snapshot.hasData) {
|
} else if (snapshot.hasData) {
|
||||||
final dests = snapshot.data;
|
final dests = snapshot.data;
|
||||||
if (dests!.length > 0) {
|
if (dests!.isNotEmpty) {
|
||||||
print("----- history -----");
|
//print("----- history -----");
|
||||||
return Container(
|
return SizedBox(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: dests.length,
|
itemCount: dests.length,
|
||||||
itemBuilder: (ctx, index) {
|
itemBuilder: (ctx, index) {
|
||||||
print("--- photo ${dests[index].checkin_image!} ----");
|
//print("--- photo ${dests[index].checkin_image!} ----");
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: CustomWidget(title: dests[index].name!,
|
child: CustomWidget(
|
||||||
subtitle: "${dests[index].sub_loc_id} : ${dests[index].name}",
|
title: dests[index].name!,
|
||||||
image1: dests[index].checkin_image != null ? Image.file(File(dests[index].checkin_image!)) : null,
|
subtitle:
|
||||||
image2: dests[index].buypoint_image != null ? Image.file(File(dests[index].buypoint_image!)) : null,
|
"${dests[index].sub_loc_id} : ${dests[index].name}",
|
||||||
),
|
image1: dests[index].checkin_image != null
|
||||||
|
? Image.file(
|
||||||
|
File(dests[index].checkin_image!))
|
||||||
|
: null,
|
||||||
|
image2:
|
||||||
|
dests[index].buypoint_image != null
|
||||||
|
? Image.file(File(
|
||||||
|
dests[index].buypoint_image!))
|
||||||
|
: null,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
return Center(child: Text("No checkin yet"));
|
return const Center(child: Text("No checkin yet"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (snapshot.connectionState ==
|
} else if (snapshot.connectionState ==
|
||||||
ConnectionState.waiting) {
|
ConnectionState.waiting) {
|
||||||
return Center(
|
return const Center(
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -81,7 +89,8 @@ class CustomWidget extends StatelessWidget {
|
|||||||
final String title;
|
final String title;
|
||||||
final String subtitle;
|
final String subtitle;
|
||||||
|
|
||||||
CustomWidget({
|
const CustomWidget({
|
||||||
|
super.key,
|
||||||
this.image1,
|
this.image1,
|
||||||
this.image2,
|
this.image2,
|
||||||
required this.title,
|
required this.title,
|
||||||
@ -93,30 +102,44 @@ class CustomWidget extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SizedBox(
|
||||||
width: 104, // 50 (width of each image) + 2 (space between images) + 2*1 (padding on both sides)
|
width:
|
||||||
|
104, // 50 (width of each image) + 2 (space between images) + 2*1 (padding on both sides)
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (image1 != null) SizedBox(width: 50, height: 100, child: image1,),
|
if (image1 != null)
|
||||||
if (image1 != null && image2 != null) SizedBox(width: 2),
|
SizedBox(
|
||||||
if (image2 != null) SizedBox(width: 50, height: 100, child: image2,),
|
width: 50,
|
||||||
|
height: 100,
|
||||||
|
child: image1,
|
||||||
|
),
|
||||||
|
if (image1 != null && image2 != null) const SizedBox(width: 2),
|
||||||
|
if (image2 != null)
|
||||||
|
SizedBox(
|
||||||
|
width: 50,
|
||||||
|
height: 100,
|
||||||
|
child: image2,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
style:
|
||||||
maxLines: null, // Allows the text to wrap onto an unlimited number of lines
|
const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||||
|
maxLines:
|
||||||
|
null, // Allows the text to wrap onto an unlimited number of lines
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
subtitle,
|
subtitle,
|
||||||
style: TextStyle(fontSize: 16),
|
style: const TextStyle(fontSize: 16),
|
||||||
maxLines: null, // Allows the text to wrap onto an unlimited number of lines
|
maxLines:
|
||||||
|
null, // Allows the text to wrap onto an unlimited number of lines
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
import 'package:rogapp/pages/index/index_controller.dart';
|
||||||
|
|
||||||
class IndexBinding extends Bindings {
|
class IndexBinding extends Bindings {
|
||||||
@override
|
@override
|
||||||
void dependencies() {
|
void dependencies() {
|
||||||
Get.put<IndexController>(IndexController());
|
Get.put<IndexController>(IndexController());
|
||||||
|
Get.put<DestinationController>(DestinationController());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,30 +40,29 @@ class IndexController extends GetxController {
|
|||||||
List<PointLatLng> routePoints = <PointLatLng>[].obs;
|
List<PointLatLng> routePoints = <PointLatLng>[].obs;
|
||||||
var routePointLenght = 0.obs;
|
var routePointLenght = 0.obs;
|
||||||
|
|
||||||
double current_lat = 0.0, current_lon = 0.0;
|
double currentLat = 0.0, currentLon = 0.0;
|
||||||
|
|
||||||
var is_loading = false.obs;
|
var isLoading = false.obs;
|
||||||
|
|
||||||
var is_mapController_loaded = false.obs;
|
var isRogMapcontrollerLoaded = false.obs;
|
||||||
var is_rog_mapcontroller_loaded = false.obs;
|
|
||||||
|
|
||||||
var is_custom_area_selected = false.obs;
|
var isCustomAreaSelected = false.obs;
|
||||||
|
|
||||||
MapController mapController = MapController();
|
MapController mapController = MapController();
|
||||||
MapController rogMapController = MapController();
|
MapController rogMapController = MapController();
|
||||||
|
|
||||||
String? userToken;
|
String? userToken;
|
||||||
|
|
||||||
|
// mode = 0 is map mode, mode = 1 list mode
|
||||||
var mode = 0.obs;
|
var mode = 0.obs;
|
||||||
|
|
||||||
// master mode, rog or selection
|
// master mode, rog or selection
|
||||||
var rog_mode = 1.obs;
|
var rogMode = 1.obs;
|
||||||
|
|
||||||
var desination_mode = 1.obs;
|
var desinationMode = 1.obs;
|
||||||
|
|
||||||
bool showPopup = true;
|
bool showPopup = true;
|
||||||
|
|
||||||
|
|
||||||
String dropdownValue = "9";
|
String dropdownValue = "9";
|
||||||
String subDropdownValue = "-1";
|
String subDropdownValue = "-1";
|
||||||
String areaDropdownValue = "-1";
|
String areaDropdownValue = "-1";
|
||||||
@ -76,133 +75,134 @@ class IndexController extends GetxController {
|
|||||||
final Connectivity _connectivity = Connectivity();
|
final Connectivity _connectivity = Connectivity();
|
||||||
late StreamSubscription<ConnectivityResult> _connectivitySubscription;
|
late StreamSubscription<ConnectivityResult> _connectivitySubscription;
|
||||||
|
|
||||||
void toggleMode(){
|
void toggleMode() {
|
||||||
if(mode.value==0){
|
if (mode.value == 0) {
|
||||||
mode += 1;
|
mode += 1;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
mode -= 1;
|
mode -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void toggleDestinationMode(){
|
void toggleDestinationMode() {
|
||||||
if(desination_mode.value==0){
|
if (desinationMode.value == 0) {
|
||||||
desination_mode.value += 1;
|
desinationMode.value += 1;
|
||||||
}
|
} else {
|
||||||
else{
|
desinationMode.value -= 1;
|
||||||
desination_mode.value -= 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void switchPage(String page){
|
void switchPage(String page) {
|
||||||
//print("######## ${currentUser[0]["user"]["id"]}");
|
////print("######## ${currentUser[0]["user"]["id"]}");
|
||||||
switch (page) {
|
switch (page) {
|
||||||
case AppPages.INITIAL :{
|
case AppPages.INITIAL:
|
||||||
rog_mode.value = 0;
|
{
|
||||||
print("-- rog mode is ctrl is ${rog_mode.value}");
|
rogMode.value = 0;
|
||||||
Get.toNamed(page);
|
//print("-- rog mode is ctrl is ${rog_mode.value}");
|
||||||
}
|
Get.toNamed(page);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case AppPages.TRAVEL : {
|
case AppPages.TRAVEL:
|
||||||
rog_mode.value = 1;
|
{
|
||||||
//Get.back();
|
rogMode.value = 1;
|
||||||
Get.off(DestnationPage(), binding: DestinationBinding());
|
//Get.back();
|
||||||
|
//Get.off(DestnationPage(), binding: DestinationBinding());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AppPages.LOGIN :{
|
case AppPages.LOGIN:
|
||||||
rog_mode.value = 2;
|
{
|
||||||
Get.toNamed(page);
|
rogMode.value = 2;
|
||||||
}
|
Get.toNamed(page);
|
||||||
break;
|
}
|
||||||
default:{
|
break;
|
||||||
rog_mode.value = 0;
|
default:
|
||||||
Get.toNamed(AppPages.INITIAL);
|
{
|
||||||
}
|
rogMode.value = 0;
|
||||||
|
Get.toNamed(AppPages.INITIAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
_ever = ever(rog_mode, (_) => print("$_ has been changed (ever)"));
|
//_ever = ever(rogMode, (_) => print("$_ has been changed (ever)"));
|
||||||
|
|
||||||
if(perfectures.isEmpty){
|
// if (perfectures.isEmpty) {
|
||||||
PerfectureService.loadPerfectures().then((value){
|
// PerfectureService.loadPerfectures().then((value) {
|
||||||
perfectures.add(value);
|
// perfectures.add(value);
|
||||||
loadAreaFor("9");
|
// loadAreaFor("9");
|
||||||
|
|
||||||
//loadSubPerfFor("9");
|
// //loadSubPerfFor("9");
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
_connectivitySubscription = _connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
_connectivitySubscription =
|
||||||
|
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
_connectivitySubscription.cancel();
|
_connectivitySubscription.cancel();
|
||||||
super.onClose();
|
super.onClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _updateConnectionStatus(ConnectivityResult result) async {
|
Future<void> _updateConnectionStatus(ConnectivityResult result) async {
|
||||||
connectionStatus = result;
|
connectionStatus = result;
|
||||||
connectionStatusName.value = result.name;
|
connectionStatusName.value = result.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initConnectivity() async {
|
Future<void> initConnectivity() async {
|
||||||
late ConnectivityResult result;
|
late ConnectivityResult result;
|
||||||
// Platform messages may fail, so we use a try/catch PlatformException.
|
// Platform messages may fail, so we use a try/catch PlatformException.
|
||||||
try {
|
try {
|
||||||
result = await _connectivity.checkConnectivity();
|
result = await _connectivity.checkConnectivity();
|
||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (_) {
|
||||||
print('Couldn\'t check connectivity status --- $e');
|
//print('Couldn\'t check connectivity status --- $e');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _updateConnectionStatus(result);
|
return _updateConnectionStatus(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
LatLngBounds boundsFromLatLngList(List<LatLng> list) {
|
LatLngBounds boundsFromLatLngList(List<LatLng> list) {
|
||||||
double? x0, x1, y0, y1;
|
double? x0, x1, y0, y1;
|
||||||
for (LatLng latLng in list) {
|
for (LatLng latLng in list) {
|
||||||
if (x0 == null || x1 == null || y0 == null || y1 == null) {
|
if (x0 == null || x1 == null || y0 == null || y1 == null) {
|
||||||
x0 = x1 = latLng.latitude;
|
x0 = x1 = latLng.latitude;
|
||||||
y0 = y1 = latLng.longitude;
|
y0 = y1 = latLng.longitude;
|
||||||
} else {
|
} else {
|
||||||
if (latLng.latitude > x1) x1 = latLng.latitude;
|
if (latLng.latitude > x1) x1 = latLng.latitude;
|
||||||
if (latLng.latitude < x0) x0 = latLng.latitude;
|
if (latLng.latitude < x0) x0 = latLng.latitude;
|
||||||
if (latLng.longitude > y1) y1 = latLng.longitude;
|
if (latLng.longitude > y1) y1 = latLng.longitude;
|
||||||
if (latLng.longitude < y0) y0 = latLng.longitude;
|
if (latLng.longitude < y0) y0 = latLng.longitude;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return LatLngBounds(LatLng(x1!, y1!), LatLng(x0!, y0!));
|
||||||
}
|
}
|
||||||
|
|
||||||
return LatLngBounds(LatLng(x1!, y1!), LatLng(x0!, y0!));
|
List<LatLng> getLocationsList() {
|
||||||
}
|
List<LatLng> locs = [];
|
||||||
|
for (int i = 0; i <= locations[0].collection.length - 1; i++) {
|
||||||
|
GeoJsonMultiPoint p =
|
||||||
|
locations[0].collection[i].geometry as GeoJsonMultiPoint;
|
||||||
|
|
||||||
|
LatLng latLng = LatLng(p.geoSerie!.geoPoints[0].latitude,
|
||||||
List<LatLng> getLocationsList(){
|
p.geoSerie!.geoPoints[0].longitude);
|
||||||
List<LatLng> locs = [];
|
locs.add(latLng);
|
||||||
for(int i=0; i<= locations[0].collection.length - 1; i++){
|
}
|
||||||
GeoJsonMultiPoint p = locations[0].collection[i].geometry as GeoJsonMultiPoint;
|
return locs;
|
||||||
|
|
||||||
LatLng latLng = LatLng(p.geoSerie!.geoPoints[0].latitude, p.geoSerie!.geoPoints[0].longitude);
|
|
||||||
locs.add(latLng);
|
|
||||||
}
|
}
|
||||||
return locs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void login(String email, String password, BuildContext context) {
|
void login(String email, String password, BuildContext context) {
|
||||||
AuthService.login(email, password).then((value) {
|
AuthService.login(email, password).then((value) {
|
||||||
print("------- logged in user details ######## $value ###### --------");
|
//print("------- logged in user details ######## $value ###### --------");
|
||||||
if (value.isNotEmpty) {
|
if (value.isNotEmpty) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
print("--------- user details login ----- $value");
|
//print("--------- user details login ----- $value");
|
||||||
changeUser(value);
|
changeUser(value);
|
||||||
} else {
|
} else {
|
||||||
is_loading.value = false;
|
isLoading.value = false;
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Failed",
|
"Failed",
|
||||||
"User login failed, please try again.",
|
"User login failed, please try again.",
|
||||||
@ -216,502 +216,182 @@ List<LatLng> getLocationsList(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void changePassword(String oldpassword, String newpassword, BuildContext context){
|
void changePassword(
|
||||||
String _token = currentUser[0]['token'];
|
String oldpassword, String newpassword, BuildContext context) {
|
||||||
//print("------- change password ######## ${currentUser[0]['token']} ###### --------");
|
String token = currentUser[0]['token'];
|
||||||
AuthService.changePassword(oldpassword, newpassword, _token).then((value){
|
////print("------- change password ######## ${currentUser[0]['token']} ###### --------");
|
||||||
print("------- change password ######## $value ###### --------");
|
AuthService.changePassword(oldpassword, newpassword, token).then((value) {
|
||||||
if(value.isNotEmpty){
|
////print("------- change password ######## $value ###### --------");
|
||||||
is_loading.value = false;
|
if (value.isNotEmpty) {
|
||||||
|
isLoading.value = false;
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
if(rog_mode.value == 1){
|
if (rogMode.value == 1) {
|
||||||
switchPage(AppPages.TRAVEL);
|
switchPage(AppPages.TRAVEL);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
switchPage(AppPages.INITIAL);
|
switchPage(AppPages.INITIAL);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
'failed'.tr,
|
'failed'.tr,
|
||||||
'password_change_failed_please_try_again'.tr,
|
'password_change_failed_please_try_again'.tr,
|
||||||
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
|
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
|
||||||
snackPosition: SnackPosition.TOP,
|
snackPosition: SnackPosition.TOP,
|
||||||
duration: const Duration(milliseconds: 800),
|
duration: const Duration(milliseconds: 800),
|
||||||
backgroundColor: Colors.yellow,
|
backgroundColor: Colors.yellow,
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
void logout() async {
|
||||||
is_loading.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void logout() async{
|
|
||||||
locations.clear();
|
locations.clear();
|
||||||
DatabaseHelper db = DatabaseHelper.instance;
|
DatabaseHelper db = DatabaseHelper.instance;
|
||||||
db.deleteAllDestinations().then((value){
|
db.deleteAllDestinations().then((value) {
|
||||||
DestinationController destinationController = Get.find<DestinationController>();
|
DestinationController destinationController =
|
||||||
destinationController.PopulateDestinations();
|
Get.find<DestinationController>();
|
||||||
|
destinationController.populateDestinations();
|
||||||
});
|
});
|
||||||
currentUser.clear();
|
currentUser.clear();
|
||||||
cats.clear();
|
cats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void register(String email, String password, BuildContext context){
|
void register(String email, String password, BuildContext context) {
|
||||||
AuthService.register(email, password).then((value){
|
AuthService.register(email, password).then((value) {
|
||||||
if(value.isNotEmpty){
|
if (value.isNotEmpty) {
|
||||||
currentUser.clear();
|
currentUser.clear();
|
||||||
currentUser.add(value);
|
currentUser.add(value);
|
||||||
is_loading.value = false;
|
isLoading.value = false;
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
loadUserDetails();
|
|
||||||
Get.toNamed(AppPages.INITIAL);
|
Get.toNamed(AppPages.INITIAL);
|
||||||
}else{
|
} else {
|
||||||
is_loading.value = false;
|
isLoading.value = false;
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
'failed'.tr,
|
'failed'.tr,
|
||||||
'user_registration_failed_please_try_again'.tr,
|
'user_registration_failed_please_try_again'.tr,
|
||||||
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
|
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
|
||||||
snackPosition: SnackPosition.TOP,
|
snackPosition: SnackPosition.TOP,
|
||||||
duration: const Duration(milliseconds: 800),
|
duration: const Duration(milliseconds: 800),
|
||||||
backgroundColor: Colors.yellow,
|
backgroundColor: Colors.yellow,
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
);
|
);
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void makeAction(BuildContext context){
|
|
||||||
int userId = currentUser[0]["user"]["id"] as int;
|
|
||||||
int locationId = currentFeature[0].properties!["location_id"] as int;
|
|
||||||
bool wanttogo = currentAction[0][0]["wanttogo"];
|
|
||||||
bool like = currentAction[0][0]["like"];
|
|
||||||
bool checkin = currentAction[0][0]["checkin"];
|
|
||||||
if(userId > 0){
|
|
||||||
ActionService.makeAction(userId, locationId, wanttogo, like, checkin).then((value){
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
String getCatText(){
|
|
||||||
String _cat = 'all'.tr;
|
|
||||||
if(currentUser.isNotEmpty){
|
|
||||||
Map<String, dynamic> _urs = currentUser[0];
|
|
||||||
print('-- is_rogaining :-- ${_urs['user']['is_rogaining']} ------');
|
|
||||||
if(_urs['user']['is_rogaining'] == true){
|
|
||||||
_cat = 'rogaining'.tr;
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
_cat = 'sight_seeing'.tr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return _cat;
|
|
||||||
}
|
|
||||||
|
|
||||||
void loadCatsv2(){
|
|
||||||
dynamic initVal = {'category':getCatText()};
|
|
||||||
LatLngBounds bounds = mapController.bounds!;
|
|
||||||
if(bounds.southWest != null && bounds.northEast != null ){
|
|
||||||
CatService.loadCats(bounds.southWest!.latitude, bounds.southWest!.longitude, bounds.northWest.latitude, bounds.northWest.longitude, bounds.northEast!.latitude, bounds.northEast!.longitude, bounds.southEast.latitude, bounds.southEast.longitude).then((value) {
|
|
||||||
cats.clear();
|
|
||||||
cats.add(initVal);
|
|
||||||
for(dynamic cat in value!){
|
|
||||||
if(cat['category'] != null){
|
|
||||||
cats.add(cat!);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void loadCatForCity(String city){
|
|
||||||
dynamic initVal = {'category':getCatText()};
|
|
||||||
LatLngBounds bounds = mapController.bounds!;
|
|
||||||
if(bounds.southWest != null && bounds.northEast != null ){
|
|
||||||
CatService.loadCatByCity(city).then((value) {
|
|
||||||
cats.clear();
|
|
||||||
cats.add(initVal);
|
|
||||||
for(dynamic cat in value!){
|
|
||||||
if(cat['category'] != null){
|
|
||||||
cats.add(cat!);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void refreshLocationForCat(){
|
|
||||||
loadLocationsBound();
|
|
||||||
// if(subDropdownValue == "-1"){
|
|
||||||
// LocationService.loadLocationsFor(dropdownValue, currentCat[0]).then((value){
|
|
||||||
// locations.clear();
|
|
||||||
// locations.add(value!);
|
|
||||||
// is_loading.value = false;
|
|
||||||
// });
|
|
||||||
// print("loading main------");
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// LocationService.loadLocationsSubFor(subDropdownValue, currentCat[0]).then((value){
|
|
||||||
// locations.clear();
|
|
||||||
// locations.add(value!);
|
|
||||||
// is_loading.value = false;
|
|
||||||
// });
|
|
||||||
// print("loading sub------");
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
void loadAreaFor(String perf){
|
|
||||||
areas.clear();
|
|
||||||
dynamic initVal = {'id':'-1', 'area_nm':'----'};
|
|
||||||
PerfectureService.loadGifuAreas(perf).then((value){
|
|
||||||
value!.add(initVal);
|
|
||||||
areas.add(value);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadUserDetails(){
|
|
||||||
if(currentUser.isNotEmpty){
|
|
||||||
int userId = currentUser[0]["user"]["id"] as int;
|
|
||||||
AuthService.UserDetails(userId).then((value){
|
|
||||||
print("--------- user details ----- $value");
|
|
||||||
if(value != null && value.isNotEmpty){
|
|
||||||
bool paid = value[0]["paid"] as bool;
|
|
||||||
if(paid){
|
|
||||||
loadCustomAreas();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void saveToDevice(String val) async {
|
void saveToDevice(String val) async {
|
||||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
await prefs.setString("user_token", val);
|
await prefs.setString("user_token", val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeUser(Map<String, dynamic> value, {bool replace = true}) {
|
void changeUser(Map<String, dynamic> value, {bool replace = true}) {
|
||||||
print("---- change user to ${value} -----");
|
////print("---- change user to $value -----");
|
||||||
currentUser.clear();
|
currentUser.clear();
|
||||||
currentUser.add(value);
|
currentUser.add(value);
|
||||||
if(replace){
|
if (replace) {
|
||||||
saveToDevice(currentUser[0]["token"]);
|
saveToDevice(currentUser[0]["token"]);
|
||||||
}
|
}
|
||||||
is_loading.value = false;
|
isLoading.value = false;
|
||||||
loadUserDetails();
|
|
||||||
loadLocationsBound();
|
loadLocationsBound();
|
||||||
cats.clear();
|
|
||||||
if (currentFeature.isNotEmpty) {
|
|
||||||
getAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentUser.isNotEmpty) {
|
if (currentUser.isNotEmpty) {
|
||||||
rog_mode.value = 0;
|
rogMode.value = 0;
|
||||||
} else {
|
} else {
|
||||||
rog_mode.value = 1;
|
rogMode.value = 1;
|
||||||
}
|
}
|
||||||
|
Get.toNamed(AppPages.INITIAL);
|
||||||
if (rog_mode.value == 1) {
|
|
||||||
switchPage(AppPages.TRAVEL);
|
|
||||||
} else {
|
|
||||||
switchPage(AppPages.INITIAL);
|
|
||||||
}
|
|
||||||
//Get.toNamed(AppPages.INITIAL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadUserDetailsForToken(String token) async {
|
loadUserDetailsForToken(String token) async {
|
||||||
AuthService.userForToken(token).then((value) {
|
AuthService.userForToken(token).then((value) {
|
||||||
print("----token val-- $value ------");
|
////print("----token val-- $value ------");
|
||||||
if(value![0]["user"].isEmpty){
|
if (value![0]["user"].isEmpty) {
|
||||||
Get.toNamed(AppPages.LOGIN);
|
Get.toNamed(AppPages.LOGIN);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
changeUser(value[0], replace:false);
|
|
||||||
print("--------- user details ----- $value");
|
|
||||||
// if (value != null && value.isNotEmpty) {
|
|
||||||
// bool paid = value[0]["paid"] as bool;
|
|
||||||
// if (paid) {
|
|
||||||
// loadCustomAreas();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void loadCustomAreas(){
|
|
||||||
customAreas.clear();
|
|
||||||
PerfectureService.loadCustomAreas().then((value){
|
|
||||||
print("--- loading custom areas $value");
|
|
||||||
customAreas.add(value);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void loadSubPerfFor(String perf){
|
|
||||||
subPerfs.clear();
|
|
||||||
dynamic initVal = {'id':'-1', 'adm2_ja':'----'};
|
|
||||||
PerfectureService.loadSubPerfectures(perf).then((value){
|
|
||||||
value!.add(initVal);
|
|
||||||
subPerfs.add(value);
|
|
||||||
subDropdownValue = getSubInitialVal();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
String getSubInitialVal(){
|
|
||||||
int min = 0;
|
|
||||||
if(subPerfs.isNotEmpty){
|
|
||||||
min = int.parse(subPerfs[0][0]['id'].toString());
|
|
||||||
for(var sub in subPerfs[0]){
|
|
||||||
int x = int.parse(sub['id'].toString()); // as int;
|
|
||||||
if(x < min){
|
|
||||||
min = x;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
changeUser(value[0], replace: false);
|
||||||
return min.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void loadLocationforPerf(String perf, MapController mapController) async {
|
|
||||||
String cat = currentCat.isNotEmpty == true ? currentCat[0] : "";
|
|
||||||
print(currentCat);
|
|
||||||
// LocationService.loadLocationsFor(perf, cat).then((value){
|
|
||||||
// locations.clear();
|
|
||||||
// locations.add(value!);
|
|
||||||
// mapController.fitBounds(currentBound[0]);
|
|
||||||
// });
|
|
||||||
locations.clear();
|
|
||||||
mapController.fitBounds(currentBound[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void loadLocationforSubPerf(String subperf, MapController mapController) async {
|
|
||||||
String cat = currentCat.isNotEmpty == true ? currentCat[0] : "";
|
|
||||||
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
|
|
||||||
cat = "";
|
|
||||||
}
|
|
||||||
LocationService.loadLocationsSubFor(subperf, cat).then((value){
|
|
||||||
locations.clear();
|
|
||||||
locations.add(value!);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadCustomLocation(String customarea) async {
|
void loadLocationsBound() {
|
||||||
String cat = currentCat.isNotEmpty == true ? currentCat[0] : "";
|
if (isCustomAreaSelected.value == true) {
|
||||||
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
|
|
||||||
cat = "";
|
|
||||||
}
|
|
||||||
print("----- $customarea");
|
|
||||||
LocationService.loadCustomLocations(customarea, cat).then((value){
|
|
||||||
locations.clear();
|
|
||||||
locations.add(value!);
|
|
||||||
List<LatLng> locs = getLocationsList();
|
|
||||||
LatLngBounds bounds = boundsFromLatLngList(locs);
|
|
||||||
mapController.fitBounds(bounds);
|
|
||||||
setBound(bounds);
|
|
||||||
Future.delayed(const Duration(microseconds: 400), () {
|
|
||||||
mapController.fitBounds(bounds);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void loadLocationsBound(){
|
|
||||||
if(is_custom_area_selected.value == true){
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
locations.clear();
|
locations.clear();
|
||||||
String cat = currentCat.isNotEmpty ? currentCat[0] : "";
|
String cat = currentCat.isNotEmpty ? currentCat[0] : "";
|
||||||
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
|
if (currentCat.isNotEmpty && currentCat[0] == "-all-") {
|
||||||
cat = "";
|
cat = "";
|
||||||
}
|
}
|
||||||
LatLngBounds bounds = mapController.bounds!;
|
LatLngBounds bounds = mapController.bounds!;
|
||||||
currentBound.clear();
|
currentBound.clear();
|
||||||
currentBound.add(bounds);
|
currentBound.add(bounds);
|
||||||
//print(currentCat);
|
////print(currentCat);
|
||||||
if(bounds.southWest != null && bounds.northEast != null ){
|
LocationService.loadLocationsBound(
|
||||||
LocationService.loadLocationsBound(bounds.southWest!.latitude, bounds.southWest!.longitude, bounds.northWest.latitude, bounds.northWest.longitude, bounds.northEast!.latitude, bounds.northEast!.longitude, bounds.southEast.latitude, bounds.southEast.longitude, cat).then((value){
|
bounds.southWest.latitude,
|
||||||
//print("---value length ------ ${value!.collection.length}");
|
bounds.southWest.longitude,
|
||||||
if(value == null){
|
bounds.northWest.latitude,
|
||||||
|
bounds.northWest.longitude,
|
||||||
|
bounds.northEast.latitude,
|
||||||
|
bounds.northEast.longitude,
|
||||||
|
bounds.southEast.latitude,
|
||||||
|
bounds.southEast.longitude,
|
||||||
|
cat)
|
||||||
|
.then((value) {
|
||||||
|
////print("---value length ------ ${value!.collection.length}");
|
||||||
|
if (value == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(value.collection.isEmpty){
|
if (value.collection.isEmpty) {
|
||||||
if(showPopup == false) {
|
if (showPopup == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Too many Points",
|
"Too many Points",
|
||||||
"please zoom in",
|
"please zoom in",
|
||||||
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
icon: const Icon(Icons.assistant_photo_outlined,
|
||||||
snackPosition: SnackPosition.TOP,
|
size: 40.0, color: Colors.blue),
|
||||||
duration: const Duration(milliseconds: 800),
|
snackPosition: SnackPosition.TOP,
|
||||||
backgroundColor: Colors.yellow,
|
duration: const Duration(milliseconds: 800),
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
backgroundColor: Colors.yellow,
|
||||||
);
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
|
);
|
||||||
showPopup = false;
|
showPopup = false;
|
||||||
//Get.showSnackbar(GetSnackBar(message: "Too many points, please zoom in",));
|
//Get.showSnackbar(GetSnackBar(message: "Too many points, please zoom in",));
|
||||||
}
|
}
|
||||||
if(value.collection.isNotEmpty){
|
if (value.collection.isNotEmpty) {
|
||||||
//print("---- added---");
|
////print("---- added---");
|
||||||
locations.add(value);
|
locations.add(value);
|
||||||
loadCatsv2();
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setBound(LatLngBounds bounds){
|
void setBound(LatLngBounds bounds) {
|
||||||
currentBound.clear();
|
currentBound.clear();
|
||||||
currentBound.add(bounds);
|
currentBound.add(bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zoomtoMainPerf(String id){
|
void zoomtoSubPerf(String id) {
|
||||||
|
////print("zooooom");
|
||||||
|
|
||||||
PerfectureService.getMainPerfExt(id).then((value){
|
PerfectureService.getSubExt(id).then((value) {
|
||||||
LatLng lat1 = LatLng(value![1], value[0]);
|
LatLng lat1 = LatLng(value![1], value[0]);
|
||||||
LatLng lat2 = LatLng(value[3], value[2]);
|
LatLng lat2 = LatLng(value[3], value[2]);
|
||||||
LatLngBounds bound = LatLngBounds(lat1, lat2);
|
LatLngBounds bound = LatLngBounds(lat1, lat2);
|
||||||
mapController.fitBounds(bound);
|
mapController.fitBounds(bound);
|
||||||
setBound(bound);
|
setBound(bound);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void zoomtoSubPerf(String id){
|
GeoJsonFeature? getFeatureForLatLong(double lat, double long) {
|
||||||
|
if (locations.isNotEmpty) {
|
||||||
print("zooooom");
|
for (GeoJsonFeature i in locations[0].collection) {
|
||||||
|
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
||||||
PerfectureService.getSubExt(id).then((value){
|
if (p.geoSerie!.geoPoints[0].latitude == lat &&
|
||||||
LatLng lat1 = LatLng(value![1], value[0]);
|
p.geoSerie!.geoPoints[0].longitude == long) {
|
||||||
LatLng lat2 = LatLng(value[3], value[2]);
|
return i;
|
||||||
LatLngBounds bound = LatLngBounds(lat1, lat2);
|
|
||||||
mapController.fitBounds(bound);
|
|
||||||
setBound(bound);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void populateForPerf(String perf, MapController mapController){
|
|
||||||
loadSubPerfFor(perf);
|
|
||||||
loadLocationforPerf(perf, mapController);
|
|
||||||
zoomtoMainPerf(perf);
|
|
||||||
is_loading.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void populateForSubPerf(String subperf, MapController mapController){
|
|
||||||
//subDropdownValue = subperf;
|
|
||||||
loadLocationforSubPerf(subperf, mapController);
|
|
||||||
zoomtoSubPerf(subperf);
|
|
||||||
is_loading.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void populateSubPerForArea(String area, MapController mapController){
|
|
||||||
loadSubPerfFor(area);
|
|
||||||
//loadCustomLocation("cus", mapController);
|
|
||||||
//zoomtoSubPerf(subperf);
|
|
||||||
is_loading.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GeoJsonFeature? getFeatureForLatLong(double lat, double long){
|
|
||||||
if(locations.isNotEmpty){
|
|
||||||
for(GeoJsonFeature i in locations[0].collection){
|
|
||||||
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
|
||||||
if(p.geoSerie!.geoPoints[0].latitude == lat && p.geoSerie!.geoPoints[0].longitude == long){
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
void getAction(){
|
|
||||||
//print(currentUser[0]["user"]["id"]);
|
|
||||||
//print(currentFeature[0].properties!["location_id"]);
|
|
||||||
if(currentUser.isEmpty){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int userId = currentUser[0]["user"]["id"] as int;
|
|
||||||
print("---- loc id ${currentFeature[0].properties}");
|
|
||||||
int locationId = currentFeature[0].properties!["location_id"] as int;
|
|
||||||
ActionService.userAction(userId, locationId).then((value){
|
|
||||||
print("------$value");
|
|
||||||
if(value != null && value.isNotEmpty){
|
|
||||||
currentAction.clear();
|
|
||||||
currentAction.add(value);
|
|
||||||
print("------${currentAction[0]}");
|
|
||||||
}else{
|
|
||||||
List<dynamic> initval = [{"user": userId, "location": locationId, "wanttogo": false, "like": false, "checkin": false}];
|
|
||||||
currentAction.clear();
|
|
||||||
currentAction.add(initval);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void makeNext(GeoJsonFeature fs){
|
|
||||||
|
|
||||||
if(rog_mode == 1){
|
|
||||||
DestinationController destinationController = Get.find<DestinationController>();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
GeoJsonFeature<GeoJsonMultiPoint> pt = fs as GeoJsonFeature<GeoJsonMultiPoint>;
|
|
||||||
|
|
||||||
for(int i=0; i<= locations[0].collection.length - 1; i++){
|
|
||||||
GeoJsonMultiPoint p = locations[0].collection[i].geometry as GeoJsonMultiPoint;
|
|
||||||
|
|
||||||
if(p.geoSerie!.geoPoints[0].latitude == pt.geometry!.geoSerie!.geoPoints[0].latitude && p.geoSerie!.geoPoints[0].longitude == pt.geometry!.geoSerie!.geoPoints[0].longitude ){
|
|
||||||
|
|
||||||
if(currentFeature.isNotEmpty){
|
|
||||||
currentFeature.clear();
|
|
||||||
}
|
|
||||||
if(i >= locations[0].collection.length - 1 ){
|
|
||||||
currentFeature.add(locations[0].collection[0]);
|
|
||||||
getAction();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
currentFeature.add(locations[0].collection[i + 1]);
|
|
||||||
getAction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void makePrevious(GeoJsonFeature fs){
|
|
||||||
|
|
||||||
if(rog_mode == 1){
|
|
||||||
DestinationController destinationController = Get.find<DestinationController>();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
GeoJsonFeature<GeoJsonMultiPoint> pt = fs as GeoJsonFeature<GeoJsonMultiPoint>;
|
|
||||||
|
|
||||||
for(int i=0; i<= locations[0].collection.length - 1; i++){
|
|
||||||
GeoJsonMultiPoint p = locations[0].collection[i].geometry as GeoJsonMultiPoint;
|
|
||||||
|
|
||||||
if(p.geoSerie!.geoPoints[0].latitude == pt.geometry!.geoSerie!.geoPoints[0].latitude && p.geoSerie!.geoPoints[0].longitude == pt.geometry!.geoSerie!.geoPoints[0].longitude ){
|
|
||||||
|
|
||||||
if(currentFeature.isNotEmpty){
|
|
||||||
currentFeature.clear();
|
|
||||||
}
|
|
||||||
if(i == 0 ){
|
|
||||||
currentFeature.add(locations[0].collection[locations[0].collection.length -1]);
|
|
||||||
getAction();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
currentFeature.add(locations[0].collection[i - 1]);
|
|
||||||
getAction();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -21,14 +21,6 @@ class IndexPage extends GetView<IndexController> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
drawer: DrawerPage(),
|
drawer: DrawerPage(),
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
// automaticallyImplyLeading: false,
|
|
||||||
// leading: IconButton(
|
|
||||||
// icon: Icon(Icons.arrow_back_ios),
|
|
||||||
// onPressed: (){
|
|
||||||
// indexController.switchPage(AppPages.TRAVEL);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
//automaticallyImplyLeading: false,
|
|
||||||
title: Text("add_location".tr),
|
title: Text("add_location".tr),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
@ -63,124 +55,86 @@ class IndexPage extends GetView<IndexController> {
|
|||||||
//CatWidget(indexController: indexController,),
|
//CatWidget(indexController: indexController,),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
bottomNavigationBar: BottomAppBar(
|
// bottomNavigationBar: BottomAppBar(
|
||||||
child: Row(
|
// child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
Obx(() =>
|
// Obx(
|
||||||
destinationController.is_in_rog.value == true ?
|
// () => destinationController.isInRog.value == true
|
||||||
IconButton(onPressed: (){}, icon: Icon(Icons.run_circle, size: 44, color: Colors.green,))
|
// ? IconButton(
|
||||||
:
|
// onPressed: () {},
|
||||||
IconButton(onPressed: (){}, icon: Icon(Icons.run_circle, size: 44, color: Colors.black12,)),
|
// icon: const Icon(
|
||||||
),
|
// Icons.run_circle,
|
||||||
Padding(
|
// size: 44,
|
||||||
padding:
|
// color: Colors.green,
|
||||||
const EdgeInsets.only(right: 10.0, top: 4.0, bottom: 4.0),
|
// ))
|
||||||
child: InkWell(
|
// : IconButton(
|
||||||
child:
|
// onPressed: () {},
|
||||||
Obx(() => destinationController.is_gps_selected == true
|
// icon: const Icon(
|
||||||
? Padding(
|
// Icons.run_circle,
|
||||||
padding: const EdgeInsets.only(
|
// size: 44,
|
||||||
right: 10.0, top: 4.0, bottom: 4.0),
|
// color: Colors.black12,
|
||||||
child: InkWell(
|
// )),
|
||||||
child: const Image(
|
// ),
|
||||||
image: AssetImage(
|
// Padding(
|
||||||
'assets/images/route3_off.png'),
|
// padding:
|
||||||
width: 35,
|
// const EdgeInsets.only(right: 10.0, top: 4.0, bottom: 4.0),
|
||||||
height: 35,
|
// child: InkWell(
|
||||||
),
|
// child: Obx(() => destinationController
|
||||||
onTap: () {
|
// .isGpsSelected.value ==
|
||||||
//indexController.switchPage(AppPages.TRAVEL);
|
// true
|
||||||
},
|
// ? Padding(
|
||||||
),
|
// padding: const EdgeInsets.only(
|
||||||
)
|
// right: 10.0, top: 4.0, bottom: 4.0),
|
||||||
: Padding(
|
// child: InkWell(
|
||||||
padding: const EdgeInsets.only(
|
// child: const Image(
|
||||||
right: 10.0, top: 4.0, bottom: 4.0),
|
// image:
|
||||||
child: InkWell(
|
// AssetImage('assets/images/route3_off.png'),
|
||||||
child: const Image(
|
// width: 35,
|
||||||
image: AssetImage(
|
// height: 35,
|
||||||
'assets/images/route2_on.png'),
|
// ),
|
||||||
width: 35,
|
// onTap: () {
|
||||||
height: 35,
|
// //indexController.switchPage(AppPages.TRAVEL);
|
||||||
),
|
// },
|
||||||
onTap: () {
|
// ),
|
||||||
//indexController.switchPage(AppPages.TRAVEL);
|
// )
|
||||||
},
|
// : Padding(
|
||||||
),
|
// padding: const EdgeInsets.only(
|
||||||
))),
|
// right: 10.0, top: 4.0, bottom: 4.0),
|
||||||
),
|
// child: InkWell(
|
||||||
],
|
// child: const Image(
|
||||||
),
|
// image:
|
||||||
),
|
// AssetImage('assets/images/route2_on.png'),
|
||||||
|
// width: 35,
|
||||||
|
// height: 35,
|
||||||
|
// ),
|
||||||
|
// onTap: () {
|
||||||
|
// //indexController.switchPage(AppPages.TRAVEL);
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ))),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
indexController.toggleMode();
|
indexController.toggleMode();
|
||||||
if (indexController.currentCat.isNotEmpty) {
|
|
||||||
print(indexController.currentCat[0].toString());
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
tooltip: 'Increment',
|
elevation: 1.0,
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => indexController.mode == 0
|
() => indexController.mode.value == 0
|
||||||
? const Image(image: AssetImage('assets/images/list2.png'))
|
? const Image(image: AssetImage('assets/images/list2.png'))
|
||||||
: const Image(image: AssetImage('assets/images/map.png')),
|
: const Image(image: AssetImage('assets/images/map.png')),
|
||||||
),
|
),
|
||||||
elevation: 4.0,
|
|
||||||
),
|
),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
|
||||||
// alignment: Alignment.centerLeft,
|
|
||||||
// height: 50.0,
|
|
||||||
// //child: SingleChildScrollView(
|
|
||||||
// // scrollDirection: Axis.horizontal,
|
|
||||||
// // child:Row(
|
|
||||||
// // mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
// // children: [
|
|
||||||
// // TextButton(child:Text("Main Pef >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.MAINPERF);},),
|
|
||||||
// // TextButton(child:Text("Sub Pef >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.SUBPERF);},),
|
|
||||||
// // TextButton(child:Text("Cities >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.CITY);},),
|
|
||||||
// // TextButton(child:Text("Categories", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.CATEGORY);},),
|
|
||||||
// // ],
|
|
||||||
// // )
|
|
||||||
// // ),
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// scrollDirection: Axis.horizontal,
|
|
||||||
// child: Obx(() =>
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// indexController.is_mapController_loaded.value == false ?
|
|
||||||
// Center(child: CircularProgressIndicator())
|
|
||||||
// :
|
|
||||||
// BreadCrumbWidget(mapController: indexController.mapController),
|
|
||||||
// Container(width: 24.0,),
|
|
||||||
// // Row(
|
|
||||||
// // children: [
|
|
||||||
// // indexController.currentCat.isNotEmpty ? Text(indexController.currentCat[0].toString()): Text(""),
|
|
||||||
// // indexController.currentCat.isNotEmpty ?
|
|
||||||
// // IconButton(
|
|
||||||
// // onPressed: (){
|
|
||||||
// // indexController.currentCat.clear();
|
|
||||||
// // indexController.loadLocationsBound();
|
|
||||||
// // },
|
|
||||||
// // icon: Icon(Icons.cancel, color: Colors.red,)
|
|
||||||
// // ) :
|
|
||||||
// // Container(width: 0, height: 0,)
|
|
||||||
// // ],
|
|
||||||
// // )
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => indexController.mode == 0
|
() => indexController.mode.value == 0
|
||||||
? MapWidget()
|
? MapWidget()
|
||||||
: const ListWidget(),
|
: const ListWidget(),
|
||||||
))
|
))
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
import 'package:rogapp/pages/index/index_controller.dart';
|
||||||
import 'package:rogapp/routes/app_pages.dart';
|
import 'package:rogapp/routes/app_pages.dart';
|
||||||
|
|
||||||
class LoginPage extends StatelessWidget {
|
class LoginPage extends StatelessWidget {
|
||||||
|
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
|
|
||||||
TextEditingController emailController = TextEditingController();
|
TextEditingController emailController = TextEditingController();
|
||||||
@ -17,208 +15,248 @@ class LoginPage extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
appBar: AppBar(
|
||||||
|
elevation: 0,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: AppBar(
|
leading: IconButton(
|
||||||
elevation: 0,
|
onPressed: () {
|
||||||
backgroundColor: Colors.white,
|
Navigator.pop(context);
|
||||||
leading:
|
},
|
||||||
IconButton( onPressed: (){
|
icon: const Icon(
|
||||||
Navigator.pop(context);
|
Icons.arrow_back_ios,
|
||||||
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
size: 20,
|
||||||
),
|
color: Colors.black,
|
||||||
body:
|
)),
|
||||||
indexController.currentUser.isEmpty ?
|
),
|
||||||
SizedBox(
|
body: indexController.currentUser.isEmpty
|
||||||
width: double.infinity,
|
? SizedBox(
|
||||||
child: Column(
|
width: double.infinity,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Column(
|
children: [
|
||||||
children: [
|
Column(
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
height: MediaQuery.of(context).size.height/6,
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
image:DecorationImage(image: AssetImage('assets/images/login_image.jpg'))
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5,),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 40
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
makeInput(label: "email".tr, controller: emailController),
|
|
||||||
makeInput(label: "password".tr, controller: passwordController, obsureText: true),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.only(top: 3,left: 3),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(40),
|
|
||||||
),
|
|
||||||
child: Obx((() =>
|
|
||||||
indexController.is_loading == true ? MaterialButton(
|
|
||||||
minWidth: double.infinity,
|
|
||||||
height:60,
|
|
||||||
onPressed: (){
|
|
||||||
|
|
||||||
},
|
|
||||||
color: Colors.grey[400],
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(40)
|
|
||||||
),
|
|
||||||
child: const CircularProgressIndicator(),
|
|
||||||
) :
|
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
MaterialButton(
|
Container(
|
||||||
minWidth: double.infinity,
|
height: MediaQuery.of(context).size.height / 6,
|
||||||
height:40,
|
decoration: const BoxDecoration(
|
||||||
onPressed: (){
|
image: DecorationImage(
|
||||||
if(emailController.text.isEmpty || passwordController.text.isEmpty){
|
image: AssetImage(
|
||||||
Get.snackbar(
|
'assets/images/login_image.jpg'))),
|
||||||
"no_values".tr,
|
),
|
||||||
"email_and_password_required".tr,
|
const SizedBox(
|
||||||
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
height: 5,
|
||||||
snackPosition: SnackPosition.TOP,
|
),
|
||||||
duration: const Duration(milliseconds: 800),
|
],
|
||||||
backgroundColor: Colors.yellow,
|
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
indexController.is_loading.value = true;
|
|
||||||
indexController.login(emailController.text, passwordController.text, context);
|
|
||||||
},
|
|
||||||
color: Colors.indigoAccent[400],
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(40)
|
|
||||||
),
|
),
|
||||||
child: const Text("ログイン",style: TextStyle(
|
Padding(
|
||||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
makeInput(
|
||||||
|
label: "email".tr, controller: emailController),
|
||||||
|
makeInput(
|
||||||
|
label: "password".tr,
|
||||||
|
controller: passwordController,
|
||||||
|
obsureText: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.only(top: 3, left: 3),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(40),
|
||||||
|
),
|
||||||
|
child: Obx(
|
||||||
|
(() => indexController.isLoading.value == true
|
||||||
|
? MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 60,
|
||||||
|
onPressed: () {},
|
||||||
|
color: Colors.grey[400],
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
)
|
||||||
|
: Column(
|
||||||
|
children: [
|
||||||
|
MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 40,
|
||||||
|
onPressed: () {
|
||||||
|
if (emailController.text.isEmpty ||
|
||||||
|
passwordController
|
||||||
|
.text.isEmpty) {
|
||||||
|
Get.snackbar(
|
||||||
|
"no_values".tr,
|
||||||
|
"email_and_password_required"
|
||||||
|
.tr,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons
|
||||||
|
.assistant_photo_outlined,
|
||||||
|
size: 40.0,
|
||||||
|
color: Colors.blue),
|
||||||
|
snackPosition:
|
||||||
|
SnackPosition.TOP,
|
||||||
|
duration: const Duration(
|
||||||
|
milliseconds: 800),
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
indexController.isLoading.value =
|
||||||
|
true;
|
||||||
|
indexController.login(
|
||||||
|
emailController.text,
|
||||||
|
passwordController.text,
|
||||||
|
context);
|
||||||
|
},
|
||||||
|
color: Colors.indigoAccent[400],
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: const Text(
|
||||||
|
"ログイン",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white70),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5.0,
|
||||||
|
),
|
||||||
|
MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 40,
|
||||||
|
onPressed: () {
|
||||||
|
Get.toNamed(AppPages.REGISTER);
|
||||||
|
},
|
||||||
|
color: Colors.redAccent,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: Text(
|
||||||
|
"sign_up".tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white70),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 2.0,
|
||||||
|
),
|
||||||
|
MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 40,
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
color: Colors.grey,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: Text(
|
||||||
|
"cancel".tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white70),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
const SizedBox(height: 5.0,),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
MaterialButton(
|
children: [
|
||||||
minWidth: double.infinity,
|
Flexible(
|
||||||
height:40,
|
child: Padding(
|
||||||
onPressed: (){
|
padding: const EdgeInsets.all(8.0),
|
||||||
Get.toNamed(AppPages.REGISTER);
|
child: Text(
|
||||||
},
|
"rogaining_user_need_tosign_up".tr,
|
||||||
color: Colors.redAccent,
|
style: const TextStyle(
|
||||||
shape: RoundedRectangleBorder(
|
overflow: TextOverflow.ellipsis,
|
||||||
borderRadius: BorderRadius.circular(40)
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Text("sign_up".tr,style: const TextStyle(
|
Row(
|
||||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
),
|
children: [
|
||||||
),
|
Flexible(
|
||||||
),
|
child: Padding(
|
||||||
const SizedBox(height: 2.0,),
|
padding: const EdgeInsets.all(8.0),
|
||||||
MaterialButton(
|
child: Text(
|
||||||
minWidth: double.infinity,
|
"app_developed_by_gifu_dx".tr,
|
||||||
height:40,
|
style: const TextStyle(
|
||||||
onPressed: (){
|
overflow: TextOverflow.ellipsis,
|
||||||
Get.back();
|
fontSize: 10.0),
|
||||||
},
|
),
|
||||||
color: Colors.grey,
|
),
|
||||||
shape: RoundedRectangleBorder(
|
),
|
||||||
borderRadius: BorderRadius.circular(40)
|
|
||||||
),
|
|
||||||
child: Text("cancel".tr,style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
)
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5,),
|
)
|
||||||
Row(
|
: TextButton(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
onPressed: () {
|
||||||
children: [
|
indexController.currentUser.clear();
|
||||||
Flexible(
|
},
|
||||||
child: Padding(
|
child: const Text("Already Logged in, Click to logout"),
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text("rogaining_user_need_tosign_up".tr, style: const TextStyle(
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text("app_developed_by_gifu_dx".tr, style: const TextStyle(
|
|
||||||
overflow: TextOverflow.ellipsis, fontSize: 10.0
|
|
||||||
),),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
|
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
):
|
|
||||||
Container(
|
|
||||||
child: TextButton(
|
|
||||||
onPressed: (){
|
|
||||||
indexController.currentUser.clear();
|
|
||||||
},
|
|
||||||
child: const Text("Already Logged in, Click to logout"),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget makeInput({label, required TextEditingController controller, obsureText = false}){
|
Widget makeInput(
|
||||||
|
{label, required TextEditingController controller, obsureText = false}) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(label,style:const TextStyle(
|
Text(
|
||||||
fontSize: 15,
|
label,
|
||||||
fontWeight: FontWeight.w400,
|
style: const TextStyle(
|
||||||
color: Colors.black87
|
fontSize: 15, fontWeight: FontWeight.w400, color: Colors.black87),
|
||||||
),),
|
),
|
||||||
const SizedBox(height: 5,),
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
TextField(
|
TextField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
obscureText: obsureText,
|
obscureText: obsureText,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: (Colors.grey[400])!,
|
color: (Colors.grey[400])!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: (Colors.grey[400])!
|
borderSide: BorderSide(color: (Colors.grey[400])!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(
|
||||||
const SizedBox(height: 30.0,)
|
height: 30.0,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,195 +15,232 @@ class LoginPopupPage extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
appBar: AppBar(
|
||||||
|
elevation: 0,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: AppBar(
|
leading: IconButton(
|
||||||
elevation: 0,
|
onPressed: () {
|
||||||
backgroundColor: Colors.white,
|
Navigator.pop(context);
|
||||||
leading:
|
},
|
||||||
IconButton( onPressed: (){
|
icon: const Icon(
|
||||||
Navigator.pop(context);
|
Icons.arrow_back_ios,
|
||||||
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
size: 20,
|
||||||
),
|
color: Colors.black,
|
||||||
body:
|
)),
|
||||||
indexController.currentUser.isEmpty ?
|
),
|
||||||
SizedBox(
|
body: indexController.currentUser.isEmpty
|
||||||
width: double.infinity,
|
? SizedBox(
|
||||||
child: Column(
|
width: double.infinity,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Column(
|
children: [
|
||||||
children: [
|
Column(
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
height: MediaQuery.of(context).size.height/5,
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
image:DecorationImage(image: AssetImage('assets/images/login_image.jpg'))
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5,),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 40
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
makeInput(label: "email".tr, controller: emailController),
|
|
||||||
makeInput(label: "password".tr, controller: passwordController, obsureText: true),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.only(top: 3,left: 3),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(40),
|
|
||||||
),
|
|
||||||
child: Obx((() =>
|
|
||||||
indexController.is_loading == true ? MaterialButton(
|
|
||||||
minWidth: double.infinity,
|
|
||||||
height:60,
|
|
||||||
onPressed: (){
|
|
||||||
|
|
||||||
},
|
|
||||||
color: Colors.grey[400],
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(40)
|
|
||||||
),
|
|
||||||
child: const CircularProgressIndicator(),
|
|
||||||
) :
|
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
MaterialButton(
|
Container(
|
||||||
minWidth: double.infinity,
|
height: MediaQuery.of(context).size.height / 5,
|
||||||
height:60,
|
decoration: const BoxDecoration(
|
||||||
onPressed: (){
|
image: DecorationImage(
|
||||||
if(emailController.text.isEmpty || passwordController.text.isEmpty){
|
image: AssetImage(
|
||||||
Get.snackbar(
|
'assets/images/login_image.jpg'))),
|
||||||
"no_values".tr,
|
),
|
||||||
"email_and_password_required".tr,
|
const SizedBox(
|
||||||
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
height: 5,
|
||||||
snackPosition: SnackPosition.TOP,
|
),
|
||||||
duration: const Duration(milliseconds: 800),
|
],
|
||||||
backgroundColor: Colors.yellow,
|
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
indexController.is_loading.value = true;
|
|
||||||
indexController.login(emailController.text, passwordController.text, context);
|
|
||||||
},
|
|
||||||
color: Colors.indigoAccent[400],
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(40)
|
|
||||||
),
|
),
|
||||||
child: const Text("ログイン",style: TextStyle(
|
Padding(
|
||||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
makeInput(
|
||||||
|
label: "email".tr, controller: emailController),
|
||||||
|
makeInput(
|
||||||
|
label: "password".tr,
|
||||||
|
controller: passwordController,
|
||||||
|
obsureText: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.only(top: 3, left: 3),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(40),
|
||||||
|
),
|
||||||
|
child: Obx(
|
||||||
|
(() => indexController.isLoading.value == true
|
||||||
|
? MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 60,
|
||||||
|
onPressed: () {},
|
||||||
|
color: Colors.grey[400],
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
)
|
||||||
|
: Column(
|
||||||
|
children: [
|
||||||
|
MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 60,
|
||||||
|
onPressed: () {
|
||||||
|
if (emailController.text.isEmpty ||
|
||||||
|
passwordController
|
||||||
|
.text.isEmpty) {
|
||||||
|
Get.snackbar(
|
||||||
|
"no_values".tr,
|
||||||
|
"email_and_password_required"
|
||||||
|
.tr,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons
|
||||||
|
.assistant_photo_outlined,
|
||||||
|
size: 40.0,
|
||||||
|
color: Colors.blue),
|
||||||
|
snackPosition:
|
||||||
|
SnackPosition.TOP,
|
||||||
|
duration: const Duration(
|
||||||
|
milliseconds: 800),
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
indexController.isLoading.value =
|
||||||
|
true;
|
||||||
|
indexController.login(
|
||||||
|
emailController.text,
|
||||||
|
passwordController.text,
|
||||||
|
context);
|
||||||
|
},
|
||||||
|
color: Colors.indigoAccent[400],
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: const Text(
|
||||||
|
"ログイン",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white70),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 19.0,
|
||||||
|
),
|
||||||
|
MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 50,
|
||||||
|
onPressed: () {
|
||||||
|
Get.toNamed(AppPages.REGISTER);
|
||||||
|
},
|
||||||
|
color: Colors.redAccent,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: Text(
|
||||||
|
"sign_up".tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white70),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 19.0,
|
||||||
|
),
|
||||||
|
MaterialButton(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 50,
|
||||||
|
onPressed: () {
|
||||||
|
Get.toNamed(AppPages.TRAVEL);
|
||||||
|
},
|
||||||
|
color: Colors.grey,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(40)),
|
||||||
|
child: Text(
|
||||||
|
"cancel".tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white70),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
const SizedBox(height: 19.0,),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
MaterialButton(
|
children: [
|
||||||
minWidth: double.infinity,
|
Flexible(
|
||||||
height:50,
|
child: Padding(
|
||||||
onPressed: (){
|
padding: const EdgeInsets.all(8.0),
|
||||||
Get.toNamed(AppPages.REGISTER);
|
child: Text(
|
||||||
},
|
"rogaining_user_need_tosign_up".tr,
|
||||||
color: Colors.redAccent,
|
style: const TextStyle(
|
||||||
shape: RoundedRectangleBorder(
|
overflow: TextOverflow.ellipsis,
|
||||||
borderRadius: BorderRadius.circular(40)
|
),
|
||||||
),
|
),
|
||||||
child: Text("sign_up".tr,style: const TextStyle(
|
),
|
||||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 19.0,),
|
|
||||||
MaterialButton(
|
|
||||||
minWidth: double.infinity,
|
|
||||||
height:50,
|
|
||||||
onPressed: (){
|
|
||||||
Get.toNamed(AppPages.TRAVEL);
|
|
||||||
},
|
|
||||||
color: Colors.grey,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(40)
|
|
||||||
),
|
|
||||||
child: Text("cancel".tr,style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
)
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20,),
|
)
|
||||||
Row(
|
: TextButton(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
onPressed: () {
|
||||||
children: [
|
indexController.currentUser.clear();
|
||||||
Flexible(
|
},
|
||||||
child: Padding(
|
child: const Text("Already Logged in, Click to logout"),
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text("rogaining_user_need_tosign_up".tr, style: const TextStyle(
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
|
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
):
|
|
||||||
Container(
|
|
||||||
child: TextButton(
|
|
||||||
onPressed: (){
|
|
||||||
indexController.currentUser.clear();
|
|
||||||
},
|
|
||||||
child: const Text("Already Logged in, Click to logout"),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget makeInput({label, required TextEditingController controller, obsureText = false}){
|
Widget makeInput(
|
||||||
|
{label, required TextEditingController controller, obsureText = false}) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(label,style:const TextStyle(
|
Text(
|
||||||
fontSize: 15,
|
label,
|
||||||
fontWeight: FontWeight.w400,
|
style: const TextStyle(
|
||||||
color: Colors.black87
|
fontSize: 15, fontWeight: FontWeight.w400, color: Colors.black87),
|
||||||
),),
|
),
|
||||||
const SizedBox(height: 5,),
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
TextField(
|
TextField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
obscureText: obsureText,
|
obscureText: obsureText,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: (Colors.grey[400])!,
|
color: (Colors.grey[400])!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: (Colors.grey[400])!
|
borderSide: BorderSide(color: (Colors.grey[400])!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(
|
||||||
const SizedBox(height: 30.0,)
|
height: 30.0,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,31 +1,31 @@
|
|||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
// import 'package:get/get.dart';
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
// import 'package:rogapp/pages/index/index_controller.dart';
|
||||||
|
|
||||||
class MainPerfPage extends StatelessWidget {
|
// class MainPerfPage extends StatelessWidget {
|
||||||
MainPerfPage({Key? key}) : super(key: key);
|
// MainPerfPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
IndexController indexController = Get.find<IndexController>();
|
// IndexController indexController = Get.find<IndexController>();
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
// return Scaffold(
|
||||||
appBar: AppBar(
|
// appBar: AppBar(
|
||||||
title: const Text("Select Main Perfecture"),
|
// title: const Text("Select Main Perfecture"),
|
||||||
),
|
// ),
|
||||||
body: ListView.builder(
|
// body: ListView.builder(
|
||||||
itemCount: indexController.perfectures.length,
|
// itemCount: indexController.perfectures.length,
|
||||||
itemBuilder: (context, index){
|
// itemBuilder: (context, index){
|
||||||
return ListTile(
|
// return ListTile(
|
||||||
onTap: (){
|
// onTap: (){
|
||||||
indexController.dropdownValue = indexController.perfectures[index][0]["id"].toString();
|
// indexController.dropdownValue = indexController.perfectures[index][0]["id"].toString();
|
||||||
indexController.populateForPerf(indexController.dropdownValue, indexController.mapController);
|
// indexController.populateForPerf(indexController.dropdownValue, indexController.mapController);
|
||||||
Get.back();
|
// Get.back();
|
||||||
},
|
// },
|
||||||
title: Text(indexController.perfectures[index][0]["adm1_ja"].toString()),
|
// title: Text(indexController.perfectures[index][0]["adm1_ja"].toString()),
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
@ -8,206 +8,118 @@ class PermissionHandlerScreen extends StatefulWidget {
|
|||||||
const PermissionHandlerScreen({Key? key}) : super(key: key);
|
const PermissionHandlerScreen({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PermissionHandlerScreen> createState() => _PermissionHandlerScreenState();
|
State<PermissionHandlerScreen> createState() =>
|
||||||
|
_PermissionHandlerScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
|
class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
|
||||||
|
|
||||||
|
|
||||||
Future<void> _showMyDialog() async {
|
|
||||||
return showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
barrierDismissible: false, // user must tap button!
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: const Text('ロケーション許可'),
|
|
||||||
content: const SingleChildScrollView(
|
|
||||||
child: ListBody(
|
|
||||||
children: <Widget>[
|
|
||||||
Text( 'このアプリでは、位置情報の収集を行います。'),
|
|
||||||
Text( 'このアプリでは、開始時点で位置情報を収集します。'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
child: const Text('わかった'),
|
|
||||||
onPressed: () {
|
|
||||||
//Navigator.of(context).pop();
|
|
||||||
Get.toNamed(AppPages.TRAVEL);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
|
||||||
super.initState();
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
//permissionServiceCall();
|
_checkPermissionStatus();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<PermissionStatus> checkLocationPermission() async {
|
_checkPermissionStatus() async {
|
||||||
return await Permission.location.status;
|
PermissionStatus status = await Permission.location.status;
|
||||||
}
|
|
||||||
|
|
||||||
permissionServiceCall() async {
|
if (status.isGranted == false) {
|
||||||
await permissionServices().then(
|
if (context.mounted) {
|
||||||
(value) {
|
showAlert(context);
|
||||||
if (value[Permission.location]!.isGranted ) {
|
}
|
||||||
/* ========= New Screen Added ============= */
|
} else if (status.isPermanentlyDenied) {
|
||||||
|
await requestPermission();
|
||||||
Get.toNamed(AppPages.TRAVEL);
|
|
||||||
|
|
||||||
// Navigator.pushReplacement(
|
|
||||||
// context,
|
|
||||||
// MaterialPageRoute(builder: (context) => SplashScreen()),
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
_showMyDialog();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*Permission services*/
|
|
||||||
Future<Map<Permission, PermissionStatus>> permissionServices() async {
|
|
||||||
// You can request multiple permissions at once.
|
|
||||||
Map<Permission, PermissionStatus> statuses = await [
|
|
||||||
Permission.location,
|
|
||||||
|
|
||||||
//add more permission to request here.
|
|
||||||
].request();
|
|
||||||
|
|
||||||
if (statuses[Permission.location]!.isPermanentlyDenied) {
|
|
||||||
await openAppSettings().then(
|
|
||||||
(value) async {
|
|
||||||
if (value) {
|
|
||||||
if (await Permission.location.status.isPermanentlyDenied == true &&
|
|
||||||
await Permission.location.status.isGranted == false) {
|
|
||||||
// openAppSettings();
|
|
||||||
permissionServiceCall(); /* opens app settings until permission is granted */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
if (statuses[Permission.location]!.isDenied) {
|
if (mounted) {
|
||||||
permissionServiceCall();
|
Get.toNamed(AppPages.LOGIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*{Permission.camera: PermissionStatus.granted, Permission.storage: PermissionStatus.granted}*/
|
|
||||||
return statuses;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void showAlert(BuildContext context) {
|
||||||
requestPermission() async {
|
showDialog(
|
||||||
PermissionStatus permission = await Permission.location.status;
|
context: context,
|
||||||
if(permission == PermissionStatus.permanentlyDenied){
|
builder: (_) => AlertDialog(
|
||||||
showPermanentAlert(context);
|
title: const Text('ロケーション許可'),
|
||||||
}else{
|
content: const SingleChildScrollView(
|
||||||
PermissionStatus newPermission = await Permission.location.request();
|
child: ListBody(
|
||||||
//showAlert(context);
|
children: <Widget>[
|
||||||
|
Text('このアプリでは、位置情報の収集を行います。'),
|
||||||
if (newPermission != PermissionStatus.granted) {
|
Text(
|
||||||
// If permission not granted, handle the issue in your own way
|
'岐阜ナビアプリではチェックポイントの自動チェックインの機能を可能にするために、現在地のデータが収集されます。アプリを閉じている時や、使用していないときにも収集されます。位置情報は、個人を特定できない統計的な情報として、ユーザーの個人情報とは一切結びつかない形で送信されます。お知らせの配信、位置情報の利用を許可しない場合は、この後表示されるダイアログで「許可しない」を選択してください。'),
|
||||||
exit(0);
|
],
|
||||||
}
|
),
|
||||||
else{
|
),
|
||||||
Get.toNamed(AppPages.TRAVEL);
|
actions: <Widget>[
|
||||||
}
|
ElevatedButton(
|
||||||
|
child: const Text('OK'),
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
requestPermission();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (permission != PermissionStatus.granted) {
|
Future<void> requestPermission() async {
|
||||||
|
PermissionStatus permission = await Permission.location.status;
|
||||||
// }
|
if (permission == PermissionStatus.permanentlyDenied) {
|
||||||
// If permission is granted or already was granted
|
showPermanentAlert();
|
||||||
return true;
|
} else {
|
||||||
}
|
PermissionStatus newPermission = await Permission.location.request();
|
||||||
|
if (newPermission != PermissionStatus.granted) {
|
||||||
|
exit(0);
|
||||||
|
} else {
|
||||||
|
if (context.mounted) {
|
||||||
|
Get.toNamed(AppPages.LOGIN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var status = Permission.location.status.then((value){
|
return const Scaffold(
|
||||||
if(value.isGranted == false){
|
body: Text(""),
|
||||||
showAlert(context);
|
|
||||||
//requestPermission() ? Get.toNamed(AppPages.TRAVEL) : exit(0);
|
|
||||||
//Future.delayed(Duration.zero, () => showAlert(context));
|
|
||||||
}
|
|
||||||
else if(value.isPermanentlyDenied){
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Get.toNamed(AppPages.TRAVEL);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return Scaffold(
|
|
||||||
body: Container(
|
|
||||||
child: const Text(""),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void showPermanentAlert(BuildContext context) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => AlertDialog(
|
|
||||||
title: const Text('無効'),
|
|
||||||
content: const SingleChildScrollView(
|
|
||||||
child: ListBody(
|
|
||||||
children: <Widget>[
|
|
||||||
Text( '位置情報が無効になっています'),
|
|
||||||
Text('このアプリケーションへの位置情報アクセスが無効になっています。続行するには設定>プライバシーとセキュリティ>位置情報サービス>岐阜ナビ で有効にしてください。'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: <Widget>[
|
|
||||||
ElevatedButton(
|
|
||||||
child: const Text('OK'),
|
|
||||||
onPressed: () {
|
|
||||||
//requestPermission();
|
|
||||||
permissionServiceCall();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void showPermanentAlert() {
|
||||||
void showAlert(BuildContext context) {
|
showDialog(
|
||||||
showDialog(
|
context: context,
|
||||||
context: context,
|
builder: (_) => AlertDialog(
|
||||||
builder: (_) => AlertDialog(
|
title: const Text('無効'),
|
||||||
title: const Text('ロケーション許可'),
|
content: const SingleChildScrollView(
|
||||||
content: const SingleChildScrollView(
|
child: ListBody(
|
||||||
child: ListBody(
|
children: <Widget>[
|
||||||
children: <Widget>[
|
Text('位置情報が無効になっています'),
|
||||||
Text( 'このアプリでは、位置情報の収集を行います。'),
|
Text(
|
||||||
Text('岐阜ナビアプリではチェックポイントの自動チェックインの機能を可能にするために、現在地のデータが収集されます。アプリを閉じている時や、使用していないときにも収集されます。位置情報は、個人を特定できない統計的な情報として、ユーザーの個人情報とは一切結びつかない形で送信されます。お知らせの配信、位置情報の利用を許可しない場合は、この後表示されるダイアログで「許可しない」を選択してください。'),
|
'このアプリケーションへの位置情報アクセスが無効になっています。続行するには設定>プライバシーとセキュリティ>位置情報サービス>岐阜ナビ で有効にしてください。'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
ElevatedButton(
|
||||||
|
child: const Text('OK'),
|
||||||
|
onPressed: () async {
|
||||||
|
await openAppSettings().then(
|
||||||
|
(value) async {
|
||||||
|
if (value) {
|
||||||
|
if (await Permission
|
||||||
|
.location.status.isPermanentlyDenied ==
|
||||||
|
true &&
|
||||||
|
await Permission.location.status.isGranted ==
|
||||||
|
false) {
|
||||||
|
requestPermission(); /* opens app settings until permission is granted */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
));
|
||||||
),
|
|
||||||
actions: <Widget>[
|
|
||||||
ElevatedButton(
|
|
||||||
child: const Text('OK'),
|
|
||||||
onPressed: () {
|
|
||||||
requestPermission();
|
|
||||||
//permissionServiceCall();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,12 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
import 'package:rogapp/pages/index/index_controller.dart';
|
||||||
import 'package:rogapp/routes/app_pages.dart';
|
import 'package:rogapp/routes/app_pages.dart';
|
||||||
|
|
||||||
class RegisterPage extends StatelessWidget {
|
class RegisterPage extends StatelessWidget {
|
||||||
|
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
|
|
||||||
TextEditingController emailController = TextEditingController();
|
TextEditingController emailController = TextEditingController();
|
||||||
@ -23,10 +20,15 @@ class RegisterPage extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
leading:
|
leading: IconButton(
|
||||||
IconButton( onPressed: (){
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.arrow_back_ios,
|
||||||
|
size: 20,
|
||||||
|
color: Colors.black,
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
@ -41,63 +43,79 @@ class RegisterPage extends StatelessWidget {
|
|||||||
Column(
|
Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
const Text ("サインアップ", style: TextStyle(
|
const Text(
|
||||||
fontSize: 30,
|
"サインアップ",
|
||||||
fontWeight: FontWeight.bold,
|
style: TextStyle(
|
||||||
),),
|
fontSize: 30,
|
||||||
const SizedBox(height: 20,),
|
fontWeight: FontWeight.bold,
|
||||||
Text("アカウントを作成し、無料です",style: TextStyle(
|
),
|
||||||
fontSize: 15,
|
),
|
||||||
color: Colors.grey[700],
|
const SizedBox(
|
||||||
),),
|
height: 20,
|
||||||
const SizedBox(height: 30,)
|
),
|
||||||
|
Text(
|
||||||
|
"アカウントを作成し、無料です",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: Colors.grey[700],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 30,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
horizontal: 40
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
makeInput(label: "Eメール", controller: emailController),
|
makeInput(label: "Eメール", controller: emailController),
|
||||||
makeInput(label: "パスワード", controller: passwordController,obsureText: true),
|
makeInput(
|
||||||
makeInput(label: "パスワードを認証する", controller: confirmPasswordController,obsureText: true)
|
label: "パスワード",
|
||||||
|
controller: passwordController,
|
||||||
|
obsureText: true),
|
||||||
|
makeInput(
|
||||||
|
label: "パスワードを認証する",
|
||||||
|
controller: confirmPasswordController,
|
||||||
|
obsureText: true)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.only(top: 3,left: 3),
|
padding: const EdgeInsets.only(top: 3, left: 3),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(40),
|
borderRadius: BorderRadius.circular(40),
|
||||||
border: const Border(
|
border: const Border(
|
||||||
bottom: BorderSide(color: Colors.black),
|
bottom: BorderSide(color: Colors.black),
|
||||||
top: BorderSide(color: Colors.black),
|
top: BorderSide(color: Colors.black),
|
||||||
right: BorderSide(color: Colors.black),
|
right: BorderSide(color: Colors.black),
|
||||||
left: BorderSide(color: Colors.black)
|
left: BorderSide(color: Colors.black))),
|
||||||
)
|
|
||||||
),
|
|
||||||
child: MaterialButton(
|
child: MaterialButton(
|
||||||
minWidth: double.infinity,
|
minWidth: double.infinity,
|
||||||
height:60,
|
height: 60,
|
||||||
onPressed: (){
|
onPressed: () {
|
||||||
if(passwordController.text != confirmPasswordController.text){
|
if (passwordController.text !=
|
||||||
|
confirmPasswordController.text) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"No match",
|
"No match",
|
||||||
"Passwords does not match",
|
"Passwords does not match",
|
||||||
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
icon: const Icon(Icons.assistant_photo_outlined,
|
||||||
|
size: 40.0, color: Colors.blue),
|
||||||
snackPosition: SnackPosition.TOP,
|
snackPosition: SnackPosition.TOP,
|
||||||
duration: const Duration(milliseconds: 800),
|
duration: const Duration(milliseconds: 800),
|
||||||
backgroundColor: Colors.yellow,
|
backgroundColor: Colors.yellow,
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if(emailController.text.isEmpty || passwordController.text.isEmpty){
|
if (emailController.text.isEmpty ||
|
||||||
|
passwordController.text.isEmpty) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"no_values".tr,
|
"no_values".tr,
|
||||||
"email_and_password_required".tr,
|
"email_and_password_required".tr,
|
||||||
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
icon: const Icon(Icons.assistant_photo_outlined,
|
||||||
|
size: 40.0, color: Colors.blue),
|
||||||
snackPosition: SnackPosition.TOP,
|
snackPosition: SnackPosition.TOP,
|
||||||
duration: const Duration(milliseconds: 800),
|
duration: const Duration(milliseconds: 800),
|
||||||
backgroundColor: Colors.yellow,
|
backgroundColor: Colors.yellow,
|
||||||
@ -105,38 +123,43 @@ class RegisterPage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
indexController.is_loading.value = true;
|
indexController.isLoading.value = true;
|
||||||
indexController.register(emailController.text, passwordController.text, context);
|
indexController.register(emailController.text,
|
||||||
|
passwordController.text, context);
|
||||||
},
|
},
|
||||||
color: Colors.redAccent,
|
color: Colors.redAccent,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(40)
|
borderRadius: BorderRadius.circular(40)),
|
||||||
|
child: Text(
|
||||||
|
"sign_up".tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Text("sign_up".tr,style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,fontSize: 16,
|
|
||||||
|
|
||||||
),),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20,),
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Flexible(child: Text("すでにアカウントをお持ちですか?")),
|
const Flexible(child: Text("すでにアカウントをお持ちですか?")),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: (){
|
onPressed: () {
|
||||||
Get.toNamed(AppPages.LOGIN);
|
Get.toNamed(AppPages.LOGIN);
|
||||||
},
|
},
|
||||||
child: const Text("ログイン",style: TextStyle(
|
child: const Text(
|
||||||
fontWeight: FontWeight.w600,
|
"ログイン",
|
||||||
fontSize: 18
|
style: TextStyle(
|
||||||
),),
|
fontWeight: FontWeight.w600, fontSize: 18),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -147,34 +170,38 @@ class RegisterPage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget makeInput({label, required TextEditingController controller, obsureText = false}){
|
Widget makeInput(
|
||||||
|
{label, required TextEditingController controller, obsureText = false}) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(label,style:const TextStyle(
|
Text(
|
||||||
fontSize: 15,
|
label,
|
||||||
fontWeight: FontWeight.w400,
|
style: const TextStyle(
|
||||||
color: Colors.black87
|
fontSize: 15, fontWeight: FontWeight.w400, color: Colors.black87),
|
||||||
),),
|
),
|
||||||
const SizedBox(height: 5,),
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
TextField(
|
TextField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
obscureText: obsureText,
|
obscureText: obsureText,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: (Colors.grey[400])!,
|
color: (Colors.grey[400])!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: (Colors.grey[400])!
|
borderSide: BorderSide(color: (Colors.grey[400])!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(
|
||||||
const SizedBox(height: 30,)
|
height: 30,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
31
lib/provider/auth_provider.dart
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:rogapp/model/auth_user.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
final authUserStateProvider =
|
||||||
|
StateNotifierProvider<AuthUserState, AuthUser>((ref) {
|
||||||
|
return AuthUserState();
|
||||||
|
});
|
||||||
|
|
||||||
|
class AuthUserState extends StateNotifier<AuthUser> {
|
||||||
|
AuthUserState() : super(AuthUser());
|
||||||
|
|
||||||
|
Future<void> saveToDevice(String val) async {
|
||||||
|
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
await prefs.setString("user_token", val);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String?> tokenFromDevice() async {
|
||||||
|
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
return prefs.getString("user_token");
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> addLogin(AuthUser user) async {
|
||||||
|
state = user;
|
||||||
|
await saveToDevice(user.auth_token!);
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeLogin() {
|
||||||
|
state = AuthUser();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,27 +1,22 @@
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:rogapp/model/game_instance_state.dart';
|
import 'package:rogapp/model/game_state_instance.dart';
|
||||||
|
|
||||||
final gameStateNotifierProvider = StateNotifierProvider<GameStaticState, GameInstanceState>((ref) {
|
final gameStateNotifierProvider =
|
||||||
|
StateNotifierProvider<GameStaticState, GameInsStatetance>((ref) {
|
||||||
return GameStaticState();
|
return GameStaticState();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
class GameStaticState extends StateNotifier<GameInsStatetance> {
|
||||||
class GameStaticState extends StateNotifier<GameInstanceState>{
|
GameStaticState() : super(GameInsStatetance());
|
||||||
GameStaticState(): super(GameInstanceState());
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
GameInstanceState get state => super.state;
|
GameInsStatetance get state => super.state;
|
||||||
|
|
||||||
void startGame(GameInstanceState gi){
|
void startGame(GameInsStatetance gi) {
|
||||||
state = gi;
|
state = gi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void doCheckin(){
|
void doCheckin() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void makeGoal(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
void makeGoal() {}
|
||||||
}
|
}
|
||||||
18
lib/provider/map_state_provider.dart
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:rogapp/model/map_state_instance.dart';
|
||||||
|
|
||||||
|
final mapStateNotifierProvider =
|
||||||
|
StateNotifierProvider<MapState, MapStateInstance>((ref) {
|
||||||
|
return MapState();
|
||||||
|
});
|
||||||
|
|
||||||
|
class MapState extends StateNotifier<MapStateInstance> {
|
||||||
|
MapState() : super(MapStateInstance());
|
||||||
|
|
||||||
|
@override
|
||||||
|
MapStateInstance get state => super.state;
|
||||||
|
|
||||||
|
void startGame(MapStateInstance mi) {
|
||||||
|
state = mi;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,11 +1,9 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get/get_navigation/src/routes/get_route.dart';
|
import 'package:get/get_navigation/src/routes/get_route.dart';
|
||||||
import 'package:rogapp/pages/camera/camera_page.dart';
|
|
||||||
import 'package:rogapp/pages/category/category_page.dart';
|
import 'package:rogapp/pages/category/category_page.dart';
|
||||||
import 'package:rogapp/pages/changepassword/change_password_page.dart';
|
import 'package:rogapp/pages/changepassword/change_password_page.dart';
|
||||||
import 'package:rogapp/pages/city/city_page.dart';
|
import 'package:rogapp/pages/city/city_page.dart';
|
||||||
import 'package:rogapp/pages/destination/destination_binding.dart';
|
import 'package:rogapp/pages/destination/destination_binding.dart';
|
||||||
import 'package:rogapp/pages/destination/destination_page.dart';
|
|
||||||
import 'package:rogapp/pages/history/history_page.dart';
|
import 'package:rogapp/pages/history/history_page.dart';
|
||||||
import 'package:rogapp/pages/home/home_binding.dart';
|
import 'package:rogapp/pages/home/home_binding.dart';
|
||||||
import 'package:rogapp/pages/home/home_page.dart';
|
import 'package:rogapp/pages/home/home_page.dart';
|
||||||
@ -24,11 +22,9 @@ import 'package:rogapp/pages/subperf/subperf_page.dart';
|
|||||||
import 'package:rogapp/spa/spa_binding.dart';
|
import 'package:rogapp/spa/spa_binding.dart';
|
||||||
import 'package:rogapp/spa/spa_page.dart';
|
import 'package:rogapp/spa/spa_page.dart';
|
||||||
|
|
||||||
|
|
||||||
part 'app_routes.dart';
|
part 'app_routes.dart';
|
||||||
|
|
||||||
class AppPages {
|
class AppPages {
|
||||||
|
|
||||||
// ignore: constant_identifier_names
|
// ignore: constant_identifier_names
|
||||||
static const INITIAL = Routes.INDEX;
|
static const INITIAL = Routes.INDEX;
|
||||||
// ignore: constant_identifier_names
|
// ignore: constant_identifier_names
|
||||||
@ -52,26 +48,11 @@ class AppPages {
|
|||||||
static const HISTORY = Routes.HISTORY;
|
static const HISTORY = Routes.HISTORY;
|
||||||
|
|
||||||
static final routes = [
|
static final routes = [
|
||||||
// GetPage(
|
|
||||||
// name: Routes.HOME,
|
|
||||||
// page: () => HomePage(),
|
|
||||||
// binding: HomeBinding(),
|
|
||||||
// ),
|
|
||||||
// GetPage(
|
|
||||||
// name: Routes.MAP,
|
|
||||||
// page: () => MapPage(),
|
|
||||||
// binding: MapBinding(),
|
|
||||||
// )
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routes.INDEX,
|
name: Routes.INDEX,
|
||||||
page: () => IndexPage(),
|
page: () => IndexPage(),
|
||||||
//binding: IndexBinding(),
|
//binding: IndexBinding(),
|
||||||
),
|
),
|
||||||
GetPage(
|
|
||||||
name: Routes.SPA,
|
|
||||||
page: () => const SpaPage(),
|
|
||||||
binding: SpaBinding(),
|
|
||||||
),
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routes.LANDING,
|
name: Routes.LANDING,
|
||||||
page: () => const LandingPage(),
|
page: () => const LandingPage(),
|
||||||
@ -87,21 +68,11 @@ class AppPages {
|
|||||||
page: () => RegisterPage(),
|
page: () => RegisterPage(),
|
||||||
//binding: SpaBinding(),
|
//binding: SpaBinding(),
|
||||||
),
|
),
|
||||||
GetPage(
|
|
||||||
name: Routes.TRAVEL,
|
|
||||||
page: () => DestnationPage(),
|
|
||||||
binding: DestinationBinding(),
|
|
||||||
),
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routes.LOADING,
|
name: Routes.LOADING,
|
||||||
page: () => const LoadingPage(),
|
page: () => const LoadingPage(),
|
||||||
//binding: DestinationBinding(),
|
//binding: DestinationBinding(),
|
||||||
),
|
),
|
||||||
GetPage(
|
|
||||||
name: Routes.DESTINATION_MAP,
|
|
||||||
page: () => DestnationPage(),
|
|
||||||
//binding: DestinationBinding(),
|
|
||||||
),
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routes.HOME,
|
name: Routes.HOME,
|
||||||
page: () => const HomePage(),
|
page: () => const HomePage(),
|
||||||
@ -116,22 +87,10 @@ class AppPages {
|
|||||||
page: () => SearchPage(),
|
page: () => SearchPage(),
|
||||||
binding: SearchBinding(),
|
binding: SearchBinding(),
|
||||||
),
|
),
|
||||||
GetPage(
|
|
||||||
name: Routes.MAINPERF,
|
|
||||||
page: () => MainPerfPage(),
|
|
||||||
),
|
|
||||||
GetPage(
|
|
||||||
name: Routes.SUBPERF,
|
|
||||||
page: () => SubPerfPage(),
|
|
||||||
),
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routes.CITY,
|
name: Routes.CITY,
|
||||||
page: () => const CityPage(),
|
page: () => const CityPage(),
|
||||||
),
|
),
|
||||||
GetPage(
|
|
||||||
name: Routes.CATEOGORY,
|
|
||||||
page: () => const CategoryPage(),
|
|
||||||
),
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routes.CHANGE_PASSWORD,
|
name: Routes.CHANGE_PASSWORD,
|
||||||
page: () => ChangePasswordPage(),
|
page: () => ChangePasswordPage(),
|
||||||
|
|||||||
@ -2,23 +2,21 @@ import 'dart:convert';
|
|||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:rogapp/utils/const.dart';
|
import 'package:rogapp/utils/const.dart';
|
||||||
|
|
||||||
|
class ActionService {
|
||||||
class ActionService{
|
static Future<Map<String, dynamic>> makeAction(int userId, int locationId,
|
||||||
|
bool wanttogo, bool like, bool checkin) async {
|
||||||
static Future<Map<String, dynamic>> makeAction(int userId, int locationId, bool wanttogo, bool like, bool checkin) async {
|
//print("----- action is ---- $like-- $wanttogo-- $checkin");
|
||||||
print("----- action is ---- $like-- $wanttogo-- $checkin");
|
|
||||||
Map<String, dynamic> cats = {};
|
Map<String, dynamic> cats = {};
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = "$serverUrl/api/makeaction/?user_id=$userId&location_id=$locationId&wanttogo=$wanttogo&like=$like&checkin=$checkin";
|
String url =
|
||||||
|
"$serverUrl/api/makeaction/?user_id=$userId&location_id=$locationId&wanttogo=$wanttogo&like=$like&checkin=$checkin";
|
||||||
//String url = "http://localhost:8100/api/makeaction/?user_id=${user_id}&location_id=${location_id}&wanttogo=${wanttogo}&like=${like}&checkin=${checkin}";
|
//String url = "http://localhost:8100/api/makeaction/?user_id=${user_id}&location_id=${location_id}&wanttogo=${wanttogo}&like=${like}&checkin=${checkin}";
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
print("url is ------ $url");
|
//print("url is ------ $url");
|
||||||
final http.Response response = await http.get(
|
final http.Response response =
|
||||||
Uri.parse(url),
|
await http.get(Uri.parse(url), headers: <String, String>{
|
||||||
headers: <String, String>{
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
@ -26,27 +24,23 @@ class ActionService{
|
|||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<List<dynamic>?> userAction(int userId, int locationId) async {
|
||||||
static Future<List<dynamic>?> userAction(int userId, int locationId) async {
|
|
||||||
List<dynamic> cats = [];
|
List<dynamic> cats = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/useraction/?user_id=$userId&location_id=$locationId';
|
String url =
|
||||||
print('++++++++$url');
|
'$serverUrl/api/useraction/?user_id=$userId&location_id=$locationId';
|
||||||
|
//print('++++++++$url');
|
||||||
//String url = 'http://localhost:8100/api/useraction/?user_id=${user_id}&location_id=${location_id}';
|
//String url = 'http://localhost:8100/api/useraction/?user_id=${user_id}&location_id=${location_id}';
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,69 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:rogapp/model/auth_user.dart';
|
||||||
|
|
||||||
import '../utils/const.dart';
|
import '../utils/const.dart';
|
||||||
|
|
||||||
|
class AuthService {
|
||||||
|
Future<AuthUser?> userLogin(String email, String password) async {
|
||||||
|
final serverUrl = ConstValues.currentServer();
|
||||||
|
final url = '$serverUrl/api/login/';
|
||||||
|
|
||||||
class AuthService{
|
try {
|
||||||
|
final http.Response response = await http.post(
|
||||||
|
Uri.parse(url),
|
||||||
|
headers: <String, String>{
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
},
|
||||||
|
body:
|
||||||
|
jsonEncode(<String, String>{'email': email, 'password': password}),
|
||||||
|
);
|
||||||
|
switch (response.statusCode) {
|
||||||
|
case 200:
|
||||||
|
final data = json.decode(utf8.decode(response.bodyBytes));
|
||||||
|
AuthUser user = AuthUser.fromMap(data["user"]);
|
||||||
|
final String token = data["token"];
|
||||||
|
user.auth_token = token;
|
||||||
|
return user;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
//throw Exception(response.reasonPhrase);
|
||||||
|
}
|
||||||
|
} on Exception catch (_) {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> changePassword(String oldpassword, String newpassword, String token) async {
|
Future<AuthUser?> userFromToken(String token) async {
|
||||||
|
final serverUrl = ConstValues.currentServer();
|
||||||
|
final url = '$serverUrl/api/user/';
|
||||||
|
try {
|
||||||
|
final http.Response response =
|
||||||
|
await http.get(Uri.parse(url), headers: <String, String>{
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'Authorization': 'Token $token'
|
||||||
|
});
|
||||||
|
switch (response.statusCode) {
|
||||||
|
case 200:
|
||||||
|
final data = json.decode(utf8.decode(response.bodyBytes));
|
||||||
|
AuthUser user = AuthUser.fromMap(data);
|
||||||
|
user.auth_token = token;
|
||||||
|
return user;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
//throw Exception(response.reasonPhrase);
|
||||||
|
}
|
||||||
|
} on Exception catch (_) {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<Map<String, dynamic>> changePassword(
|
||||||
|
String oldpassword, String newpassword, String token) async {
|
||||||
Map<String, dynamic> changePassword = {};
|
Map<String, dynamic> changePassword = {};
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/change-password/';
|
String url = '$serverUrl/api/change-password/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final http.Response response = await http.put(
|
final http.Response response = await http.put(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
@ -24,28 +77,25 @@ class AuthService{
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
changePassword = json.decode(utf8.decode(response.bodyBytes));
|
changePassword = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return changePassword;
|
return changePassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<Map<String, dynamic>> login(
|
||||||
static Future<Map<String, dynamic>> login(String email, String password) async {
|
String email, String password) async {
|
||||||
print("------- in logged email $email pwd $password ###### --------");
|
//print("------- in logged email $email pwd $password ###### --------");
|
||||||
Map<String, dynamic> cats = {};
|
Map<String, dynamic> cats = {};
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/login/';
|
String url = '$serverUrl/api/login/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
//String url = 'http://localhost:8100/api/login/';
|
//String url = 'http://localhost:8100/api/login/';
|
||||||
final http.Response response = await http.post(
|
final http.Response response = await http.post(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
body: jsonEncode(<String, String>{
|
body: jsonEncode(<String, String>{'email': email, 'password': password}),
|
||||||
'email': email,
|
|
||||||
'password': password
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
@ -54,41 +104,36 @@ class AuthService{
|
|||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<Map<String, dynamic>> register(
|
||||||
static Future<Map<String, dynamic>> register(String email, String password) async {
|
String email, String password) async {
|
||||||
Map<String, dynamic> cats = {};
|
Map<String, dynamic> cats = {};
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/register/';
|
String url = '$serverUrl/api/register/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final http.Response response = await http.post(
|
final http.Response response = await http.post(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
body: jsonEncode(<String, String>{
|
body: jsonEncode(<String, String>{'email': email, 'password': password}),
|
||||||
'email': email,
|
|
||||||
'password': password
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
print(response.body);
|
//print(response.body);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> deleteUser(String token) async {
|
static Future<Map<String, dynamic>> deleteUser(String token) async {
|
||||||
Map<String, dynamic> cats = {};
|
Map<String, dynamic> cats = {};
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/delete-account/';
|
String url = '$serverUrl/api/delete-account/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final http.Response response = await http.get(
|
final http.Response response =
|
||||||
Uri.parse(url),
|
await http.get(Uri.parse(url), headers: <String, String>{
|
||||||
headers: <String, String>{
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Authorization': 'Token $token'
|
||||||
'Authorization': 'Token $token'
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
@ -96,50 +141,45 @@ class AuthService{
|
|||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<List<dynamic>?> userDetails(int userid) async {
|
||||||
static Future<List<dynamic>?> UserDetails(int userid) async {
|
|
||||||
List<dynamic> cats = [];
|
List<dynamic> cats = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/userdetials?user_id=$userid';
|
String url = '$serverUrl/api/userdetials?user_id=$userid';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
print("---- UserDetails url is $url");
|
//print("---- UserDetails url is $url");
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static Future<List<dynamic>?> userForToken(String token) async {
|
static Future<List<dynamic>?> userForToken(String token) async {
|
||||||
Map<String, dynamic> cats = {};
|
Map<String, dynamic> cats = {};
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/user/';
|
String url = '$serverUrl/api/user/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
print("---- UserDetails url is $url");
|
//print("---- UserDetails url is $url");
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Authorization': 'Token $token'
|
'Authorization': 'Token $token'
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
print("--- eeeeee $cats ----");
|
//print("--- eeeeee $cats ----");
|
||||||
}
|
}
|
||||||
return [{"user":cats, "token":token}];
|
return [
|
||||||
|
{"user": cats, "token": token}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,50 +3,42 @@ import 'package:http/http.dart' as http;
|
|||||||
|
|
||||||
import '../utils/const.dart';
|
import '../utils/const.dart';
|
||||||
|
|
||||||
|
class CatService {
|
||||||
class CatService{
|
static Future<List<dynamic>?> loadCats(double lat1, double lon1, double lat2,
|
||||||
|
double lon2, double lat3, double lon3, double lat4, double lon4) async {
|
||||||
static Future<List<dynamic>?> loadCats(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3, double lat4, double lon4) async {
|
|
||||||
List<dynamic> cats = [];
|
List<dynamic> cats = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/cats/?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
|
String url =
|
||||||
print('++++++++$url');
|
'$serverUrl/api/cats/?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
|
||||||
final response = await http.get(Uri.parse(url),
|
//print('++++++++$url');
|
||||||
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<List<dynamic>?> loadCatByCity(String cityname) async {
|
||||||
static Future<List<dynamic>?> loadCatByCity(String cityname)async {
|
|
||||||
List<dynamic> cats = [];
|
List<dynamic> cats = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/catbycity/?$cityname';
|
String url = '$serverUrl/api/catbycity/?$cityname';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -8,20 +8,16 @@ import 'package:rogapp/pages/destination/destination_controller.dart';
|
|||||||
|
|
||||||
import '../utils/const.dart';
|
import '../utils/const.dart';
|
||||||
|
|
||||||
|
class DestinationService {
|
||||||
class DestinationService{
|
static Future<List<dynamic>> getDestinations(int userId) async {
|
||||||
|
|
||||||
static Future<List<dynamic>> getDestinations(int userId) async {
|
|
||||||
List<dynamic> cats = [];
|
List<dynamic> cats = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = "$serverUrl/api/destinations/?user_id=$userId";
|
String url = "$serverUrl/api/destinations/?user_id=$userId";
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final http.Response response = await http.get(
|
final http.Response response =
|
||||||
Uri.parse(url),
|
await http.get(Uri.parse(url), headers: <String, String>{
|
||||||
headers: <String, String>{
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
@ -29,36 +25,33 @@ class DestinationService{
|
|||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> deleteDestination(int destId) async {
|
static Future<Map<String, dynamic>> deleteDestination(int destId) async {
|
||||||
Map<String, dynamic> cats = {};
|
Map<String, dynamic> cats = {};
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = "$serverUrl/api/delete_destination/?dest_id=$destId";
|
String url = "$serverUrl/api/delete_destination/?dest_id=$destId";
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final http.Response response = await http.get(
|
final http.Response response =
|
||||||
Uri.parse(url),
|
await http.get(Uri.parse(url), headers: <String, String>{
|
||||||
headers: <String, String>{
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
print("####### ---- $cats");
|
//print("####### ---- $cats");
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<int> updateOrder(int actionId, int order, String dir) async {
|
static Future<int> updateOrder(int actionId, int order, String dir) async {
|
||||||
int cats = 0;
|
int cats = 0;
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = "$serverUrl/api/updateorder/?user_action_id=$actionId&order=$order&dir=$dir";
|
String url =
|
||||||
print('++++++++$url');
|
"$serverUrl/api/updateorder/?user_action_id=$actionId&order=$order&dir=$dir";
|
||||||
final http.Response response = await http.get(
|
//print('++++++++$url');
|
||||||
Uri.parse(url),
|
final http.Response response =
|
||||||
headers: <String, String>{
|
await http.get(Uri.parse(url), headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
@ -66,23 +59,25 @@ class DestinationService{
|
|||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<List<PointLatLng>>? getDestinationLine(List<Destination> destinations, Map<String, dynamic> mtx) async{
|
static Future<List<PointLatLng>>? getDestinationLine(
|
||||||
|
List<Destination> destinations, Map<String, dynamic> mtx) async {
|
||||||
PolylinePoints polylinePoints = PolylinePoints();
|
PolylinePoints polylinePoints = PolylinePoints();
|
||||||
|
|
||||||
if(destinations.isEmpty){
|
if (destinations.isEmpty) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
//print("##### @@@@@ ${destinations[0].lat}");
|
//print("##### @@@@@ ${destinations[0].lat}");
|
||||||
PointLatLng origin = PointLatLng(destinations[0].lat!, destinations[0].lon!);
|
PointLatLng origin =
|
||||||
PointLatLng dest = PointLatLng(destinations[destinations.length -1].lat!, destinations[destinations.length -1].lon!);
|
PointLatLng(destinations[0].lat!, destinations[0].lon!);
|
||||||
|
PointLatLng dest = PointLatLng(destinations[destinations.length - 1].lat!,
|
||||||
|
destinations[destinations.length - 1].lon!);
|
||||||
|
|
||||||
List<PolylineWayPoint> wayPoints = [];
|
List<PolylineWayPoint> wayPoints = [];
|
||||||
int i=0;
|
int i = 0;
|
||||||
for(dynamic d in destinations){
|
for (dynamic d in destinations) {
|
||||||
if(i == 0 || i == (destinations.length -1)){
|
if (i == 0 || i == (destinations.length - 1)) {
|
||||||
i+=1;
|
i += 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
double la = d.lat;
|
double la = d.lat;
|
||||||
@ -90,31 +85,31 @@ class DestinationService{
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
PolylineWayPoint pwp = PolylineWayPoint(location: "$la,$ln", stopOver: false);
|
PolylineWayPoint pwp =
|
||||||
|
PolylineWayPoint(location: "$la,$ln", stopOver: false);
|
||||||
|
|
||||||
//print("----- UUUUUU ${pwp}");
|
//print("----- UUUUUU ${pwp}");
|
||||||
//PointLatLng wp = PointLatLng(d["Location"]["geometry"][0][1], d["Location"]["geometry"][0][0]);
|
//PointLatLng wp = PointLatLng(d["Location"]["geometry"][0][1], d["Location"]["geometry"][0][0]);
|
||||||
wayPoints.add(pwp);
|
wayPoints.add(pwp);
|
||||||
i+=1;
|
i += 1;
|
||||||
j += 4;
|
j += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
final DestinationController destinationController = Get.find<DestinationController>();
|
final DestinationController destinationController =
|
||||||
int travMode = destinationController.travelMode.value;
|
Get.find<DestinationController>();
|
||||||
String _mode = "WALKING";
|
// int travMode = destinationController.travelMode.value;
|
||||||
if(travMode == 1){
|
// String mode = "WALKING";
|
||||||
//_mode = TravelMode.driving;
|
// if (travMode == 1) {
|
||||||
_mode = "DRIVING";
|
// //_mode = TravelMode.driving;
|
||||||
}
|
// mode = "DRIVING";
|
||||||
else if(travMode == 2) {
|
// } else if (travMode == 2) {
|
||||||
//_mode = TravelMode.transit;
|
// //_mode = TravelMode.transit;
|
||||||
_mode = "TRANSIT";
|
// mode = "TRANSIT";
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
//PolylineResult result = await polylinePoints.getRouteBetweenCoordinates("AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE", PointLatLng(35.389282, 136.498027), PointLatLng(36.285848, 137.575186));
|
//PolylineResult result = await polylinePoints.getRouteBetweenCoordinates("AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE", PointLatLng(35.389282, 136.498027), PointLatLng(36.285848, 137.575186));
|
||||||
Map<String, dynamic> pl = destinationController.matrix["routes"][0]["overview_polyline"];
|
Map<String, dynamic> pl =
|
||||||
|
destinationController.matrix["routes"][0]["overview_polyline"];
|
||||||
List<PointLatLng> result = polylinePoints.decodePolyline(pl["points"]);
|
List<PointLatLng> result = polylinePoints.decodePolyline(pl["points"]);
|
||||||
//List<PointLatLng> result = polylinePoints.decodePolyline("qkyvEq`z`Yp@DBMr@XL@Td@Eb@PREd@IFe@rKIzCY|GEvCBzCHvS@xC?HnBHtBHlBFnBFhGRtDVW~BE`@ICHLk@dE_ClPgAtHu@bFsAhPg@~Ge@bFaEtg@kEpi@oCd\\w@nIw@hGe@fBy@nBqAjC{@zBgBtFOd@M@Wv@i@`BQf@ITKCuE`@yDZqBRCHa@DKG_AHwBRiBR_Fp@y@LYBY]M@KJo@v@M@cAGoGN_Cx@}Cf@}@@mM~@qF`@gCLwBj@sBrAeAhAsAtCoF|MmAbD{@fBwAdBw@p@_Ax@BFOHAl@?`@MAQCEAOIQSaBx@{Ah@eATsAHSB?d@A`D?f@IdWy@AS??V?|BCJ}@?cA?k@Au@wBqDuKQaACg@z@gELg@GK~@uEp@{A@q@y@CHwFHcG?KDqCDK^ABABEH{AE{B{@_Ho@uFIaBFQhBaC@SQSg@k@g@q@Yw@qA{De@}B]uDCsAMEWDqAFu@@^A@TDjA@vDA`CETK|AEtAIFY@o@ALpBZ~HBlCBn@EDGPu@pASJO`@Qf@?ROr@K?qDLHnEUTsDNkENYB{Ab@I^?zA}CrCkBfBw@t@@LwA`Bo@r@eGvD}BrAGGuAj@[?i@rBVi@P}@T?F?^MxDuBhDsBzAcAn@s@zCgDAI~A{A|CsC?{A?UHItA_@DCXC~J_@TUIoEvDKTm@?Y^iALIb@k@f@aAE}AA_BC{@\\Cv@CxAEj@ExCwDDc@CYFANCh@WHEIIRQhB}B|C_E\\w@Hq@JE?a@O}CGkAIwEGmDEmDAKLA^?A}@C{@?e@E_DFQNi@LcB\\eBPsADGKOEWBOH[GCPs@Pq@\\cANs@^q@jAu@fCqAf@]HCXoCV_BVmAZmBVcDBeCCgDAaB?s@RE?aCCaEAyHAoDd@EJiD@_@AaAj@A\\A?Gp@@r@oBXm@LQ?IEy@Fy@tA[n@Gj@Tz@[~ACdAAx@Lp@Kr@]hAa@HAQoCMwCSwGSiGK_CCCKaBCgCOoCOgECwGB_OB{JHkBEmC?yCDyFF{QFue@BsYByE?oAEgAByLBiL?gLBuGXsEd@cCNA?OHa@jAuCn@eAtCyDh@k@v@EvBKr@EEkACUKaC?G~@gAlCeDFBT[jFeGZAfBEh@UpBM`AEMaFjFYIhE?hEPpCJzAPt@Fj@GNUFu@N[FyBbAuB`@_@LEIOB}@HUBQFk@FcAACGQA}@Bi@F@F[Dc@D[FQHELGhBMtDGR?D");
|
//List<PointLatLng> result = polylinePoints.decodePolyline("qkyvEq`z`Yp@DBMr@XL@Td@Eb@PREd@IFe@rKIzCY|GEvCBzCHvS@xC?HnBHtBHlBFnBFhGRtDVW~BE`@ICHLk@dE_ClPgAtHu@bFsAhPg@~Ge@bFaEtg@kEpi@oCd\\w@nIw@hGe@fBy@nBqAjC{@zBgBtFOd@M@Wv@i@`BQf@ITKCuE`@yDZqBRCHa@DKG_AHwBRiBR_Fp@y@LYBY]M@KJo@v@M@cAGoGN_Cx@}Cf@}@@mM~@qF`@gCLwBj@sBrAeAhAsAtCoF|MmAbD{@fBwAdBw@p@_Ax@BFOHAl@?`@MAQCEAOIQSaBx@{Ah@eATsAHSB?d@A`D?f@IdWy@AS??V?|BCJ}@?cA?k@Au@wBqDuKQaACg@z@gELg@GK~@uEp@{A@q@y@CHwFHcG?KDqCDK^ABABEH{AE{B{@_Ho@uFIaBFQhBaC@SQSg@k@g@q@Yw@qA{De@}B]uDCsAMEWDqAFu@@^A@TDjA@vDA`CETK|AEtAIFY@o@ALpBZ~HBlCBn@EDGPu@pASJO`@Qf@?ROr@K?qDLHnEUTsDNkENYB{Ab@I^?zA}CrCkBfBw@t@@LwA`Bo@r@eGvD}BrAGGuAj@[?i@rBVi@P}@T?F?^MxDuBhDsBzAcAn@s@zCgDAI~A{A|CsC?{A?UHItA_@DCXC~J_@TUIoEvDKTm@?Y^iALIb@k@f@aAE}AA_BC{@\\Cv@CxAEj@ExCwDDc@CYFANCh@WHEIIRQhB}B|C_E\\w@Hq@JE?a@O}CGkAIwEGmDEmDAKLA^?A}@C{@?e@E_DFQNi@LcB\\eBPsADGKOEWBOH[GCPs@Pq@\\cANs@^q@jAu@fCqAf@]HCXoCV_BVmAZmBVcDBeCCgDAaB?s@RE?aCCaEAyHAoDd@EJiD@_@AaAj@A\\A?Gp@@r@oBXm@LQ?IEy@Fy@tA[n@Gj@Tz@[~ACdAAx@Lp@Kr@]hAa@HAQoCMwCSwGSiGK_CCCKaBCgCOoCOgECwGB_OB{JHkBEmC?yCDyFF{QFue@BsYByE?oAEgAByLBiL?gLBuGXsEd@cCNA?OHa@jAuCn@eAtCyDh@k@v@EvBKr@EEkACUKaC?G~@gAlCeDFBT[jFeGZAfBEh@UpBM`AEMaFjFYIhE?hEPpCJzAPt@Fj@GNUFu@N[FyBbAuB`@_@LEIOB}@HUBQFk@FcAACGQA}@Bi@F@F[Dc@D[FQHELGhBMtDGR?D");
|
||||||
//PolylineResult result = await polylinePoints.getRouteBetweenCoordinates("AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE", origin,dest, travelMode: _mode, wayPoints: wayPoints);
|
//PolylineResult result = await polylinePoints.getRouteBetweenCoordinates("AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE", origin,dest, travelMode: _mode, wayPoints: wayPoints);
|
||||||
@ -122,7 +117,4 @@ class DestinationService{
|
|||||||
//print("#####@@@@@ ${result.points}");
|
//print("#####@@@@@ ${result.points}");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,301 +17,305 @@ import '../utils/const.dart';
|
|||||||
class ExternalService {
|
class ExternalService {
|
||||||
static final ExternalService _instance = ExternalService._internal();
|
static final ExternalService _instance = ExternalService._internal();
|
||||||
|
|
||||||
factory ExternalService(){
|
factory ExternalService() {
|
||||||
return _instance;
|
return _instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExternalService._internal();
|
ExternalService._internal();
|
||||||
|
|
||||||
String getFormatedTime(DateTime datetime){
|
String getFormatedTime(DateTime datetime) {
|
||||||
return DateFormat('yyyy-MM-dd HH:mm:ss').format(datetime);
|
return DateFormat('yyyy-MM-dd HH:mm:ss').format(datetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Map<String, dynamic>> StartRogaining() async {
|
Future<Map<String, dynamic>> startRogaining() async {
|
||||||
|
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
|
|
||||||
Map<String, dynamic> _res = {};
|
Map<String, dynamic> res = {};
|
||||||
|
|
||||||
int userId = indexController.currentUser[0]["user"]["id"];
|
int userId = indexController.currentUser[0]["user"]["id"];
|
||||||
//print("--- Pressed -----");
|
//print("--- Pressed -----");
|
||||||
String _team = indexController.currentUser[0]["user"]['team_name'];
|
String team = indexController.currentUser[0]["user"]['team_name'];
|
||||||
//print("--- _team : ${_team}-----");
|
//print("--- _team : ${_team}-----");
|
||||||
String _event_code = indexController.currentUser[0]["user"]["event_code"];
|
String eventCode = indexController.currentUser[0]["user"]["event_code"];
|
||||||
|
|
||||||
if(indexController.connectionStatusName != "wifi" && indexController.connectionStatusName != "mobile"){
|
if (indexController.connectionStatusName.value != "wifi" &&
|
||||||
|
indexController.connectionStatusName.value != "mobile") {
|
||||||
DatabaseHelper db = DatabaseHelper.instance;
|
DatabaseHelper db = DatabaseHelper.instance;
|
||||||
Rog _rog = Rog(
|
Rog rog = Rog(
|
||||||
id:1,
|
id: 1,
|
||||||
team_name: _team,
|
team_name: team,
|
||||||
event_code : _event_code,
|
event_code: eventCode,
|
||||||
user_id: userId,
|
user_id: userId,
|
||||||
cp_number: -1,
|
cp_number: -1,
|
||||||
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
||||||
image: null,
|
image: null,
|
||||||
rog_action_type: 0
|
rog_action_type: 0);
|
||||||
);
|
db.insertRogaining(rog);
|
||||||
db.insertRogaining(_rog);
|
} else {
|
||||||
}
|
|
||||||
else {
|
|
||||||
String url = 'https://rogaining.sumasen.net/gifuroge/start_from_rogapp';
|
String url = 'https://rogaining.sumasen.net/gifuroge/start_from_rogapp';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final http.Response response = await http.post(
|
final http.Response response = await http.post(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
body: jsonEncode(<String, String>{
|
body: jsonEncode(
|
||||||
'team_name': _team,
|
<String, String>{'team_name': team, 'event_code': eventCode}),
|
||||||
'event_code': _event_code
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
print("---- start rogianing api status ---- ${response.statusCode}");
|
//print("---- start rogianing api status ---- ${response.statusCode}");
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
_res = json.decode(utf8.decode(response.bodyBytes));
|
res = json.decode(utf8.decode(response.bodyBytes));
|
||||||
print('----_res : $_res ----');
|
//print('----_res : $res ----');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Map<String, dynamic>> makeCheckpoint(int userId, String token, String checkinTime, String teamname, int cp, String eventcode, String imageurl) async {
|
Future<Map<String, dynamic>> makeCheckpoint(
|
||||||
print("~~~~ in API call function ~~~~");
|
int userId,
|
||||||
print("~~~~ cp is ${cp} ~~~~");
|
String token,
|
||||||
|
String checkinTime,
|
||||||
|
String teamname,
|
||||||
|
int cp,
|
||||||
|
String eventcode,
|
||||||
|
String imageurl) async {
|
||||||
|
// print("~~~~ in API call function ~~~~");
|
||||||
|
// print("~~~~ cp is $cp ~~~~");
|
||||||
//print("--cpcp-- ${cp}");
|
//print("--cpcp-- ${cp}");
|
||||||
Map<String, dynamic> _res = {};
|
Map<String, dynamic> res = {};
|
||||||
String url = 'https://rogaining.sumasen.net/gifuroge/checkin_from_rogapp';
|
String url = 'https://rogaining.sumasen.net/gifuroge/checkin_from_rogapp';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
|
|
||||||
if(imageurl != null){
|
if (imageurl != null) {
|
||||||
if(indexController.connectionStatusName != "wifi" && indexController.connectionStatusName != "mobile"){
|
if (indexController.connectionStatusName.value != "wifi" &&
|
||||||
|
indexController.connectionStatusName.value != "mobile") {
|
||||||
DatabaseHelper db = DatabaseHelper.instance;
|
DatabaseHelper db = DatabaseHelper.instance;
|
||||||
Rog _rog = Rog(
|
Rog rog = Rog(
|
||||||
id:1,
|
id: 1,
|
||||||
team_name: teamname,
|
team_name: teamname,
|
||||||
event_code : eventcode,
|
event_code: eventcode,
|
||||||
user_id: userId,
|
user_id: userId,
|
||||||
cp_number: cp,
|
cp_number: cp,
|
||||||
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
||||||
image: imageurl,
|
image: imageurl,
|
||||||
rog_action_type: 1,
|
rog_action_type: 1,
|
||||||
);
|
);
|
||||||
db.insertRogaining(_rog);
|
db.insertRogaining(rog);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url1 = "$serverUrl/api/checkinimage/";
|
String url1 = "$serverUrl/api/checkinimage/";
|
||||||
final im1Bytes = File(imageurl).readAsBytesSync();
|
final im1Bytes = File(imageurl).readAsBytesSync();
|
||||||
String im1_64 = base64Encode(im1Bytes);
|
String im1_64 = base64Encode(im1Bytes);
|
||||||
|
|
||||||
print("~~~~ before calling api 1 ~~~~");
|
//print("~~~~ before calling api 1 ~~~~");
|
||||||
|
|
||||||
final http.Response response = await http.post(
|
final http.Response response = await http.post(
|
||||||
Uri.parse(url1),
|
Uri.parse(url1),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Authorization': 'Token $token'
|
'Authorization': 'Token $token'
|
||||||
},
|
},
|
||||||
// 'id', 'user', 'goalimage', 'goaltime', 'team_name', 'event_code','cp_number'
|
// 'id', 'user', 'goalimage', 'goaltime', 'team_name', 'event_code','cp_number'
|
||||||
body: jsonEncode(<String, String>{
|
body: jsonEncode(<String, String>{
|
||||||
'user' : userId.toString(),
|
'user': userId.toString(),
|
||||||
'team_name': teamname,
|
'team_name': teamname,
|
||||||
'event_code': eventcode,
|
'event_code': eventcode,
|
||||||
'checkinimage' : im1_64,
|
'checkinimage': im1_64,
|
||||||
'checkintime' : checkinTime,
|
'checkintime': checkinTime,
|
||||||
'cp_number' : cp.toString()
|
'cp_number': cp.toString()
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
_res = json.decode(utf8.decode(response.bodyBytes));
|
res = json.decode(utf8.decode(response.bodyBytes));
|
||||||
print("~~~~ api1 result ${_res} ~~~~");
|
//print("~~~~ api1 result $res ~~~~");
|
||||||
//print("-----@@@@@ checkin $_res -----");
|
//print("-----@@@@@ checkin $_res -----");
|
||||||
|
|
||||||
if(response.statusCode == 201){
|
if (response.statusCode == 201) {
|
||||||
print("~~~~ image from api1 ${_res["checkinimage"].toString()} ~~~~");
|
//print("~~~~ image from api1 ${res["checkinimage"].toString()} ~~~~");
|
||||||
//print('---- toekn is ${token} -----');
|
//print('---- toekn is ${token} -----');
|
||||||
print("~~~~ token is ${token} ~~~~");
|
//print("~~~~ token is $token ~~~~");
|
||||||
print("~~~~ before callling api2 ~~~~");
|
//print("~~~~ before callling api2 ~~~~");
|
||||||
final http.Response response2 = await http.post(
|
|
||||||
Uri.parse(url),
|
|
||||||
headers: <String, String>{
|
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
|
||||||
},
|
|
||||||
body: jsonEncode(<String, String>{
|
|
||||||
'team_name': teamname,
|
|
||||||
'cp_number': cp.toString(),
|
|
||||||
'event_code': eventcode,
|
|
||||||
'image': _res["checkinimage"].toString().replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net')
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
var vv = jsonEncode(<String, String>{
|
|
||||||
'team_name': teamname,
|
|
||||||
'cp_number': cp.toString(),
|
|
||||||
'event_code': eventcode,
|
|
||||||
'image': _res["checkinimage"].toString().replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net')
|
|
||||||
});
|
|
||||||
print("~~~~ api 2 values ${vv} ~~~~");
|
|
||||||
//print("--json-- $vv");
|
|
||||||
//print("--- checnin response ${response2.statusCode}----");
|
|
||||||
if (response2.statusCode == 200) {
|
|
||||||
_res = json.decode(utf8.decode(response2.bodyBytes));
|
|
||||||
print('----checkin res _res : $_res ----');
|
|
||||||
if(_res["status"] == "ERROR"){
|
|
||||||
Get.snackbar("エラーがおきました", _res["detail"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
Get.snackbar("エラーがおきました", "サーバーに更新できませんでした");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(indexController.connectionStatusName != "wifi" || indexController.connectionStatusName != "mobile"){
|
|
||||||
DatabaseHelper db = DatabaseHelper.instance;
|
|
||||||
Rog _rog = Rog(
|
|
||||||
id:1,
|
|
||||||
team_name: teamname,
|
|
||||||
event_code : eventcode,
|
|
||||||
user_id: userId,
|
|
||||||
cp_number: cp,
|
|
||||||
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
|
||||||
image: null,
|
|
||||||
rog_action_type: 1,
|
|
||||||
);
|
|
||||||
db.insertRogaining(_rog);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
final http.Response response3 = await http.post(
|
|
||||||
Uri.parse(url),
|
|
||||||
headers: <String, String>{
|
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
|
||||||
},
|
|
||||||
body: jsonEncode(<String, String>{
|
|
||||||
'team_name': teamname,
|
|
||||||
'cp_number': cp.toString(),
|
|
||||||
'event_code': eventcode,
|
|
||||||
'image': ""
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
var vvv = jsonEncode(<String, String>{
|
|
||||||
'team_name': teamname,
|
|
||||||
'cp_number': cp.toString(),
|
|
||||||
'event_code': eventcode,
|
|
||||||
'image': _res["checkinimage"].toString().replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net')
|
|
||||||
});
|
|
||||||
print("--json-- $vvv");
|
|
||||||
print("--- checnin response ${response3.statusCode}----");
|
|
||||||
if (response3.statusCode == 200) {
|
|
||||||
_res = json.decode(utf8.decode(response3.bodyBytes));
|
|
||||||
print('----checkin res _res : $_res ----');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print("~~~~ done checkin ~~~~");
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Future<Map<String, dynamic>> makeGoal(int userId, String token, String teamname, String image, String goalTime, String eventcode) async {
|
|
||||||
Map<String, dynamic> _res2 = {};
|
|
||||||
|
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
|
||||||
final DestinationController destinationController = Get.find<DestinationController>();
|
|
||||||
|
|
||||||
//if(indexController.connectionStatusName != "wifi" && indexController.connectionStatusName != "mobile"){
|
|
||||||
DatabaseHelper db = DatabaseHelper.instance;
|
|
||||||
Rog _rog = Rog(
|
|
||||||
id:1,
|
|
||||||
team_name: teamname,
|
|
||||||
event_code : eventcode,
|
|
||||||
user_id: userId,
|
|
||||||
cp_number: -1,
|
|
||||||
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
|
||||||
image: image,
|
|
||||||
rog_action_type: 1,
|
|
||||||
);
|
|
||||||
db.insertRogaining(_rog);
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
String serverUrl = ConstValues.currentServer();
|
|
||||||
String url1 = "$serverUrl/api/goalimage/";
|
|
||||||
final im1Bytes = File(image).readAsBytesSync();
|
|
||||||
String im1_64 = base64Encode(im1Bytes);
|
|
||||||
|
|
||||||
final http.Response response = await http.post(
|
|
||||||
Uri.parse(url1),
|
|
||||||
headers: <String, String>{
|
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
|
||||||
'Authorization': 'Token $token'
|
|
||||||
},
|
|
||||||
// 'id', 'user', 'goalimage', 'goaltime', 'team_name', 'event_code','cp_number'
|
|
||||||
body: jsonEncode(<String, String>{
|
|
||||||
'user' : userId.toString(),
|
|
||||||
'team_name': teamname,
|
|
||||||
'event_code': eventcode,
|
|
||||||
'goaltime' : goalTime,
|
|
||||||
'goalimage' : im1_64,
|
|
||||||
'cp_number' : "-1"
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
String url = 'https://rogaining.sumasen.net/gifuroge/goal_from_rogapp';
|
|
||||||
print('++++++++$url');
|
|
||||||
if (response.statusCode == 201) {
|
|
||||||
Map<String, dynamic> _res = json.decode(utf8.decode(response.bodyBytes));
|
|
||||||
print('----_res : $_res ----');
|
|
||||||
print('---- image url ${_res["goalimage"]} ----');
|
|
||||||
final http.Response response2 = await http.post(
|
final http.Response response2 = await http.post(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
body: jsonEncode(<String, String>{
|
body: jsonEncode(<String, String>{
|
||||||
'team_name': teamname,
|
'team_name': teamname,
|
||||||
'event_code': eventcode,
|
'cp_number': cp.toString(),
|
||||||
'goal_time' : goalTime,
|
'event_code': eventcode,
|
||||||
'image' : _res["goalimage"].toString().replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net')
|
'image': res["checkinimage"].toString().replaceAll(
|
||||||
}
|
'http://localhost:8100', 'http://rogaining.sumasen.net')
|
||||||
),
|
}),
|
||||||
);
|
);
|
||||||
String rec = jsonEncode(<String, String>{
|
var vv = jsonEncode(<String, String>{
|
||||||
'team_name': teamname,
|
'team_name': teamname,
|
||||||
'event_code': eventcode,
|
'cp_number': cp.toString(),
|
||||||
'goal_time' : goalTime,
|
'event_code': eventcode,
|
||||||
'image' : _res["goalimage"].toString().replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net')
|
'image': res["checkinimage"].toString().replaceAll(
|
||||||
}
|
'http://localhost:8100', 'http://rogaining.sumasen.net')
|
||||||
);
|
});
|
||||||
print("-- json -- $rec");
|
//print("~~~~ api 2 values $vv ~~~~");
|
||||||
print('----- response2 is $response2 --------');
|
//print("--json-- $vv");
|
||||||
if (response2.statusCode == 200) {
|
//print("--- checnin response ${response2.statusCode}----");
|
||||||
_res2 = json.decode(utf8.decode(response2.bodyBytes));
|
if (response2.statusCode == 200) {
|
||||||
|
res = json.decode(utf8.decode(response2.bodyBytes));
|
||||||
|
//print('----checkin res _res : $res ----');
|
||||||
|
if (res["status"] == "ERROR") {
|
||||||
|
Get.snackbar("エラーがおきました", res["detail"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Get.snackbar("エラーがおきました", "サーバーに更新できませんでした");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
} else {
|
||||||
destinationController.resetRogaining();
|
if (indexController.connectionStatusName.value != "wifi" ||
|
||||||
return _res2;
|
indexController.connectionStatusName.value != "mobile") {
|
||||||
|
DatabaseHelper db = DatabaseHelper.instance;
|
||||||
|
Rog rog = Rog(
|
||||||
|
id: 1,
|
||||||
|
team_name: teamname,
|
||||||
|
event_code: eventcode,
|
||||||
|
user_id: userId,
|
||||||
|
cp_number: cp,
|
||||||
|
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
||||||
|
image: null,
|
||||||
|
rog_action_type: 1,
|
||||||
|
);
|
||||||
|
db.insertRogaining(rog);
|
||||||
|
} else {
|
||||||
|
final http.Response response3 = await http.post(
|
||||||
|
Uri.parse(url),
|
||||||
|
headers: <String, String>{
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
},
|
||||||
|
body: jsonEncode(<String, String>{
|
||||||
|
'team_name': teamname,
|
||||||
|
'cp_number': cp.toString(),
|
||||||
|
'event_code': eventcode,
|
||||||
|
'image': ""
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
var vvv = jsonEncode(<String, String>{
|
||||||
|
'team_name': teamname,
|
||||||
|
'cp_number': cp.toString(),
|
||||||
|
'event_code': eventcode,
|
||||||
|
'image': res["checkinimage"].toString().replaceAll(
|
||||||
|
'http://localhost:8100', 'http://rogaining.sumasen.net')
|
||||||
|
});
|
||||||
|
// print("--json-- $vvv");
|
||||||
|
// print("--- checnin response ${response3.statusCode}----");
|
||||||
|
if (response3.statusCode == 200) {
|
||||||
|
res = json.decode(utf8.decode(response3.bodyBytes));
|
||||||
|
//print('----checkin res _res : $res ----');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//print("~~~~ done checkin ~~~~");
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<Map<String, dynamic>> makeGoal(int userId, String token,
|
||||||
|
String teamname, String image, String goalTime, String eventcode) async {
|
||||||
|
Map<String, dynamic> res2 = {};
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> usersEventCode(String teamcode, String password) async {
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
Map<String, dynamic> _res = {};
|
final DestinationController destinationController =
|
||||||
String url = "https://rogaining.sumasen.net/gifuroge/check_event_code?zekken_number=$teamcode&password=$password";
|
Get.find<DestinationController>();
|
||||||
print('++++++++$url');
|
|
||||||
final http.Response response = await http.get(
|
//if(indexController.connectionStatusName != "wifi" && indexController.connectionStatusName != "mobile"){
|
||||||
Uri.parse(url),
|
DatabaseHelper db = DatabaseHelper.instance;
|
||||||
|
Rog rog = Rog(
|
||||||
|
id: 1,
|
||||||
|
team_name: teamname,
|
||||||
|
event_code: eventcode,
|
||||||
|
user_id: userId,
|
||||||
|
cp_number: -1,
|
||||||
|
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
||||||
|
image: image,
|
||||||
|
rog_action_type: 1,
|
||||||
|
);
|
||||||
|
db.insertRogaining(rog);
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
String serverUrl = ConstValues.currentServer();
|
||||||
|
String url1 = "$serverUrl/api/goalimage/";
|
||||||
|
final im1Bytes = File(image).readAsBytesSync();
|
||||||
|
String im1_64 = base64Encode(im1Bytes);
|
||||||
|
|
||||||
|
final http.Response response = await http.post(
|
||||||
|
Uri.parse(url1),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
}
|
'Authorization': 'Token $token'
|
||||||
|
},
|
||||||
|
// 'id', 'user', 'goalimage', 'goaltime', 'team_name', 'event_code','cp_number'
|
||||||
|
body: jsonEncode(<String, String>{
|
||||||
|
'user': userId.toString(),
|
||||||
|
'team_name': teamname,
|
||||||
|
'event_code': eventcode,
|
||||||
|
'goaltime': goalTime,
|
||||||
|
'goalimage': im1_64,
|
||||||
|
'cp_number': "-1"
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
String url = 'https://rogaining.sumasen.net/gifuroge/goal_from_rogapp';
|
||||||
_res = json.decode(utf8.decode(response.bodyBytes));
|
//print('++++++++$url');
|
||||||
|
if (response.statusCode == 201) {
|
||||||
|
Map<String, dynamic> res = json.decode(utf8.decode(response.bodyBytes));
|
||||||
|
// print('----_res : $res ----');
|
||||||
|
// print('---- image url ${res["goalimage"]} ----');
|
||||||
|
final http.Response response2 = await http.post(
|
||||||
|
Uri.parse(url),
|
||||||
|
headers: <String, String>{
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
},
|
||||||
|
body: jsonEncode(<String, String>{
|
||||||
|
'team_name': teamname,
|
||||||
|
'event_code': eventcode,
|
||||||
|
'goal_time': goalTime,
|
||||||
|
'image': res["goalimage"].toString().replaceAll(
|
||||||
|
'http://localhost:8100', 'http://rogaining.sumasen.net')
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
String rec = jsonEncode(<String, String>{
|
||||||
|
'team_name': teamname,
|
||||||
|
'event_code': eventcode,
|
||||||
|
'goal_time': goalTime,
|
||||||
|
'image': res["goalimage"]
|
||||||
|
.toString()
|
||||||
|
.replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net')
|
||||||
|
});
|
||||||
|
// print("-- json -- $rec");
|
||||||
|
// print('----- response2 is $response2 --------');
|
||||||
|
if (response2.statusCode == 200) {
|
||||||
|
res2 = json.decode(utf8.decode(response2.bodyBytes));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return _res;
|
//}
|
||||||
|
destinationController.resetRogaining();
|
||||||
|
return res2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<Map<String, dynamic>> usersEventCode(
|
||||||
|
String teamcode, String password) async {
|
||||||
|
Map<String, dynamic> res = {};
|
||||||
|
String url =
|
||||||
|
"https://rogaining.sumasen.net/gifuroge/check_event_code?zekken_number=$teamcode&password=$password";
|
||||||
|
//print('++++++++$url');
|
||||||
|
final http.Response response =
|
||||||
|
await http.get(Uri.parse(url), headers: <String, String>{
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
res = json.decode(utf8.decode(response.bodyBytes));
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -3,33 +3,30 @@ import 'package:http/http.dart' as http;
|
|||||||
|
|
||||||
import '../utils/const.dart';
|
import '../utils/const.dart';
|
||||||
|
|
||||||
class LocationLineService{
|
class LocationLineService {
|
||||||
|
static Future<GeoJsonFeature?> loadLocationLines() async {
|
||||||
static Future<GeoJsonFeature?> loadLocationLines() async {
|
|
||||||
final geo = GeoJson();
|
final geo = GeoJson();
|
||||||
GeoJsonFeature? fs;
|
GeoJsonFeature? fs;
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/location_line/';
|
String url = '$serverUrl/api/location_line/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
geo.processedFeatures.listen((fst) {
|
geo.processedFeatures.listen((fst) {
|
||||||
fs = fst;
|
fs = fst;
|
||||||
});
|
});
|
||||||
|
|
||||||
await geo.parse(response.body, verbose:true);
|
await geo.parse(response.body, verbose: true);
|
||||||
|
|
||||||
return fs;
|
return fs;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw Exception('Failed to create album.');
|
throw Exception('Failed to create album.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -3,34 +3,31 @@ import 'package:http/http.dart' as http;
|
|||||||
|
|
||||||
import '../utils/const.dart';
|
import '../utils/const.dart';
|
||||||
|
|
||||||
class LocationPolygonervice{
|
class LocationPolygonervice {
|
||||||
|
static Future<GeoJsonFeature?> loadLocationLines() async {
|
||||||
static Future<GeoJsonFeature?> loadLocationLines() async {
|
|
||||||
final geo = GeoJson();
|
final geo = GeoJson();
|
||||||
GeoJsonFeature? fs;
|
GeoJsonFeature? fs;
|
||||||
|
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/location_polygon/';
|
String url = '$serverUrl/api/location_polygon/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
geo.processedFeatures.listen((fst) {
|
geo.processedFeatures.listen((fst) {
|
||||||
fs = fst;
|
fs = fst;
|
||||||
});
|
});
|
||||||
|
|
||||||
await geo.parse(response.body, verbose:true);
|
await geo.parse(response.body, verbose: true);
|
||||||
|
|
||||||
return fs;
|
return fs;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw Exception('Failed to create album.');
|
throw Exception('Failed to create album.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -6,8 +6,7 @@ import 'package:http/http.dart' as http;
|
|||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
import 'package:rogapp/pages/index/index_controller.dart';
|
||||||
import 'package:rogapp/utils/const.dart';
|
import 'package:rogapp/utils/const.dart';
|
||||||
|
|
||||||
class LocationService{
|
class LocationService {
|
||||||
|
|
||||||
// static Future<GeoJsonFeatureCollection?> loadLocations() async {
|
// static Future<GeoJsonFeatureCollection?> loadLocations() async {
|
||||||
|
|
||||||
// final IndexController indexController = Get.find<IndexController>();
|
// final IndexController indexController = Get.find<IndexController>();
|
||||||
@ -34,42 +33,42 @@ class LocationService{
|
|||||||
// return null;
|
// return null;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
static Future<GeoJsonFeatureCollection?> loadLocationsFor(String perfecture, String cat) async {
|
static Future<GeoJsonFeatureCollection?> loadLocationsFor(
|
||||||
|
String perfecture, String cat) async {
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
String url = "";
|
String url = "";
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
|
|
||||||
if(cat.isNotEmpty){
|
if (cat.isNotEmpty) {
|
||||||
if(indexController.currentUser.isNotEmpty){
|
if (indexController.currentUser.isNotEmpty) {
|
||||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
bool rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||||
String r = _rog == true ? 'True': 'False';
|
String r = rog == true ? 'True' : 'False';
|
||||||
var grp = indexController.currentUser[0]['user']['event_code'];
|
var grp = indexController.currentUser[0]['user']['event_code'];
|
||||||
url = '$serverUrl/api/inperf/?rog=$r&perf=' + perfecture + '&cat=' + cat;
|
url = '$serverUrl/api/inperf/?rog=$r&perf=$perfecture&cat=$cat';
|
||||||
|
} else {
|
||||||
|
url = '$serverUrl/api/inperf/?perf=$perfecture&cat=$cat';
|
||||||
}
|
}
|
||||||
else {
|
} else {
|
||||||
url = '$serverUrl/api/inperf/?perf=' + perfecture + '&cat=' + cat;
|
if (indexController.currentUser.isNotEmpty) {
|
||||||
|
bool rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||||
|
String r = rog == true ? 'True' : 'False';
|
||||||
|
var grp = indexController.currentUser[0]['user']['event_code'];
|
||||||
|
url = '$serverUrl/api/inperf/?rog=$r&perf=$perfecture';
|
||||||
|
} else {
|
||||||
|
url = '$serverUrl/api/inperf/?perf=$perfecture';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
//print('++++++++$url');
|
||||||
if(indexController.currentUser.isNotEmpty){
|
final response = await http.get(
|
||||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
Uri.parse(url),
|
||||||
String r = _rog == true ? 'True': 'False';
|
|
||||||
var grp = indexController.currentUser[0]['user']['event_code'];
|
|
||||||
url = '$serverUrl/api/inperf/?rog=$r&perf=' + perfecture;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
url = '$serverUrl/api/inperf/?perf=' + perfecture;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print('++++++++$url');
|
|
||||||
final response = await http.get(Uri.parse(url),
|
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
GeoJsonFeatureCollection cc = await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
GeoJsonFeatureCollection cc =
|
||||||
|
await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||||
//print(cc);
|
//print(cc);
|
||||||
return cc; //featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
return cc; //featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
@ -80,97 +79,104 @@ class LocationService{
|
|||||||
List<dynamic> ext = [];
|
List<dynamic> ext = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/locsext/';
|
String url = '$serverUrl/api/locsext/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.post(Uri.parse(url),
|
final response = await http.post(Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Authorization': 'Token $token'
|
'Authorization': 'Token $token'
|
||||||
},
|
},
|
||||||
body: jsonEncode(<String, String>{
|
body: jsonEncode(<String, String>{
|
||||||
'token': token,
|
'token': token,
|
||||||
})
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
ext = json.decode(utf8.decode(response.bodyBytes));
|
ext = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return ext;
|
return ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<GeoJsonFeatureCollection?> loadLocationsSubFor(
|
||||||
static Future<GeoJsonFeatureCollection?> loadLocationsSubFor(String subperfecture, String cat) async {
|
String subperfecture, String cat) async {
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
String url = "";
|
String url = "";
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
if(cat.isNotEmpty){
|
if (cat.isNotEmpty) {
|
||||||
if(indexController.currentUser.isNotEmpty){
|
if (indexController.currentUser.isNotEmpty) {
|
||||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
bool rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||||
String r = _rog == true ? 'True': 'False';
|
String r = rog == true ? 'True' : 'False';
|
||||||
var grp = indexController.currentUser[0]['user']['event_code'];
|
var grp = indexController.currentUser[0]['user']['event_code'];
|
||||||
url = '$serverUrl/api/insubperf?rog=$r&subperf=' + subperfecture + '&cat=' + cat;
|
url = '$serverUrl/api/insubperf?rog=$r&subperf=$subperfecture&cat=$cat';
|
||||||
|
} else {
|
||||||
|
url = '$serverUrl/api/insubperf?subperf=$subperfecture&cat=$cat';
|
||||||
}
|
}
|
||||||
else{
|
} else {
|
||||||
url = '$serverUrl/api/insubperf?subperf=' + subperfecture + '&cat=' + cat;
|
if (indexController.currentUser.isNotEmpty) {
|
||||||
|
bool rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||||
|
String r = rog == true ? 'True' : 'False';
|
||||||
|
var grp = indexController.currentUser[0]['user']['event_code'];
|
||||||
|
url = '$serverUrl/api/insubperf?rog=$r&subperf=$subperfecture';
|
||||||
|
} else {
|
||||||
|
url = '$serverUrl/api/insubperf?subperf=$subperfecture';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
//print('++++++++$url');
|
||||||
if(indexController.currentUser.isNotEmpty){
|
final response = await http.get(
|
||||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
Uri.parse(url),
|
||||||
String r = _rog == true ? 'True': 'False';
|
|
||||||
var grp = indexController.currentUser[0]['user']['event_code'];
|
|
||||||
url = '$serverUrl/api/insubperf?rog=$r&subperf=' + subperfecture;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
url = '$serverUrl/api/insubperf?subperf=' + subperfecture;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print('++++++++$url');
|
|
||||||
final response = await http.get(Uri.parse(url),
|
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
GeoJsonFeatureCollection cc = await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
GeoJsonFeatureCollection cc =
|
||||||
|
await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||||
//print(cc);
|
//print(cc);
|
||||||
return cc; //featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
return cc; //featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<GeoJsonFeatureCollection?> loadLocationsBound(
|
||||||
static Future<GeoJsonFeatureCollection?> loadLocationsBound(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3, double lat4, double lon4, String cat) async {
|
double lat1,
|
||||||
print("-------- in location for bound -------------");
|
double lon1,
|
||||||
|
double lat2,
|
||||||
|
double lon2,
|
||||||
|
double lat3,
|
||||||
|
double lon3,
|
||||||
|
double lat4,
|
||||||
|
double lon4,
|
||||||
|
String cat) async {
|
||||||
|
//print("-------- in location for bound -------------");
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
String url = "";
|
String url = "";
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
if(cat.isNotEmpty){
|
if (cat.isNotEmpty) {
|
||||||
if(indexController.currentUser.isNotEmpty){
|
if (indexController.currentUser.isNotEmpty) {
|
||||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
bool rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||||
String r = _rog == true ? 'True': 'False';
|
String r = rog == true ? 'True' : 'False';
|
||||||
var grp = indexController.currentUser[0]['user']['event_code'];
|
var grp = indexController.currentUser[0]['user']['event_code'];
|
||||||
url = '$serverUrl/api/inbound?rog=$r&grp=$grp&ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4' '&cat=' + cat;
|
url =
|
||||||
|
'$serverUrl/api/inbound?rog=$r&grp=$grp&ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4&cat=$cat';
|
||||||
|
} else {
|
||||||
|
url =
|
||||||
|
'$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4&cat=$cat';
|
||||||
}
|
}
|
||||||
else{
|
} else {
|
||||||
url = '$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4' '&cat=' + cat;
|
if (indexController.currentUser.isNotEmpty) {
|
||||||
|
bool rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||||
|
String r = rog == true ? 'True' : 'False';
|
||||||
|
var grp = indexController.currentUser[0]['user']['event_code'];
|
||||||
|
//print("-------- requested user group $grp -------------");
|
||||||
|
url =
|
||||||
|
'$serverUrl/api/inbound?rog=$r&grp=$grp&ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
|
||||||
|
} else {
|
||||||
|
url =
|
||||||
|
'$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
//print('++++++++$url');
|
||||||
if(indexController.currentUser.isNotEmpty){
|
final response = await http.get(
|
||||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
Uri.parse(url),
|
||||||
String r = _rog == true ? 'True': 'False';
|
|
||||||
var grp = indexController.currentUser[0]['user']['event_code'];
|
|
||||||
print("-------- requested user group $grp -------------");
|
|
||||||
url = '$serverUrl/api/inbound?rog=$r&grp=$grp&ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
url = '$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print('++++++++$url');
|
|
||||||
final response = await http.get(Uri.parse(url),
|
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
@ -181,11 +187,11 @@ class LocationService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
GeoJsonFeatureCollection cc = await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
GeoJsonFeatureCollection cc =
|
||||||
if(cc.collection.isEmpty){
|
await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||||
|
if (cc.collection.isEmpty) {
|
||||||
return null;
|
return null;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
//print("---- feature got from server is ${cc.collection[0].properties} ------");
|
//print("---- feature got from server is ${cc.collection[0].properties} ------");
|
||||||
return cc;
|
return cc;
|
||||||
}
|
}
|
||||||
@ -193,39 +199,37 @@ class LocationService{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<GeoJsonFeatureCollection?> loadCustomLocations(
|
||||||
static Future<GeoJsonFeatureCollection?> loadCustomLocations(String name, String cat) async {
|
String name, String cat) async {
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
final IndexController indexController = Get.find<IndexController>();
|
||||||
String url = "";
|
String url = "";
|
||||||
if(cat == "-all-"){
|
if (cat == "-all-") {
|
||||||
cat = "";
|
cat = "";
|
||||||
}
|
}
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
print("loadCustomLocations url is ----- $cat");
|
//print("loadCustomLocations url is ----- $cat");
|
||||||
if(cat.isNotEmpty){
|
if (cat.isNotEmpty) {
|
||||||
if(indexController.currentUser.isNotEmpty){
|
if (indexController.currentUser.isNotEmpty) {
|
||||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
bool rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||||
String r = _rog == true ? 'True': 'False';
|
String r = rog == true ? 'True' : 'False';
|
||||||
var grp = indexController.currentUser[0]['user']['event_code'];
|
var grp = indexController.currentUser[0]['user']['event_code'];
|
||||||
url = '$serverUrl/api/custom_area/?rog=$r&&cat=' + cat;
|
url = '$serverUrl/api/custom_area/?rog=$r&&cat=$cat';
|
||||||
|
} else {
|
||||||
|
url = '$serverUrl/api/custom_area/?&cat=$cat';
|
||||||
}
|
}
|
||||||
else{
|
} else {
|
||||||
url = '$serverUrl/api/custom_area/?&cat=' + cat;
|
if (indexController.currentUser.isNotEmpty) {
|
||||||
}
|
bool rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||||
}
|
String r = rog == true ? 'True' : 'False';
|
||||||
else{
|
|
||||||
if(indexController.currentUser.isNotEmpty){
|
|
||||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
|
||||||
String r = _rog == true ? 'True': 'False';
|
|
||||||
var grp = indexController.currentUser[0]['user']['event_code'];
|
var grp = indexController.currentUser[0]['user']['event_code'];
|
||||||
url = '$serverUrl/api/customarea?rog=$r&name=$name';
|
url = '$serverUrl/api/customarea?rog=$r&name=$name';
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
url = '$serverUrl/api/customarea?name=$name';
|
url = '$serverUrl/api/customarea?name=$name';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
@ -236,18 +240,14 @@ class LocationService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
GeoJsonFeatureCollection cc = await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
GeoJsonFeatureCollection cc =
|
||||||
if(cc.collection.isEmpty){
|
await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||||
|
if (cc.collection.isEmpty) {
|
||||||
return null;
|
return null;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return cc;
|
return cc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,73 +1,66 @@
|
|||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:rogapp/model/destination.dart';
|
import 'package:rogapp/model/destination.dart';
|
||||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||||
|
|
||||||
|
class MatrixService {
|
||||||
class MatrixService{
|
static Future<Map<String, dynamic>> getDestinations(
|
||||||
|
List<Destination> destinations) async {
|
||||||
static Future<Map<String, dynamic>> getDestinations(List<Destination> destinations) async {
|
final DestinationController destinationController =
|
||||||
|
Get.find<DestinationController>();
|
||||||
final DestinationController destinationController = Get.find<DestinationController>();
|
|
||||||
|
|
||||||
String locs = "";
|
String locs = "";
|
||||||
String origin = "";
|
String origin = "";
|
||||||
String destination = "";
|
String destination = "";
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(Destination d in destinations){
|
for (Destination d in destinations) {
|
||||||
|
//print("---- getting matrix for $d ------------");
|
||||||
|
|
||||||
print("---- getting matrix for $d ------------");
|
if (i == 0) {
|
||||||
|
|
||||||
if(i==0){
|
|
||||||
origin = "${d.lat}, ${d.lon}";
|
origin = "${d.lat}, ${d.lon}";
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i == (destinations.length - 1)){
|
if (i == (destinations.length - 1)) {
|
||||||
destination = "${d.lat}, ${d.lon}";
|
destination = "${d.lat}, ${d.lon}";
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
print("lat is ${d.lat}, long is ${d.lon}");
|
//print("lat is ${d.lat}, long is ${d.lon}");
|
||||||
locs += "${d.lat}, ${d.lon}|";
|
locs += "${d.lat}, ${d.lon}|";
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
locs = "optimize:false|$locs";
|
locs = "optimize:false|$locs";
|
||||||
|
|
||||||
String _mode = "walking";
|
String mode = "walking";
|
||||||
switch (destinationController.travelMode.value) {
|
switch (destinationController.travelMode.value) {
|
||||||
case 1:
|
case 1:
|
||||||
_mode = "driving";
|
mode = "driving";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
_mode = "transit";
|
mode = "transit";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_mode = "walking";
|
mode = "walking";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> cats = {};
|
Map<String, dynamic> cats = {};
|
||||||
String url = "https://maps.googleapis.com/maps/api/directions/json?destination=$destination&mode=$_mode&waypoints=$locs&origin=$origin&key=AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE";
|
String url =
|
||||||
print('++++++++$url');
|
"https://maps.googleapis.com/maps/api/directions/json?destination=$destination&mode=$mode&waypoints=$locs&origin=$origin&key=AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE";
|
||||||
final http.Response response = await http.get(
|
//print('++++++++$url');
|
||||||
Uri.parse(url),
|
final http.Response response =
|
||||||
headers: <String, String>{
|
await http.get(Uri.parse(url), headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,22 +2,20 @@ import 'dart:convert';
|
|||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:rogapp/utils/const.dart';
|
import 'package:rogapp/utils/const.dart';
|
||||||
|
|
||||||
|
class PerfectureService {
|
||||||
class PerfectureService{
|
|
||||||
|
|
||||||
static Future<List<dynamic>?> loadPerfectures() async {
|
static Future<List<dynamic>?> loadPerfectures() async {
|
||||||
List<dynamic> perfs = [];
|
List<dynamic> perfs = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/perf_main/';
|
String url = '$serverUrl/api/perf_main/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return perfs;
|
return perfs;
|
||||||
@ -26,35 +24,34 @@ class PerfectureService{
|
|||||||
static Future<List<dynamic>?> loadSubPerfectures(String area) async {
|
static Future<List<dynamic>?> loadSubPerfectures(String area) async {
|
||||||
List<dynamic> perfs = [];
|
List<dynamic> perfs = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/subperfinmain/?area=' + area;
|
String url = '$serverUrl/api/subperfinmain/?area=$area';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return perfs;
|
return perfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Future<List<dynamic>?> getMainPerfExt(String id) async {
|
static Future<List<dynamic>?> getMainPerfExt(String id) async {
|
||||||
List<dynamic> perfs = [];
|
List<dynamic> perfs = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/mainperfext/?perf=' + id;
|
String url = '$serverUrl/api/mainperfext/?perf=$id';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return perfs;
|
return perfs;
|
||||||
@ -63,16 +60,16 @@ class PerfectureService{
|
|||||||
static Future<List<dynamic>?> loadGifuAreas(String perf) async {
|
static Future<List<dynamic>?> loadGifuAreas(String perf) async {
|
||||||
List<dynamic> perfs = [];
|
List<dynamic> perfs = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/allgifuareas/?perf=' + perf;
|
String url = '$serverUrl/api/allgifuareas/?perf=$perf';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return perfs;
|
return perfs;
|
||||||
@ -82,40 +79,35 @@ class PerfectureService{
|
|||||||
List<dynamic> perfs = [];
|
List<dynamic> perfs = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/customareanames';
|
String url = '$serverUrl/api/customareanames';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return perfs;
|
return perfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Future<List<dynamic>?> getSubExt(String id) async {
|
static Future<List<dynamic>?> getSubExt(String id) async {
|
||||||
List<dynamic> perfs = [];
|
List<dynamic> perfs = [];
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/perfext/?sub_perf=' + id;
|
String url = '$serverUrl/api/perfext/?sub_perf=$id';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final response = await http.get(Uri.parse(url),
|
final response = await http.get(
|
||||||
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
|
||||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||||
}
|
}
|
||||||
return perfs;
|
return perfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,27 +1,22 @@
|
|||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:rogapp/utils/const.dart';
|
import 'package:rogapp/utils/const.dart';
|
||||||
|
|
||||||
|
|
||||||
class TrackingService {
|
class TrackingService {
|
||||||
|
static Future<Map<String, dynamic>> addTrack(
|
||||||
static Future<Map<String, dynamic>> addTrack(String userId, double lat, double lon) async {
|
String userId, double lat, double lon) async {
|
||||||
Map<String, dynamic> cats = {};
|
Map<String, dynamic> cats = {};
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
String url = '$serverUrl/api/track/';
|
String url = '$serverUrl/api/track/';
|
||||||
print('++++++++$url');
|
//print('++++++++$url');
|
||||||
final geom = '{"type": "MULTIPOINT", "coordinates": [[$lon, $lat]]}';
|
final geom = '{"type": "MULTIPOINT", "coordinates": [[$lon, $lat]]}';
|
||||||
final http.Response response = await http.post(
|
final http.Response response = await http.post(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
},
|
},
|
||||||
body: jsonEncode(<String, String>{
|
body: jsonEncode(<String, String>{'user_id': userId, 'geom': geom}),
|
||||||
'user_id': userId,
|
|
||||||
'geom': geom
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
@ -29,5 +24,4 @@ class TrackingService {
|
|||||||
}
|
}
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -6,7 +6,7 @@ import 'package:path/path.dart';
|
|||||||
|
|
||||||
import '../model/rog.dart';
|
import '../model/rog.dart';
|
||||||
|
|
||||||
class DatabaseHelper{
|
class DatabaseHelper {
|
||||||
DatabaseHelper._privateConstructor();
|
DatabaseHelper._privateConstructor();
|
||||||
static final DatabaseHelper instance = DatabaseHelper._privateConstructor();
|
static final DatabaseHelper instance = DatabaseHelper._privateConstructor();
|
||||||
|
|
||||||
@ -21,7 +21,13 @@ class DatabaseHelper{
|
|||||||
// version: 1,
|
// version: 1,
|
||||||
// onCreate: _onCreate,
|
// onCreate: _onCreate,
|
||||||
// );
|
// );
|
||||||
return openDatabase(join(await getDatabasesPath(), 'rog.db',), version: 1, onCreate: _onCreate);
|
return openDatabase(
|
||||||
|
join(
|
||||||
|
await getDatabasesPath(),
|
||||||
|
'rog.db',
|
||||||
|
),
|
||||||
|
version: 1,
|
||||||
|
onCreate: _onCreate);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future _onCreate(Database db, int version) async {
|
Future _onCreate(Database db, int version) async {
|
||||||
@ -56,7 +62,7 @@ class DatabaseHelper{
|
|||||||
)
|
)
|
||||||
''');
|
''');
|
||||||
|
|
||||||
await db.execute('''
|
await db.execute('''
|
||||||
CREATE TABLE rogaining(
|
CREATE TABLE rogaining(
|
||||||
rog_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
rog_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
course_id INTEGER,
|
course_id INTEGER,
|
||||||
@ -69,7 +75,7 @@ class DatabaseHelper{
|
|||||||
)
|
)
|
||||||
''');
|
''');
|
||||||
|
|
||||||
await db.execute('''
|
await db.execute('''
|
||||||
CREATE TABLE rog(
|
CREATE TABLE rog(
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
team_name TEXT,
|
team_name TEXT,
|
||||||
@ -81,54 +87,41 @@ class DatabaseHelper{
|
|||||||
rog_action_type INTEGER
|
rog_action_type INTEGER
|
||||||
)
|
)
|
||||||
''');
|
''');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Rog>> allRogianing() async {
|
Future<List<Rog>> allRogianing() async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var rog = await db.query('rog');
|
var rog = await db.query('rog');
|
||||||
List<Rog> roglist = rog.isNotEmpty ?
|
List<Rog> roglist =
|
||||||
rog.map((e) => Rog.fromMap(e)).toList() : [];
|
rog.isNotEmpty ? rog.map((e) => Rog.fromMap(e)).toList() : [];
|
||||||
print("--------- $rog");
|
//print("--------- $rog");
|
||||||
return roglist;
|
return roglist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<List<Rog>> getRogainingByLatLon(double lat, double lon) async {
|
Future<List<Rog>> getRogainingByLatLon(double lat, double lon) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var rog = await db.query('rog', where: "lat = $lat and lon= $lon");
|
var rog = await db.query('rog', where: "lat = $lat and lon= $lon");
|
||||||
List<Rog> roglist = rog.isNotEmpty
|
List<Rog> roglist =
|
||||||
? rog.map((e) => Rog.fromMap(e)).toList() : [];
|
rog.isNotEmpty ? rog.map((e) => Rog.fromMap(e)).toList() : [];
|
||||||
return roglist;
|
return roglist;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future clearSelection() async {
|
Future clearSelection() async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
Map<String, dynamic> rowClear = {
|
Map<String, dynamic> rowClear = {"selected": false};
|
||||||
"selected": false
|
return await db.update("destination", rowClear);
|
||||||
};
|
|
||||||
return await db.update(
|
|
||||||
"destination",
|
|
||||||
rowClear
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> toggleSelecttion(Destination dest) async {
|
Future<int> toggleSelecttion(Destination dest) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
|
|
||||||
bool val = !dest.selected!;
|
bool val = !dest.selected!;
|
||||||
Map<String, dynamic> rowTarget = {
|
Map<String, dynamic> rowTarget = {"selected": val};
|
||||||
"selected": val
|
|
||||||
};
|
|
||||||
|
|
||||||
await clearSelection();
|
await clearSelection();
|
||||||
|
|
||||||
return await db.update(
|
return await db.update("destination", rowTarget,
|
||||||
"destination",
|
where: 'location_id = ?', whereArgs: [dest.location_id!]);
|
||||||
rowTarget,
|
|
||||||
where: 'location_id = ?',
|
|
||||||
whereArgs: [dest.location_id!]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> deleteRogaining(int id) async {
|
Future<int> deleteRogaining(int id) async {
|
||||||
@ -139,28 +132,27 @@ class DatabaseHelper{
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<void> deleteAllRogaining() async {
|
Future<void> deleteAllRogaining() async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
await db.delete('rog');
|
await db.delete('rog');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> isRogAlreadyAvailable(int id) async {
|
||||||
Future<bool>isRogAlreadyAvailable(int id) async{
|
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var rog = await db.query('rog', where: "id = $id");
|
var rog = await db.query('rog', where: "id = $id");
|
||||||
return rog.isNotEmpty ? true : false;
|
return rog.isNotEmpty ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int?>latestGoal() async{
|
Future<int?> latestGoal() async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
return Sqflite.firstIntValue(await db.rawQuery('SELECT MAX(checkintime) FROM rog'));
|
return Sqflite.firstIntValue(
|
||||||
|
await db.rawQuery('SELECT MAX(checkintime) FROM rog'));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> insertRogaining(Rog rog) async {
|
Future<int> insertRogaining(Rog rog) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
int? nextOrder = Sqflite.firstIntValue(await db.rawQuery('SELECT MAX(id) FROM rog'));
|
int? nextOrder =
|
||||||
|
Sqflite.firstIntValue(await db.rawQuery('SELECT MAX(id) FROM rog'));
|
||||||
nextOrder = nextOrder ?? 0;
|
nextOrder = nextOrder ?? 0;
|
||||||
nextOrder = nextOrder + 1;
|
nextOrder = nextOrder + 1;
|
||||||
rog.id = nextOrder;
|
rog.id = nextOrder;
|
||||||
@ -169,40 +161,41 @@ class DatabaseHelper{
|
|||||||
rog.toMap(),
|
rog.toMap(),
|
||||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||||
);
|
);
|
||||||
print("------ database helper insert $res-----------::::::::");
|
//print("------ database helper insert $res-----------::::::::");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<List<Destination>> getDestinations() async {
|
Future<List<Destination>> getDestinations() async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var dest = await db.query('destination', orderBy: 'list_order');
|
var dest = await db.query('destination', orderBy: 'list_order');
|
||||||
List<Destination> destList = dest.isNotEmpty ?
|
List<Destination> destList =
|
||||||
dest.map((e) => Destination.fromMap(e)).toList() : [];
|
dest.isNotEmpty ? dest.map((e) => Destination.fromMap(e)).toList() : [];
|
||||||
print("--------- $destList");
|
//print("--------- $destList");
|
||||||
return destList;
|
return destList;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Destination>> getDestinationById(int id) async {
|
Future<List<Destination>> getDestinationById(int id) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var rog = await db.query('destination', where: "location_id = $id");
|
var rog = await db.query('destination', where: "location_id = $id");
|
||||||
List<Destination> deslist = rog.isNotEmpty
|
List<Destination> deslist =
|
||||||
? rog.map((e) => Destination.fromMap(e)).toList() : [];
|
rog.isNotEmpty ? rog.map((e) => Destination.fromMap(e)).toList() : [];
|
||||||
return deslist;
|
return deslist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<List<Destination>> getDestinationByLatLon(
|
||||||
Future<List<Destination>> getDestinationByLatLon(double lat, double lon) async {
|
double lat, double lon) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var dest = await db.query('destination', where: "lat = $lat and lon= $lon", orderBy: 'list_order');
|
var dest = await db.query('destination',
|
||||||
List<Destination> destList = dest.isNotEmpty
|
where: "lat = $lat and lon= $lon", orderBy: 'list_order');
|
||||||
? dest.map((e) => Destination.fromMap(e)).toList() : [];
|
List<Destination> destList =
|
||||||
|
dest.isNotEmpty ? dest.map((e) => Destination.fromMap(e)).toList() : [];
|
||||||
return destList;
|
return destList;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> deleteDestination(int locationId) async {
|
Future<int> deleteDestination(int locationId) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var dest = await db.delete('destination', where: "location_id = $locationId");
|
var dest =
|
||||||
|
await db.delete('destination', where: "location_id = $locationId");
|
||||||
int ret = dest > 0 ? dest : -1;
|
int ret = dest > 0 ? dest : -1;
|
||||||
|
|
||||||
//after deleting set correct order
|
//after deleting set correct order
|
||||||
@ -211,26 +204,20 @@ class DatabaseHelper{
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void>setOrder() async {
|
Future<void> setOrder() async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var byOrder = await db.query('destination', orderBy: 'list_order');
|
var byOrder = await db.query('destination', orderBy: 'list_order');
|
||||||
|
|
||||||
List<Destination> desDb = byOrder.isNotEmpty
|
List<Destination> desDb = byOrder.isNotEmpty
|
||||||
? byOrder.map((e) => Destination.fromMap(e)).toList() : [];
|
? byOrder.map((e) => Destination.fromMap(e)).toList()
|
||||||
|
: [];
|
||||||
|
|
||||||
int order = 1;
|
int order = 1;
|
||||||
for( Destination d in desDb){
|
for (Destination d in desDb) {
|
||||||
|
Map<String, dynamic> rowTarget = {"list_order": order};
|
||||||
|
|
||||||
Map<String, dynamic> rowTarget = {
|
await db.update("destination", rowTarget,
|
||||||
"list_order": order
|
where: 'location_id = ?', whereArgs: [d.location_id]);
|
||||||
};
|
|
||||||
|
|
||||||
await db.update(
|
|
||||||
"destination",
|
|
||||||
rowTarget,
|
|
||||||
where: 'location_id = ?',
|
|
||||||
whereArgs: [d.location_id]
|
|
||||||
);
|
|
||||||
|
|
||||||
order += 1;
|
order += 1;
|
||||||
}
|
}
|
||||||
@ -241,15 +228,17 @@ class DatabaseHelper{
|
|||||||
await db.delete('destination');
|
await db.delete('destination');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool>isAlreadyAvailable(int locationId) async{
|
Future<bool> isAlreadyAvailable(int locationId) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var dest = await db.query('destination', where: "location_id = $locationId");
|
var dest =
|
||||||
|
await db.query('destination', where: "location_id = $locationId");
|
||||||
return dest.isNotEmpty ? true : false;
|
return dest.isNotEmpty ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> insertDestination(Destination dest) async {
|
Future<int> insertDestination(Destination dest) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
int? nextOrder = Sqflite.firstIntValue(await db.rawQuery('SELECT MAX(list_order) FROM destination'));
|
int? nextOrder = Sqflite.firstIntValue(
|
||||||
|
await db.rawQuery('SELECT MAX(list_order) FROM destination'));
|
||||||
nextOrder = nextOrder ?? 0;
|
nextOrder = nextOrder ?? 0;
|
||||||
nextOrder = nextOrder + 1;
|
nextOrder = nextOrder + 1;
|
||||||
dest.list_order = nextOrder;
|
dest.list_order = nextOrder;
|
||||||
@ -262,67 +251,50 @@ class DatabaseHelper{
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> updateCancelBuyPoint(Destination destination)async {
|
Future<int> updateCancelBuyPoint(Destination destination) async {
|
||||||
print("---- updating puypint image in db -----");
|
//print("---- updating puypint image in db -----");
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {"buy_point": 0};
|
||||||
"buy_point": 0
|
return await db.update("destination", row,
|
||||||
};
|
where: 'location_id = ?', whereArgs: [destination.location_id!]);
|
||||||
return await db.update(
|
|
||||||
"destination",
|
|
||||||
row,
|
|
||||||
where: 'location_id = ?',
|
|
||||||
whereArgs: [destination.location_id!]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> updateBuyPoint(Destination destination, String imageUrl)async {
|
Future<int> updateBuyPoint(Destination destination, String imageUrl) async {
|
||||||
print("---- updating puypint image in db -----");
|
//print("---- updating puypint image in db -----");
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {"buypoint_image": imageUrl};
|
||||||
"buypoint_image": imageUrl
|
return await db.update("destination", row,
|
||||||
};
|
where: 'location_id = ?', whereArgs: [destination.location_id!]);
|
||||||
return await db.update(
|
|
||||||
"destination",
|
|
||||||
row,
|
|
||||||
where: 'location_id = ?',
|
|
||||||
whereArgs: [destination.location_id!]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> updateAction(Destination destination, bool checkin)async {
|
Future<int> updateAction(Destination destination, bool checkin) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
int act = checkin == false ? 0 : 1;
|
int act = checkin == false ? 0 : 1;
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {"checkedin": act};
|
||||||
"checkedin": act
|
return await db.update("destination", row,
|
||||||
};
|
where: 'location_id = ?', whereArgs: [destination.location_id!]);
|
||||||
return await db.update(
|
|
||||||
"destination",
|
|
||||||
row,
|
|
||||||
where: 'location_id = ?',
|
|
||||||
whereArgs: [destination.location_id!]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateOrder(Destination d, int dir)async {
|
Future<void> updateOrder(Destination d, int dir) async {
|
||||||
Database db = await instance.database;
|
Database db = await instance.database;
|
||||||
var target = await db.query('destination', where: "list_order = ${d.list_order! + dir}");
|
var target = await db.query('destination',
|
||||||
var dest = await db.query('destination', where: "location_id = ${d.location_id}");
|
where: "list_order = ${d.list_order! + dir}");
|
||||||
|
var dest =
|
||||||
|
await db.query('destination', where: "location_id = ${d.location_id}");
|
||||||
|
|
||||||
print("--- target in db is $target");
|
// print("--- target in db is $target");
|
||||||
print("--- destine in db is $dest");
|
// print("--- destine in db is $dest");
|
||||||
|
|
||||||
if(target.isNotEmpty){
|
|
||||||
|
|
||||||
|
if (target.isNotEmpty) {
|
||||||
List<Destination> targetIndb = target.isNotEmpty
|
List<Destination> targetIndb = target.isNotEmpty
|
||||||
? target.map((e) => Destination.fromMap(e)).toList() : [];
|
? target.map((e) => Destination.fromMap(e)).toList()
|
||||||
|
: [];
|
||||||
|
|
||||||
List<Destination> destIndb = dest.isNotEmpty
|
List<Destination> destIndb = dest.isNotEmpty
|
||||||
? dest.map((e) => Destination.fromMap(e)).toList() : [];
|
? dest.map((e) => Destination.fromMap(e)).toList()
|
||||||
|
: [];
|
||||||
|
|
||||||
Map<String, dynamic> rowTarget = {
|
Map<String, dynamic> rowTarget = {"list_order": d.list_order};
|
||||||
"list_order": d.list_order
|
|
||||||
};
|
|
||||||
|
|
||||||
Map<String, dynamic> rowDes = {
|
Map<String, dynamic> rowDes = {
|
||||||
"list_order": destIndb[0].list_order! + dir
|
"list_order": destIndb[0].list_order! + dir
|
||||||
@ -331,19 +303,11 @@ class DatabaseHelper{
|
|||||||
// print("--- target destination is ${target_indb[0].location_id}");
|
// print("--- target destination is ${target_indb[0].location_id}");
|
||||||
// print("--- destine destination is is ${dest_indb[0].location_id}");
|
// print("--- destine destination is is ${dest_indb[0].location_id}");
|
||||||
|
|
||||||
await db.update(
|
await db.update("destination", rowTarget,
|
||||||
"destination",
|
where: 'location_id = ?', whereArgs: [targetIndb[0].location_id]);
|
||||||
rowTarget,
|
|
||||||
where: 'location_id = ?',
|
|
||||||
whereArgs: [targetIndb[0].location_id]
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.update(
|
await db.update("destination", rowDes,
|
||||||
"destination",
|
where: 'location_id = ?', whereArgs: [destIndb[0].location_id]);
|
||||||
rowDes,
|
|
||||||
where: 'location_id = ?',
|
|
||||||
whereArgs: [destIndb[0].location_id]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,6 +315,4 @@ class DatabaseHelper{
|
|||||||
// Database db = await instance.database;
|
// Database db = await instance.database;
|
||||||
// return await Sqflite.firstIntValue(await db.rawQuery("SELECT COUNT(*) FROM incidents"));
|
// return await Sqflite.firstIntValue(await db.rawQuery("SELECT COUNT(*) FROM incidents"));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,42 +1,39 @@
|
|||||||
|
|
||||||
import 'package:geojson/geojson.dart';
|
import 'package:geojson/geojson.dart';
|
||||||
import 'package:rogapp/model/destination.dart';
|
import 'package:rogapp/model/destination.dart';
|
||||||
|
|
||||||
class TextUtils{
|
class TextUtils {
|
||||||
|
static String getDisplayTextFeture(GeoJsonFeature f) {
|
||||||
static String getDisplayTextFeture(GeoJsonFeature f){
|
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||||
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
String txt = "";
|
||||||
String txt = "";
|
// if(f.properties!["cp"] > 0){
|
||||||
// if(f.properties!["cp"] > 0){
|
// //print("-- sub-- ${f.properties!["cp"]} ----");
|
||||||
// //print("-- sub-- ${f.properties!["cp"]} ----");
|
// txt = "${f.properties!["cp"].toString().replaceAll(regex, '')}";
|
||||||
// txt = "${f.properties!["cp"].toString().replaceAll(regex, '')}";
|
|
||||||
// }
|
|
||||||
//if(f.properties!["buy_point"] != null && f.properties!["buy_point"] > 0){
|
|
||||||
txt = txt + "${f.properties!["sub_loc_id"]}";
|
|
||||||
//}
|
|
||||||
return txt;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static String getDisplayText(Destination dp){
|
|
||||||
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
|
||||||
String txt = "";
|
|
||||||
if(dp.cp! > 0){
|
|
||||||
txt = dp.cp.toString().replaceAll(regex, '');
|
|
||||||
if(dp.checkin_point != null && dp.checkin_point! > 0){
|
|
||||||
txt = txt + "{${dp.checkin_point.toString().replaceAll(regex, '')}}";
|
|
||||||
}
|
|
||||||
if(dp.buy_point != null && dp.buy_point! > 0){
|
|
||||||
print("^^^^^^^^^ ${dp.sub_loc_id}^^^^^^^^^^");
|
|
||||||
txt = "#${dp.cp.toString().replaceAll(regex, '')}(${dp.checkin_point.toString().replaceAll(regex, '')}+${dp.buy_point.toString().replaceAll(regex, '')})";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return txt;
|
|
||||||
}
|
|
||||||
|
|
||||||
// static String getDisplayText(String num){
|
|
||||||
// RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
|
||||||
// return "${num.replaceAll(regex, '')}";
|
|
||||||
// }
|
// }
|
||||||
|
//if(f.properties!["buy_point"] != null && f.properties!["buy_point"] > 0){
|
||||||
|
txt = "$txt${f.properties!["sub_loc_id"]}";
|
||||||
|
//}
|
||||||
|
return txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
static String getDisplayText(Destination dp) {
|
||||||
|
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||||
|
String txt = "";
|
||||||
|
if (dp.cp! > 0) {
|
||||||
|
txt = dp.cp.toString().replaceAll(regex, '');
|
||||||
|
if (dp.checkin_point != null && dp.checkin_point! > 0) {
|
||||||
|
txt = "$txt{${dp.checkin_point.toString().replaceAll(regex, '')}}";
|
||||||
|
}
|
||||||
|
if (dp.buy_point != null && dp.buy_point! > 0) {
|
||||||
|
//print("^^^^^^^^^ ${dp.sub_loc_id}^^^^^^^^^^");
|
||||||
|
txt =
|
||||||
|
"#${dp.cp.toString().replaceAll(regex, '')}(${dp.checkin_point.toString().replaceAll(regex, '')}+${dp.buy_point.toString().replaceAll(regex, '')})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static String getDisplayText(String num){
|
||||||
|
// RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||||
|
// return "${num.replaceAll(regex, '')}";
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
@ -1,5 +1,3 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geojson/geojson.dart';
|
import 'package:geojson/geojson.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
@ -28,15 +26,15 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
|
|
||||||
Image getImage() {
|
Image getImage() {
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
if (indexController.rog_mode == 1) {
|
if (indexController.rogMode == 1) {
|
||||||
//print("----- rogaining mode 1");
|
//print("----- rogaining mode 1");
|
||||||
if (indexController.currentDestinationFeature.isEmpty ||
|
if (indexController.currentDestinationFeature.isEmpty ||
|
||||||
indexController.currentDestinationFeature[0].photos! == "") {
|
indexController.currentDestinationFeature[0].photos! == "") {
|
||||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||||
} else {
|
} else {
|
||||||
//print("@@@@@@@@@@@@@ rog mode -------------------- ${indexController.currentDestinationFeature[0].photos} @@@@@@@@@@@");
|
//print("@@@@@@@@@@@@@ rog mode -------------------- ${indexController.currentDestinationFeature[0].photos} @@@@@@@@@@@");
|
||||||
String _photo = indexController.currentDestinationFeature[0].photos!;
|
String photo = indexController.currentDestinationFeature[0].photos!;
|
||||||
if (_photo.contains('http')) {
|
if (photo.contains('http')) {
|
||||||
return Image(
|
return Image(
|
||||||
image: NetworkImage(
|
image: NetworkImage(
|
||||||
indexController.currentDestinationFeature[0].photos!,
|
indexController.currentDestinationFeature[0].photos!,
|
||||||
@ -49,8 +47,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
} else {
|
} else {
|
||||||
return Image(
|
return Image(
|
||||||
image: NetworkImage(
|
image: NetworkImage(
|
||||||
'$serverUrl/media/compressed/' +
|
'$serverUrl/media/compressed/${indexController.currentDestinationFeature[0].photos!}',
|
||||||
indexController.currentDestinationFeature[0].photos!,
|
|
||||||
),
|
),
|
||||||
errorBuilder: (BuildContext context, Object exception,
|
errorBuilder: (BuildContext context, Object exception,
|
||||||
StackTrace? stackTrace) {
|
StackTrace? stackTrace) {
|
||||||
@ -64,8 +61,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
if (gf.properties!["photos"] == null || gf.properties!["photos"] == "") {
|
if (gf.properties!["photos"] == null || gf.properties!["photos"] == "") {
|
||||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||||
} else {
|
} else {
|
||||||
String _photo = gf.properties!["photos"];
|
String photo = gf.properties!["photos"];
|
||||||
if (_photo.contains('http')) {
|
if (photo.contains('http')) {
|
||||||
return Image(
|
return Image(
|
||||||
image: NetworkImage(
|
image: NetworkImage(
|
||||||
gf.properties!["photos"],
|
gf.properties!["photos"],
|
||||||
@ -78,7 +75,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
} else {
|
} else {
|
||||||
return Image(
|
return Image(
|
||||||
image: NetworkImage(
|
image: NetworkImage(
|
||||||
'$serverUrl/media/compressed/' + gf.properties!["photos"],
|
'$serverUrl/media/compressed/${gf.properties!["photos"]}',
|
||||||
),
|
),
|
||||||
errorBuilder: (BuildContext context, Object exception,
|
errorBuilder: (BuildContext context, Object exception,
|
||||||
StackTrace? stackTrace) {
|
StackTrace? stackTrace) {
|
||||||
@ -91,7 +88,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _launchURL(url) async {
|
void _launchURL(url) async {
|
||||||
if (!await launch(url)) throw 'Could not launch $url';
|
if (!await launchUrl(url)) throw 'Could not launch $url';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isInDestination(String locationid) {
|
bool isInDestination(String locationid) {
|
||||||
@ -107,63 +104,60 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
destinationController.skip_gps = true;
|
destinationController.skipGps = true;
|
||||||
print('---- rog_mode ----- ${indexController.rog_mode} -----');
|
//print('---- rog_mode ----- ${indexController.rog_mode} -----');
|
||||||
return indexController.rog_mode == 0
|
return indexController.rogMode.value == 0
|
||||||
? detailsSheet(context)
|
? detailsSheet(context)
|
||||||
: destinationSheet(context);
|
: destinationSheet(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show destination detais
|
// Show destination detais
|
||||||
SingleChildScrollView destinationSheet(BuildContext context) {
|
SingleChildScrollView destinationSheet(BuildContext context) {
|
||||||
print(
|
// print(
|
||||||
'---- currentDestinationFeature ----- ${indexController.currentDestinationFeature[0].name} -----');
|
// '---- currentDestinationFeature ----- ${indexController.currentDestinationFeature[0].name} -----');
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Container(
|
child: Row(
|
||||||
child: Row(
|
children: [
|
||||||
children: [
|
MaterialButton(
|
||||||
MaterialButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
Get.back();
|
||||||
Get.back();
|
//destinationController.makePrevious(indexController.currentDestinationFeature[0]);
|
||||||
//destinationController.makePrevious(indexController.currentDestinationFeature[0]);
|
},
|
||||||
},
|
color: Colors.blue,
|
||||||
color: Colors.blue,
|
textColor: Colors.white,
|
||||||
textColor: Colors.white,
|
padding: const EdgeInsets.all(16),
|
||||||
child: const Icon(
|
shape: const CircleBorder(),
|
||||||
Icons.arrow_back_ios,
|
child: const Icon(
|
||||||
size: 14,
|
Icons.arrow_back_ios,
|
||||||
),
|
size: 14,
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
shape: const CircleBorder(),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
child: Container(
|
Expanded(
|
||||||
alignment: Alignment.center,
|
child: Container(
|
||||||
child: Obx(() => indexController.currentUser.isNotEmpty
|
alignment: Alignment.center,
|
||||||
? Text(
|
child: Obx(() => indexController.currentUser.isNotEmpty
|
||||||
"${TextUtils.getDisplayText(indexController.currentDestinationFeature[0])} : ${TextUtils.getDisplayText(indexController.currentDestinationFeature[0])} : ${indexController.currentDestinationFeature[0].name!}",
|
? Text(
|
||||||
style: const TextStyle(
|
"${TextUtils.getDisplayText(indexController.currentDestinationFeature[0])} : ${TextUtils.getDisplayText(indexController.currentDestinationFeature[0])} : ${indexController.currentDestinationFeature[0].name!}",
|
||||||
fontSize: 15.0,
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontSize: 15.0,
|
||||||
),
|
fontWeight: FontWeight.bold,
|
||||||
)
|
),
|
||||||
: Text(
|
)
|
||||||
indexController
|
: Text(
|
||||||
.currentDestinationFeature[0].name!,
|
indexController.currentDestinationFeature[0].name!,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 15.0,
|
fontSize: 15.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
@ -180,8 +174,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
children: [
|
children: [
|
||||||
Obx(
|
Obx(
|
||||||
() => indexController.currentDestinationFeature.isNotEmpty &&
|
() => indexController.currentDestinationFeature.isNotEmpty &&
|
||||||
destinationController.is_in_checkin.value == true &&
|
destinationController.isInCheckin.value == true &&
|
||||||
destinationController.is_at_start.value == false
|
destinationController.isAtStart.value == false
|
||||||
? Row(
|
? Row(
|
||||||
children: [
|
children: [
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
@ -196,8 +190,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
.currentDestinationFeature[0]
|
.currentDestinationFeature[0]
|
||||||
.hidden_location ==
|
.hidden_location ==
|
||||||
0) {
|
0) {
|
||||||
destinationController.skip_gps = false;
|
destinationController.skipGps = false;
|
||||||
destinationController.is_photo_shoot.value =
|
destinationController.isPhotoShoot.value =
|
||||||
true;
|
true;
|
||||||
Get.back();
|
Get.back();
|
||||||
} else {
|
} else {
|
||||||
@ -210,7 +204,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
.currentDestinationFeature[0].cp !=
|
.currentDestinationFeature[0].cp !=
|
||||||
-1) {
|
-1) {
|
||||||
destinationController
|
destinationController
|
||||||
.rogaining_counted.value = true;
|
.rogainingCounted.value = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -238,18 +232,18 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
: Container(),
|
: Container(),
|
||||||
),
|
),
|
||||||
Obx(
|
Obx(
|
||||||
() => destinationController.is_at_start.value == true
|
() => destinationController.isAtStart.value == true
|
||||||
? ElevatedButton(
|
? ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
destinationController.is_in_rog.value = true;
|
destinationController.isInRog.value = true;
|
||||||
destinationController.addToRogaining(
|
destinationController.addToRogaining(
|
||||||
destinationController.current_lat,
|
destinationController.currentLat,
|
||||||
destinationController.current_lon,
|
destinationController.currentLon,
|
||||||
indexController
|
indexController
|
||||||
.currentDestinationFeature[0].location_id!);
|
.currentDestinationFeature[0].location_id!);
|
||||||
saveGameState();
|
saveGameState();
|
||||||
ExternalService()
|
ExternalService()
|
||||||
.StartRogaining()
|
.startRogaining()
|
||||||
.then((value) => Get.back());
|
.then((value) => Get.back());
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -265,8 +259,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
: Container(),
|
: Container(),
|
||||||
),
|
),
|
||||||
Obx(
|
Obx(
|
||||||
() => destinationController.is_at_goal.value == true &&
|
() => destinationController.isAtGoal.value == true &&
|
||||||
destinationController.rogaining_counted == true
|
destinationController.rogainingCounted.value == true
|
||||||
? ElevatedButton(
|
? ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.toNamed(AppPages.CAMERA_PAGE);
|
Get.toNamed(AppPages.CAMERA_PAGE);
|
||||||
@ -374,51 +368,51 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
|
|
||||||
// show add location details
|
// show add location details
|
||||||
SingleChildScrollView detailsSheet(BuildContext context) {
|
SingleChildScrollView detailsSheet(BuildContext context) {
|
||||||
|
Destination cdest = destinationController
|
||||||
Destination _cdest = destinationController.festuretoDestination(
|
.festuretoDestination(indexController.currentFeature[0]);
|
||||||
indexController.currentFeature[0]);
|
|
||||||
var distance = const Distance();
|
var distance = const Distance();
|
||||||
double _distance_to_dest = distance.as(LengthUnit.Meter, LatLng(destinationController.current_lat, destinationController.current_lon), LatLng(_cdest.lat!, _cdest.lon!));
|
double distanceToDest = distance.as(
|
||||||
|
LengthUnit.Meter,
|
||||||
|
LatLng(
|
||||||
|
destinationController.currentLat, destinationController.currentLon),
|
||||||
|
LatLng(cdest.lat!, cdest.lon!));
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Container(
|
child: Row(
|
||||||
child: Row(
|
children: [
|
||||||
children: [
|
MaterialButton(
|
||||||
MaterialButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
Get.back();
|
||||||
Get.back();
|
//indexController.makePrevious(indexController.currentFeature[0]);
|
||||||
//indexController.makePrevious(indexController.currentFeature[0]);
|
},
|
||||||
},
|
color: Colors.blue,
|
||||||
color: Colors.blue,
|
textColor: Colors.white,
|
||||||
textColor: Colors.white,
|
padding: const EdgeInsets.all(16),
|
||||||
child: const Icon(
|
shape: const CircleBorder(),
|
||||||
Icons.arrow_back_ios,
|
child: const Icon(
|
||||||
//Icons.arrow_back_ios,
|
Icons.arrow_back_ios,
|
||||||
size: 14,
|
//Icons.arrow_back_ios,
|
||||||
),
|
size: 14,
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
shape: const CircleBorder(),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
child: Container(
|
Expanded(
|
||||||
alignment: Alignment.center,
|
child: Container(
|
||||||
child: Obx(() => Text(
|
alignment: Alignment.center,
|
||||||
indexController
|
child: Obx(() => Text(
|
||||||
.currentFeature[0].properties!["location_name"],
|
indexController
|
||||||
style: const TextStyle(
|
.currentFeature[0].properties!["location_name"],
|
||||||
fontSize: 15.0,
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontSize: 15.0,
|
||||||
),
|
fontWeight: FontWeight.bold,
|
||||||
)),
|
),
|
||||||
),
|
)),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
@ -446,26 +440,25 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
indexController.currentDestinationFeature[0]
|
indexController.currentDestinationFeature[0]
|
||||||
.checkedin ==
|
.checkedin ==
|
||||||
false &&
|
false &&
|
||||||
destinationController.is_at_start.value ==
|
destinationController.isAtStart.value == true
|
||||||
true
|
|
||||||
? ElevatedButton(
|
? ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await destinationController.resetRogaining();
|
await destinationController
|
||||||
print("~~~~ start button ~~~~");
|
.resetRogaining();
|
||||||
destinationController.is_in_rog.value =
|
//print("~~~~ start button ~~~~");
|
||||||
true;
|
destinationController.isInRog.value = true;
|
||||||
destinationController.addToRogaining(
|
destinationController.addToRogaining(
|
||||||
destinationController.current_lat,
|
destinationController.currentLat,
|
||||||
destinationController.current_lon,
|
destinationController.currentLon,
|
||||||
indexController
|
indexController
|
||||||
.currentDestinationFeature[0]
|
.currentDestinationFeature[0]
|
||||||
.location_id!);
|
.location_id!);
|
||||||
saveGameState();
|
saveGameState();
|
||||||
ExternalService()
|
ExternalService()
|
||||||
.StartRogaining()
|
.startRogaining()
|
||||||
.then((value){
|
.then((value) {
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
// start
|
// start
|
||||||
@ -484,9 +477,9 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
: Container(),
|
: Container(),
|
||||||
),
|
),
|
||||||
Obx(
|
Obx(
|
||||||
() => destinationController.is_at_goal.value ==
|
() => destinationController.isAtGoal.value == true &&
|
||||||
true &&
|
destinationController
|
||||||
destinationController.rogaining_counted ==
|
.rogainingCounted.value ==
|
||||||
true
|
true
|
||||||
? ElevatedButton(
|
? ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@ -521,7 +514,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
.onPrimaryContainer),
|
.onPrimaryContainer),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
print("---- go to ----");
|
//print("---- go to ----");
|
||||||
GeoJsonFeature<GeoJsonMultiPoint> mp =
|
GeoJsonFeature<GeoJsonMultiPoint> mp =
|
||||||
indexController.currentFeature[0]
|
indexController.currentFeature[0]
|
||||||
as GeoJsonFeature<GeoJsonMultiPoint>;
|
as GeoJsonFeature<GeoJsonMultiPoint>;
|
||||||
@ -530,7 +523,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
desiredAccuracy:
|
desiredAccuracy:
|
||||||
LocationAccuracy.bestForNavigation,
|
LocationAccuracy.bestForNavigation,
|
||||||
forceAndroidLocationManager: true);
|
forceAndroidLocationManager: true);
|
||||||
print("------- position -------- $position");
|
//print("------- position -------- $position");
|
||||||
Destination ds = Destination(
|
Destination ds = Destination(
|
||||||
lat: position.latitude,
|
lat: position.latitude,
|
||||||
lon: position.longitude);
|
lon: position.longitude);
|
||||||
@ -550,49 +543,48 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
color:
|
color:
|
||||||
Theme.of(context).colorScheme.onPrimary),
|
Theme.of(context).colorScheme.onPrimary),
|
||||||
)),
|
)),
|
||||||
SizedBox(
|
const SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
// forced start / checkin
|
// forced start / checkin
|
||||||
_distance_to_dest <= 100 ?
|
distanceToDest <= 100
|
||||||
ElevatedButton(
|
? ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor:
|
backgroundColor: Theme.of(context)
|
||||||
Theme.of(context).colorScheme.secondary),
|
|
||||||
onPressed: () async {
|
|
||||||
print("~~~~ manual checkin button ~~~~");
|
|
||||||
if (destination.cp == -1) {
|
|
||||||
destinationController.is_in_rog.value = true;
|
|
||||||
destinationController.addToRogaining(
|
|
||||||
destinationController.current_lat,
|
|
||||||
destinationController.current_lon,
|
|
||||||
destination.location_id!);
|
|
||||||
saveGameState();
|
|
||||||
ExternalService()
|
|
||||||
.StartRogaining()
|
|
||||||
.then((value) => Get.back());
|
|
||||||
} else {
|
|
||||||
await destinationController.CallforCheckin(destination);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
destinationController
|
|
||||||
.festuretoDestination(
|
|
||||||
indexController
|
|
||||||
.currentFeature[0])
|
|
||||||
.cp ==
|
|
||||||
-1
|
|
||||||
? "ロゲ開始"
|
|
||||||
: "チェックイン",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.onSecondary))):
|
.secondary),
|
||||||
|
onPressed: () async {
|
||||||
Container()
|
//print("~~~~ manual checkin button ~~~~");
|
||||||
,
|
if (destination.cp == -1) {
|
||||||
|
destinationController.isInRog.value = true;
|
||||||
|
destinationController.addToRogaining(
|
||||||
|
destinationController.currentLat,
|
||||||
|
destinationController.currentLon,
|
||||||
|
destination.location_id!);
|
||||||
|
saveGameState();
|
||||||
|
ExternalService()
|
||||||
|
.startRogaining()
|
||||||
|
.then((value) => Get.back());
|
||||||
|
} else {
|
||||||
|
await destinationController
|
||||||
|
.callforCheckin(destination);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
destinationController
|
||||||
|
.festuretoDestination(
|
||||||
|
indexController
|
||||||
|
.currentFeature[0])
|
||||||
|
.cp ==
|
||||||
|
-1
|
||||||
|
? "ロゲ開始"
|
||||||
|
: "チェックイン",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.onSecondary)))
|
||||||
|
: Container(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
@ -603,8 +595,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
children: [
|
children: [
|
||||||
indexController.currentDestinationFeature
|
indexController.currentDestinationFeature
|
||||||
.isNotEmpty &&
|
.isNotEmpty &&
|
||||||
destinationController
|
destinationController.isInCheckin.value ==
|
||||||
.is_in_checkin.value ==
|
|
||||||
true
|
true
|
||||||
? Container()
|
? Container()
|
||||||
: FutureBuilder<Widget>(
|
: FutureBuilder<Widget>(
|
||||||
@ -787,14 +778,14 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Widget> wantToGo(BuildContext context) async {
|
Future<Widget> wantToGo(BuildContext context) async {
|
||||||
bool _selected = false;
|
bool selected = false;
|
||||||
print(
|
// print(
|
||||||
'---target-- ${indexController.currentFeature[0].properties!["location_id"]}----');
|
// '---target-- ${indexController.currentFeature[0].properties!["location_id"]}----');
|
||||||
for (Destination d in destinationController.destinations) {
|
for (Destination d in destinationController.destinations) {
|
||||||
print('---- ${d.location_id.toString()} ----');
|
//print('---- ${d.location_id.toString()} ----');
|
||||||
if (d.location_id ==
|
if (d.location_id ==
|
||||||
indexController.currentFeature[0].properties!["location_id"]) {
|
indexController.currentFeature[0].properties!["location_id"]) {
|
||||||
_selected = true;
|
selected = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -905,12 +896,12 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 8.0,
|
width: 8.0,
|
||||||
),
|
),
|
||||||
Obx((() => indexController.rog_mode == 1
|
Obx((() => indexController.rogMode.value == 1
|
||||||
? ElevatedButton(
|
? ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Destination dest =
|
Destination dest =
|
||||||
indexController.currentDestinationFeature[0];
|
indexController.currentDestinationFeature[0];
|
||||||
print("~~~~ before checking button ~~~~");
|
//print("~~~~ before checking button ~~~~");
|
||||||
//print("------ curent destination is ${dest!.checkedIn}-------");
|
//print("------ curent destination is ${dest!.checkedIn}-------");
|
||||||
destinationController.makeCheckin(
|
destinationController.makeCheckin(
|
||||||
dest, !dest.checkedin!, "");
|
dest, !dest.checkedin!, "");
|
||||||
@ -945,8 +936,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
child: const Text("Image"),
|
child: const Text("Image"),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final ImagePicker _picker = ImagePicker();
|
final ImagePicker picker = ImagePicker();
|
||||||
_picker
|
picker
|
||||||
.pickImage(source: ImageSource.camera)
|
.pickImage(source: ImageSource.camera)
|
||||||
.then((value) {
|
.then((value) {
|
||||||
//print("----- image---- ${value!.path}");
|
//print("----- image---- ${value!.path}");
|
||||||
@ -968,7 +959,6 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
//print("---temp---${temp}");
|
//print("---temp---${temp}");
|
||||||
indexController.currentAction.add([temp]);
|
indexController.currentAction.add([temp]);
|
||||||
}
|
}
|
||||||
indexController.makeAction(context);
|
|
||||||
},
|
},
|
||||||
child: Text("checkin".tr))
|
child: Text("checkin".tr))
|
||||||
],
|
],
|
||||||
@ -984,7 +974,6 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
//print("---temp---${temp}");
|
//print("---temp---${temp}");
|
||||||
indexController.currentAction.add([temp]);
|
indexController.currentAction.add([temp]);
|
||||||
}
|
}
|
||||||
indexController.makeAction(context);
|
|
||||||
},
|
},
|
||||||
child: const Icon(Icons.favorite, color: Colors.red),
|
child: const Icon(Icons.favorite, color: Colors.red),
|
||||||
)
|
)
|
||||||
@ -1006,7 +995,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (isurl) {
|
if (isurl) {
|
||||||
if (indexController.rog_mode == 0) {
|
if (indexController.rogMode.value == 0) {
|
||||||
_launchURL(indexController
|
_launchURL(indexController
|
||||||
.currentFeature[0].properties!["webcontents"]);
|
.currentFeature[0].properties!["webcontents"]);
|
||||||
} else {
|
} else {
|
||||||
@ -1015,7 +1004,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width - (MediaQuery.of(context).size.width * 0.28),
|
width: MediaQuery.of(context).size.width -
|
||||||
|
(MediaQuery.of(context).size.width * 0.28),
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
|
|||||||
@ -1,381 +0,0 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:geojson/geojson.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:image_picker/image_picker.dart';
|
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
|
||||||
import 'package:rogapp/routes/app_pages.dart';
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
|
|
||||||
class BottomSheetWidget extends StatelessWidget {
|
|
||||||
//const BottomSheetWidget({ Key? key }, GeoJsonFeature? pt) : super(key: key);
|
|
||||||
|
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
|
||||||
|
|
||||||
BottomSheetWidget({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
Image getImage(GeoJsonFeature? gf){
|
|
||||||
if(gf!.properties!["photos"] == null || gf.properties!["photos"] == ""){
|
|
||||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return Image(image: NetworkImage(
|
|
||||||
gf.properties!["photos"],
|
|
||||||
),
|
|
||||||
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
|
|
||||||
return Image.asset("assets/images/empty_image.png");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _launchURL(url) async {
|
|
||||||
if (!await launch(url)) throw 'Could not launch $url';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
const SizedBox(height: 5.0,),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
MaterialButton(
|
|
||||||
onPressed: () {
|
|
||||||
indexController.makePrevious(indexController.currentFeature[0]);
|
|
||||||
},
|
|
||||||
color: Colors.blue,
|
|
||||||
textColor: Colors.white,
|
|
||||||
child: const Icon(
|
|
||||||
Icons.arrow_back_ios,
|
|
||||||
size: 14,
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.all(14),
|
|
||||||
shape: const CircleBorder(),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Obx(() =>
|
|
||||||
Text(indexController.currentFeature[0].properties!["location_name"], style: const TextStyle(
|
|
||||||
fontSize: 15.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
MaterialButton(
|
|
||||||
onPressed: () {
|
|
||||||
indexController.makeNext(indexController.currentFeature[0]);
|
|
||||||
},
|
|
||||||
color: Colors.blue,
|
|
||||||
textColor: Colors.white,
|
|
||||||
child: const Icon(
|
|
||||||
Icons.arrow_forward_ios,
|
|
||||||
size: 14,
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.all(14),
|
|
||||||
shape: const CircleBorder(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: SizedBox(
|
|
||||||
height: 260.0,
|
|
||||||
child: Obx(() => getImage(indexController.currentFeature[0])),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
indexController.currentFeature[0].properties!["address"] != null ?
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: Text("address".tr, style: const TextStyle(fontWeight: FontWeight.bold),)),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12.0,),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: Obx(() => Text(indexController.currentFeature[0].properties!["address"] ?? '',
|
|
||||||
style: const TextStyle(color: Colors.blue,),
|
|
||||||
softWrap: true,
|
|
||||||
overflow: TextOverflow.ellipsis,)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
): const SizedBox(width: 0.0, height: 0,),
|
|
||||||
indexController.currentFeature[0].properties!["phone"] != null ?
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(child: Container(
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: Text("telephone".tr, style: const TextStyle(fontWeight: FontWeight.bold),))),
|
|
||||||
const SizedBox(width: 12.0,),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: Obx(() => Text(indexController.currentFeature[0].properties!["phone"] ?? '',
|
|
||||||
style: const TextStyle(color: Colors.blue,),
|
|
||||||
overflow: TextOverflow.ellipsis,)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
): const SizedBox(width: 0, height: 0,),
|
|
||||||
indexController.currentFeature[0].properties!["email"] != null ?
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(child: Container(
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: Text("email".tr, style: const TextStyle(fontWeight: FontWeight.bold),))),
|
|
||||||
const SizedBox(width: 12.0,),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: Obx(() => Text(indexController.currentFeature[0].properties!["email"] ?? '',
|
|
||||||
style: const TextStyle(color: Colors.blue,),
|
|
||||||
overflow: TextOverflow.ellipsis,)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
): const SizedBox(width: 0, height: 0,),
|
|
||||||
indexController.currentFeature[0].properties!["webcontents"] != null ?
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(child: Container(
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: Text(
|
|
||||||
"web".tr, style: const TextStyle(fontWeight: FontWeight.bold)))),
|
|
||||||
const SizedBox(width: 12.0,),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: Obx(() => InkWell(
|
|
||||||
onTap: (){
|
|
||||||
_launchURL(indexController.currentFeature[0].properties!["webcontents"]);
|
|
||||||
},
|
|
||||||
child: Text(indexController.currentFeature[0].properties!["webcontents"] ?? '',
|
|
||||||
style: const TextStyle(color: Colors.blue,),
|
|
||||||
softWrap: false,
|
|
||||||
overflow: TextOverflow.fade,),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
): const SizedBox(width: 0.0, height: 0.0,),
|
|
||||||
indexController.currentFeature[0].properties!["videos"] != null ?
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(child: Container(
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: Text("video".tr, style: const TextStyle(fontWeight: FontWeight.bold)))),
|
|
||||||
const SizedBox(width: 12.0,),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: Obx(() => Text(indexController.currentFeature[0].properties!["videos"] ?? '',
|
|
||||||
style: const TextStyle(color: Colors.blue,),
|
|
||||||
overflow: TextOverflow.ellipsis,)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
): const SizedBox(width: 0.0, height: 0.0,),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20.0,),
|
|
||||||
Obx(() =>
|
|
||||||
indexController.currentAction.isNotEmpty ?
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
|
||||||
indexController.rog_mode.value == 0 ?
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
indexController.currentAction[0][0]["wanttogo"] == false ?
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: (){
|
|
||||||
if(indexController.currentAction.isNotEmpty){
|
|
||||||
print(indexController.currentAction[0]);
|
|
||||||
indexController.currentAction[0][0]["wanttogo"] = true;
|
|
||||||
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
|
|
||||||
indexController.currentAction.clear();
|
|
||||||
print("---temp---$temp");
|
|
||||||
indexController.currentAction.add([temp]);
|
|
||||||
}
|
|
||||||
indexController.makeAction(context);
|
|
||||||
},
|
|
||||||
child: Text("want_to_go".tr)
|
|
||||||
) :
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: (){
|
|
||||||
if(indexController.currentAction.isNotEmpty){
|
|
||||||
print(indexController.currentAction[0]);
|
|
||||||
indexController.currentAction[0][0]["wanttogo"] = false;
|
|
||||||
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
|
|
||||||
indexController.currentAction.clear();
|
|
||||||
print("---temp---$temp");
|
|
||||||
indexController.currentAction.add([temp]);
|
|
||||||
}
|
|
||||||
indexController.makeAction(context);
|
|
||||||
},
|
|
||||||
|
|
||||||
child: IconButton(
|
|
||||||
icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "want_to_go".tr,), onPressed: () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
indexController.currentAction[0][0]["like"] == false ?
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: (){
|
|
||||||
if(indexController.currentAction.isNotEmpty){
|
|
||||||
print(indexController.currentAction[0]);
|
|
||||||
indexController.currentAction[0][0]["like"] = true;
|
|
||||||
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
|
|
||||||
indexController.currentAction.clear();
|
|
||||||
print("---temp---$temp");
|
|
||||||
indexController.currentAction.add([temp]);
|
|
||||||
}
|
|
||||||
indexController.makeAction(context);
|
|
||||||
},
|
|
||||||
child: Text("like".tr)
|
|
||||||
) :
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: (){
|
|
||||||
if(indexController.currentAction.isNotEmpty){
|
|
||||||
print(indexController.currentAction[0]);
|
|
||||||
indexController.currentAction[0][0]["like"] = false;
|
|
||||||
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
|
|
||||||
indexController.currentAction.clear();
|
|
||||||
print("---temp---$temp");
|
|
||||||
indexController.currentAction.add([temp]);
|
|
||||||
}
|
|
||||||
indexController.makeAction(context);
|
|
||||||
},
|
|
||||||
|
|
||||||
child: IconButton(
|
|
||||||
icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "like".tr,), onPressed: () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
:
|
|
||||||
const SizedBox(width: 0, height: 0,),
|
|
||||||
indexController.rog_mode.value == 1 ?
|
|
||||||
indexController.currentAction[0][0]["checkin"] == false ?
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
ElevatedButton(
|
|
||||||
child: const Text("Image"), onPressed: (){
|
|
||||||
final ImagePicker _picker = ImagePicker();
|
|
||||||
_picker.pickImage(source: ImageSource.camera).then((value){
|
|
||||||
print("----- image---- ${value!.path}");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: (){
|
|
||||||
if(indexController.currentAction.isNotEmpty){
|
|
||||||
print(indexController.currentAction[0]);
|
|
||||||
indexController.currentAction[0][0]["checkin"] = true;
|
|
||||||
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
|
|
||||||
indexController.currentAction.clear();
|
|
||||||
print("---temp---$temp");
|
|
||||||
indexController.currentAction.add([temp]);
|
|
||||||
}
|
|
||||||
indexController.makeAction(context);
|
|
||||||
},
|
|
||||||
child: Text("checkin".tr)
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
:
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: (){
|
|
||||||
if(indexController.currentAction.isNotEmpty){
|
|
||||||
print(indexController.currentAction[0]);
|
|
||||||
indexController.currentAction[0][0]["checkin"] = false;
|
|
||||||
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
|
|
||||||
indexController.currentAction.clear();
|
|
||||||
print("---temp---$temp");
|
|
||||||
indexController.currentAction.add([temp]);
|
|
||||||
}
|
|
||||||
indexController.makeAction(context);
|
|
||||||
},
|
|
||||||
|
|
||||||
child: const Icon(
|
|
||||||
Icons.favorite, color: Colors.red)
|
|
||||||
|
|
||||||
,
|
|
||||||
):
|
|
||||||
const SizedBox(width: 0, height: 0,),
|
|
||||||
],
|
|
||||||
): Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: (){
|
|
||||||
Get.toNamed(AppPages.LOGIN);
|
|
||||||
},
|
|
||||||
child: const Flexible(child: Text("その他のオプションについてはログインしてください")))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 60.0,),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:flutter_breadcrumb/flutter_breadcrumb.dart';
|
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
|
||||||
import 'package:rogapp/widgets/perfecture_widget.dart';
|
|
||||||
|
|
||||||
class BreadCrumbWidget extends StatelessWidget {
|
|
||||||
BreadCrumbWidget({Key? key, this.mapController}) : super(key: key);
|
|
||||||
|
|
||||||
final MapController? mapController;
|
|
||||||
|
|
||||||
final IndexController indexController = Get.find<IndexController>();
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
print("------ map controller is $mapController------------");
|
|
||||||
return
|
|
||||||
Obx(()=>
|
|
||||||
indexController.perfectures.isNotEmpty && mapController != null ?
|
|
||||||
BreadCrumb.builder(
|
|
||||||
itemCount: indexController.perfectures.length,
|
|
||||||
builder: (index){
|
|
||||||
return
|
|
||||||
BreadCrumbItem(
|
|
||||||
content: PerfectureWidget(indexController: indexController, mapController: mapController!) //Text('Item$index')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
):
|
|
||||||
const Text("Empty")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
56
lib/widgets/c_form_text_field.dart
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CFormTextField extends StatelessWidget {
|
||||||
|
const CFormTextField({
|
||||||
|
super.key,
|
||||||
|
required this.cFocus,
|
||||||
|
required TextEditingController cController,
|
||||||
|
}) : cTextEditingController = cController;
|
||||||
|
|
||||||
|
final FocusNode cFocus;
|
||||||
|
final TextEditingController cTextEditingController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextFormField(
|
||||||
|
autocorrect: false,
|
||||||
|
autofocus: true,
|
||||||
|
focusNode: cFocus,
|
||||||
|
controller: cTextEditingController,
|
||||||
|
keyboardType: TextInputType.emailAddress,
|
||||||
|
textInputAction: TextInputAction.done,
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return "Need a valied email address";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
decoration: InputDecoration(
|
||||||
|
//filled: true,
|
||||||
|
//fillColor: Theme.of(context).colorScheme.primaryContainer,
|
||||||
|
hintText: "Enter email address",
|
||||||
|
labelText: "Email",
|
||||||
|
labelStyle: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.onPrimaryContainer,
|
||||||
|
fontSize: 16),
|
||||||
|
prefixIcon: const Icon(Icons.email_outlined),
|
||||||
|
suffixIcon: cTextEditingController.text.isNotEmpty
|
||||||
|
? IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
cTextEditingController.clear();
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.clear))
|
||||||
|
: Container(
|
||||||
|
width: 0,
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
width: 1, color: Theme.of(context).colorScheme.secondary)),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
width: 2, color: Theme.of(context).colorScheme.primary))),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
54
lib/widgets/c_password_text_filed.dart
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CPasswordTextField extends StatefulWidget {
|
||||||
|
const CPasswordTextField(
|
||||||
|
{super.key, required this.cFocusNode, required this.cController});
|
||||||
|
|
||||||
|
final FocusNode cFocusNode;
|
||||||
|
final TextEditingController cController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CPasswordTextField> createState() => _CPasswordTextFieldState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CPasswordTextFieldState extends State<CPasswordTextField> {
|
||||||
|
var _isVisible = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextFormField(
|
||||||
|
controller: widget.cController,
|
||||||
|
textInputAction: TextInputAction.go,
|
||||||
|
obscureText: !_isVisible,
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty || value.length < 5) {
|
||||||
|
return "Need a valied password with more than 4 charectors";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
decoration: InputDecoration(
|
||||||
|
//filled: true,
|
||||||
|
//fillColor: Theme.of(context).colorScheme.tertiaryContainer,
|
||||||
|
hintText: "Enter password",
|
||||||
|
labelText: "Password",
|
||||||
|
labelStyle: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.primary, fontSize: 16),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_isVisible = !_isVisible;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: _isVisible
|
||||||
|
? const Icon(Icons.visibility)
|
||||||
|
: const Icon(Icons.visibility_off)),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
width: 1, color: Theme.of(context).colorScheme.secondary)),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
width: 2, color: Theme.of(context).colorScheme.primary))));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,49 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
|
||||||
|
|
||||||
class CatWidget extends StatefulWidget {
|
|
||||||
CatWidget({ Key? key, required this.indexController, }) : super(key: key);
|
|
||||||
|
|
||||||
IndexController indexController;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<CatWidget> createState() => _CatWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _CatWidgetState extends State<CatWidget> {
|
|
||||||
String defaultValue = "---";
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return
|
|
||||||
PopupMenuButton(
|
|
||||||
onSelected: (value) {
|
|
||||||
widget.indexController.currentCat.clear();
|
|
||||||
widget.indexController.currentCat.add(value.toString());
|
|
||||||
widget.indexController.refreshLocationForCat();
|
|
||||||
setState(() {
|
|
||||||
print(value);
|
|
||||||
//widget.indexController.is_loading.value = true;
|
|
||||||
defaultValue = value.toString();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
itemBuilder: (BuildContext context){
|
|
||||||
List<PopupMenuItem> itms = <PopupMenuItem>[];
|
|
||||||
for(dynamic d in widget.indexController.cats[0]){
|
|
||||||
PopupMenuItem itm = PopupMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
|
|
||||||
itms.add(itm);
|
|
||||||
}
|
|
||||||
return itms;
|
|
||||||
}
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// widget.indexController.cats.map((e) =>
|
|
||||||
// PopupMenuItem(
|
|
||||||
// value: defaultValue,
|
|
||||||
// child: Text(e[0]['category'].toString()),
|
|
||||||
// )
|
|
||||||
// ).toList(),
|
|
||||||
@ -23,10 +23,10 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
destinationController.destinations[index].photos == "") {
|
destinationController.destinations[index].photos == "") {
|
||||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||||
} else {
|
} else {
|
||||||
print(
|
// print(
|
||||||
"------- image is ${destinationController.destinations[index].photos!}------");
|
// "------- image is ${destinationController.destinations[index].photos!}------");
|
||||||
String _photo = destinationController.destinations[index].photos!;
|
String photo = destinationController.destinations[index].photos!;
|
||||||
if (_photo.contains('http')) {
|
if (photo.contains('http')) {
|
||||||
return Image(
|
return Image(
|
||||||
image:
|
image:
|
||||||
NetworkImage(destinationController.destinations[index].photos!),
|
NetworkImage(destinationController.destinations[index].photos!),
|
||||||
@ -39,8 +39,8 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
//print("==== photo is ${server_url + '/media/compressed/' + destinationController.destinations[index].photos!} ===");
|
//print("==== photo is ${server_url + '/media/compressed/' + destinationController.destinations[index].photos!} ===");
|
||||||
return Image(
|
return Image(
|
||||||
image: NetworkImage('$serverUrl/media/compressed/' +
|
image: NetworkImage(
|
||||||
destinationController.destinations[index].photos!),
|
'$serverUrl/media/compressed/${destinationController.destinations[index].photos!}'),
|
||||||
errorBuilder:
|
errorBuilder:
|
||||||
(BuildContext context, Object exception, StackTrace? stackTrace) {
|
(BuildContext context, Object exception, StackTrace? stackTrace) {
|
||||||
return Image.asset("assets/images/empty_image.png");
|
return Image.asset("assets/images/empty_image.png");
|
||||||
@ -84,7 +84,7 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
print("--- selected destination is ${d.list_order}");
|
//print("--- selected destination is ${d.list_order}");
|
||||||
destinationController.makeOrder(d, -1);
|
destinationController.makeOrder(d, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
print("--- selected destination is ${d.list_order}");
|
//print("--- selected destination is ${d.list_order}");
|
||||||
destinationController.makeOrder(d, 1);
|
destinationController.makeOrder(d, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,8 +145,8 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
print(
|
//print(
|
||||||
"------ destination widget------ ${destinationController.destinationCount.value} ----------");
|
// "------ destination widget------ ${destinationController.destinationCount.value} ----------");
|
||||||
|
|
||||||
return Obx(() => Stack(
|
return Obx(() => Stack(
|
||||||
children: [
|
children: [
|
||||||
@ -161,12 +161,12 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
isFirst: index == 0 ? true : false,
|
isFirst: index == 0 ? true : false,
|
||||||
indicatorStyle: IndicatorStyle(
|
indicatorStyle: IndicatorStyle(
|
||||||
indicator: CircleAvatar(
|
indicator: CircleAvatar(
|
||||||
|
backgroundColor: Colors.red,
|
||||||
child: Text(
|
child: Text(
|
||||||
destinationController.destinations[index].list_order
|
destinationController.destinations[index].list_order
|
||||||
.toString(),
|
.toString(),
|
||||||
style: const TextStyle(color: Colors.white),
|
style: const TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.red,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
key: Key(index.toString()),
|
key: Key(index.toString()),
|
||||||
@ -180,7 +180,7 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
{
|
{
|
||||||
Destination? fs =
|
Destination? fs =
|
||||||
destinationController.destinations[index];
|
destinationController.destinations[index];
|
||||||
print("----fsf-----$index");
|
//print("----fsf-----$index");
|
||||||
if (indexController
|
if (indexController
|
||||||
.currentDestinationFeature.isNotEmpty) {
|
.currentDestinationFeature.isNotEmpty) {
|
||||||
indexController.currentDestinationFeature
|
indexController.currentDestinationFeature
|
||||||
@ -188,8 +188,8 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
indexController.currentDestinationFeature
|
indexController.currentDestinationFeature
|
||||||
.add(fs);
|
.add(fs);
|
||||||
print(
|
// print(
|
||||||
"--- ndexController.currentDestinationFeature ----- ${indexController.currentDestinationFeature[0].name} ----");
|
// "--- ndexController.currentDestinationFeature ----- ${indexController.currentDestinationFeature[0].name} ----");
|
||||||
//indexController.getAction();
|
//indexController.getAction();
|
||||||
|
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
@ -198,7 +198,9 @@ class DestinationWidget extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
//builder:((context) => BottomSheetWidget())
|
//builder:((context) => BottomSheetWidget())
|
||||||
builder: ((context) => BottomSheetNew(destination: fs,)));
|
builder: ((context) => BottomSheetNew(
|
||||||
|
destination: fs,
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
|
|||||||
@ -28,13 +28,13 @@ class _ListWidgetState extends State<ListWidget> {
|
|||||||
"") {
|
"") {
|
||||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||||
} else {
|
} else {
|
||||||
print("==== photo index is $index ===");
|
//print("==== photo index is $index ===");
|
||||||
String serverUrl = ConstValues.currentServer();
|
String serverUrl = ConstValues.currentServer();
|
||||||
GeoJsonFeature<dynamic> gf =
|
GeoJsonFeature<dynamic> gf =
|
||||||
indexController.locations[0].collection[index];
|
indexController.locations[0].collection[index];
|
||||||
String _photo = gf.properties!["photos"];
|
String photo = gf.properties!["photos"];
|
||||||
return Image(
|
return Image(
|
||||||
image: NetworkImage('$serverUrl/media/compressed/' + _photo),
|
image: NetworkImage('$serverUrl/media/compressed/$photo'),
|
||||||
errorBuilder:
|
errorBuilder:
|
||||||
(BuildContext context, Object exception, StackTrace? stackTrace) {
|
(BuildContext context, Object exception, StackTrace? stackTrace) {
|
||||||
return Image.asset("assets/images/empty_image.png");
|
return Image.asset("assets/images/empty_image.png");
|
||||||
@ -57,19 +57,19 @@ class _ListWidgetState extends State<ListWidget> {
|
|||||||
|
|
||||||
Destination createDestination(GeoJsonFeature feature) {
|
Destination createDestination(GeoJsonFeature feature) {
|
||||||
final props = feature.properties;
|
final props = feature.properties;
|
||||||
GeoJsonMultiPoint _pt = feature.geometry;
|
GeoJsonMultiPoint pt = feature.geometry;
|
||||||
|
|
||||||
return Destination(
|
return Destination(
|
||||||
cp: props!['cp'],
|
cp: props!['cp'],
|
||||||
lat: _pt.geoSerie!.geoPoints.first.latitude,
|
lat: pt.geoSerie!.geoPoints.first.latitude,
|
||||||
lon: _pt.geoSerie!.geoPoints.first.longitude,
|
lon: pt.geoSerie!.geoPoints.first.longitude,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> matrixDistance(int i) async {
|
Future<String> matrixDistance(int i) async {
|
||||||
// Create two destinations directly from indexController.locations[0].collection
|
// Create two destinations directly from indexController.locations[0].collection
|
||||||
Destination desCurr = Destination(
|
Destination desCurr = Destination(
|
||||||
lat: indexController.current_lat, lon: indexController.current_lon);
|
lat: indexController.currentLat, lon: indexController.currentLon);
|
||||||
//Destination dest1 = createDestination(indexController.locations[0].collection[0]);
|
//Destination dest1 = createDestination(indexController.locations[0].collection[0]);
|
||||||
Destination dest2 =
|
Destination dest2 =
|
||||||
createDestination(indexController.locations[0].collection[i]);
|
createDestination(indexController.locations[0].collection[i]);
|
||||||
@ -82,7 +82,7 @@ class _ListWidgetState extends State<ListWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _pullRefresh() async {
|
Future<void> _pullRefresh() async {
|
||||||
print("pull to refesh");
|
//print("pull to refesh");
|
||||||
indexController.locations[0].collection.sort((a, b) =>
|
indexController.locations[0].collection.sort((a, b) =>
|
||||||
(a.properties!['cp'] as Comparable)
|
(a.properties!['cp'] as Comparable)
|
||||||
.compareTo(b.properties!['cp'] as Comparable));
|
.compareTo(b.properties!['cp'] as Comparable));
|
||||||
@ -99,23 +99,24 @@ class _ListWidgetState extends State<ListWidget> {
|
|||||||
itemCount: indexController.locations[0].collection.length,
|
itemCount: indexController.locations[0].collection.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemBuilder: (_, index) {
|
itemBuilder: (_, index) {
|
||||||
bool _is_found = false;
|
bool isFound = false;
|
||||||
for (Destination d in destinationController.destinations) {
|
for (Destination d in destinationController.destinations) {
|
||||||
if (indexController.locations[0].collection[index]
|
if (indexController.locations[0].collection[index]
|
||||||
.properties!['location_id'] ==
|
.properties!['location_id'] ==
|
||||||
d.location_id) {
|
d.location_id) {
|
||||||
_is_found = true;
|
isFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Card(
|
return Card(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
selected: _is_found,
|
selected: isFound,
|
||||||
selectedTileColor: Colors.yellow.shade200,
|
selectedTileColor: Colors.yellow.shade200,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
GeoJsonFeature gf =
|
GeoJsonFeature gf =
|
||||||
indexController.locations[0].collection[index];
|
indexController.locations[0].collection[index];
|
||||||
Destination des = destinationController.festuretoDestination(gf);
|
Destination des =
|
||||||
|
destinationController.festuretoDestination(gf);
|
||||||
changeCurrentFeature(gf);
|
changeCurrentFeature(gf);
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
constraints: BoxConstraints.loose(
|
constraints: BoxConstraints.loose(
|
||||||
@ -123,7 +124,9 @@ class _ListWidgetState extends State<ListWidget> {
|
|||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
context: context,
|
context: context,
|
||||||
//builder: (context) => BottomSheetWidget(),
|
//builder: (context) => BottomSheetWidget(),
|
||||||
builder: ((context) => BottomSheetNew(destination: des,)));
|
builder: ((context) => BottomSheetNew(
|
||||||
|
destination: des,
|
||||||
|
)));
|
||||||
},
|
},
|
||||||
leading: getImage(index),
|
leading: getImage(index),
|
||||||
title: indexController.locations[0].collection[index]
|
title: indexController.locations[0].collection[index]
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class MapWidget extends StatelessWidget {
|
|||||||
Widget getMarkerShape(GeoJsonFeature i, BuildContext context) {
|
Widget getMarkerShape(GeoJsonFeature i, BuildContext context) {
|
||||||
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
||||||
//print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
|
//print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
|
||||||
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
//RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -35,12 +35,11 @@ class MapWidget extends StatelessWidget {
|
|||||||
GeoJsonFeature? fs = indexController.getFeatureForLatLong(
|
GeoJsonFeature? fs = indexController.getFeatureForLatLong(
|
||||||
p.geoSerie!.geoPoints[0].latitude,
|
p.geoSerie!.geoPoints[0].latitude,
|
||||||
p.geoSerie!.geoPoints[0].longitude);
|
p.geoSerie!.geoPoints[0].longitude);
|
||||||
print("------- fs $fs------");
|
//print("------- fs $fs------");
|
||||||
if (fs != null) {
|
if (fs != null) {
|
||||||
indexController.currentFeature.clear();
|
indexController.currentFeature.clear();
|
||||||
indexController.currentFeature.add(fs);
|
indexController.currentFeature.add(fs);
|
||||||
//print("----- fs is ${fs.properties!['photos']}");
|
//print("----- fs is ${fs.properties!['photos']}");
|
||||||
indexController.getAction();
|
|
||||||
|
|
||||||
Destination des = destinationController.festuretoDestination(fs);
|
Destination des = destinationController.festuretoDestination(fs);
|
||||||
|
|
||||||
@ -55,7 +54,7 @@ class MapWidget extends StatelessWidget {
|
|||||||
))
|
))
|
||||||
//builder:((context) => BottomSheetWidget())
|
//builder:((context) => BottomSheetWidget())
|
||||||
).whenComplete(() {
|
).whenComplete(() {
|
||||||
destinationController.skip_gps = false;
|
destinationController.skipGps = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -107,7 +106,7 @@ class MapWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<LatLng>? getPoints() {
|
List<LatLng>? getPoints() {
|
||||||
print("##### --- route point ${indexController.routePoints.length}");
|
//print("##### --- route point ${indexController.routePoints.length}");
|
||||||
List<LatLng> pts = [];
|
List<LatLng> pts = [];
|
||||||
for (PointLatLng p in indexController.routePoints) {
|
for (PointLatLng p in indexController.routePoints) {
|
||||||
LatLng l = LatLng(p.latitude, p.longitude);
|
LatLng l = LatLng(p.latitude, p.longitude);
|
||||||
@ -118,13 +117,13 @@ class MapWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
print(
|
// print(
|
||||||
"---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
|
// "---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
|
||||||
|
|
||||||
final PopupController _popupController = PopupController();
|
final PopupController popupController = PopupController();
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => indexController.is_loading == true
|
Obx(() => indexController.isLoading.value == true
|
||||||
? const Padding(
|
? const Padding(
|
||||||
padding: EdgeInsets.only(top: 60.0),
|
padding: EdgeInsets.only(top: 60.0),
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator(),
|
||||||
@ -134,19 +133,13 @@ class MapWidget extends StatelessWidget {
|
|||||||
options: MapOptions(
|
options: MapOptions(
|
||||||
maxZoom: 18.4,
|
maxZoom: 18.4,
|
||||||
onMapReady: () {
|
onMapReady: () {
|
||||||
indexController.is_mapController_loaded.value = true;
|
|
||||||
subscription = indexController.mapController.mapEventStream
|
subscription = indexController.mapController.mapEventStream
|
||||||
.listen((MapEvent mapEvent) {
|
.listen((MapEvent mapEvent) {
|
||||||
if (mapEvent is MapEventMoveStart) {
|
if (mapEvent is MapEventMoveStart) {
|
||||||
//print(DateTime.now().toString() + ' [MapEventMoveStart] START');
|
//print(DateTime.now().toString() + ' [MapEventMoveStart] START');
|
||||||
// do something
|
// do something
|
||||||
}
|
}
|
||||||
if (mapEvent is MapEventMoveEnd &&
|
if (mapEvent is MapEventMoveEnd) {}
|
||||||
indexController.currentUser.isEmpty) {
|
|
||||||
//print(DateTime.now().toString() + ' [MapEventMoveStart] END');
|
|
||||||
indexController.loadLocationsBound();
|
|
||||||
//indexController.rogMapController!.move(c.center, c.zoom);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//center: LatLng(37.15319600454702, 139.58765950528198),
|
//center: LatLng(37.15319600454702, 139.58765950528198),
|
||||||
@ -163,7 +156,7 @@ class MapWidget extends StatelessWidget {
|
|||||||
onPositionChanged: (MapPosition pos, isvalue) {
|
onPositionChanged: (MapPosition pos, isvalue) {
|
||||||
indexController.currentBound = [pos.bounds!];
|
indexController.currentBound = [pos.bounds!];
|
||||||
},
|
},
|
||||||
onTap: (_, __) => _popupController
|
onTap: (_, __) => popupController
|
||||||
.hideAllPopups(), // Hide popup when the map is tapped.
|
.hideAllPopups(), // Hide popup when the map is tapped.
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
@ -181,7 +174,7 @@ class MapWidget extends StatelessWidget {
|
|||||||
: Container(),
|
: Container(),
|
||||||
),
|
),
|
||||||
CurrentLocationLayer(
|
CurrentLocationLayer(
|
||||||
followOnLocationUpdate: FollowOnLocationUpdate.once,
|
followOnLocationUpdate: FollowOnLocationUpdate.never,
|
||||||
turnOnHeadingUpdate: TurnOnHeadingUpdate.never,
|
turnOnHeadingUpdate: TurnOnHeadingUpdate.never,
|
||||||
style: const LocationMarkerStyle(
|
style: const LocationMarkerStyle(
|
||||||
marker: DefaultLocationMarker(
|
marker: DefaultLocationMarker(
|
||||||
@ -199,13 +192,13 @@ class MapWidget extends StatelessWidget {
|
|||||||
? MarkerLayer(
|
? MarkerLayer(
|
||||||
markers:
|
markers:
|
||||||
indexController.locations[0].collection.map((i) {
|
indexController.locations[0].collection.map((i) {
|
||||||
print("i si ${i.properties!['location_id']}");
|
//print("i si ${i.properties!['location_id']}");
|
||||||
|
|
||||||
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||||
GeoJsonMultiPoint p =
|
GeoJsonMultiPoint p =
|
||||||
i.geometry as GeoJsonMultiPoint;
|
i.geometry as GeoJsonMultiPoint;
|
||||||
print(
|
//print(
|
||||||
"lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
|
// "lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
|
||||||
return Marker(
|
return Marker(
|
||||||
anchorPos: AnchorPos.exactly(Anchor(108.0, 18.0)),
|
anchorPos: AnchorPos.exactly(Anchor(108.0, 18.0)),
|
||||||
height: 32.0,
|
height: 32.0,
|
||||||
|
|||||||
@ -1,237 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
|
||||||
|
|
||||||
|
|
||||||
class PerfectureWidget extends StatefulWidget {
|
|
||||||
|
|
||||||
IndexController indexController;
|
|
||||||
MapController mapController;
|
|
||||||
|
|
||||||
|
|
||||||
PerfectureWidget({Key? key, required this.indexController, required this.mapController}) : super(key: key){
|
|
||||||
//indexController.zoomtoMainPerf("9", mapController);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<PerfectureWidget> createState() => _PerfectureWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PerfectureWidgetState extends State<PerfectureWidget> {
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool isNumeric(String s) {
|
|
||||||
if (s == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return double.tryParse(s) != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
List<DropdownMenuItem<String>> getDropdownItems() {
|
|
||||||
List<DropdownMenuItem<String>> dropDownItems = [];
|
|
||||||
|
|
||||||
for (Map<String, dynamic> currency in widget.indexController.perfectures[0]) {
|
|
||||||
//print(currency["id"].toString());
|
|
||||||
var newDropdown = DropdownMenuItem(
|
|
||||||
child: Text(currency["adm1_ja"].toString()),
|
|
||||||
value: currency["id"].toString(),
|
|
||||||
);
|
|
||||||
|
|
||||||
dropDownItems.add(newDropdown);
|
|
||||||
}
|
|
||||||
return dropDownItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<DropdownMenuItem<String>> getSubDropdownItems() {
|
|
||||||
List<DropdownMenuItem<String>> dropDownItems = [];
|
|
||||||
|
|
||||||
if(widget.indexController.subPerfs.isNotEmpty){
|
|
||||||
|
|
||||||
for (Map<String, dynamic> currency in widget.indexController.subPerfs[0]) {
|
|
||||||
var newDropdown = DropdownMenuItem(
|
|
||||||
child: Text(currency["adm2_ja"].toString()),
|
|
||||||
value: currency["id"].toString(),
|
|
||||||
);
|
|
||||||
dropDownItems.add(newDropdown);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return dropDownItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<DropdownMenuItem<String>> getCustomArea(){
|
|
||||||
List<DropdownMenuItem<String>> dropDownItems = [];
|
|
||||||
if(widget.indexController.areas.isNotEmpty){
|
|
||||||
|
|
||||||
for (Map<String, dynamic> currency in widget.indexController.areas[0]) {
|
|
||||||
var newDropdown = DropdownMenuItem(
|
|
||||||
child: Text(currency["area_nm"].toString()),
|
|
||||||
value: currency["id"].toString(),
|
|
||||||
);
|
|
||||||
dropDownItems.add(newDropdown);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(widget.indexController.customAreas.isNotEmpty){
|
|
||||||
|
|
||||||
for (Map<String, dynamic> currency in widget.indexController.customAreas[0]) {
|
|
||||||
var newDropdown = DropdownMenuItem(
|
|
||||||
child: Text(currency["event_name"].toString()),
|
|
||||||
value: currency["event_name"].toString(),
|
|
||||||
);
|
|
||||||
|
|
||||||
dropDownItems.add(newDropdown);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return dropDownItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<DropdownMenuItem<String>> getCategory(){
|
|
||||||
List<DropdownMenuItem<String>> dropDownItems = [];
|
|
||||||
|
|
||||||
dropDownItems.clear();
|
|
||||||
|
|
||||||
//print("--------cats ------############### ${widget.indexController.cats.toString()} -------------");
|
|
||||||
for(dynamic d in widget.indexController.cats){
|
|
||||||
//print("-------- ddd ------############### ${d} --------dddd-----");
|
|
||||||
var newDropdown = DropdownMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
|
|
||||||
//print("--------cats ------############### ${d['category'].toString()} -------------");
|
|
||||||
dropDownItems.add(newDropdown);
|
|
||||||
}
|
|
||||||
|
|
||||||
//return [];
|
|
||||||
|
|
||||||
return dropDownItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
|
|
||||||
return Obx(() =>
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
DropdownButton<String>(
|
|
||||||
value: widget.indexController.dropdownValue,
|
|
||||||
icon: const Icon(Icons.arrow_downward),
|
|
||||||
elevation: 16,
|
|
||||||
style: const TextStyle(color: Colors.deepPurple),
|
|
||||||
underline: Container(
|
|
||||||
height: 2,
|
|
||||||
color: Colors.deepPurpleAccent,
|
|
||||||
),
|
|
||||||
onChanged: (String? newValue) {
|
|
||||||
//setState(() {
|
|
||||||
if(newValue != null){
|
|
||||||
widget.indexController.is_loading.value = true;
|
|
||||||
widget.indexController.dropdownValue = newValue;
|
|
||||||
widget.indexController.populateForPerf(newValue, widget.mapController);
|
|
||||||
}
|
|
||||||
//});
|
|
||||||
},
|
|
||||||
items: getDropdownItems()
|
|
||||||
),
|
|
||||||
|
|
||||||
// Gifu areas
|
|
||||||
widget.indexController.areas.isNotEmpty ?
|
|
||||||
DropdownButton<String>(
|
|
||||||
value: widget.indexController.areaDropdownValue,
|
|
||||||
icon: const Icon(Icons.arrow_downward),
|
|
||||||
elevation: 16,
|
|
||||||
style: const TextStyle(color: Colors.deepPurple),
|
|
||||||
hint: const Text("select"),
|
|
||||||
underline: Container(
|
|
||||||
height: 2,
|
|
||||||
color: Colors.deepPurpleAccent,
|
|
||||||
),
|
|
||||||
onChanged: (String? newValue) {
|
|
||||||
if (isNumeric(newValue!)){
|
|
||||||
widget.indexController.is_custom_area_selected.value = false;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
widget.indexController.loadCustomLocation(newValue);
|
|
||||||
widget.indexController.is_custom_area_selected.value = true;
|
|
||||||
widget.indexController.subPerfs.clear();
|
|
||||||
widget.indexController.cats.clear();
|
|
||||||
}
|
|
||||||
setState(() {
|
|
||||||
widget.indexController.locations.clear();
|
|
||||||
widget.indexController.is_loading.value = true;
|
|
||||||
widget.indexController.areaDropdownValue = newValue;
|
|
||||||
widget.indexController.populateSubPerForArea(newValue, widget.mapController);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
items: getCustomArea(),
|
|
||||||
): const Text(""),
|
|
||||||
|
|
||||||
widget.indexController.subPerfs.isNotEmpty ?
|
|
||||||
DropdownButton<String>(
|
|
||||||
value: widget.indexController.subDropdownValue,
|
|
||||||
icon: const Icon(Icons.arrow_downward),
|
|
||||||
elevation: 16,
|
|
||||||
style: const TextStyle(color: Colors.deepPurple),
|
|
||||||
hint: const Text("select"),
|
|
||||||
underline: Container(
|
|
||||||
height: 2,
|
|
||||||
color: Colors.deepPurpleAccent,
|
|
||||||
),
|
|
||||||
onChanged: (String? newValue) {
|
|
||||||
setState(() {
|
|
||||||
if(newValue != null){
|
|
||||||
//widget.indexController.is_loading.value = true;
|
|
||||||
//widget.indexController.populateForSubPerf(newValue, widget.mapController);
|
|
||||||
//widget.indexController.loadLocationforSubPerf(newValue, widget.mapController);
|
|
||||||
widget.indexController.subDropdownValue = newValue;
|
|
||||||
widget.indexController.loadCatForCity(newValue);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
items:
|
|
||||||
getSubDropdownItems()
|
|
||||||
) :
|
|
||||||
const Text(""),
|
|
||||||
//CatWidget(indexController: widget.indexController,),
|
|
||||||
widget.indexController.cats.isNotEmpty ?
|
|
||||||
DropdownButton<String>(
|
|
||||||
value: widget.indexController.getCatText(),
|
|
||||||
icon: const Icon(Icons.arrow_downward),
|
|
||||||
elevation: 16,
|
|
||||||
style: const TextStyle(color: Colors.deepPurple),
|
|
||||||
hint: const Text("select"),
|
|
||||||
underline: Container(
|
|
||||||
height: 2,
|
|
||||||
color: Colors.deepPurpleAccent,
|
|
||||||
),
|
|
||||||
onChanged: (String? newValue) {
|
|
||||||
setState(() {
|
|
||||||
if(newValue != null){
|
|
||||||
widget.indexController.is_loading.value = true;
|
|
||||||
widget.indexController.cateogory = newValue;
|
|
||||||
widget.indexController.currentCat.clear();
|
|
||||||
widget.indexController.currentCat.add(newValue);
|
|
||||||
widget.indexController.populateForSubPerf(widget.indexController.subDropdownValue, widget.mapController);
|
|
||||||
//widget.indexController.loadLocationforSubPerf(newValue, widget.mapController);
|
|
||||||
//widget.indexController.subDropdownValue = newValue;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
items:
|
|
||||||
getCategory(),
|
|
||||||
)
|
|
||||||
:
|
|
||||||
Container(),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
1
linux/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
flutter/ephemeral
|
||||||
139
linux/CMakeLists.txt
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
# Project-level configuration.
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
project(runner LANGUAGES CXX)
|
||||||
|
|
||||||
|
# The name of the executable created for the application. Change this to change
|
||||||
|
# the on-disk name of your application.
|
||||||
|
set(BINARY_NAME "rog_app")
|
||||||
|
# The unique GTK application identifier for this application. See:
|
||||||
|
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
||||||
|
set(APPLICATION_ID "com.dvox.rog_app")
|
||||||
|
|
||||||
|
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||||
|
# versions of CMake.
|
||||||
|
cmake_policy(SET CMP0063 NEW)
|
||||||
|
|
||||||
|
# Load bundled libraries from the lib/ directory relative to the binary.
|
||||||
|
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
|
||||||
|
|
||||||
|
# Root filesystem for cross-building.
|
||||||
|
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
|
||||||
|
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Define build configuration options.
|
||||||
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
||||||
|
STRING "Flutter build mode" FORCE)
|
||||||
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||||
|
"Debug" "Profile" "Release")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Compilation settings that should be applied to most targets.
|
||||||
|
#
|
||||||
|
# Be cautious about adding new options here, as plugins use this function by
|
||||||
|
# default. In most cases, you should add new options to specific targets instead
|
||||||
|
# of modifying this function.
|
||||||
|
function(APPLY_STANDARD_SETTINGS TARGET)
|
||||||
|
target_compile_features(${TARGET} PUBLIC cxx_std_14)
|
||||||
|
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
||||||
|
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
||||||
|
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Flutter library and tool build rules.
|
||||||
|
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
||||||
|
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
||||||
|
|
||||||
|
# System-level dependencies.
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||||
|
|
||||||
|
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
||||||
|
|
||||||
|
# Define the application target. To change its name, change BINARY_NAME above,
|
||||||
|
# not the value here, or `flutter run` will no longer work.
|
||||||
|
#
|
||||||
|
# Any new source files that you add to the application should be added here.
|
||||||
|
add_executable(${BINARY_NAME}
|
||||||
|
"main.cc"
|
||||||
|
"my_application.cc"
|
||||||
|
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Apply the standard set of build settings. This can be removed for applications
|
||||||
|
# that need different build settings.
|
||||||
|
apply_standard_settings(${BINARY_NAME})
|
||||||
|
|
||||||
|
# Add dependency libraries. Add any application-specific dependencies here.
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
||||||
|
|
||||||
|
# Run the Flutter tool portions of the build. This must not be removed.
|
||||||
|
add_dependencies(${BINARY_NAME} flutter_assemble)
|
||||||
|
|
||||||
|
# Only the install-generated bundle's copy of the executable will launch
|
||||||
|
# correctly, since the resources must in the right relative locations. To avoid
|
||||||
|
# people trying to run the unbundled copy, put it in a subdirectory instead of
|
||||||
|
# the default top-level location.
|
||||||
|
set_target_properties(${BINARY_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Generated plugin build rules, which manage building the plugins and adding
|
||||||
|
# them to the application.
|
||||||
|
include(flutter/generated_plugins.cmake)
|
||||||
|
|
||||||
|
|
||||||
|
# === Installation ===
|
||||||
|
# By default, "installing" just makes a relocatable bundle in the build
|
||||||
|
# directory.
|
||||||
|
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
|
||||||
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Start with a clean build bundle directory every time.
|
||||||
|
install(CODE "
|
||||||
|
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
|
||||||
|
" COMPONENT Runtime)
|
||||||
|
|
||||||
|
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
||||||
|
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
|
|
||||||
|
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
|
||||||
|
install(FILES "${bundled_library}"
|
||||||
|
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
endforeach(bundled_library)
|
||||||
|
|
||||||
|
# Fully re-copy the assets directory on each build to avoid having stale files
|
||||||
|
# from a previous install.
|
||||||
|
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
|
||||||
|
install(CODE "
|
||||||
|
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
|
||||||
|
" COMPONENT Runtime)
|
||||||
|
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
|
||||||
|
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
|
||||||
|
|
||||||
|
# Install the AOT library on non-Debug builds only.
|
||||||
|
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
endif()
|
||||||
88
linux/flutter/CMakeLists.txt
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
# This file controls Flutter-level build steps. It should not be edited.
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
|
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
||||||
|
|
||||||
|
# Configuration provided via flutter tool.
|
||||||
|
include(${EPHEMERAL_DIR}/generated_config.cmake)
|
||||||
|
|
||||||
|
# TODO: Move the rest of this into files in ephemeral. See
|
||||||
|
# https://github.com/flutter/flutter/issues/57146.
|
||||||
|
|
||||||
|
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
|
||||||
|
# which isn't available in 3.10.
|
||||||
|
function(list_prepend LIST_NAME PREFIX)
|
||||||
|
set(NEW_LIST "")
|
||||||
|
foreach(element ${${LIST_NAME}})
|
||||||
|
list(APPEND NEW_LIST "${PREFIX}${element}")
|
||||||
|
endforeach(element)
|
||||||
|
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# === Flutter Library ===
|
||||||
|
# System-level dependencies.
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||||
|
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
||||||
|
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||||
|
|
||||||
|
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
|
||||||
|
|
||||||
|
# Published to parent scope for install step.
|
||||||
|
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
||||||
|
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
||||||
|
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
||||||
|
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_LIBRARY_HEADERS
|
||||||
|
"fl_basic_message_channel.h"
|
||||||
|
"fl_binary_codec.h"
|
||||||
|
"fl_binary_messenger.h"
|
||||||
|
"fl_dart_project.h"
|
||||||
|
"fl_engine.h"
|
||||||
|
"fl_json_message_codec.h"
|
||||||
|
"fl_json_method_codec.h"
|
||||||
|
"fl_message_codec.h"
|
||||||
|
"fl_method_call.h"
|
||||||
|
"fl_method_channel.h"
|
||||||
|
"fl_method_codec.h"
|
||||||
|
"fl_method_response.h"
|
||||||
|
"fl_plugin_registrar.h"
|
||||||
|
"fl_plugin_registry.h"
|
||||||
|
"fl_standard_message_codec.h"
|
||||||
|
"fl_standard_method_codec.h"
|
||||||
|
"fl_string_codec.h"
|
||||||
|
"fl_value.h"
|
||||||
|
"fl_view.h"
|
||||||
|
"flutter_linux.h"
|
||||||
|
)
|
||||||
|
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
|
||||||
|
add_library(flutter INTERFACE)
|
||||||
|
target_include_directories(flutter INTERFACE
|
||||||
|
"${EPHEMERAL_DIR}"
|
||||||
|
)
|
||||||
|
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
|
||||||
|
target_link_libraries(flutter INTERFACE
|
||||||
|
PkgConfig::GTK
|
||||||
|
PkgConfig::GLIB
|
||||||
|
PkgConfig::GIO
|
||||||
|
)
|
||||||
|
add_dependencies(flutter flutter_assemble)
|
||||||
|
|
||||||
|
# === Flutter tool backend ===
|
||||||
|
# _phony_ is a non-existent file to force this command to run every time,
|
||||||
|
# since currently there's no way to get a full input/output list from the
|
||||||
|
# flutter tool.
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/_phony_
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E env
|
||||||
|
${FLUTTER_TOOL_ENVIRONMENT}
|
||||||
|
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
|
||||||
|
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
add_custom_target(flutter_assemble DEPENDS
|
||||||
|
"${FLUTTER_LIBRARY}"
|
||||||
|
${FLUTTER_LIBRARY_HEADERS}
|
||||||
|
)
|
||||||
23
linux/flutter/generated_plugin_registrant.cc
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <file_selector_linux/file_selector_plugin.h>
|
||||||
|
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
|
||||||
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
|
|
||||||
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||||
|
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin");
|
||||||
|
isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||||
|
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||||
|
}
|
||||||
15
linux/flutter/generated_plugin_registrant.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
#ifndef GENERATED_PLUGIN_REGISTRANT_
|
||||||
|
#define GENERATED_PLUGIN_REGISTRANT_
|
||||||
|
|
||||||
|
#include <flutter_linux/flutter_linux.h>
|
||||||
|
|
||||||
|
// Registers Flutter plugins.
|
||||||
|
void fl_register_plugins(FlPluginRegistry* registry);
|
||||||
|
|
||||||
|
#endif // GENERATED_PLUGIN_REGISTRANT_
|
||||||
26
linux/flutter/generated_plugins.cmake
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# Generated file, do not edit.
|
||||||
|
#
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
file_selector_linux
|
||||||
|
isar_flutter_libs
|
||||||
|
url_launcher_linux
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
)
|
||||||
|
|
||||||
|
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||||
|
|
||||||
|
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||||
|
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||||
|
endforeach(plugin)
|
||||||
|
|
||||||
|
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||||
|
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||||
|
endforeach(ffi_plugin)
|
||||||
6
linux/main.cc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "my_application.h"
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
g_autoptr(MyApplication) app = my_application_new();
|
||||||
|
return g_application_run(G_APPLICATION(app), argc, argv);
|
||||||
|
}
|
||||||
104
linux/my_application.cc
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
#include "my_application.h"
|
||||||
|
|
||||||
|
#include <flutter_linux/flutter_linux.h>
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
|
#include <gdk/gdkx.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "flutter/generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
struct _MyApplication {
|
||||||
|
GtkApplication parent_instance;
|
||||||
|
char** dart_entrypoint_arguments;
|
||||||
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
|
||||||
|
|
||||||
|
// Implements GApplication::activate.
|
||||||
|
static void my_application_activate(GApplication* application) {
|
||||||
|
MyApplication* self = MY_APPLICATION(application);
|
||||||
|
GtkWindow* window =
|
||||||
|
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
|
||||||
|
|
||||||
|
// Use a header bar when running in GNOME as this is the common style used
|
||||||
|
// by applications and is the setup most users will be using (e.g. Ubuntu
|
||||||
|
// desktop).
|
||||||
|
// If running on X and not using GNOME then just use a traditional title bar
|
||||||
|
// in case the window manager does more exotic layout, e.g. tiling.
|
||||||
|
// If running on Wayland assume the header bar will work (may need changing
|
||||||
|
// if future cases occur).
|
||||||
|
gboolean use_header_bar = TRUE;
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
|
GdkScreen* screen = gtk_window_get_screen(window);
|
||||||
|
if (GDK_IS_X11_SCREEN(screen)) {
|
||||||
|
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
|
||||||
|
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
|
||||||
|
use_header_bar = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (use_header_bar) {
|
||||||
|
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
|
||||||
|
gtk_widget_show(GTK_WIDGET(header_bar));
|
||||||
|
gtk_header_bar_set_title(header_bar, "rog_app");
|
||||||
|
gtk_header_bar_set_show_close_button(header_bar, TRUE);
|
||||||
|
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
|
||||||
|
} else {
|
||||||
|
gtk_window_set_title(window, "rog_app");
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_window_set_default_size(window, 1280, 720);
|
||||||
|
gtk_widget_show(GTK_WIDGET(window));
|
||||||
|
|
||||||
|
g_autoptr(FlDartProject) project = fl_dart_project_new();
|
||||||
|
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
|
||||||
|
|
||||||
|
FlView* view = fl_view_new(project);
|
||||||
|
gtk_widget_show(GTK_WIDGET(view));
|
||||||
|
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
|
||||||
|
|
||||||
|
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
|
||||||
|
|
||||||
|
gtk_widget_grab_focus(GTK_WIDGET(view));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GApplication::local_command_line.
|
||||||
|
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
|
||||||
|
MyApplication* self = MY_APPLICATION(application);
|
||||||
|
// Strip out the first argument as it is the binary name.
|
||||||
|
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
|
||||||
|
|
||||||
|
g_autoptr(GError) error = nullptr;
|
||||||
|
if (!g_application_register(application, nullptr, &error)) {
|
||||||
|
g_warning("Failed to register: %s", error->message);
|
||||||
|
*exit_status = 1;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_application_activate(application);
|
||||||
|
*exit_status = 0;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GObject::dispose.
|
||||||
|
static void my_application_dispose(GObject* object) {
|
||||||
|
MyApplication* self = MY_APPLICATION(object);
|
||||||
|
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
|
||||||
|
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void my_application_class_init(MyApplicationClass* klass) {
|
||||||
|
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
|
||||||
|
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
|
||||||
|
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void my_application_init(MyApplication* self) {}
|
||||||
|
|
||||||
|
MyApplication* my_application_new() {
|
||||||
|
return MY_APPLICATION(g_object_new(my_application_get_type(),
|
||||||
|
"application-id", APPLICATION_ID,
|
||||||
|
"flags", G_APPLICATION_NON_UNIQUE,
|
||||||
|
nullptr));
|
||||||
|
}
|
||||||
18
linux/my_application.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef FLUTTER_MY_APPLICATION_H_
|
||||||
|
#define FLUTTER_MY_APPLICATION_H_
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
|
||||||
|
GtkApplication)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* my_application_new:
|
||||||
|
*
|
||||||
|
* Creates a new Flutter-based application.
|
||||||
|
*
|
||||||
|
* Returns: a new #MyApplication.
|
||||||
|
*/
|
||||||
|
MyApplication* my_application_new();
|
||||||
|
|
||||||
|
#endif // FLUTTER_MY_APPLICATION_H_
|
||||||
7
macos/.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Flutter-related
|
||||||
|
**/Flutter/ephemeral/
|
||||||
|
**/Pods/
|
||||||
|
|
||||||
|
# Xcode-related
|
||||||
|
**/dgph
|
||||||
|
**/xcuserdata/
|
||||||
2
macos/Flutter/Flutter-Debug.xcconfig
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
2
macos/Flutter/Flutter-Release.xcconfig
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
26
macos/Flutter/GeneratedPluginRegistrant.swift
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
import FlutterMacOS
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
import connectivity_plus
|
||||||
|
import file_selector_macos
|
||||||
|
import geolocator_apple
|
||||||
|
import isar_flutter_libs
|
||||||
|
import path_provider_foundation
|
||||||
|
import shared_preferences_foundation
|
||||||
|
import sqflite
|
||||||
|
import url_launcher_macos
|
||||||
|
|
||||||
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
|
||||||
|
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||||
|
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||||
|
IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin"))
|
||||||
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
|
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||||
|
}
|
||||||
43
macos/Podfile
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
platform :osx, '10.14'
|
||||||
|
|
||||||
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||||
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||||
|
|
||||||
|
project 'Runner', {
|
||||||
|
'Debug' => :debug,
|
||||||
|
'Profile' => :release,
|
||||||
|
'Release' => :release,
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutter_root
|
||||||
|
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
|
||||||
|
unless File.exist?(generated_xcode_build_settings_path)
|
||||||
|
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
|
||||||
|
end
|
||||||
|
|
||||||
|
File.foreach(generated_xcode_build_settings_path) do |line|
|
||||||
|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
||||||
|
return matches[1].strip if matches
|
||||||
|
end
|
||||||
|
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
|
||||||
|
end
|
||||||
|
|
||||||
|
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
||||||
|
|
||||||
|
flutter_macos_podfile_setup
|
||||||
|
|
||||||
|
target 'Runner' do
|
||||||
|
use_frameworks!
|
||||||
|
use_modular_headers!
|
||||||
|
|
||||||
|
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
|
||||||
|
target 'RunnerTests' do
|
||||||
|
inherit! :search_paths
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
post_install do |installer|
|
||||||
|
installer.pods_project.targets.each do |target|
|
||||||
|
flutter_additional_macos_build_settings(target)
|
||||||
|
end
|
||||||
|
end
|
||||||
79
macos/Podfile.lock
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
PODS:
|
||||||
|
- connectivity_plus (0.0.1):
|
||||||
|
- FlutterMacOS
|
||||||
|
- ReachabilitySwift
|
||||||
|
- file_selector_macos (0.0.1):
|
||||||
|
- FlutterMacOS
|
||||||
|
- FlutterMacOS (1.0.0)
|
||||||
|
- FMDB (2.7.5):
|
||||||
|
- FMDB/standard (= 2.7.5)
|
||||||
|
- FMDB/standard (2.7.5)
|
||||||
|
- geolocator_apple (1.2.0):
|
||||||
|
- FlutterMacOS
|
||||||
|
- isar_flutter_libs (1.0.0):
|
||||||
|
- FlutterMacOS
|
||||||
|
- path_provider_foundation (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
|
- ReachabilitySwift (5.0.0)
|
||||||
|
- shared_preferences_foundation (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
|
- sqflite (0.0.2):
|
||||||
|
- FlutterMacOS
|
||||||
|
- FMDB (>= 2.7.5)
|
||||||
|
- url_launcher_macos (0.0.1):
|
||||||
|
- FlutterMacOS
|
||||||
|
|
||||||
|
DEPENDENCIES:
|
||||||
|
- connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`)
|
||||||
|
- file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
|
||||||
|
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||||
|
- geolocator_apple (from `Flutter/ephemeral/.symlinks/plugins/geolocator_apple/macos`)
|
||||||
|
- isar_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos`)
|
||||||
|
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
|
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
|
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`)
|
||||||
|
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||||
|
|
||||||
|
SPEC REPOS:
|
||||||
|
trunk:
|
||||||
|
- FMDB
|
||||||
|
- ReachabilitySwift
|
||||||
|
|
||||||
|
EXTERNAL SOURCES:
|
||||||
|
connectivity_plus:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos
|
||||||
|
file_selector_macos:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos
|
||||||
|
FlutterMacOS:
|
||||||
|
:path: Flutter/ephemeral
|
||||||
|
geolocator_apple:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/geolocator_apple/macos
|
||||||
|
isar_flutter_libs:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos
|
||||||
|
path_provider_foundation:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
|
||||||
|
shared_preferences_foundation:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
|
||||||
|
sqflite:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos
|
||||||
|
url_launcher_macos:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
|
||||||
|
|
||||||
|
SPEC CHECKSUMS:
|
||||||
|
connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747
|
||||||
|
file_selector_macos: 468fb6b81fac7c0e88d71317f3eec34c3b008ff9
|
||||||
|
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||||
|
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||||
|
geolocator_apple: 72a78ae3f3e4ec0db62117bd93e34523f5011d58
|
||||||
|
isar_flutter_libs: 43385c99864c168fadba7c9adeddc5d38838ca6a
|
||||||
|
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||||
|
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
|
||||||
|
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
||||||
|
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea
|
||||||
|
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
|
||||||
|
|
||||||
|
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
|
||||||
|
|
||||||
|
COCOAPODS: 1.12.1
|
||||||
791
macos/Runner.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,791 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 54;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXAggregateTarget section */
|
||||||
|
33CC111A2044C6BA0003C045 /* Flutter Assemble */ = {
|
||||||
|
isa = PBXAggregateTarget;
|
||||||
|
buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */;
|
||||||
|
buildPhases = (
|
||||||
|
33CC111E2044C6BF0003C045 /* ShellScript */,
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = "Flutter Assemble";
|
||||||
|
productName = FLX;
|
||||||
|
};
|
||||||
|
/* End PBXAggregateTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
29C936F6B41D4CF6A36D3561 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBAFBE8E48736BB9F33FD7AB /* Pods_Runner.framework */; };
|
||||||
|
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
|
||||||
|
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
|
||||||
|
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
|
||||||
|
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||||
|
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||||
|
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||||
|
6C33DCDBD6162F4A7C2CBCB0 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9920CB38EA4E29A448D54F2E /* Pods_RunnerTests.framework */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 33CC10EC2044A3C60003C045;
|
||||||
|
remoteInfo = Runner;
|
||||||
|
};
|
||||||
|
33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 33CC111A2044C6BA0003C045;
|
||||||
|
remoteInfo = FLX;
|
||||||
|
};
|
||||||
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
33CC110E2044A8840003C045 /* Bundle Framework */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "";
|
||||||
|
dstSubfolderSpec = 10;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
name = "Bundle Framework";
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
0E20681DBD4FC198DFF5D8A2 /* 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>"; };
|
||||||
|
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||||
|
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
||||||
|
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
||||||
|
33CC10ED2044A3C60003C045 /* rog_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = rog_app.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||||
|
33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = "<group>"; };
|
||||||
|
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = "<group>"; };
|
||||||
|
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||||
|
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||||
|
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||||
|
6114E0F2A0E1D978BBC23F48 /* 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>"; };
|
||||||
|
7A4ED4006175F78D62E8F44A /* 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>"; };
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9920CB38EA4E29A448D54F2E /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
ACAE88445D9C42C378D637D1 /* 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>"; };
|
||||||
|
B213AC3587D3A6D81B80E686 /* 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>"; };
|
||||||
|
DB3AD6E65B5CC8A5A9E2767E /* 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>"; };
|
||||||
|
FBAFBE8E48736BB9F33FD7AB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
331C80D2294CF70F00263BE5 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
6C33DCDBD6162F4A7C2CBCB0 /* Pods_RunnerTests.framework in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
33CC10EA2044A3C60003C045 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
29C936F6B41D4CF6A36D3561 /* Pods_Runner.framework in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
331C80D6294CF71000263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
331C80D7294CF71000263BE5 /* RunnerTests.swift */,
|
||||||
|
);
|
||||||
|
path = RunnerTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33BA886A226E78AF003329D5 /* Configs */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33E5194F232828860026EE4D /* AppInfo.xcconfig */,
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||||
|
333000ED22D3DE5D00554162 /* Warnings.xcconfig */,
|
||||||
|
);
|
||||||
|
path = Configs;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33CC10E42044A3C60003C045 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33FAB671232836740065AC1E /* Runner */,
|
||||||
|
33CEB47122A05771004F2AC0 /* Flutter */,
|
||||||
|
331C80D6294CF71000263BE5 /* RunnerTests */,
|
||||||
|
33CC10EE2044A3C60003C045 /* Products */,
|
||||||
|
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
||||||
|
44EF3E5C1C7C4011C695FB04 /* Pods */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33CC10EE2044A3C60003C045 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33CC10ED2044A3C60003C045 /* rog_app.app */,
|
||||||
|
331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33CC11242044D66E0003C045 /* Resources */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33CC10F22044A3C60003C045 /* Assets.xcassets */,
|
||||||
|
33CC10F42044A3C60003C045 /* MainMenu.xib */,
|
||||||
|
33CC10F72044A3C60003C045 /* Info.plist */,
|
||||||
|
);
|
||||||
|
name = Resources;
|
||||||
|
path = ..;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33CEB47122A05771004F2AC0 /* Flutter */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,
|
||||||
|
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
|
||||||
|
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
|
||||||
|
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
|
||||||
|
);
|
||||||
|
path = Flutter;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33FAB671232836740065AC1E /* Runner */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33CC10F02044A3C60003C045 /* AppDelegate.swift */,
|
||||||
|
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
|
||||||
|
33E51913231747F40026EE4D /* DebugProfile.entitlements */,
|
||||||
|
33E51914231749380026EE4D /* Release.entitlements */,
|
||||||
|
33CC11242044D66E0003C045 /* Resources */,
|
||||||
|
33BA886A226E78AF003329D5 /* Configs */,
|
||||||
|
);
|
||||||
|
path = Runner;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
44EF3E5C1C7C4011C695FB04 /* Pods */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
7A4ED4006175F78D62E8F44A /* Pods-Runner.debug.xcconfig */,
|
||||||
|
0E20681DBD4FC198DFF5D8A2 /* Pods-Runner.release.xcconfig */,
|
||||||
|
ACAE88445D9C42C378D637D1 /* Pods-Runner.profile.xcconfig */,
|
||||||
|
B213AC3587D3A6D81B80E686 /* Pods-RunnerTests.debug.xcconfig */,
|
||||||
|
DB3AD6E65B5CC8A5A9E2767E /* Pods-RunnerTests.release.xcconfig */,
|
||||||
|
6114E0F2A0E1D978BBC23F48 /* Pods-RunnerTests.profile.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Pods;
|
||||||
|
path = Pods;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
FBAFBE8E48736BB9F33FD7AB /* Pods_Runner.framework */,
|
||||||
|
9920CB38EA4E29A448D54F2E /* Pods_RunnerTests.framework */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
331C80D4294CF70F00263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||||
|
buildPhases = (
|
||||||
|
99E923FC9D9148D50932EEE0 /* [CP] Check Pods Manifest.lock */,
|
||||||
|
331C80D1294CF70F00263BE5 /* Sources */,
|
||||||
|
331C80D2294CF70F00263BE5 /* Frameworks */,
|
||||||
|
331C80D3294CF70F00263BE5 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
331C80DA294CF71000263BE5 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = RunnerTests;
|
||||||
|
productName = RunnerTests;
|
||||||
|
productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */;
|
||||||
|
productType = "com.apple.product-type.bundle.unit-test";
|
||||||
|
};
|
||||||
|
33CC10EC2044A3C60003C045 /* Runner */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
|
buildPhases = (
|
||||||
|
427A05FAB0ED774C4EAAB828 /* [CP] Check Pods Manifest.lock */,
|
||||||
|
33CC10E92044A3C60003C045 /* Sources */,
|
||||||
|
33CC10EA2044A3C60003C045 /* Frameworks */,
|
||||||
|
33CC10EB2044A3C60003C045 /* Resources */,
|
||||||
|
33CC110E2044A8840003C045 /* Bundle Framework */,
|
||||||
|
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||||
|
4C7DD54BFBA1868DB86927DD /* [CP] Embed Pods Frameworks */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
33CC11202044C79F0003C045 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = Runner;
|
||||||
|
productName = Runner;
|
||||||
|
productReference = 33CC10ED2044A3C60003C045 /* rog_app.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
33CC10E52044A3C60003C045 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastSwiftUpdateCheck = 0920;
|
||||||
|
LastUpgradeCheck = 1430;
|
||||||
|
ORGANIZATIONNAME = "";
|
||||||
|
TargetAttributes = {
|
||||||
|
331C80D4294CF70F00263BE5 = {
|
||||||
|
CreatedOnToolsVersion = 14.0;
|
||||||
|
TestTargetID = 33CC10EC2044A3C60003C045;
|
||||||
|
};
|
||||||
|
33CC10EC2044A3C60003C045 = {
|
||||||
|
CreatedOnToolsVersion = 9.2;
|
||||||
|
LastSwiftMigration = 1100;
|
||||||
|
ProvisioningStyle = Automatic;
|
||||||
|
SystemCapabilities = {
|
||||||
|
com.apple.Sandbox = {
|
||||||
|
enabled = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
33CC111A2044C6BA0003C045 = {
|
||||||
|
CreatedOnToolsVersion = 9.2;
|
||||||
|
ProvisioningStyle = Manual;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
|
||||||
|
compatibilityVersion = "Xcode 9.3";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 33CC10E42044A3C60003C045;
|
||||||
|
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
33CC10EC2044A3C60003C045 /* Runner */,
|
||||||
|
331C80D4294CF70F00263BE5 /* RunnerTests */,
|
||||||
|
33CC111A2044C6BA0003C045 /* Flutter Assemble */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
331C80D3294CF70F00263BE5 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
33CC10EB2044A3C60003C045 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,
|
||||||
|
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
3399D490228B24CF009A79C7 /* ShellScript */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
|
||||||
|
};
|
||||||
|
33CC111E2044C6BF0003C045 /* ShellScript */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
Flutter/ephemeral/FlutterInputs.xcfilelist,
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
Flutter/ephemeral/tripwire,
|
||||||
|
);
|
||||||
|
outputFileListPaths = (
|
||||||
|
Flutter/ephemeral/FlutterOutputs.xcfilelist,
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
||||||
|
};
|
||||||
|
427A05FAB0ED774C4EAAB828 /* [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;
|
||||||
|
};
|
||||||
|
4C7DD54BFBA1868DB86927DD /* [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;
|
||||||
|
};
|
||||||
|
99E923FC9D9148D50932EEE0 /* [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;
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
331C80D1294CF70F00263BE5 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
33CC10E92044A3C60003C045 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,
|
||||||
|
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,
|
||||||
|
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXTargetDependency section */
|
||||||
|
331C80DA294CF71000263BE5 /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 33CC10EC2044A3C60003C045 /* Runner */;
|
||||||
|
targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
33CC11202044C79F0003C045 /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
|
||||||
|
targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
/* End PBXTargetDependency section */
|
||||||
|
|
||||||
|
/* Begin PBXVariantGroup section */
|
||||||
|
33CC10F42044A3C60003C045 /* MainMenu.xib */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
33CC10F52044A3C60003C045 /* Base */,
|
||||||
|
);
|
||||||
|
name = MainMenu.xib;
|
||||||
|
path = Runner;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
331C80DB294CF71000263BE5 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = B213AC3587D3A6D81B80E686 /* Pods-RunnerTests.debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.dvox.rogApp.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rog_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/rog_app";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
331C80DC294CF71000263BE5 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = DB3AD6E65B5CC8A5A9E2767E /* Pods-RunnerTests.release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.dvox.rogApp.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rog_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/rog_app";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
331C80DD294CF71000263BE5 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 6114E0F2A0E1D978BBC23F48 /* Pods-RunnerTests.profile.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.dvox.rogApp.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rog_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/rog_app";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
338D0CE9231458BD00FA5F75 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "-";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
338D0CEA231458BD00FA5F75 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/../Frameworks",
|
||||||
|
);
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
338D0CEB231458BD00FA5F75 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
33CC10F92044A3C60003C045 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "-";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
33CC10FA2044A3C60003C045 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "-";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
33CC10FC2044A3C60003C045 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/../Frameworks",
|
||||||
|
);
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
33CC10FD2044A3C60003C045 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/../Frameworks",
|
||||||
|
);
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
33CC111C2044C6BA0003C045 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
33CC111D2044C6BA0003C045 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
331C80DB294CF71000263BE5 /* Debug */,
|
||||||
|
331C80DC294CF71000263BE5 /* Release */,
|
||||||
|
331C80DD294CF71000263BE5 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
33CC10F92044A3C60003C045 /* Debug */,
|
||||||
|
33CC10FA2044A3C60003C045 /* Release */,
|
||||||
|
338D0CE9231458BD00FA5F75 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
33CC10FC2044A3C60003C045 /* Debug */,
|
||||||
|
33CC10FD2044A3C60003C045 /* Release */,
|
||||||
|
338D0CEA231458BD00FA5F75 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
33CC111C2044C6BA0003C045 /* Debug */,
|
||||||
|
33CC111D2044C6BA0003C045 /* Release */,
|
||||||
|
338D0CEB231458BD00FA5F75 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1430"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||||
|
BuildableName = "rog_app.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||||
|
BuildableName = "rog_app.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO"
|
||||||
|
parallelizable = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "331C80D4294CF70F00263BE5"
|
||||||
|
BuildableName = "RunnerTests.xctest"
|
||||||
|
BlueprintName = "RunnerTests"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||||
|
BuildableName = "rog_app.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Profile"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||||
|
BuildableName = "rog_app.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
10
macos/Runner.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:Runner.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
<FileRef
|
||||||
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
9
macos/Runner/AppDelegate.swift
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import Cocoa
|
||||||
|
import FlutterMacOS
|
||||||
|
|
||||||
|
@NSApplicationMain
|
||||||
|
class AppDelegate: FlutterAppDelegate {
|
||||||
|
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"size" : "16x16",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_16.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "16x16",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_32.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "32x32",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_32.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "32x32",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_64.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "128x128",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_128.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "128x128",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_256.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "256x256",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_256.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "256x256",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_512.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "512x512",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_512.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "512x512",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_1024.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 101 KiB |
BIN
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
Normal file
|
After Width: | Height: | Size: 520 B |
BIN
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
343
macos/Runner/Base.lproj/MainMenu.xib
Normal file
@ -0,0 +1,343 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="macosx"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
|
||||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
|
</dependencies>
|
||||||
|
<objects>
|
||||||
|
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||||
|
<connections>
|
||||||
|
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
|
||||||
|
</connections>
|
||||||
|
</customObject>
|
||||||
|
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||||
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||||
|
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Runner" customModuleProvider="target">
|
||||||
|
<connections>
|
||||||
|
<outlet property="applicationMenu" destination="uQy-DD-JDr" id="XBo-yE-nKs"/>
|
||||||
|
<outlet property="mainFlutterWindow" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
|
||||||
|
</connections>
|
||||||
|
</customObject>
|
||||||
|
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||||
|
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||||
|
<items>
|
||||||
|
<menuItem title="APP_NAME" id="1Xt-HY-uBw">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="APP_NAME" systemMenu="apple" id="uQy-DD-JDr">
|
||||||
|
<items>
|
||||||
|
<menuItem title="About APP_NAME" id="5kV-Vb-QxS">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||||
|
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
|
||||||
|
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
|
||||||
|
<menuItem title="Services" id="NMo-om-nkz">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
|
||||||
|
<menuItem title="Hide APP_NAME" keyEquivalent="h" id="Olw-nP-bQN">
|
||||||
|
<connections>
|
||||||
|
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||||
|
<menuItem title="Quit APP_NAME" keyEquivalent="q" id="4sb-4s-VLi">
|
||||||
|
<connections>
|
||||||
|
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Edit" id="5QF-Oa-p0T">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
|
||||||
|
<connections>
|
||||||
|
<action selector="undo:" target="-1" id="M6e-cu-g7V"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
|
||||||
|
<connections>
|
||||||
|
<action selector="redo:" target="-1" id="oIA-Rs-6OD"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
|
||||||
|
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
|
||||||
|
<connections>
|
||||||
|
<action selector="cut:" target="-1" id="YJe-68-I9s"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
|
||||||
|
<connections>
|
||||||
|
<action selector="copy:" target="-1" id="G1f-GL-Joy"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
|
||||||
|
<connections>
|
||||||
|
<action selector="paste:" target="-1" id="UvS-8e-Qdg"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Delete" id="pa3-QI-u2k">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
|
||||||
|
<connections>
|
||||||
|
<action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
|
||||||
|
<menuItem title="Find" id="4EN-yA-p0u">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Find" id="1b7-l0-nxx">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
|
||||||
|
<connections>
|
||||||
|
<action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
|
||||||
|
<connections>
|
||||||
|
<action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
|
||||||
|
<connections>
|
||||||
|
<action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
|
||||||
|
<connections>
|
||||||
|
<action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
|
||||||
|
<connections>
|
||||||
|
<action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
|
||||||
|
<connections>
|
||||||
|
<action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
|
||||||
|
<connections>
|
||||||
|
<action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
|
||||||
|
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Substitutions" id="9ic-FL-obx">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
|
||||||
|
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Smart Links" id="cwL-P1-jid">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Data Detectors" id="tRr-pd-1PS">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Transformations" id="2oI-Rn-ZJC">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Speech" id="xrE-MZ-jX0">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="View" id="H8h-7b-M4v">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="View" id="HyV-fh-RgO">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleFullScreen:" target="-1" id="dU3-MA-1Rq"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Window" id="aUF-d1-5bR">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
|
||||||
|
<connections>
|
||||||
|
<action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Zoom" id="R4o-n2-Eq4">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
|
||||||
|
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Help" id="EPT-qC-fAb">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<menu key="submenu" title="Help" systemMenu="help" id="rJ0-wn-3NY"/>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
<point key="canvasLocation" x="142" y="-258"/>
|
||||||
|
</menu>
|
||||||
|
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
|
||||||
|
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||||
|
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
|
||||||
|
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
|
||||||
|
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
</view>
|
||||||
|
</window>
|
||||||
|
</objects>
|
||||||
|
</document>
|
||||||
14
macos/Runner/Configs/AppInfo.xcconfig
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Application-level settings for the Runner target.
|
||||||
|
//
|
||||||
|
// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
|
||||||
|
// future. If not, the values below would default to using the project name when this becomes a
|
||||||
|
// 'flutter create' template.
|
||||||
|
|
||||||
|
// The application's name. By default this is also the title of the Flutter window.
|
||||||
|
PRODUCT_NAME = rog_app
|
||||||
|
|
||||||
|
// The application's bundle identifier
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.dvox.rogApp
|
||||||
|
|
||||||
|
// The copyright displayed in application information
|
||||||
|
PRODUCT_COPYRIGHT = Copyright © 2023 com.dvox. All rights reserved.
|
||||||
2
macos/Runner/Configs/Debug.xcconfig
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include "../../Flutter/Flutter-Debug.xcconfig"
|
||||||
|
#include "Warnings.xcconfig"
|
||||||
2
macos/Runner/Configs/Release.xcconfig
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include "../../Flutter/Flutter-Release.xcconfig"
|
||||||
|
#include "Warnings.xcconfig"
|
||||||
13
macos/Runner/Configs/Warnings.xcconfig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES
|
||||||
|
CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
|
||||||
|
CLANG_WARN_PRAGMA_PACK = YES
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES
|
||||||
|
CLANG_WARN_COMMA = YES
|
||||||
|
GCC_WARN_STRICT_SELECTOR_MATCH = YES
|
||||||
|
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
|
||||||
|
GCC_WARN_SHADOW = YES
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES
|
||||||
12
macos/Runner/DebugProfile.entitlements
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.app-sandbox</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.server</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
32
macos/Runner/Info.plist
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||||
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||||
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
<string>$(PRODUCT_COPYRIGHT)</string>
|
||||||
|
<key>NSMainNibFile</key>
|
||||||
|
<string>MainMenu</string>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
15
macos/Runner/MainFlutterWindow.swift
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import Cocoa
|
||||||
|
import FlutterMacOS
|
||||||
|
|
||||||
|
class MainFlutterWindow: NSWindow {
|
||||||
|
override func awakeFromNib() {
|
||||||
|
let flutterViewController = FlutterViewController()
|
||||||
|
let windowFrame = self.frame
|
||||||
|
self.contentViewController = flutterViewController
|
||||||
|
self.setFrame(windowFrame, display: true)
|
||||||
|
|
||||||
|
RegisterGeneratedPlugins(registry: flutterViewController)
|
||||||
|
|
||||||
|
super.awakeFromNib()
|
||||||
|
}
|
||||||
|
}
|
||||||
8
macos/Runner/Release.entitlements
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.app-sandbox</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
12
macos/RunnerTests/RunnerTests.swift
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import FlutterMacOS
|
||||||
|
import Cocoa
|
||||||
|
import XCTest
|
||||||
|
|
||||||
|
class RunnerTests: XCTestCase {
|
||||||
|
|
||||||
|
func testExample() {
|
||||||
|
// If you add code to the Runner application, consider adding tests here.
|
||||||
|
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
94
pubspec.lock
@ -177,14 +177,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.3"
|
version: "3.0.3"
|
||||||
csslib:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: csslib
|
|
||||||
sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -532,10 +524,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: get
|
name: get
|
||||||
sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a"
|
sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.6.5"
|
version: "4.6.6"
|
||||||
google_api_availability:
|
google_api_availability:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -560,54 +552,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.1"
|
version: "1.0.1"
|
||||||
google_maps:
|
google_fonts:
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: google_maps
|
|
||||||
sha256: "555d5d736339b0478e821167ac521c810d7b51c3b2734e6802a9f046b64ea37a"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "6.3.0"
|
|
||||||
google_maps_flutter:
|
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: google_maps_flutter
|
name: google_fonts
|
||||||
sha256: d4914cb38b3dcb62c39c085d968d434de0f8050f00f4d9f5ba4a7c7e004934cb
|
sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.0"
|
version: "4.0.4"
|
||||||
google_maps_flutter_android:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: google_maps_flutter_android
|
|
||||||
sha256: e6cb018169e49332f88d23b1d2119b09e8ab4e7d3a1b889a1b7b3fd113e034ba
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.5.1"
|
|
||||||
google_maps_flutter_ios:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: google_maps_flutter_ios
|
|
||||||
sha256: "2a595c9789070786c654e9772ec0d1bb759ae37d2dd776291af5398531274e06"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.3.1"
|
|
||||||
google_maps_flutter_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: google_maps_flutter_platform_interface
|
|
||||||
sha256: a3e9e6896501e566d902c6c69f010834d410ef4b7b5c18b90c77e871c86b7907
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.4.1"
|
|
||||||
google_maps_flutter_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: google_maps_flutter_web
|
|
||||||
sha256: f893d1542c6562bc8299ef768fbbe92ade83c220ab3209b9477ec9f81ad585e4
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.5.4+2"
|
|
||||||
google_maps_webservice:
|
google_maps_webservice:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -616,16 +568,8 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.20-nullsafety.5"
|
version: "0.0.20-nullsafety.5"
|
||||||
html:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: html
|
|
||||||
sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.15.4"
|
|
||||||
http:
|
http:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
|
sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
|
||||||
@ -768,14 +712,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.7"
|
version: "0.6.7"
|
||||||
js_wrapping:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: js_wrapping
|
|
||||||
sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.4"
|
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -784,6 +720,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.8.1"
|
version: "4.8.1"
|
||||||
|
keyboard_dismisser:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: keyboard_dismisser
|
||||||
|
sha256: f67e032581fc3dd1f77e1cb54c421b089e015d122aeba2490ba001cfcc42a181
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0"
|
||||||
latlong2:
|
latlong2:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1096,14 +1040,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.0"
|
version: "2.4.0"
|
||||||
sanitize_html:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: sanitize_html
|
|
||||||
sha256: "0a445f19bbaa196f5a4f93461aa066b94e6e025622eb1e9bc77872a5e25233a5"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.0"
|
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
17
pubspec.yaml
@ -3,7 +3,7 @@ description: A new Flutter project.
|
|||||||
|
|
||||||
# The following line prevents the package from being accidentally published to
|
# The following line prevents the package from being accidentally published to
|
||||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
# The following defines the version and build number for your application.
|
# The following defines the version and build number for your application.
|
||||||
# A version number is three numbers separated by dots, like 1.2.43
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
version: 1.0.24+24
|
version: 1.0.24+24
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.1.0 <4.0.0'
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
|
|
||||||
# Dependencies specify other packages that your package needs in order to work.
|
# Dependencies specify other packages that your package needs in order to work.
|
||||||
# To automatically upgrade your package dependencies to the latest versions
|
# To automatically upgrade your package dependencies to the latest versions
|
||||||
@ -30,12 +30,11 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
sqflite: ^2.0.1
|
sqflite: ^2.0.1
|
||||||
get: ^4.6.5
|
get: ^4.6.6
|
||||||
flutter_map: ^4.0.0
|
flutter_map: ^4.0.0
|
||||||
geolocator: ^9.0.2
|
geolocator: ^9.0.2
|
||||||
permission_handler: ^10.0.0
|
permission_handler: ^10.0.0
|
||||||
@ -54,14 +53,15 @@ dependencies:
|
|||||||
flutter_map_location_marker: any
|
flutter_map_location_marker: any
|
||||||
flutter_map_marker_cluster: any
|
flutter_map_marker_cluster: any
|
||||||
material_design_icons_flutter: ^7.0.7296
|
material_design_icons_flutter: ^7.0.7296
|
||||||
#google_fonts: ^2.1.1
|
google_fonts: ^4.0.4
|
||||||
|
keyboard_dismisser: ^3.0.0
|
||||||
image_picker: ^1.0.4
|
image_picker: ^1.0.4
|
||||||
#geojson_vi: ^2.0.7
|
#geojson_vi: ^2.0.7
|
||||||
geojson: ^1.0.0
|
geojson: ^1.0.0
|
||||||
url_launcher: ^6.0.20
|
url_launcher: ^6.0.20
|
||||||
flutter_breadcrumb: ^1.0.1
|
flutter_breadcrumb: ^1.0.1
|
||||||
timeline_tile: ^2.0.0
|
timeline_tile: ^2.0.0
|
||||||
google_maps_flutter: ^2.1.5
|
# google_maps_flutter: ^2.5.0
|
||||||
#flutter_map_marker_popup: any
|
#flutter_map_marker_popup: any
|
||||||
flutter_polyline_points: ^1.0.0
|
flutter_polyline_points: ^1.0.0
|
||||||
google_maps_webservice: ^0.0.19
|
google_maps_webservice: ^0.0.19
|
||||||
@ -77,15 +77,13 @@ dependencies:
|
|||||||
shared_preferences: ^2.0.15
|
shared_preferences: ^2.0.15
|
||||||
gallery_saver: ^2.3.2
|
gallery_saver: ^2.3.2
|
||||||
flutter_riverpod: ^2.4.0
|
flutter_riverpod: ^2.4.0
|
||||||
|
http: ^0.13.6
|
||||||
|
|
||||||
|
|
||||||
flutter_icons:
|
flutter_icons:
|
||||||
android: true
|
android: true
|
||||||
ios: true
|
ios: true
|
||||||
image_path: "assets/icon.png"
|
image_path: "assets/icon.png"
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
@ -102,7 +100,6 @@ dev_dependencies:
|
|||||||
|
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
flutter:
|
flutter:
|
||||||
|
|
||||||
# The following line ensures that the Material Icons font is
|
# The following line ensures that the Material Icons font is
|
||||||
# included with your application, so that you can use the icons in
|
# included with your application, so that you can use the icons in
|
||||||
# the material Icons class.
|
# the material Icons class.
|
||||||
|
|||||||