Compare commits
42 Commits
rog_only
...
static_sta
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d1c84d9fb | |||
| 0af1b3139c | |||
| 6f084b2349 | |||
| 44cb728fab | |||
| 13e07b007a | |||
| 9c66dffe69 | |||
| d8fd352a62 | |||
| 23fde37e3d | |||
| 4e4cfda40b | |||
| 8a1e5b1ca8 | |||
| acc03f8e2b | |||
| 3abd306e89 | |||
| 4648b0424d | |||
| b04985b71f | |||
| 954ff36640 | |||
| 85b8c4705f | |||
| e8d65ba725 | |||
| 32ae1f5249 | |||
| 7a154b4390 | |||
| 7412d1e074 | |||
| 0508c50b97 | |||
| 0e2a8f89f3 | |||
| 7fdb6c05ee | |||
| 4db56e9c0f | |||
| 0ca29a5293 | |||
| 93dacc35ae | |||
| 167a321cd5 | |||
| 67c3a46cd5 | |||
| 63a86d75d6 | |||
| f760294a39 | |||
| a2b055fe8b | |||
| 14c8cb6f70 | |||
| cac0c1065f | |||
| 15c70acf7b | |||
| b54c29eb4b | |||
| aa7b13b76a | |||
| 30fea7cf8a | |||
| f64ac1ccfd | |||
| 48f4b833f6 | |||
| d67d17e971 | |||
| c2d9e366d1 | |||
| 6f3249631f |
@ -56,7 +56,7 @@ android {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.dvox.gifunavi"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
targetSdkVersion 33
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
multiDexEnabled true
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
package com.dvox.rog_app
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity: FlutterActivity() {
|
||||
}
|
||||
BIN
assets/images/money.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
@ -12,16 +12,10 @@ PODS:
|
||||
- FMDB (2.7.5):
|
||||
- FMDB/standard (= 2.7.5)
|
||||
- FMDB/standard (2.7.5)
|
||||
- gallery_saver (0.0.1):
|
||||
- Flutter
|
||||
- geolocator_apple (1.2.0):
|
||||
- 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):
|
||||
- Flutter
|
||||
- isar_flutter_libs (1.0.0):
|
||||
@ -47,8 +41,8 @@ DEPENDENCIES:
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_compass (from `.symlinks/plugins/flutter_compass/ios`)
|
||||
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
|
||||
- gallery_saver (from `.symlinks/plugins/gallery_saver/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`)
|
||||
- isar_flutter_libs (from `.symlinks/plugins/isar_flutter_libs/ios`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
@ -60,7 +54,6 @@ DEPENDENCIES:
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- FMDB
|
||||
- GoogleMaps
|
||||
- ReachabilitySwift
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
@ -74,10 +67,10 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/flutter_compass/ios"
|
||||
flutter_keyboard_visibility:
|
||||
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
|
||||
gallery_saver:
|
||||
:path: ".symlinks/plugins/gallery_saver/ios"
|
||||
geolocator_apple:
|
||||
:path: ".symlinks/plugins/geolocator_apple/ios"
|
||||
google_maps_flutter_ios:
|
||||
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
|
||||
image_picker_ios:
|
||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||
isar_flutter_libs:
|
||||
@ -100,9 +93,8 @@ SPEC CHECKSUMS:
|
||||
flutter_compass: cbbd285cea1584c7ac9c4e0c3e1f17cbea55e855
|
||||
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
gallery_saver: 9fc173c9f4fcc48af53b2a9ebea1b643255be542
|
||||
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
|
||||
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
|
||||
GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693
|
||||
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||
isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073
|
||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||
|
||||
@ -7,13 +7,13 @@
|
||||
objects = {
|
||||
|
||||
/* 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 */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
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 */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@ -30,14 +30,14 @@
|
||||
/* End PBXCopyFilesBuildPhase 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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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; };
|
||||
@ -45,8 +45,8 @@
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
D7C4F924DD034151EFC15038 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -54,7 +54,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EAFC0FFB27C8DC9071E67D5D /* Pods_Runner.framework in Frameworks */,
|
||||
084EA8A81CF8B34528999293 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -64,9 +64,9 @@
|
||||
6C3C11D7BE49E5BED7989712 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BEC4F75C6B655CA90D5B5E18 /* Pods-Runner.debug.xcconfig */,
|
||||
13E5CD9612AF4CC8B90A74C3 /* Pods-Runner.release.xcconfig */,
|
||||
F1D3FD8F51C2EAF6C3A7EE25 /* Pods-Runner.profile.xcconfig */,
|
||||
4310B59AA1289CC3AE4DBA82 /* Pods-Runner.debug.xcconfig */,
|
||||
37AC108B2188F1C5AA1C2C9E /* Pods-Runner.release.xcconfig */,
|
||||
D464128FC0D5DAEBC1011C26 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
@ -89,7 +89,7 @@
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
6C3C11D7BE49E5BED7989712 /* Pods */,
|
||||
E6F2437A5B5AAF08D2998197 /* Frameworks */,
|
||||
D3D7A1CBA3FB0154A6C84903 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@ -116,10 +116,10 @@
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E6F2437A5B5AAF08D2998197 /* Frameworks */ = {
|
||||
D3D7A1CBA3FB0154A6C84903 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
853FC5087A11FEE54BE443C8 /* Pods_Runner.framework */,
|
||||
D7C4F924DD034151EFC15038 /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@ -131,15 +131,14 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
6B25D2836FC6A82461E36025 /* [CP] Check Pods Manifest.lock */,
|
||||
9ACF47601C5E8A391157E87A /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
ED4E40E6FE1C0A73CAC736F8 /* [CP] Embed Pods Frameworks */,
|
||||
FE7C2E909403F98AB3140FE6 /* [CP] Copy Pods Resources */,
|
||||
CD1CB185AC38B6B245F9A672 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -214,7 +213,22 @@
|
||||
shellPath = /bin/sh;
|
||||
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;
|
||||
buildActionMask = 2147483647;
|
||||
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";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
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";
|
||||
};
|
||||
ED4E40E6FE1C0A73CAC736F8 /* [CP] Embed Pods Frameworks */ = {
|
||||
CD1CB185AC38B6B245F9A672 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@ -268,23 +267,6 @@
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
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 */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@ -362,6 +344,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@ -376,7 +359,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = D5SL68ATB9;
|
||||
DEVELOPMENT_TEAM = ECMVJVB7LV;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
@ -490,6 +473,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
@ -506,7 +490,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = D5SL68ATB9;
|
||||
DEVELOPMENT_TEAM = ECMVJVB7LV;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
@ -530,7 +514,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = D5SL68ATB9;
|
||||
DEVELOPMENT_TEAM = ECMVJVB7LV;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
import GoogleMaps
|
||||
|
||||
@UIApplicationMain
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
@ -8,7 +7,6 @@ import GoogleMaps
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GMSServices.provideAPIKey("AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE")
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
|
||||
@ -27,17 +27,17 @@
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>写真撮影のためカメラにアクセスします</string>
|
||||
<string>「岐阜ナビは旅のさまざまなチェックポイントで写真を撮影して共有するためにカメラへのアクセスが必要です。これにより、訪問を確認し、体験を向上させることができます。」</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>このアプリでは、位置情報の収集を行います。</string>
|
||||
<string>「岐阜ナビはアプリが閉じられているときでも位置情報へのアクセスが必要です。これにより、チェックポイントでの自動チェックインを提供し、旅の間のナビゲーション体験を向上させます。」</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>このアプリでは、バックグラウンドで位置情報を収集します。</string>
|
||||
<string>「自動チェックインを有効にし、ナビゲーションを改善するために、岐阜ナビはアプリが使用されていないときでも継続的に位置情報へのアクセスを必要とします。」</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>このアプリでは、開始時点で位置情報を収集します。</string>
|
||||
<string>「岐阜ナビにアプリ使用中の位置情報へのアクセスを許可することで、チェックポイントでのチェックインを有効にし、位置に基づいた情報とガイダンスを提供します。」</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>プロフィールに動画を投稿してください。</string>
|
||||
<string>「岐阜ナビは、ナビゲーション体験を向上させるために、音声コマンドやオーディオフィードバックなどの機能にマイクへのアクセスが必要です。」</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>写真ライブラリへのアクセス警告</string>
|
||||
<string>「岐阜ナビはチェックポイントで撮影した写真を保存・管理し、他人と旅の様子を共有するために、写真ライブラリへのアクセスが必要です。」</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>Need to save image in phone Album</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
@ -45,9 +45,7 @@
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>ロゲイニングのゴールでは写真撮影が必要です。</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string> 収録音声の保存が必要です。</string>
|
||||
<string>「岐阜ナビはチェックポイントで撮影した写真を写真ライブラリに保存し、あなたの旅行の記録を保持し、友人と共有することができます。」</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
|
||||
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.
|
||||
}
|
||||
|
||||
}
|
||||
133
lib/main.dart
@ -3,11 +3,32 @@ import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.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/utils/string_values.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
// import 'package:is_lock_screen/is_lock_screen.dart';
|
||||
|
||||
void saveGameState() async {
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
pref.setBool("is_in_rog", destinationController.isInRog.value);
|
||||
pref.setBool(
|
||||
"rogaining_counted", destinationController.rogainingCounted.value);
|
||||
}
|
||||
|
||||
void restoreGame() async {
|
||||
SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
destinationController.skipGps = false;
|
||||
destinationController.isInRog.value = pref.getBool("is_in_rog") ?? false;
|
||||
destinationController.rogainingCounted.value =
|
||||
pref.getBool("rogaining_counted") ?? false;
|
||||
//print(
|
||||
// "--restored -- destinationController.isInRog.value ${pref.getBool("is_in_rog")} -- ${pref.getBool("rogaining_counted")}");
|
||||
}
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
@ -26,7 +47,6 @@ void main() async {
|
||||
key: 'behaviour',
|
||||
value: 'cacheFirst',
|
||||
);
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
@ -43,40 +63,51 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (context.mounted) {
|
||||
restoreGame();
|
||||
}
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
// void saveGameState() async {
|
||||
// DestinationController destinationController = Get.find<DestinationController>();
|
||||
// SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
// pref.setBool("is_in_rog", destinationController.is_in_rog.value);
|
||||
// pref.setBool("rogaining_counted", destinationController.rogaining_counted.value);
|
||||
// }
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
switch (state) {
|
||||
case AppLifecycleState.resumed:
|
||||
print("RESUMED");
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
if(destinationController.positionStream == null){
|
||||
destinationController.startGPSTimer();
|
||||
}
|
||||
break;
|
||||
case AppLifecycleState.inactive:
|
||||
print("INACTIVE");
|
||||
break;
|
||||
case AppLifecycleState.paused:
|
||||
print("PAUSED");
|
||||
break;
|
||||
case AppLifecycleState.detached:
|
||||
print("DETACHED");
|
||||
break;
|
||||
case AppLifecycleState.hidden:
|
||||
print("DETACHED");
|
||||
break;
|
||||
}
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
switch (state) {
|
||||
case AppLifecycleState.resumed:
|
||||
//print("RESUMED");
|
||||
restoreGame();
|
||||
break;
|
||||
case AppLifecycleState.inactive:
|
||||
//print("INACTIVE");
|
||||
break;
|
||||
case AppLifecycleState.paused:
|
||||
//print("PAUSED");
|
||||
saveGameState();
|
||||
break;
|
||||
case AppLifecycleState.detached:
|
||||
//print("DETACHED");
|
||||
saveGameState();
|
||||
break;
|
||||
case AppLifecycleState.hidden:
|
||||
//print("DETACHED");
|
||||
saveGameState();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -87,8 +118,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
fallbackLocale: const Locale('en', 'US'),
|
||||
title: 'ROGAINING',
|
||||
theme: ThemeData(
|
||||
colorScheme:
|
||||
ColorScheme.fromSeed(seedColor: Color.fromARGB(255, 36, 135, 221)),
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color.fromARGB(255, 36, 135, 221)),
|
||||
useMaterial3: true,
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
@ -103,51 +134,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,113 +1,130 @@
|
||||
|
||||
|
||||
class Destination {
|
||||
String? name;
|
||||
String? address;
|
||||
String? phone;
|
||||
String? email;
|
||||
String? webcontents;
|
||||
String? videos;
|
||||
String? category;
|
||||
int? series;
|
||||
double? lat;
|
||||
double? lon;
|
||||
String? sub_loc_id;
|
||||
int? location_id;
|
||||
int? list_order;
|
||||
String? photos;
|
||||
double? checkin_radious;
|
||||
int? auto_checkin;
|
||||
bool? selected = false;
|
||||
bool? checkedin = false;
|
||||
double? cp;
|
||||
double? checkin_point;
|
||||
double? buy_point;
|
||||
int? hidden_location;
|
||||
String? name;
|
||||
String? address;
|
||||
String? phone;
|
||||
String? email;
|
||||
String? webcontents;
|
||||
String? videos;
|
||||
String? category;
|
||||
int? series;
|
||||
double? lat;
|
||||
double? lon;
|
||||
String? sub_loc_id;
|
||||
int? location_id;
|
||||
int? list_order;
|
||||
String? photos;
|
||||
double? checkin_radious;
|
||||
int? auto_checkin;
|
||||
bool? selected = false;
|
||||
bool? checkedin = false;
|
||||
double? cp;
|
||||
double? checkin_point;
|
||||
double? buy_point;
|
||||
int? hidden_location;
|
||||
String? checkin_image;
|
||||
String? buypoint_image;
|
||||
bool forced_checkin = false;
|
||||
int recipt_times = 0;
|
||||
String? tags;
|
||||
|
||||
Destination({
|
||||
this.name,
|
||||
this.address,
|
||||
this.phone,
|
||||
this.email,
|
||||
this.webcontents,
|
||||
this.videos,
|
||||
this.category,
|
||||
this.series,
|
||||
this.lat,
|
||||
this.lon,
|
||||
this.sub_loc_id,
|
||||
this.location_id,
|
||||
this.list_order,
|
||||
this.photos,
|
||||
this.checkin_radious,
|
||||
this.auto_checkin,
|
||||
this.selected,
|
||||
this.checkedin,
|
||||
this.cp,
|
||||
this.checkin_point,
|
||||
this.buy_point,
|
||||
this.hidden_location
|
||||
});
|
||||
Destination(
|
||||
{this.name,
|
||||
this.address,
|
||||
this.phone,
|
||||
this.email,
|
||||
this.webcontents,
|
||||
this.videos,
|
||||
this.category,
|
||||
this.series,
|
||||
this.lat,
|
||||
this.lon,
|
||||
this.sub_loc_id,
|
||||
this.location_id,
|
||||
this.list_order,
|
||||
this.photos,
|
||||
this.checkin_radious,
|
||||
this.auto_checkin,
|
||||
this.selected,
|
||||
this.checkedin,
|
||||
this.cp,
|
||||
this.checkin_point,
|
||||
this.buy_point,
|
||||
this.hidden_location,
|
||||
this.checkin_image,
|
||||
this.buypoint_image,
|
||||
this.forced_checkin = false,
|
||||
this.recipt_times = 0,
|
||||
this.tags});
|
||||
|
||||
factory Destination.fromMap(Map<String, dynamic> json) {
|
||||
factory Destination.fromMap(Map<String, dynamic> json) {
|
||||
bool selec = json['selected'] == 0 ? false : true;
|
||||
bool checkin = json['checkedin'] == 0 ? false : true;
|
||||
bool forcedCheckin = json['forced_checkin'] == 0 ? false : true;
|
||||
|
||||
bool selec = json['selected'] == 0 ? false : true;
|
||||
bool checkin = json['checkedin'] == 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']
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap(){
|
||||
int sel = selected == false ? 0 : 1;
|
||||
int check = checkedin == 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
|
||||
};
|
||||
}
|
||||
//print("-----tags model----- ${json}");
|
||||
|
||||
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"],
|
||||
tags: json["tags"]);
|
||||
}
|
||||
|
||||
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,
|
||||
'tags': tags
|
||||
};
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
47
lib/model/gps_data.dart
Normal file
@ -0,0 +1,47 @@
|
||||
class GpsData {
|
||||
int id;
|
||||
String team_name;
|
||||
String event_code;
|
||||
double lat;
|
||||
double lon;
|
||||
int is_checkin;
|
||||
int created_at;
|
||||
int is_synced;
|
||||
|
||||
GpsData({
|
||||
required this.id,
|
||||
required this.team_name,
|
||||
required this.event_code,
|
||||
required this.lat,
|
||||
required this.lon,
|
||||
required this.created_at,
|
||||
this.is_checkin = 0,
|
||||
this.is_synced = 0,
|
||||
});
|
||||
|
||||
factory GpsData.fromMap(Map<String, dynamic> json) {
|
||||
return GpsData(
|
||||
id: json["id"],
|
||||
team_name: json["team_name"],
|
||||
event_code: json["event_code"],
|
||||
lat: json["lat"],
|
||||
lon: json["lon"],
|
||||
is_checkin: json["is_checkin"],
|
||||
created_at: json["created_at"],
|
||||
is_synced: json["is_synced"] ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
'team_name': team_name,
|
||||
'event_code': event_code,
|
||||
'lat': lat,
|
||||
'lon': lon,
|
||||
'is_checkin': is_checkin,
|
||||
'created_at': created_at,
|
||||
'is_synced': is_synced,
|
||||
};
|
||||
}
|
||||
}
|
||||
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 */
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -7,141 +7,274 @@ import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/services/external_service.dart';
|
||||
import 'package:rogapp/utils/const.dart';
|
||||
|
||||
String getTagText(bool isRecept, String? tags) {
|
||||
if (tags == null || tags.isEmpty) {
|
||||
return "";
|
||||
}
|
||||
List<String> tts = tags.split(" ");
|
||||
List<String> ttt = tags.split(" ");
|
||||
if (isRecept) {
|
||||
if (ttt.length > tts.length && ttt.length > 1) {
|
||||
return ttt[1];
|
||||
}
|
||||
}
|
||||
if (!isRecept) {
|
||||
if (ttt.length > tts.length && ttt.length > 1) {
|
||||
return ttt[0];
|
||||
}
|
||||
}
|
||||
if (!isRecept) {
|
||||
return tts[0];
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Image getDisplayImage(Destination destination) {
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
|
||||
Image img = Image.asset("assets/images/empty_image.png");
|
||||
if (destination.phone == null) {
|
||||
return img;
|
||||
}
|
||||
|
||||
if (destination.photos!.contains('http')) {
|
||||
return Image(
|
||||
image: NetworkImage(
|
||||
destination.phone!,
|
||||
),
|
||||
errorBuilder:
|
||||
(BuildContext context, Object exception, StackTrace? stackTrace) {
|
||||
return Image.asset("assets/images/empty_image.png");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
return Image(
|
||||
image: NetworkImage(
|
||||
'$serverUrl/media/compressed/${destination.photos}',
|
||||
),
|
||||
errorBuilder:
|
||||
(BuildContext context, Object exception, StackTrace? stackTrace) {
|
||||
return Image.asset("assets/images/empty_image.png");
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ImageProvider getFinishImage() {
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
if (destinationController.photos.isNotEmpty) {
|
||||
return FileImage(destinationController.photos[0]);
|
||||
} else {
|
||||
return const AssetImage('assets/images/empty_image.png');
|
||||
}
|
||||
}
|
||||
|
||||
ImageProvider getReceiptImage() {
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
if (destinationController.photos.isNotEmpty) {
|
||||
return FileImage(destinationController.photos[0]);
|
||||
} else {
|
||||
return const AssetImage('assets/images/money.png');
|
||||
}
|
||||
}
|
||||
|
||||
class CameraPage extends StatelessWidget {
|
||||
Destination? destination;
|
||||
CameraPage({Key? key, this.destination}) : super(key: key);
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
bool? manulaCheckin = false;
|
||||
bool? buyPointPhoto = false;
|
||||
Destination destination;
|
||||
Destination? dbDest;
|
||||
String? initImage;
|
||||
CameraPage(
|
||||
{Key? key,
|
||||
required this.destination,
|
||||
this.dbDest,
|
||||
this.manulaCheckin,
|
||||
this.buyPointPhoto,
|
||||
this.initImage})
|
||||
: super(key: key);
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
var settingGoal = false.obs;
|
||||
|
||||
Timer? timer;
|
||||
|
||||
ImageProvider getFinishImage(){
|
||||
if(destinationController.photos.isNotEmpty){
|
||||
return FileImage(destinationController.photos[0]);
|
||||
}
|
||||
else{
|
||||
return const AssetImage('assets/images/empty_image.png');
|
||||
}
|
||||
}
|
||||
|
||||
Widget getAction(BuildContext context) {
|
||||
if(destinationController.is_at_goal.value && destinationController.is_in_rog.value){
|
||||
//print("----cccheckin is --- ${dbDest?.checkedin} ----");
|
||||
if (manulaCheckin == true) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
if(settingGoal.value ==false){
|
||||
destinationController.openCamera(context);
|
||||
}
|
||||
},
|
||||
child: Text("take_photo of the clock".tr)
|
||||
),
|
||||
Obx(() =>
|
||||
destinationController.photos.isNotEmpty ?
|
||||
settingGoal.value == false ?
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red
|
||||
),
|
||||
onPressed: () async {
|
||||
settingGoal.value = true;
|
||||
try{
|
||||
int userId = indexController.currentUser[0]["user"]["id"];
|
||||
//print("--- Pressed -----");
|
||||
String _team = indexController.currentUser[0]["user"]['team_name'];
|
||||
//print("--- _team : ${_team}-----");
|
||||
String _event_code = indexController.currentUser[0]["user"]["event_code"];
|
||||
//print("--- _event_code : ${_event_code}-----");
|
||||
String _token = indexController.currentUser[0]["token"];
|
||||
//print("--- _token : ${_token}-----");
|
||||
DateTime now = DateTime.now();
|
||||
String formattedDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(now);
|
||||
|
||||
await ExternalService().makeGoal(userId, _token, _team, destinationController.photos[0].path, formattedDate, _event_code).then((value){
|
||||
print("---called ext api ${value['status']} ------");
|
||||
if(value['status'] == 'OK'){
|
||||
Get.back();
|
||||
destinationController.skip_gps = false;
|
||||
Get.snackbar("目標が保存されました", "目標が正常に追加されました");
|
||||
destinationController.resetRogaining();
|
||||
}
|
||||
else{
|
||||
print("---- status ${value['status']} ---- ");
|
||||
Get.snackbar("目標が追加されていません", "please_try_again");
|
||||
}
|
||||
});
|
||||
}
|
||||
on Exception catch(_){
|
||||
settingGoal.value = false;
|
||||
}
|
||||
finally{
|
||||
settingGoal.value = false;
|
||||
}
|
||||
},
|
||||
child:Text("finish_goal".tr)
|
||||
)
|
||||
:
|
||||
Container(
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
)
|
||||
:
|
||||
Container()
|
||||
)
|
||||
],
|
||||
);
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
destinationController.openCamera(context, destination);
|
||||
},
|
||||
child: const Text("撮影")),
|
||||
Obx(() => destinationController.photos.isNotEmpty
|
||||
? ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
||||
onPressed: () async {
|
||||
await destinationController.makeCheckin(destination, true,
|
||||
destinationController.photos[0].path);
|
||||
Get.back();
|
||||
destinationController.rogainingCounted.value = true;
|
||||
destinationController.skipGps = false;
|
||||
destinationController.isPhotoShoot.value = false;
|
||||
Get.snackbar("チェックインしました。",
|
||||
"${destination.sub_loc_id} : ${destination.name}");
|
||||
},
|
||||
child: const Text("チェックイン"))
|
||||
: Container())
|
||||
],
|
||||
);
|
||||
}
|
||||
else{
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Obx(() =>
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
destinationController.openCamera(context);
|
||||
},
|
||||
child: destinationController.photos.isNotEmpty ? const Text("再撮影") : const Text("撮影")
|
||||
)
|
||||
),
|
||||
Obx(() =>
|
||||
destinationController.photos.isNotEmpty ?
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red
|
||||
),
|
||||
onPressed: (){
|
||||
print("##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
|
||||
destinationController.makeCheckin(indexController.currentDestinationFeature[0], true, destinationController.photos[0].path);
|
||||
Get.back();
|
||||
destinationController.rogaining_counted.value = true;
|
||||
destinationController.skip_gps = false;
|
||||
destinationController.is_photo_shoot.value = false;
|
||||
Get.snackbar("チェックインした", "正常にチェックインしました");
|
||||
|
||||
// ExternalService().makeGoal(user_id, _token, _team, destinationController.photos[0].path, formattedDate, _event_code).then((value){
|
||||
// print("---called ext api ${value['status']} ------");
|
||||
// if(value['status'] == 'OK'){
|
||||
// Get.back();
|
||||
// destinationController.skip_gps = false;
|
||||
// Get.snackbar("Checked in", "Checked in successfuly");
|
||||
// }
|
||||
// else{
|
||||
// print("---- status ${value['status']} ---- ");
|
||||
// Get.snackbar("Checkin not added", "please_try_again");
|
||||
// }
|
||||
// });
|
||||
},
|
||||
child: const Text("チェックイン")
|
||||
):
|
||||
Container()
|
||||
)
|
||||
],
|
||||
);
|
||||
if (destinationController.isAtGoal.value &&
|
||||
destinationController.isInRog.value) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if (settingGoal.value == false) {
|
||||
destinationController.openCamera(context, destination);
|
||||
}
|
||||
},
|
||||
child: Text("take_photo of the clock".tr)),
|
||||
Obx(() => destinationController.photos.isNotEmpty
|
||||
? settingGoal.value == false
|
||||
? ElevatedButton(
|
||||
style:
|
||||
ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
||||
onPressed: () async {
|
||||
// print(
|
||||
// "----- user isss ${indexController.currentUser[0]} -----");
|
||||
|
||||
settingGoal.value = true;
|
||||
try {
|
||||
int userId =
|
||||
indexController.currentUser[0]["user"]["id"];
|
||||
//print("--- Pressed -----");
|
||||
String team = indexController.currentUser[0]["user"]
|
||||
['team_name'];
|
||||
//print("--- _team : ${_team}-----");
|
||||
String eventCode = indexController.currentUser[0]
|
||||
["user"]["event_code"];
|
||||
//print("--- _event_code : ${_event_code}-----");
|
||||
String token =
|
||||
indexController.currentUser[0]["token"];
|
||||
//print("--- _token : ${_token}-----");
|
||||
DateTime now = DateTime.now();
|
||||
String formattedDate =
|
||||
DateFormat('yyyy-MM-dd HH:mm:ss').format(now);
|
||||
|
||||
await ExternalService()
|
||||
.makeGoal(
|
||||
userId,
|
||||
token,
|
||||
team,
|
||||
destinationController.photos[0].path,
|
||||
formattedDate,
|
||||
eventCode)
|
||||
.then((value) {
|
||||
// print(
|
||||
// "---called ext api ${value['status']} ------");
|
||||
if (value['status'] == 'OK') {
|
||||
Get.back();
|
||||
destinationController.skipGps = false;
|
||||
Get.snackbar("目標が保存されました", "目標が正常に追加されました");
|
||||
destinationController.resetRogaining();
|
||||
} else {
|
||||
//print("---- status ${value['status']} ---- ");
|
||||
Get.snackbar("目標が追加されていません", "please_try_again");
|
||||
}
|
||||
});
|
||||
} on Exception catch (_) {
|
||||
settingGoal.value = false;
|
||||
} finally {
|
||||
settingGoal.value = false;
|
||||
}
|
||||
},
|
||||
child: Text("finish_goal".tr))
|
||||
: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Container())
|
||||
],
|
||||
);
|
||||
} else if (destinationController.isInRog.value &&
|
||||
dbDest?.checkedin != null &&
|
||||
dbDest?.checkedin == true) {
|
||||
//make buypoint image
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Obx(() => ElevatedButton(
|
||||
onPressed: () {
|
||||
destinationController.openCamera(context, destination);
|
||||
},
|
||||
child: destinationController.photos.isNotEmpty
|
||||
? const Text("再撮影")
|
||||
: const Text("撮影"))),
|
||||
Obx(() => destinationController.photos.isNotEmpty
|
||||
? ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
||||
onPressed: () async {
|
||||
// print(
|
||||
// "##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
|
||||
await destinationController.makeBuyPoint(
|
||||
destination, destinationController.photos[0].path);
|
||||
Get.back();
|
||||
destinationController.rogainingCounted.value = true;
|
||||
destinationController.skipGps = false;
|
||||
destinationController.isPhotoShoot.value = false;
|
||||
Get.snackbar("お買い物加点を行いました。",
|
||||
"${destination.sub_loc_id} : ${destination.name}");
|
||||
},
|
||||
child: const Text("レシートの写真を撮る"))
|
||||
: Container())
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Obx(() => ElevatedButton(
|
||||
onPressed: () {
|
||||
destinationController.openCamera(context, destination);
|
||||
},
|
||||
child: destinationController.photos.isNotEmpty
|
||||
? const Text("再撮影")
|
||||
: const Text("撮影"))),
|
||||
Obx(() => destinationController.photos.isNotEmpty
|
||||
? ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
||||
onPressed: () async {
|
||||
// print(
|
||||
// "##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
|
||||
await destinationController.makeCheckin(
|
||||
indexController.currentDestinationFeature[0],
|
||||
true,
|
||||
destinationController.photos[0].path);
|
||||
Get.back();
|
||||
destinationController.rogainingCounted.value = true;
|
||||
destinationController.skipGps = false;
|
||||
destinationController.isPhotoShoot.value = false;
|
||||
Get.snackbar(
|
||||
"チェックインしました",
|
||||
indexController.currentDestinationFeature[0].name ??
|
||||
"");
|
||||
},
|
||||
child: const Text("チェックイン"))
|
||||
: Container())
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,31 +284,173 @@ class CameraPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if(destinationController.is_in_rog.value){
|
||||
//print("---- photos ${destination.photos} ----");
|
||||
if (buyPointPhoto == true) {
|
||||
//print("--- buy point camera ${destination.toString()}");
|
||||
return BuyPointCamera(destination: destination);
|
||||
} else if (destinationController.isInRog.value) {
|
||||
//print("-----tags camera page----- ${destination.tags}");
|
||||
//print("--- in normal camera ${destination.toString()}");
|
||||
return Scaffold(
|
||||
appBar:
|
||||
destinationController.is_in_rog.value && destinationController.rogaining_counted.value == true ?
|
||||
AppBar(
|
||||
title: destination!.cp == -1 ?
|
||||
Text("finishing_rogaining".tr)
|
||||
:
|
||||
Text("cp_pls_take_photo".tr)
|
||||
,
|
||||
leading: IconButton(
|
||||
icon: Text("cancel".tr),
|
||||
onPressed: (){
|
||||
Navigator.of(context).pop();
|
||||
destinationController.skip_10s = true;
|
||||
timer = Timer.periodic(const Duration(seconds: 10), (Timer t){
|
||||
destinationController.skip_10s = false;
|
||||
});
|
||||
},
|
||||
appBar: destinationController.isInRog.value &&
|
||||
destinationController.rogainingCounted.value == true
|
||||
? AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
title: destination.cp == -1
|
||||
? Text("finishing_rogaining".tr)
|
||||
: Text("${destination.sub_loc_id} : ${destination.name}"),
|
||||
leading: IconButton(
|
||||
icon: Text("cancel".tr),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
destinationController.skip_10s = true;
|
||||
timer =
|
||||
Timer.periodic(const Duration(seconds: 10), (Timer t) {
|
||||
destinationController.skip_10s = false;
|
||||
});
|
||||
},
|
||||
),
|
||||
centerTitle: true,
|
||||
)
|
||||
: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text("${destination.sub_loc_id} : ${destination.name}"),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Obx(
|
||||
() => Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 370,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: destinationController.photos.isEmpty
|
||||
? getDisplayImage(destination).image
|
||||
: getFinishImage(),
|
||||
fit: BoxFit.cover)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Text(getTagText(
|
||||
false,
|
||||
destination.tags,
|
||||
))
|
||||
// child: Obx(() => destinationController.photos.isEmpty == true
|
||||
// ? const Text("撮影してチェックインしてください。")
|
||||
// : const Text("チェックインをタップしてください。")),
|
||||
),
|
||||
getAction(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return StartRogaining();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class StartRogaining extends StatelessWidget {
|
||||
StartRogaining({Key? key}) : super(key: key);
|
||||
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text(
|
||||
"Not started yet".tr,
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("You have not started rogaining yet.".tr,
|
||||
style: const TextStyle(fontSize: 24)),
|
||||
const SizedBox(
|
||||
height: 40.0,
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
destinationController.skipGps = false;
|
||||
},
|
||||
child: const Text("Back"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// class NotAtGoal extends StatelessWidget {
|
||||
// NotAtGoal({Key? key}) : super(key: key);
|
||||
|
||||
// DestinationController destinationController =
|
||||
// Get.find<DestinationController>();
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// title: Text(
|
||||
// "Not reached the goal yet".tr,
|
||||
// ),
|
||||
// ),
|
||||
// body: Container(
|
||||
// child: Center(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Text("You have not reached the goal yet.".tr,
|
||||
// style: const TextStyle(fontSize: 24)),
|
||||
// const SizedBox(
|
||||
// height: 40.0,
|
||||
// ),
|
||||
// ElevatedButton(
|
||||
// onPressed: () {
|
||||
// Get.back();
|
||||
// destinationController.skip_gps = false;
|
||||
// },
|
||||
// child: const Text("Back"),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
class BuyPointCamera extends StatelessWidget {
|
||||
BuyPointCamera({Key? key, required this.destination}) : super(key: key);
|
||||
|
||||
Destination destination;
|
||||
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text(
|
||||
"${destination.sub_loc_id} : ${destination.name}",
|
||||
),
|
||||
centerTitle: true,
|
||||
)
|
||||
:
|
||||
AppBar(
|
||||
title: const Text("チェックポイント"),
|
||||
),
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
@ -183,95 +458,86 @@ class CameraPage extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Obx(() =>
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 370,
|
||||
decoration: BoxDecoration(
|
||||
image:
|
||||
DecorationImage(
|
||||
image: getFinishImage(),
|
||||
fit: BoxFit.cover
|
||||
)
|
||||
child: Obx(
|
||||
() => Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 370,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: getReceiptImage(), fit: BoxFit.cover)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
getAction(context),
|
||||
],
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(getTagText(true, destination.tags)),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Obx(() => Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
destinationController.openCamera(
|
||||
context, destination);
|
||||
},
|
||||
child: destinationController.photos.isNotEmpty
|
||||
? const Text("再撮影")
|
||||
: const Text("撮影")),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
await destinationController
|
||||
.cancelBuyPoint(destination);
|
||||
Get.back();
|
||||
destinationController.rogainingCounted.value = true;
|
||||
destinationController.skipGps = false;
|
||||
destinationController.isPhotoShoot.value = false;
|
||||
},
|
||||
child: const Text("買い物なし"))
|
||||
],
|
||||
)),
|
||||
Obx(() => destinationController.photos.isNotEmpty
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// ElevatedButton(
|
||||
// style: ElevatedButton.styleFrom(
|
||||
// backgroundColor: Colors.red),
|
||||
// onPressed: () async {},
|
||||
// child: const Text("買物なし")),
|
||||
// const SizedBox(
|
||||
// width: 10,
|
||||
// ),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red),
|
||||
onPressed: () async {
|
||||
await destinationController.makeBuyPoint(
|
||||
destination,
|
||||
destinationController.photos[0].path);
|
||||
Get.back();
|
||||
destinationController.rogainingCounted.value =
|
||||
true;
|
||||
destinationController.skipGps = false;
|
||||
destinationController.isPhotoShoot.value = false;
|
||||
Get.snackbar("お買い物加点を行いました",
|
||||
"${destination.sub_loc_id} : ${destination.name}");
|
||||
},
|
||||
child: const Text("完了"))
|
||||
],
|
||||
)
|
||||
: Container())
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return StartRogaining();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class StartRogaining extends StatelessWidget {
|
||||
StartRogaining({Key? key}) : super(key: key);
|
||||
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Not started yet".tr,),
|
||||
),
|
||||
body: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("You have not started rogaining yet.".tr, style: const TextStyle(fontSize: 24)),
|
||||
const SizedBox(height: 40.0,),
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
Get.back();
|
||||
destinationController.skip_gps = false;
|
||||
},
|
||||
child: const Text("Back"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NotAtGoal extends StatelessWidget {
|
||||
NotAtGoal({Key? key}) : super(key: key);
|
||||
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Not reached the goal yet".tr,),
|
||||
),
|
||||
body: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("You have not reached the goal yet.".tr, style: const TextStyle(fontSize: 24)),
|
||||
const SizedBox(height: 40.0,),
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
Get.back();
|
||||
destinationController.skip_gps = false;
|
||||
},
|
||||
child: const Text("Back"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -13,150 +13,170 @@ class ChangePasswordPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
|
||||
backgroundColor: Colors.white,
|
||||
leading:
|
||||
IconButton( onPressed: (){
|
||||
Navigator.pop(context);
|
||||
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
)),
|
||||
),
|
||||
body:
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
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(
|
||||
body: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
makeInput(label: "old_password".tr, controller: oldPasswordController),
|
||||
makeInput(label: "new_password".tr, controller: newPasswordController, obsureText: true),
|
||||
Text(
|
||||
"change_password".tr,
|
||||
style: const TextStyle(fontSize: 24.0),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
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(
|
||||
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),
|
||||
child: Column(
|
||||
children: [
|
||||
makeInput(
|
||||
label: "old_password".tr,
|
||||
controller: oldPasswordController),
|
||||
makeInput(
|
||||
label: "new_password".tr,
|
||||
controller: newPasswordController,
|
||||
obsureText: true),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
const SizedBox(height: 20,),
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
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 (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}){
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(label,style:const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black87
|
||||
),),
|
||||
const SizedBox(height: 5,),
|
||||
TextField(
|
||||
controller: controller,
|
||||
obscureText: obsureText,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: (Colors.grey[400])!,
|
||||
Widget makeInput(
|
||||
{label, required TextEditingController controller, obsureText = false}) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 15, fontWeight: FontWeight.w400, color: Colors.black87),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
TextField(
|
||||
controller: controller,
|
||||
obscureText: obsureText,
|
||||
decoration: InputDecoration(
|
||||
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,9 +1,11 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/main.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
|
||||
class DestinationBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.put<DestinationController>(DestinationController());
|
||||
restoreGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,208 +1,252 @@
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:geolocator/geolocator.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:latlong2/latlong.dart';
|
||||
// import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
// import 'package:rogapp/pages/destination_map/destination_map_page.dart';
|
||||
// import 'package:rogapp/pages/drawer/drawer_page.dart';
|
||||
// import 'package:rogapp/pages/index/index_controller.dart';
|
||||
// import 'package:rogapp/routes/app_pages.dart';
|
||||
// import 'package:rogapp/widgets/destination_widget.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/destination_map/destination_map_page.dart';
|
||||
import 'package:rogapp/pages/drawer/drawer_page.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/widgets/destination_widget.dart';
|
||||
// class XDestnationPage extends StatelessWidget {
|
||||
// XDestnationPage({Key? key}) : super(key: key);
|
||||
|
||||
class DestnationPage extends StatelessWidget {
|
||||
DestnationPage({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>();
|
||||
// final List<int> _items = List<int>.generate(50, (int index) => index);
|
||||
|
||||
final List<int> _items = List<int>.generate(50, (int index) => index);
|
||||
// Future<void> showCurrentPosition() async {
|
||||
// LocationPermission permission = await Geolocator.checkPermission();
|
||||
// if (permission != LocationPermission.whileInUse ||
|
||||
// permission != LocationPermission.always) {
|
||||
// permission = await Geolocator.requestPermission();
|
||||
// }
|
||||
// Position position = await Geolocator.getCurrentPosition(
|
||||
// desiredAccuracy: LocationAccuracy.high,
|
||||
// forceAndroidLocationManager: true);
|
||||
// indexController.rogMapController
|
||||
// .move(LatLng(position.latitude, position.longitude), 14);
|
||||
// }
|
||||
|
||||
Future<void> showCurrentPosition() async {
|
||||
LocationPermission permission = await Geolocator.checkPermission();
|
||||
if (permission != LocationPermission.whileInUse ||
|
||||
permission != LocationPermission.always) {
|
||||
permission = await Geolocator.requestPermission();
|
||||
}
|
||||
Position position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high, forceAndroidLocationManager: true);
|
||||
indexController.rogMapController.move(LatLng(position.latitude, position.longitude), 14);
|
||||
}
|
||||
// Image getImage(int index) {
|
||||
// if (destinationController.destinations[index].photos == null ||
|
||||
// destinationController.destinations[index].photos == "") {
|
||||
// return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||
// } else {
|
||||
// return Image(
|
||||
// image:
|
||||
// NetworkImage(destinationController.destinations[index].photos!));
|
||||
// }
|
||||
// }
|
||||
|
||||
Image getImage(int index){
|
||||
if(destinationController.destinations[index].photos == null || destinationController.destinations[index].photos == ""){
|
||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||
}
|
||||
else{
|
||||
return Image(image: NetworkImage(destinationController.destinations[index].photos!));
|
||||
}
|
||||
}
|
||||
// Widget getRoutingImage(int route) {
|
||||
// switch (route) {
|
||||
// case 0:
|
||||
// return const Image(
|
||||
// image: AssetImage('assets/images/p4_9_man.png'),
|
||||
// width: 35.0,
|
||||
// );
|
||||
// case 1:
|
||||
// return const Image(
|
||||
// image: AssetImage('assets/images/p4_8_car.png'),
|
||||
// width: 35.0,
|
||||
// );
|
||||
// case 2:
|
||||
// return const Image(
|
||||
// image: AssetImage('assets/images/p4_10_train.png'),
|
||||
// width: 35.0,
|
||||
// );
|
||||
// default:
|
||||
// return const Image(
|
||||
// image: AssetImage('assets/images/p4_9_man.png'),
|
||||
// width: 35.0,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
Widget getRoutingImage(int route){
|
||||
switch (route) {
|
||||
case 0:
|
||||
return const Image(image: AssetImage('assets/images/p4_9_man.png'), width: 35.0,);
|
||||
case 1:
|
||||
return const Image(image: AssetImage('assets/images/p4_8_car.png'), width: 35.0,);
|
||||
case 2:
|
||||
return const Image(image: AssetImage('assets/images/p4_10_train.png'), width: 35.0,);
|
||||
default:
|
||||
return const Image(image: AssetImage('assets/images/p4_9_man.png'), width: 35.0,);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
indexController.switchPage(AppPages.INITIAL);
|
||||
return false;
|
||||
},
|
||||
child: Scaffold(
|
||||
drawer: DrawerPage(),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:13.0),
|
||||
child: InkWell(
|
||||
child: Obx((() => getRoutingImage(destinationController.travelMode.value))),
|
||||
onTap: (){
|
||||
Get.bottomSheet(
|
||||
Obx(() =>
|
||||
ListView(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top:30.0, bottom: 30),
|
||||
child: Center(child: Text("select_travel_mode".tr, style: const TextStyle(fontSize: 22.0, color:Colors.red, fontWeight:FontWeight.bold),),),
|
||||
),
|
||||
ListTile(
|
||||
selected: destinationController.travelMode == 0 ? true : false,
|
||||
selectedTileColor: Colors.amber.shade200,
|
||||
leading: const Image(image: AssetImage('assets/images/p4_9_man.png'),),
|
||||
title: Text("walking".tr),
|
||||
onTap:(){
|
||||
destinationController.travelMode.value = 0;
|
||||
destinationController.PopulateDestinations();
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
selected: destinationController.travelMode == 1 ? true : false,
|
||||
selectedTileColor: Colors.amber.shade200,
|
||||
leading: const Image(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,
|
||||
backgroundColor: Colors.white,
|
||||
);
|
||||
//destinationController.PopulateDestinations();
|
||||
}
|
||||
),
|
||||
)
|
||||
,
|
||||
IconButton(
|
||||
icon: const Icon(Icons.travel_explore, size: 35,),
|
||||
onPressed: (){
|
||||
indexController.switchPage(AppPages.INITIAL);
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: (){
|
||||
//print("######");
|
||||
indexController.toggleDestinationMode();
|
||||
},
|
||||
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,
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
appBar:AppBar(
|
||||
automaticallyImplyLeading: true,
|
||||
title: Text("app_title".tr),
|
||||
actions: [
|
||||
InkWell(
|
||||
onTap: (){
|
||||
Get.toNamed(AppPages.CAMERA_PAGE);
|
||||
},
|
||||
child: destinationController.is_in_rog == true ?
|
||||
Image.asset("assets/images/basic-walking.gif",height: 10.0,)
|
||||
:
|
||||
destinationController.is_at_goal == true ?
|
||||
IconButton(
|
||||
onPressed:(){Get.toNamed(AppPages.CAMERA_PAGE);},
|
||||
icon: const Icon(Icons.assistant_photo),
|
||||
)
|
||||
:
|
||||
IconButton(
|
||||
onPressed:(){Get.toNamed(AppPages.CAMERA_PAGE);},
|
||||
icon: const Icon(Icons.accessibility),
|
||||
),
|
||||
),
|
||||
// Obx(() =>
|
||||
// Text(indexController.connectionStatusName.value)
|
||||
// ),
|
||||
Obx(() =>
|
||||
ToggleButtons(
|
||||
disabledColor: Colors.grey.shade200,
|
||||
selectedColor: Colors.red,
|
||||
children: const <Widget>[
|
||||
Icon(Icons.explore, size: 35.0,
|
||||
)],
|
||||
onPressed: (int index) {
|
||||
destinationController.is_gps_selected.value = !destinationController.is_gps_selected.value;
|
||||
if(destinationController.is_gps_selected.value){
|
||||
destinationController.chekcs = 0;
|
||||
destinationController.skip_gps = false;
|
||||
//destinationController.resetRogaining();
|
||||
}
|
||||
},
|
||||
isSelected: [destinationController.is_gps_selected.value],
|
||||
),
|
||||
),
|
||||
// IconButton(onPressed: (){
|
||||
// showCurrentPosition();
|
||||
// },
|
||||
// icon: Icon(Icons.location_on_outlined))
|
||||
],
|
||||
),
|
||||
body: Obx(() =>
|
||||
indexController.desination_mode.value == 0 ?
|
||||
DestinationWidget():
|
||||
DestinationMapPage()
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return WillPopScope(
|
||||
// onWillPop: () async {
|
||||
// indexController.switchPage(AppPages.INITIAL);
|
||||
// return false;
|
||||
// },
|
||||
// child: Scaffold(
|
||||
// drawer: DrawerPage(),
|
||||
// bottomNavigationBar: BottomAppBar(
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: <Widget>[
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 13.0),
|
||||
// child: InkWell(
|
||||
// child: Obx((() => getRoutingImage(
|
||||
// destinationController.travelMode.value))),
|
||||
// onTap: () {
|
||||
// Get.bottomSheet(
|
||||
// Obx(
|
||||
// () => ListView(
|
||||
// children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(
|
||||
// top: 30.0, bottom: 30),
|
||||
// child: Center(
|
||||
// child: Text(
|
||||
// "select_travel_mode".tr,
|
||||
// style: const TextStyle(
|
||||
// fontSize: 22.0,
|
||||
// color: Colors.red,
|
||||
// fontWeight: FontWeight.bold),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ListTile(
|
||||
// selected:
|
||||
// destinationController.travelMode.value ==
|
||||
// 0
|
||||
// ? true
|
||||
// : false,
|
||||
// selectedTileColor: Colors.amber.shade200,
|
||||
// leading: const Image(
|
||||
// image: AssetImage(
|
||||
// 'assets/images/p4_9_man.png'),
|
||||
// ),
|
||||
// title: Text("walking".tr),
|
||||
// onTap: () {
|
||||
// destinationController.travelMode.value = 0;
|
||||
// destinationController
|
||||
// .populateDestinations();
|
||||
// Get.back();
|
||||
// },
|
||||
// ),
|
||||
// ListTile(
|
||||
// selected:
|
||||
// destinationController.travelMode.value ==
|
||||
// 1
|
||||
// ? true
|
||||
// : false,
|
||||
// selectedTileColor: Colors.amber.shade200,
|
||||
// leading: const Image(
|
||||
// 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,
|
||||
// backgroundColor: Colors.white,
|
||||
// );
|
||||
// //destinationController.PopulateDestinations();
|
||||
// }),
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: const Icon(
|
||||
// Icons.travel_explore,
|
||||
// size: 35,
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// indexController.switchPage(AppPages.INITIAL);
|
||||
// }),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// floatingActionButton: FloatingActionButton(
|
||||
// onPressed: () {
|
||||
// //print("######");
|
||||
// indexController.toggleDestinationMode();
|
||||
// },
|
||||
// tooltip: 'Increment',
|
||||
// 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,
|
||||
// appBar: AppBar(
|
||||
// automaticallyImplyLeading: true,
|
||||
// title: Text("app_title".tr),
|
||||
// actions: [
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// Get.toNamed(AppPages.CAMERA_PAGE);
|
||||
// },
|
||||
// child: destinationController.isInRog.value == true
|
||||
// ? Image.asset(
|
||||
// "assets/images/basic-walking.gif",
|
||||
// height: 10.0,
|
||||
// )
|
||||
// : destinationController.isAtGoal.value == true
|
||||
// ? IconButton(
|
||||
// onPressed: () {
|
||||
// Get.toNamed(AppPages.CAMERA_PAGE);
|
||||
// },
|
||||
// icon: const Icon(Icons.assistant_photo),
|
||||
// )
|
||||
// : IconButton(
|
||||
// onPressed: () {
|
||||
// Get.toNamed(AppPages.CAMERA_PAGE);
|
||||
// },
|
||||
// icon: const Icon(Icons.accessibility),
|
||||
// ),
|
||||
// ),
|
||||
// // Obx(() =>
|
||||
// // Text(indexController.connectionStatusName.value)
|
||||
// // ),
|
||||
// Obx(
|
||||
// () => ToggleButtons(
|
||||
// disabledColor: Colors.grey.shade200,
|
||||
// selectedColor: Colors.red,
|
||||
// onPressed: (int index) {
|
||||
// destinationController.isGpsSelected.value =
|
||||
// !destinationController.isGpsSelected.value;
|
||||
// if (destinationController.isGpsSelected.value) {
|
||||
// destinationController.chekcs = 0;
|
||||
// destinationController.skipGps = false;
|
||||
// //destinationController.resetRogaining();
|
||||
// }
|
||||
// },
|
||||
// isSelected: [destinationController.isGpsSelected.value],
|
||||
// children: const <Widget>[
|
||||
// Icon(
|
||||
// Icons.explore,
|
||||
// size: 35.0,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// // IconButton(onPressed: (){
|
||||
// // showCurrentPosition();
|
||||
// // },
|
||||
// // icon: Icon(Icons.location_on_outlined))
|
||||
// ],
|
||||
// ),
|
||||
// body: Obx(() => indexController.desinationMode.value == 0
|
||||
// ? DestinationWidget()
|
||||
// : DestinationMapPage())),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -25,7 +25,7 @@ class DestinationMapPage extends StatelessWidget {
|
||||
final PopupController _popupLayerController = PopupController();
|
||||
|
||||
List<LatLng>? getPoints() {
|
||||
print("##### --- route point ${indexController.routePoints.length}");
|
||||
//print("##### --- route point ${indexController.routePoints.length}");
|
||||
List<LatLng> pts = [];
|
||||
for (PointLatLng p in indexController.routePoints) {
|
||||
LatLng l = LatLng(p.latitude, p.longitude);
|
||||
@ -39,14 +39,14 @@ class DestinationMapPage extends StatelessWidget {
|
||||
int index = -1;
|
||||
for (int i = 0; i < destinationController.destinations.length; i++) {
|
||||
Destination d = destinationController.destinations[i];
|
||||
print("^^^^ $d ^^^^");
|
||||
//print("^^^^ $d ^^^^");
|
||||
Marker m = Marker(
|
||||
point: LatLng(d.lat!, d.lon!),
|
||||
anchorPos: AnchorPos.align(AnchorAlign.center),
|
||||
builder: (cts) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
print("-- Destination is --- ${d.name} ------");
|
||||
//print("-- Destination is --- ${d.name} ------");
|
||||
if (indexController.currentDestinationFeature.isNotEmpty) {
|
||||
indexController.currentDestinationFeature.clear();
|
||||
}
|
||||
@ -57,10 +57,12 @@ class DestinationMapPage extends StatelessWidget {
|
||||
context: Get.context!,
|
||||
isScrollControlled: true,
|
||||
constraints: BoxConstraints.loose(
|
||||
Size(Get.width, Get.height * 0.75)),
|
||||
builder: ((context) => BottomSheetNew())).whenComplete(() {
|
||||
print("---- set skip gps to false -----");
|
||||
destinationController.skip_gps = false;
|
||||
Size(Get.width, Get.height * 0.85)),
|
||||
builder: ((context) => BottomSheetNew(
|
||||
destination: d,
|
||||
))).whenComplete(() {
|
||||
//print("---- set skip gps to false -----");
|
||||
destinationController.skipGps = false;
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
@ -118,18 +120,18 @@ class DestinationMapPage extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 0.0),
|
||||
//child: TravelMap(),
|
||||
child: TravelMap(),
|
||||
child: travelMap(),
|
||||
),
|
||||
],
|
||||
)));
|
||||
}
|
||||
|
||||
FlutterMap TravelMap() {
|
||||
FlutterMap travelMap() {
|
||||
return FlutterMap(
|
||||
mapController: indexController.rogMapController,
|
||||
options: MapOptions(
|
||||
onMapReady: () {
|
||||
indexController.is_rog_mapcontroller_loaded.value = true;
|
||||
indexController.isRogMapcontrollerLoaded.value = true;
|
||||
subscription = indexController.rogMapController.mapEventStream
|
||||
.listen((MapEvent mapEvent) {
|
||||
if (mapEvent is MapEventMoveStart) {}
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
|
||||
import 'package:flutter/material.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/routes/app_pages.dart';
|
||||
import 'package:rogapp/services/auth_service.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class DrawerPage extends StatelessWidget {
|
||||
DrawerPage({ Key? key }) : super(key: key);
|
||||
DrawerPage({Key? key}) : super(key: key);
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
void _launchURL(url) async {
|
||||
if (!await launch(url)) throw 'Could not launch $url';
|
||||
if (!await launchUrl(url)) throw 'Could not launch $url';
|
||||
}
|
||||
|
||||
@override
|
||||
@ -27,71 +27,125 @@ class DrawerPage extends StatelessWidget {
|
||||
Container(
|
||||
height: 100,
|
||||
color: Colors.amber,
|
||||
child: Obx(() =>
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child:
|
||||
indexController.currentUser.isEmpty ?
|
||||
Flexible(child: Text("drawer_title".tr, style: const TextStyle(color: Colors.black, fontSize: 20),))
|
||||
:
|
||||
Text(indexController.currentUser[0]['user']['email'], style: const TextStyle(color: Colors.black, fontSize: 20),),
|
||||
),
|
||||
)
|
||||
),
|
||||
child: Obx(() => Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: indexController.currentUser.isEmpty
|
||||
? Flexible(
|
||||
child: Text(
|
||||
"drawer_title".tr,
|
||||
style: const TextStyle(
|
||||
color: Colors.black, fontSize: 20),
|
||||
))
|
||||
: Text(
|
||||
indexController.currentUser[0]['user']['email'],
|
||||
style: const TextStyle(
|
||||
color: Colors.black, fontSize: 20),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
Obx(() =>
|
||||
indexController.currentUser.isEmpty ?
|
||||
ListTile(
|
||||
leading: const Icon(Icons.login),
|
||||
title: Text("login".tr),
|
||||
onTap: (){
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
},
|
||||
) :
|
||||
ListTile(
|
||||
leading: const Icon(Icons.login),
|
||||
title: Text("logout".tr),
|
||||
onTap: (){
|
||||
indexController.logout();
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
},
|
||||
)
|
||||
),
|
||||
indexController.currentUser.isNotEmpty ?
|
||||
ListTile(
|
||||
leading: const Icon(Icons.password),
|
||||
title: Text("change_password".tr),
|
||||
onTap: (){
|
||||
Get.toNamed(AppPages.CHANGE_PASSWORD);
|
||||
},
|
||||
) :
|
||||
const SizedBox(width: 0, height: 0,),
|
||||
indexController.currentUser.isEmpty ?
|
||||
ListTile(
|
||||
leading: const Icon(Icons.person),
|
||||
title: Text("sign_up".tr),
|
||||
onTap: (){
|
||||
Get.toNamed(AppPages.REGISTER);
|
||||
},
|
||||
) :
|
||||
const SizedBox(width: 0, height: 0,),
|
||||
indexController.currentUser.isNotEmpty ?
|
||||
ListTile(
|
||||
leading: const Icon(Icons.delete_forever),
|
||||
title: Text("delete_account".tr),
|
||||
onTap: (){
|
||||
String _token = indexController.currentUser[0]['token'];
|
||||
AuthService.deleteUser(_token).then((value){
|
||||
if(value.isNotEmpty){
|
||||
indexController.logout();
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
Get.snackbar("accounted_deleted".tr, "account_deleted_message".tr);
|
||||
}
|
||||
});
|
||||
},
|
||||
) :
|
||||
const SizedBox(width: 0, height: 0,),
|
||||
Obx(() => indexController.currentUser.isEmpty
|
||||
? ListTile(
|
||||
leading: const Icon(Icons.login),
|
||||
title: Text("login".tr),
|
||||
onTap: () {
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
},
|
||||
)
|
||||
: ListTile(
|
||||
leading: const Icon(Icons.login),
|
||||
title: Text("logout".tr),
|
||||
onTap: () {
|
||||
indexController.logout();
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
},
|
||||
)),
|
||||
indexController.currentUser.isNotEmpty
|
||||
? ListTile(
|
||||
leading: const Icon(Icons.password),
|
||||
title: Text("change_password".tr),
|
||||
onTap: () {
|
||||
Get.toNamed(AppPages.CHANGE_PASSWORD);
|
||||
},
|
||||
)
|
||||
: const SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
),
|
||||
indexController.currentUser.isEmpty
|
||||
? ListTile(
|
||||
leading: const Icon(Icons.person),
|
||||
title: Text("sign_up".tr),
|
||||
onTap: () {
|
||||
Get.toNamed(AppPages.REGISTER);
|
||||
},
|
||||
)
|
||||
: const SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
),
|
||||
indexController.currentUser.isNotEmpty
|
||||
? ListTile(
|
||||
leading: const Icon(Icons.password),
|
||||
title: const Text("リセット"),
|
||||
onTap: () {
|
||||
Get.defaultDialog(
|
||||
title: "よろしいですか、リセットしますか?",
|
||||
middleText: "これにより、すべてのゲーム データが削除され、すべての状態が削除されます",
|
||||
textConfirm: "確認する",
|
||||
textCancel: "キャンセルする",
|
||||
onCancel: () => Get.back(),
|
||||
onConfirm: () {
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
destinationController.resetRogaining();
|
||||
destinationController.deleteDBDestinations();
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
},
|
||||
)
|
||||
: const SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
),
|
||||
indexController.currentUser.isNotEmpty
|
||||
? ListTile(
|
||||
leading: const Icon(Icons.delete_forever),
|
||||
title: Text("delete_account".tr),
|
||||
onTap: () {
|
||||
String token = indexController.currentUser[0]['token'];
|
||||
AuthService.deleteUser(token).then((value) {
|
||||
if (value.isNotEmpty) {
|
||||
indexController.logout();
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
Get.snackbar("accounted_deleted".tr,
|
||||
"account_deleted_message".tr);
|
||||
}
|
||||
});
|
||||
},
|
||||
)
|
||||
: const SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
),
|
||||
indexController.currentUser.isNotEmpty
|
||||
? ListTile(
|
||||
leading: const Icon(Icons.delete_forever),
|
||||
title: Text("ユーザーデータを削除する".tr),
|
||||
onTap: () {
|
||||
String token = indexController.currentUser[0]['token'];
|
||||
AuthService.deleteUser(token).then((value) {
|
||||
Get.snackbar("ユーザーデータを削除する",
|
||||
"データを削除するためにユーザーの同意が設定されています アプリとサーバーでユーザーデータが削除されました");
|
||||
});
|
||||
},
|
||||
)
|
||||
: const SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const Icon(Icons.person),
|
||||
// title: Text("profile".tr),
|
||||
@ -107,19 +161,22 @@ class DrawerPage extends StatelessWidget {
|
||||
// title: Text("point_rank".tr),
|
||||
// onTap: (){},
|
||||
// ),
|
||||
indexController.currentUser.isNotEmpty ?
|
||||
ListTile(
|
||||
leading: const Icon(Icons.featured_video),
|
||||
title: Text("rog_web".tr),
|
||||
onTap: (){
|
||||
_launchURL("https://www.gifuai.net/?page_id=17397");
|
||||
},
|
||||
) :
|
||||
const SizedBox(width: 0, height: 0,),
|
||||
indexController.currentUser.isNotEmpty
|
||||
? ListTile(
|
||||
leading: const Icon(Icons.featured_video),
|
||||
title: Text("rog_web".tr),
|
||||
onTap: () {
|
||||
_launchURL("https://www.gifuai.net/?page_id=17397");
|
||||
},
|
||||
)
|
||||
: const SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.privacy_tip),
|
||||
title: Text("privacy".tr),
|
||||
onTap: (){
|
||||
onTap: () {
|
||||
_launchURL("https://rogaining.sumasen.net/api/privacy/");
|
||||
},
|
||||
)
|
||||
|
||||
149
lib/pages/gps/gps_page.dart
Normal file
@ -0,0 +1,149 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rogapp/model/gps_data.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/utils/database_gps.dart';
|
||||
import 'package:rogapp/widgets/base_layer_widget.dart';
|
||||
|
||||
class GpsPage extends StatefulWidget {
|
||||
const GpsPage({super.key});
|
||||
|
||||
@override
|
||||
State<GpsPage> createState() => _GpsPageState();
|
||||
}
|
||||
|
||||
class _GpsPageState extends State<GpsPage> {
|
||||
var gpsData = [].obs;
|
||||
MapController? mapController;
|
||||
StreamSubscription? subscription;
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
final DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
loadGpsData();
|
||||
}
|
||||
|
||||
void loadGpsData() async {
|
||||
final team_name = indexController.currentUser[0]["user"]['team_name'];
|
||||
final event_code = indexController.currentUser[0]["user"]["event_code"];
|
||||
GpsDatabaseHelper db = GpsDatabaseHelper.instance;
|
||||
var data = await db.getGPSData(team_name, event_code);
|
||||
gpsData.value = data;
|
||||
|
||||
//print("--- gps data ${data} ----");
|
||||
}
|
||||
|
||||
Widget getMarkerShape(GpsData i) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
height: 22,
|
||||
width: 22,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color:
|
||||
i.is_checkin == 0 ? Colors.blueAccent : Colors.green,
|
||||
width: i.is_checkin == 0 ? 0.4 : 2,
|
||||
style: BorderStyle.solid)),
|
||||
child: const Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.circle,
|
||||
size: 6.0,
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
color: Colors.transparent,
|
||||
child: i.is_checkin == 1
|
||||
? Text(
|
||||
DateTime.fromMicrosecondsSinceEpoch(i.created_at)
|
||||
.hour
|
||||
.toString() +
|
||||
":" +
|
||||
DateTime.fromMicrosecondsSinceEpoch(i.created_at)
|
||||
.minute
|
||||
.toString(),
|
||||
// ":" +
|
||||
// DateTime.fromMicrosecondsSinceEpoch(i.created_at)
|
||||
// .second
|
||||
// .toString(),
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
))
|
||||
: Container()),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("GPS way points"),
|
||||
),
|
||||
body: Container(
|
||||
child: Obx(
|
||||
() => FlutterMap(
|
||||
mapController: mapController,
|
||||
options: MapOptions(
|
||||
maxZoom: 18.4,
|
||||
onMapReady: () {},
|
||||
//center: LatLng(37.15319600454702, 139.58765950528198),
|
||||
bounds: indexController.currentBound.isNotEmpty
|
||||
? indexController.currentBound[0]
|
||||
: LatLngBounds.fromPoints([
|
||||
LatLng(35.03999881162295, 136.40587119778962),
|
||||
LatLng(36.642756778706904, 137.95226720406063)
|
||||
]),
|
||||
zoom: 1,
|
||||
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
|
||||
|
||||
onPositionChanged: (MapPosition pos, isvalue) {
|
||||
indexController.currentBound = [pos.bounds!];
|
||||
},
|
||||
onTap: (tapPos, cord) {}, // Hide popup when the map is tapped.
|
||||
),
|
||||
children: [
|
||||
const BaseLayer(),
|
||||
MarkerLayer(
|
||||
markers: gpsData.map((i) {
|
||||
return Marker(
|
||||
anchorPos: AnchorPos.exactly(Anchor(108.0, 18.0)),
|
||||
height: 32.0,
|
||||
width: 120.0,
|
||||
point: LatLng(i.lat, i.lon),
|
||||
builder: (ctx) {
|
||||
return getMarkerShape(i);
|
||||
// return Container(
|
||||
// width: 40,
|
||||
// height: 40,
|
||||
// color: Colors.orange,
|
||||
// );
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -18,7 +18,7 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("History"),
|
||||
title: const Text("通過履歴"),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -32,37 +32,45 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: TextStyle(fontSize: 18),
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else if (snapshot.hasData) {
|
||||
final dests = snapshot.data;
|
||||
if (dests!.length > 0) {
|
||||
print("----- history -----");
|
||||
return Container(
|
||||
if (dests!.isNotEmpty) {
|
||||
//print("----- history -----");
|
||||
return SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 150,
|
||||
child: Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: dests.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return ListTile(
|
||||
title: Text(dests[index].name ?? ""),
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: ListView.builder(
|
||||
itemCount: dests.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
//print("--- photo ${dests[index].checkin_image!} ----");
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: CustomWidget(
|
||||
title: dests[index].name!,
|
||||
subtitle:
|
||||
Text(dests[index].address ?? ""),
|
||||
leading: dests[0].photos != null
|
||||
? Container(width: 100, height: 100, child: Image.file(File(dests[0].photos!)))
|
||||
: Container(),
|
||||
);
|
||||
}),
|
||||
));
|
||||
"${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 {
|
||||
return Center(child: Text("No checkin yet"));
|
||||
return const Center(child: Text("No checkin yet"));
|
||||
}
|
||||
}
|
||||
} else if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
@ -74,3 +82,69 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomWidget extends StatelessWidget {
|
||||
final Image? image1;
|
||||
final Image? image2;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
|
||||
const CustomWidget({
|
||||
super.key,
|
||||
this.image1,
|
||||
this.image2,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width:
|
||||
104, // 50 (width of each image) + 2 (space between images) + 2*1 (padding on both sides)
|
||||
child: Row(
|
||||
children: [
|
||||
if (image1 != null)
|
||||
SizedBox(
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
maxLines:
|
||||
null, // Allows the text to wrap onto an unlimited number of lines
|
||||
),
|
||||
Text(
|
||||
subtitle,
|
||||
style: const TextStyle(fontSize: 16),
|
||||
maxLines:
|
||||
null, // Allows the text to wrap onto an unlimited number of lines
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
|
||||
class IndexBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.put<IndexController>(IndexController());
|
||||
Get.put<DestinationController>(DestinationController());
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,15 +10,10 @@ import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_binding.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/destination/destination_page.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/services/action_service.dart';
|
||||
import 'package:rogapp/services/auth_service.dart';
|
||||
import 'package:rogapp/services/cat_service.dart';
|
||||
import 'package:rogapp/services/location_service.dart';
|
||||
import 'package:rogapp/services/perfecture_service.dart';
|
||||
import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@ -40,169 +35,143 @@ class IndexController extends GetxController {
|
||||
List<PointLatLng> routePoints = <PointLatLng>[].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 is_rog_mapcontroller_loaded = false.obs;
|
||||
var isRogMapcontrollerLoaded = false.obs;
|
||||
|
||||
var is_custom_area_selected = false.obs;
|
||||
var isCustomAreaSelected = false.obs;
|
||||
|
||||
MapController mapController = MapController();
|
||||
MapController rogMapController = MapController();
|
||||
|
||||
String? userToken;
|
||||
|
||||
// mode = 0 is map mode, mode = 1 list mode
|
||||
var mode = 0.obs;
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
String dropdownValue = "9";
|
||||
String subDropdownValue = "-1";
|
||||
String areaDropdownValue = "-1";
|
||||
String cateogory = "-all-";
|
||||
|
||||
late Worker _ever;
|
||||
|
||||
ConnectivityResult connectionStatus = ConnectivityResult.none;
|
||||
var connectionStatusName = "".obs;
|
||||
final Connectivity _connectivity = Connectivity();
|
||||
late StreamSubscription<ConnectivityResult> _connectivitySubscription;
|
||||
|
||||
void toggleMode(){
|
||||
if(mode.value==0){
|
||||
void toggleMode() {
|
||||
if (mode.value == 0) {
|
||||
mode += 1;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
mode -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void toggleDestinationMode(){
|
||||
if(desination_mode.value==0){
|
||||
desination_mode.value += 1;
|
||||
}
|
||||
else{
|
||||
desination_mode.value -= 1;
|
||||
void toggleDestinationMode() {
|
||||
if (desinationMode.value == 0) {
|
||||
desinationMode.value += 1;
|
||||
} else {
|
||||
desinationMode.value -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void switchPage(String page){
|
||||
//print("######## ${currentUser[0]["user"]["id"]}");
|
||||
void switchPage(String page) {
|
||||
////print("######## ${currentUser[0]["user"]["id"]}");
|
||||
switch (page) {
|
||||
case AppPages.INITIAL :{
|
||||
rog_mode.value = 0;
|
||||
print("-- rog mode is ctrl is ${rog_mode.value}");
|
||||
Get.toNamed(page);
|
||||
}
|
||||
case AppPages.INDEX:
|
||||
{
|
||||
rogMode.value = 0;
|
||||
//print("-- rog mode is ctrl is ${rog_mode.value}");
|
||||
Get.toNamed(page);
|
||||
}
|
||||
break;
|
||||
case AppPages.TRAVEL : {
|
||||
rog_mode.value = 1;
|
||||
//Get.back();
|
||||
Get.off(DestnationPage(), binding: DestinationBinding());
|
||||
|
||||
}
|
||||
break;
|
||||
case AppPages.LOGIN :{
|
||||
rog_mode.value = 2;
|
||||
Get.toNamed(page);
|
||||
}
|
||||
break;
|
||||
default:{
|
||||
rog_mode.value = 0;
|
||||
Get.toNamed(AppPages.INITIAL);
|
||||
}
|
||||
case AppPages.TRAVEL:
|
||||
{
|
||||
rogMode.value = 1;
|
||||
//Get.back();
|
||||
//Get.off(DestnationPage(), binding: DestinationBinding());
|
||||
}
|
||||
break;
|
||||
case AppPages.LOGIN:
|
||||
{
|
||||
rogMode.value = 2;
|
||||
Get.toNamed(page);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
rogMode.value = 1;
|
||||
Get.toNamed(AppPages.INDEX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
_ever = ever(rog_mode, (_) => print("$_ has been changed (ever)"));
|
||||
|
||||
if(perfectures.isEmpty){
|
||||
PerfectureService.loadPerfectures().then((value){
|
||||
perfectures.add(value);
|
||||
loadAreaFor("9");
|
||||
|
||||
//loadSubPerfFor("9");
|
||||
});
|
||||
}
|
||||
|
||||
_connectivitySubscription = _connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||
_connectivitySubscription =
|
||||
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
@override
|
||||
void onClose() {
|
||||
_connectivitySubscription.cancel();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _updateConnectionStatus(ConnectivityResult result) async {
|
||||
connectionStatus = result;
|
||||
connectionStatusName.value = result.name;
|
||||
}
|
||||
Future<void> _updateConnectionStatus(ConnectivityResult result) async {
|
||||
connectionStatus = result;
|
||||
connectionStatusName.value = result.name;
|
||||
}
|
||||
|
||||
Future<void> initConnectivity() async {
|
||||
Future<void> initConnectivity() async {
|
||||
late ConnectivityResult result;
|
||||
// Platform messages may fail, so we use a try/catch PlatformException.
|
||||
try {
|
||||
result = await _connectivity.checkConnectivity();
|
||||
} on PlatformException catch (e) {
|
||||
print('Couldn\'t check connectivity status --- $e');
|
||||
} on PlatformException catch (_) {
|
||||
//print('Couldn\'t check connectivity status --- $e');
|
||||
return;
|
||||
}
|
||||
|
||||
return _updateConnectionStatus(result);
|
||||
}
|
||||
|
||||
LatLngBounds boundsFromLatLngList(List<LatLng> list) {
|
||||
double? x0, x1, y0, y1;
|
||||
for (LatLng latLng in list) {
|
||||
if (x0 == null || x1 == null || y0 == null || y1 == null) {
|
||||
x0 = x1 = latLng.latitude;
|
||||
y0 = y1 = latLng.longitude;
|
||||
} else {
|
||||
if (latLng.latitude > x1) x1 = latLng.latitude;
|
||||
if (latLng.latitude < x0) x0 = latLng.latitude;
|
||||
if (latLng.longitude > y1) y1 = latLng.longitude;
|
||||
if (latLng.longitude < y0) y0 = latLng.longitude;
|
||||
LatLngBounds boundsFromLatLngList(List<LatLng> list) {
|
||||
double? x0, x1, y0, y1;
|
||||
for (LatLng latLng in list) {
|
||||
if (x0 == null || x1 == null || y0 == null || y1 == null) {
|
||||
x0 = x1 = latLng.latitude;
|
||||
y0 = y1 = latLng.longitude;
|
||||
} else {
|
||||
if (latLng.latitude > x1) x1 = latLng.latitude;
|
||||
if (latLng.latitude < x0) x0 = latLng.latitude;
|
||||
if (latLng.longitude > y1) y1 = 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, p.geoSerie!.geoPoints[0].longitude);
|
||||
locs.add(latLng);
|
||||
}
|
||||
return locs;
|
||||
}
|
||||
|
||||
|
||||
void login(String email, String password, BuildContext context) {
|
||||
AuthService.login(email, password).then((value) {
|
||||
print("------- logged in user details ######## $value ###### --------");
|
||||
//print("------- logged in user details ######## $value ###### --------");
|
||||
if (value.isNotEmpty) {
|
||||
Navigator.pop(context);
|
||||
print("--------- user details login ----- $value");
|
||||
//print("--------- user details login ----- $value");
|
||||
changeUser(value);
|
||||
} else {
|
||||
is_loading.value = false;
|
||||
isLoading.value = false;
|
||||
Get.snackbar(
|
||||
"Failed",
|
||||
"User login failed, please try again.",
|
||||
@ -216,502 +185,171 @@ List<LatLng> getLocationsList(){
|
||||
});
|
||||
}
|
||||
|
||||
void changePassword(String oldpassword, String newpassword, BuildContext context){
|
||||
String _token = currentUser[0]['token'];
|
||||
//print("------- change password ######## ${currentUser[0]['token']} ###### --------");
|
||||
AuthService.changePassword(oldpassword, newpassword, _token).then((value){
|
||||
print("------- change password ######## $value ###### --------");
|
||||
if(value.isNotEmpty){
|
||||
is_loading.value = false;
|
||||
void changePassword(
|
||||
String oldpassword, String newpassword, BuildContext context) {
|
||||
String token = currentUser[0]['token'];
|
||||
////print("------- change password ######## ${currentUser[0]['token']} ###### --------");
|
||||
AuthService.changePassword(oldpassword, newpassword, token).then((value) {
|
||||
////print("------- change password ######## $value ###### --------");
|
||||
if (value.isNotEmpty) {
|
||||
isLoading.value = false;
|
||||
Navigator.pop(context);
|
||||
if(rog_mode.value == 1){
|
||||
if (rogMode.value == 1) {
|
||||
switchPage(AppPages.TRAVEL);
|
||||
} else {
|
||||
switchPage(AppPages.INDEX);
|
||||
}
|
||||
else{
|
||||
switchPage(AppPages.INITIAL);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'failed'.tr,
|
||||
'password_change_failed_please_try_again'.tr,
|
||||
icon: const Icon(Icons.error, 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"))
|
||||
);
|
||||
}
|
||||
'failed'.tr,
|
||||
'password_change_failed_please_try_again'.tr,
|
||||
icon: const Icon(Icons.error, 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"))
|
||||
);
|
||||
}
|
||||
});
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
});
|
||||
is_loading.value = false;
|
||||
}
|
||||
|
||||
void logout() async{
|
||||
void logout() async {
|
||||
locations.clear();
|
||||
DatabaseHelper db = DatabaseHelper.instance;
|
||||
db.deleteAllDestinations().then((value){
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
destinationController.PopulateDestinations();
|
||||
db.deleteAllDestinations().then((value) {
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
destinationController.populateDestinations();
|
||||
});
|
||||
currentUser.clear();
|
||||
cats.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void register(String email, String password, BuildContext context){
|
||||
AuthService.register(email, password).then((value){
|
||||
if(value.isNotEmpty){
|
||||
void register(String email, String password, BuildContext context) {
|
||||
AuthService.register(email, password).then((value) {
|
||||
if (value.isNotEmpty) {
|
||||
currentUser.clear();
|
||||
currentUser.add(value);
|
||||
is_loading.value = false;
|
||||
isLoading.value = false;
|
||||
Navigator.pop(context);
|
||||
loadUserDetails();
|
||||
Get.toNamed(AppPages.INITIAL);
|
||||
}else{
|
||||
is_loading.value = false;
|
||||
Get.snackbar(
|
||||
'failed'.tr,
|
||||
'user_registration_failed_please_try_again'.tr,
|
||||
icon: const Icon(Icons.error, 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"))
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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;
|
||||
Get.toNamed(AppPages.INDEX);
|
||||
} else {
|
||||
isLoading.value = false;
|
||||
Get.snackbar(
|
||||
'failed'.tr,
|
||||
'user_registration_failed_please_try_again'.tr,
|
||||
icon: const Icon(Icons.error, 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"))
|
||||
);
|
||||
}
|
||||
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 {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString("user_token", val);
|
||||
}
|
||||
|
||||
void changeUser(Map<String, dynamic> value, {bool replace = true}) {
|
||||
print("---- change user to ${value} -----");
|
||||
//print("---- change user to $value -----");
|
||||
currentUser.clear();
|
||||
currentUser.add(value);
|
||||
if(replace){
|
||||
if (replace) {
|
||||
saveToDevice(currentUser[0]["token"]);
|
||||
}
|
||||
is_loading.value = false;
|
||||
loadUserDetails();
|
||||
isLoading.value = false;
|
||||
loadLocationsBound();
|
||||
cats.clear();
|
||||
if (currentFeature.isNotEmpty) {
|
||||
getAction();
|
||||
}
|
||||
|
||||
if (currentUser.isNotEmpty) {
|
||||
rog_mode.value = 0;
|
||||
rogMode.value = 0;
|
||||
} else {
|
||||
rog_mode.value = 1;
|
||||
rogMode.value = 1;
|
||||
}
|
||||
|
||||
if (rog_mode.value == 1) {
|
||||
switchPage(AppPages.TRAVEL);
|
||||
} else {
|
||||
switchPage(AppPages.INITIAL);
|
||||
}
|
||||
//Get.toNamed(AppPages.INITIAL);
|
||||
//print('--- c rog mode --- ${rogMode.value}');
|
||||
Get.toNamed(AppPages.INDEX);
|
||||
}
|
||||
|
||||
loadUserDetailsForToken(String token) async {
|
||||
AuthService.userForToken(token).then((value) {
|
||||
print("----token val-- $value ------");
|
||||
if(value![0]["user"].isEmpty){
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
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;
|
||||
}
|
||||
AuthService.userForToken(token).then((value) {
|
||||
////print("----token val-- $value ------");
|
||||
if (value![0]["user"].isEmpty) {
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
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!);
|
||||
changeUser(value[0], replace: false);
|
||||
});
|
||||
}
|
||||
|
||||
void loadCustomLocation(String customarea) async {
|
||||
String cat = currentCat.isNotEmpty == true ? currentCat[0] : "";
|
||||
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){
|
||||
void loadLocationsBound() {
|
||||
if (isCustomAreaSelected.value == true) {
|
||||
return;
|
||||
}
|
||||
locations.clear();
|
||||
String cat = currentCat.isNotEmpty ? currentCat[0] : "";
|
||||
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
|
||||
if (currentCat.isNotEmpty && currentCat[0] == "-all-") {
|
||||
cat = "";
|
||||
}
|
||||
LatLngBounds bounds = mapController.bounds!;
|
||||
currentBound.clear();
|
||||
currentBound.add(bounds);
|
||||
//print(currentCat);
|
||||
if(bounds.southWest != null && bounds.northEast != null ){
|
||||
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){
|
||||
//print("---value length ------ ${value!.collection.length}");
|
||||
if(value == null){
|
||||
////print(currentCat);
|
||||
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) {
|
||||
////print("---value length ------ ${value!.collection.length}");
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
if(value.collection.isEmpty){
|
||||
if(showPopup == false) {
|
||||
if (value.collection.isEmpty) {
|
||||
if (showPopup == false) {
|
||||
return;
|
||||
}
|
||||
Get.snackbar(
|
||||
"Too many Points",
|
||||
"please zoom in",
|
||||
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"))
|
||||
);
|
||||
"Too many Points",
|
||||
"please zoom in",
|
||||
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"))
|
||||
);
|
||||
showPopup = false;
|
||||
//Get.showSnackbar(GetSnackBar(message: "Too many points, please zoom in",));
|
||||
}
|
||||
if(value.collection.isNotEmpty){
|
||||
//print("---- added---");
|
||||
locations.add(value);
|
||||
loadCatsv2();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (value.collection.isNotEmpty) {
|
||||
////print("---- added---");
|
||||
locations.add(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void setBound(LatLngBounds bounds){
|
||||
void setBound(LatLngBounds bounds) {
|
||||
currentBound.clear();
|
||||
currentBound.add(bounds);
|
||||
}
|
||||
|
||||
void zoomtoMainPerf(String id){
|
||||
|
||||
PerfectureService.getMainPerfExt(id).then((value){
|
||||
LatLng lat1 = LatLng(value![1], value[0]);
|
||||
LatLng lat2 = LatLng(value[3], value[2]);
|
||||
LatLngBounds bound = LatLngBounds(lat1, lat2);
|
||||
mapController.fitBounds(bound);
|
||||
setBound(bound);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void zoomtoSubPerf(String id){
|
||||
|
||||
print("zooooom");
|
||||
|
||||
PerfectureService.getSubExt(id).then((value){
|
||||
LatLng lat1 = LatLng(value![1], value[0]);
|
||||
LatLng lat2 = LatLng(value[3], value[2]);
|
||||
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();
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,9 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/model/gps_data.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/drawer/drawer_page.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/utils/database_gps.dart';
|
||||
import 'package:rogapp/widgets/list_widget.dart';
|
||||
import 'package:rogapp/widgets/map_widget.dart';
|
||||
|
||||
@ -21,16 +23,18 @@ class IndexPage extends GetView<IndexController> {
|
||||
child: Scaffold(
|
||||
drawer: DrawerPage(),
|
||||
appBar: AppBar(
|
||||
// automaticallyImplyLeading: false,
|
||||
// leading: IconButton(
|
||||
// icon: Icon(Icons.arrow_back_ios),
|
||||
// onPressed: (){
|
||||
// indexController.switchPage(AppPages.TRAVEL);
|
||||
// },
|
||||
// ),
|
||||
//automaticallyImplyLeading: false,
|
||||
title: Text("add_location".tr),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
// GpsDatabaseHelper db = GpsDatabaseHelper.instance;
|
||||
// List<GpsData> data = await db.getGPSData(
|
||||
// indexController.currentUser[0]["user"]['team_name'],
|
||||
// indexController.currentUser[0]["user"]["event_code"]);
|
||||
// print("GPS data is ${data.length}");
|
||||
Get.toNamed(AppPages.GPS);
|
||||
},
|
||||
icon: const Icon(Icons.telegram)),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.toNamed(AppPages.HISTORY);
|
||||
@ -63,118 +67,86 @@ class IndexPage extends GetView<IndexController> {
|
||||
//CatWidget(indexController: indexController,),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(right: 10.0, top: 4.0, bottom: 4.0),
|
||||
child: InkWell(
|
||||
child:
|
||||
Obx(() => destinationController.is_gps_selected == true
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 10.0, top: 4.0, bottom: 4.0),
|
||||
child: InkWell(
|
||||
child: const Image(
|
||||
image: AssetImage(
|
||||
'assets/images/route3_off.png'),
|
||||
width: 35,
|
||||
height: 35,
|
||||
),
|
||||
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);
|
||||
},
|
||||
),
|
||||
))),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// bottomNavigationBar: BottomAppBar(
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: <Widget>[
|
||||
// Obx(
|
||||
// () => destinationController.isInRog.value == true
|
||||
// ? IconButton(
|
||||
// onPressed: () {},
|
||||
// icon: const Icon(
|
||||
// Icons.run_circle,
|
||||
// size: 44,
|
||||
// color: Colors.green,
|
||||
// ))
|
||||
// : IconButton(
|
||||
// onPressed: () {},
|
||||
// icon: const Icon(
|
||||
// Icons.run_circle,
|
||||
// size: 44,
|
||||
// color: Colors.black12,
|
||||
// )),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding:
|
||||
// const EdgeInsets.only(right: 10.0, top: 4.0, bottom: 4.0),
|
||||
// child: InkWell(
|
||||
// child: Obx(() => destinationController
|
||||
// .isGpsSelected.value ==
|
||||
// true
|
||||
// ? Padding(
|
||||
// padding: const EdgeInsets.only(
|
||||
// right: 10.0, top: 4.0, bottom: 4.0),
|
||||
// child: InkWell(
|
||||
// child: const Image(
|
||||
// image:
|
||||
// AssetImage('assets/images/route3_off.png'),
|
||||
// width: 35,
|
||||
// height: 35,
|
||||
// ),
|
||||
// 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(
|
||||
onPressed: () {
|
||||
indexController.toggleMode();
|
||||
if (indexController.currentCat.isNotEmpty) {
|
||||
print(indexController.currentCat[0].toString());
|
||||
}
|
||||
},
|
||||
tooltip: 'Increment',
|
||||
elevation: 1.0,
|
||||
child: Obx(
|
||||
() => indexController.mode == 0
|
||||
() => indexController.mode.value == 0
|
||||
? const Image(image: AssetImage('assets/images/list2.png'))
|
||||
: const Image(image: AssetImage('assets/images/map.png')),
|
||||
),
|
||||
elevation: 4.0,
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
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(
|
||||
child: Obx(
|
||||
() => indexController.mode == 0
|
||||
() => indexController.mode.value == 0
|
||||
? MapWidget()
|
||||
: const ListWidget(),
|
||||
))
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
|
||||
class LoginPage extends StatelessWidget {
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
TextEditingController emailController = TextEditingController();
|
||||
@ -17,208 +15,248 @@ class LoginPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.white,
|
||||
leading:
|
||||
IconButton( onPressed: (){
|
||||
Navigator.pop(context);
|
||||
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
||||
),
|
||||
body:
|
||||
indexController.currentUser.isEmpty ?
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
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(
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
)),
|
||||
),
|
||||
body: indexController.currentUser.isEmpty
|
||||
? SizedBox(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
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.is_loading == 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.is_loading.value = true;
|
||||
indexController.login(emailController.text, passwordController.text, context);
|
||||
},
|
||||
color: Colors.indigoAccent[400],
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40)
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height / 6,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/login_image.jpg'))),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Text("ログイン",style: TextStyle(
|
||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
||||
Padding(
|
||||
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,
|
||||
),
|
||||
),
|
||||
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)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
"rogaining_user_need_tosign_up".tr,
|
||||
style: const TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
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
|
||||
),
|
||||
),
|
||||
),
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
const SizedBox(height: 5,),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Padding(
|
||||
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
|
||||
),),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
],
|
||||
),
|
||||
)
|
||||
: TextButton(
|
||||
onPressed: () {
|
||||
indexController.currentUser.clear();
|
||||
},
|
||||
child: const Text("Already Logged in, Click to logout"),
|
||||
),
|
||||
],
|
||||
),
|
||||
):
|
||||
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(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(label,style:const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black87
|
||||
),),
|
||||
const SizedBox(height: 5,),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 15, fontWeight: FontWeight.w400, color: Colors.black87),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
TextField(
|
||||
controller: controller,
|
||||
obscureText: obsureText,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: (Colors.grey[400])!,
|
||||
),
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: (Colors.grey[400])!
|
||||
borderSide: BorderSide(color: (Colors.grey[400])!),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30.0,)
|
||||
const SizedBox(
|
||||
height: 30.0,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -15,195 +15,232 @@ class LoginPopupPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.white,
|
||||
leading:
|
||||
IconButton( onPressed: (){
|
||||
Navigator.pop(context);
|
||||
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
||||
),
|
||||
body:
|
||||
indexController.currentUser.isEmpty ?
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
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(
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
)),
|
||||
),
|
||||
body: indexController.currentUser.isEmpty
|
||||
? SizedBox(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
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.is_loading == 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.is_loading.value = true;
|
||||
indexController.login(emailController.text, passwordController.text, context);
|
||||
},
|
||||
color: Colors.indigoAccent[400],
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40)
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height / 5,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/login_image.jpg'))),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Text("ログイン",style: TextStyle(
|
||||
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
|
||||
Padding(
|
||||
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,
|
||||
),
|
||||
),
|
||||
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
|
||||
),
|
||||
),
|
||||
)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
"rogaining_user_need_tosign_up".tr,
|
||||
style: const TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
const SizedBox(height: 20,),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text("rogaining_user_need_tosign_up".tr, style: const TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
],
|
||||
),
|
||||
)
|
||||
: TextButton(
|
||||
onPressed: () {
|
||||
indexController.currentUser.clear();
|
||||
},
|
||||
child: const Text("Already Logged in, Click to logout"),
|
||||
),
|
||||
],
|
||||
),
|
||||
):
|
||||
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(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(label,style:const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black87
|
||||
),),
|
||||
const SizedBox(height: 5,),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 15, fontWeight: FontWeight.w400, color: Colors.black87),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
TextField(
|
||||
controller: controller,
|
||||
obscureText: obsureText,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: (Colors.grey[400])!,
|
||||
),
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: (Colors.grey[400])!
|
||||
borderSide: BorderSide(color: (Colors.grey[400])!),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30.0,)
|
||||
const SizedBox(
|
||||
height: 30.0,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,31 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:rogapp/pages/index/index_controller.dart';
|
||||
|
||||
class MainPerfPage extends StatelessWidget {
|
||||
MainPerfPage({Key? key}) : super(key: key);
|
||||
// class MainPerfPage extends StatelessWidget {
|
||||
// MainPerfPage({Key? key}) : super(key: key);
|
||||
|
||||
IndexController indexController = Get.find<IndexController>();
|
||||
// IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Select Main Perfecture"),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: indexController.perfectures.length,
|
||||
itemBuilder: (context, index){
|
||||
return ListTile(
|
||||
onTap: (){
|
||||
indexController.dropdownValue = indexController.perfectures[index][0]["id"].toString();
|
||||
indexController.populateForPerf(indexController.dropdownValue, indexController.mapController);
|
||||
Get.back();
|
||||
},
|
||||
title: Text(indexController.perfectures[index][0]["adm1_ja"].toString()),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// title: const Text("Select Main Perfecture"),
|
||||
// ),
|
||||
// body: ListView.builder(
|
||||
// itemCount: indexController.perfectures.length,
|
||||
// itemBuilder: (context, index){
|
||||
// return ListTile(
|
||||
// onTap: (){
|
||||
// indexController.dropdownValue = indexController.perfectures[index][0]["id"].toString();
|
||||
// indexController.populateForPerf(indexController.dropdownValue, indexController.mapController);
|
||||
// Get.back();
|
||||
// },
|
||||
// title: Text(indexController.perfectures[index][0]["adm1_ja"].toString()),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@ -8,206 +8,125 @@ class PermissionHandlerScreen extends StatefulWidget {
|
||||
const PermissionHandlerScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<PermissionHandlerScreen> createState() => _PermissionHandlerScreenState();
|
||||
State<PermissionHandlerScreen> createState() =>
|
||||
_PermissionHandlerScreenState();
|
||||
}
|
||||
|
||||
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
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
//permissionServiceCall();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_checkPermissionStatus();
|
||||
});
|
||||
}
|
||||
|
||||
Future<PermissionStatus> checkLocationPermission() async {
|
||||
return await Permission.location.status;
|
||||
}
|
||||
_checkPermissionStatus() async {
|
||||
PermissionStatus status = await Permission.location.status;
|
||||
|
||||
permissionServiceCall() async {
|
||||
await permissionServices().then(
|
||||
(value) {
|
||||
if (value[Permission.location]!.isGranted ) {
|
||||
/* ========= New Screen Added ============= */
|
||||
|
||||
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 */
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
if (status.isGranted == false) {
|
||||
if (context.mounted) {
|
||||
showAlert(context);
|
||||
}
|
||||
} else if (status.isPermanentlyDenied) {
|
||||
await requestPermission();
|
||||
} else {
|
||||
if (statuses[Permission.location]!.isDenied) {
|
||||
permissionServiceCall();
|
||||
if (mounted) {
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
}
|
||||
}
|
||||
|
||||
/*{Permission.camera: PermissionStatus.granted, Permission.storage: PermissionStatus.granted}*/
|
||||
return statuses;
|
||||
}
|
||||
|
||||
|
||||
requestPermission() async {
|
||||
PermissionStatus permission = await Permission.location.status;
|
||||
if(permission == PermissionStatus.permanentlyDenied){
|
||||
showPermanentAlert(context);
|
||||
}else{
|
||||
PermissionStatus newPermission = await Permission.location.request();
|
||||
//showAlert(context);
|
||||
|
||||
if (newPermission != PermissionStatus.granted) {
|
||||
// If permission not granted, handle the issue in your own way
|
||||
exit(0);
|
||||
}
|
||||
else{
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
}
|
||||
void showAlert(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => AlertDialog(
|
||||
title: const Text('ロケーション許可'),
|
||||
content: const SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: <Widget>[
|
||||
Text('ぎふナビ "アプリへようこそ!\n'),
|
||||
Text('収集データ:\n'),
|
||||
Text(
|
||||
'岐阜ナビアプリをより快適にご利用いただくために、チェックポイントでの自動チェックインのための位置情報を収集しています。また、撮影した画像やチェックインした時間を収集し、チャレンジの勝者を決定します。\n'),
|
||||
Text('お客様のデータの使用方法:\n'),
|
||||
Text(
|
||||
'お客様のデータは、アプリを改善し、競争力のある魅力的な体験を提供するのに役立ちます。お客様の位置情報と画像は、個人を特定できない統計データとして処理され、いかなる個人情報にもリンクされないようにしています\n'),
|
||||
Text('お客様の管理:\n'),
|
||||
Text(
|
||||
'お客様はご自身のデータを完全に管理することができます。アプリの設定でいつでも同意を撤回することができます。位置情報の収集に同意しなくても、ぎふナビを楽しむことはできますが、自動チェックインや競技への参加など、一部の機能が制限されることを覚えておいてください。位置情報、画像、時刻情報の利用に同意する場合は「許可」を選択してください。許可しない場合は、「許可しない」を選択してください。あなたの選択は、アプリの他の機能を使用することに影響しません。\n'),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
ElevatedButton(
|
||||
child: const Text('OK'),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
requestPermission();
|
||||
},
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
// if (permission != PermissionStatus.granted) {
|
||||
|
||||
// }
|
||||
// If permission is granted or already was granted
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var status = Permission.location.status.then((value){
|
||||
if(value.isGranted == false){
|
||||
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();
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
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('岐阜ナビアプリではチェックポイントの自動チェックインの機能を可能にするために、現在地のデータが収集されます。アプリを閉じている時や、使用していないときにも収集されます。位置情報は、個人を特定できない統計的な情報として、ユーザーの個人情報とは一切結びつかない形で送信されます。お知らせの配信、位置情報の利用を許可しない場合は、この後表示されるダイアログで「許可しない」を選択してください。'),
|
||||
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 */
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
ElevatedButton(
|
||||
child: const Text('OK'),
|
||||
onPressed: () {
|
||||
requestPermission();
|
||||
//permissionServiceCall();
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,12 +1,9 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
|
||||
class RegisterPage extends StatelessWidget {
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
TextEditingController emailController = TextEditingController();
|
||||
@ -23,10 +20,15 @@ class RegisterPage extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.white,
|
||||
leading:
|
||||
IconButton( onPressed: (){
|
||||
Navigator.pop(context);
|
||||
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
)),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
@ -41,63 +43,79 @@ class RegisterPage extends StatelessWidget {
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
const Text ("サインアップ", style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
),),
|
||||
const SizedBox(height: 20,),
|
||||
Text("アカウントを作成し、無料です",style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[700],
|
||||
),),
|
||||
const SizedBox(height: 30,)
|
||||
const Text(
|
||||
"サインアップ",
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"アカウントを作成し、無料です",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
)
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 40
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||
child: Column(
|
||||
children: [
|
||||
makeInput(label: "Eメール", controller: emailController),
|
||||
makeInput(label: "パスワード", controller: passwordController,obsureText: true),
|
||||
makeInput(label: "パスワードを認証する", controller: confirmPasswordController,obsureText: true)
|
||||
makeInput(
|
||||
label: "パスワード",
|
||||
controller: passwordController,
|
||||
obsureText: true),
|
||||
makeInput(
|
||||
label: "パスワードを認証する",
|
||||
controller: confirmPasswordController,
|
||||
obsureText: true)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(top: 3,left: 3),
|
||||
padding: const EdgeInsets.only(top: 3, left: 3),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
border: const Border(
|
||||
bottom: BorderSide(color: Colors.black),
|
||||
top: BorderSide(color: Colors.black),
|
||||
right: BorderSide(color: Colors.black),
|
||||
left: BorderSide(color: Colors.black)
|
||||
)
|
||||
),
|
||||
left: BorderSide(color: Colors.black))),
|
||||
child: MaterialButton(
|
||||
minWidth: double.infinity,
|
||||
height:60,
|
||||
onPressed: (){
|
||||
if(passwordController.text != confirmPasswordController.text){
|
||||
height: 60,
|
||||
onPressed: () {
|
||||
if (passwordController.text !=
|
||||
confirmPasswordController.text) {
|
||||
Get.snackbar(
|
||||
"No match",
|
||||
"Passwords does not match",
|
||||
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
||||
"Passwords does not match",
|
||||
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"))
|
||||
);
|
||||
}
|
||||
if(emailController.text.isEmpty || passwordController.text.isEmpty){
|
||||
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),
|
||||
"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,
|
||||
@ -105,38 +123,43 @@ class RegisterPage extends StatelessWidget {
|
||||
);
|
||||
return;
|
||||
}
|
||||
indexController.is_loading.value = true;
|
||||
indexController.register(emailController.text, passwordController.text, context);
|
||||
indexController.isLoading.value = true;
|
||||
indexController.register(emailController.text,
|
||||
passwordController.text, context);
|
||||
},
|
||||
color: Colors.redAccent,
|
||||
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(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Flexible(child: Text("すでにアカウントをお持ちですか?")),
|
||||
TextButton(
|
||||
onPressed: (){
|
||||
onPressed: () {
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
},
|
||||
child: const Text("ログイン",style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 18
|
||||
),),
|
||||
child: const Text(
|
||||
"ログイン",
|
||||
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(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(label,style:const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black87
|
||||
),),
|
||||
const SizedBox(height: 5,),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 15, fontWeight: FontWeight.w400, color: Colors.black87),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
TextField(
|
||||
controller: controller,
|
||||
obscureText: obsureText,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: (Colors.grey[400])!,
|
||||
),
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: (Colors.grey[400])!
|
||||
borderSide: BorderSide(color: (Colors.grey[400])!),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30,)
|
||||
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_typeahead/flutter_typeahead.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/pages/search/search_controller.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_new.dart';
|
||||
@ -84,6 +86,8 @@ class SearchPage extends StatelessWidget {
|
||||
onSuggestionSelected: (GeoJsonFeature suggestion) {
|
||||
indexController.currentFeature.clear();
|
||||
indexController.currentFeature.add(suggestion);
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
Destination des = destinationController.festuretoDestination(suggestion);
|
||||
Get.back();
|
||||
showModalBottomSheet(
|
||||
constraints:
|
||||
@ -91,7 +95,7 @@ class SearchPage extends StatelessWidget {
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
//builder: (context) => BottomSheetWidget(),
|
||||
builder: ((context) => BottomSheetNew()));
|
||||
builder: ((context) => BottomSheetNew(destination: des,)));
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
22
lib/provider/game_state_provider.dart
Normal file
@ -0,0 +1,22 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:rogapp/model/game_state_instance.dart';
|
||||
|
||||
final gameStateNotifierProvider =
|
||||
StateNotifierProvider<GameStaticState, GameInsStatetance>((ref) {
|
||||
return GameStaticState();
|
||||
});
|
||||
|
||||
class GameStaticState extends StateNotifier<GameInsStatetance> {
|
||||
GameStaticState() : super(GameInsStatetance());
|
||||
|
||||
@override
|
||||
GameInsStatetance get state => super.state;
|
||||
|
||||
void startGame(GameInsStatetance gi) {
|
||||
state = gi;
|
||||
}
|
||||
|
||||
void doCheckin() {}
|
||||
|
||||
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,10 @@
|
||||
import 'package:get/get.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/changepassword/change_password_page.dart';
|
||||
import 'package:rogapp/pages/city/city_page.dart';
|
||||
import 'package:rogapp/pages/destination/destination_binding.dart';
|
||||
import 'package:rogapp/pages/destination/destination_page.dart';
|
||||
import 'package:rogapp/pages/gps/gps_page.dart';
|
||||
import 'package:rogapp/pages/history/history_page.dart';
|
||||
import 'package:rogapp/pages/home/home_binding.dart';
|
||||
import 'package:rogapp/pages/home/home_page.dart';
|
||||
@ -24,13 +23,11 @@ import 'package:rogapp/pages/subperf/subperf_page.dart';
|
||||
import 'package:rogapp/spa/spa_binding.dart';
|
||||
import 'package:rogapp/spa/spa_page.dart';
|
||||
|
||||
|
||||
part 'app_routes.dart';
|
||||
|
||||
class AppPages {
|
||||
|
||||
// ignore: constant_identifier_names
|
||||
static const INITIAL = Routes.INDEX;
|
||||
static const INDEX = Routes.INDEX;
|
||||
// ignore: constant_identifier_names
|
||||
static const SPA = Routes.SPA;
|
||||
static const LANDING = Routes.LANDING;
|
||||
@ -50,28 +47,14 @@ class AppPages {
|
||||
static const CAMERA_PAGE = Routes.CAMERA_PAGE;
|
||||
static const PROGRESS = Routes.PROGRESS;
|
||||
static const HISTORY = Routes.HISTORY;
|
||||
static const GPS = Routes.GPS;
|
||||
|
||||
static final routes = [
|
||||
// GetPage(
|
||||
// name: Routes.HOME,
|
||||
// page: () => HomePage(),
|
||||
// binding: HomeBinding(),
|
||||
// ),
|
||||
// GetPage(
|
||||
// name: Routes.MAP,
|
||||
// page: () => MapPage(),
|
||||
// binding: MapBinding(),
|
||||
// )
|
||||
GetPage(
|
||||
name: Routes.INDEX,
|
||||
page: () => IndexPage(),
|
||||
//binding: IndexBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.SPA,
|
||||
page: () => const SpaPage(),
|
||||
binding: SpaBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.LANDING,
|
||||
page: () => const LandingPage(),
|
||||
@ -87,21 +70,11 @@ class AppPages {
|
||||
page: () => RegisterPage(),
|
||||
//binding: SpaBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.TRAVEL,
|
||||
page: () => DestnationPage(),
|
||||
binding: DestinationBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.LOADING,
|
||||
page: () => const LoadingPage(),
|
||||
//binding: DestinationBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.DESTINATION_MAP,
|
||||
page: () => DestnationPage(),
|
||||
//binding: DestinationBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.HOME,
|
||||
page: () => const HomePage(),
|
||||
@ -116,30 +89,14 @@ class AppPages {
|
||||
page: () => SearchPage(),
|
||||
binding: SearchBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.MAINPERF,
|
||||
page: () => MainPerfPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.SUBPERF,
|
||||
page: () => SubPerfPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.CITY,
|
||||
page: () => const CityPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.CATEOGORY,
|
||||
page: () => const CategoryPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.CHANGE_PASSWORD,
|
||||
page: () => ChangePasswordPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.CAMERA_PAGE,
|
||||
page: () => CameraPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.PROGRESS,
|
||||
page: () => const ProgressPage(),
|
||||
@ -147,6 +104,10 @@ class AppPages {
|
||||
GetPage(
|
||||
name: Routes.HISTORY,
|
||||
page: () => const HistoryPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.GPS,
|
||||
page: () => const GpsPage(),
|
||||
)
|
||||
];
|
||||
}
|
||||
@ -25,4 +25,5 @@ abstract class Routes {
|
||||
static const CAMERA_PAGE = '/camera_page';
|
||||
static const PROGRESS = '/progress';
|
||||
static const HISTORY = '/history';
|
||||
static const GPS = '/gp';
|
||||
}
|
||||
|
||||
@ -2,23 +2,21 @@ import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:rogapp/utils/const.dart';
|
||||
|
||||
|
||||
class ActionService{
|
||||
|
||||
static Future<Map<String, dynamic>> makeAction(int userId, int locationId, bool wanttogo, bool like, bool checkin) async {
|
||||
print("----- action is ---- $like-- $wanttogo-- $checkin");
|
||||
class ActionService {
|
||||
static Future<Map<String, dynamic>> makeAction(int userId, int locationId,
|
||||
bool wanttogo, bool like, bool checkin) async {
|
||||
//print("----- action is ---- $like-- $wanttogo-- $checkin");
|
||||
Map<String, dynamic> cats = {};
|
||||
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}";
|
||||
print('++++++++$url');
|
||||
print("url is ------ $url");
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
}
|
||||
);
|
||||
//print('++++++++$url');
|
||||
//print("url is ------ $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) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
@ -26,27 +24,23 @@ class ActionService{
|
||||
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 = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/useraction/?user_id=$userId&location_id=$locationId';
|
||||
print('++++++++$url');
|
||||
String 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}';
|
||||
final response = await http.get(Uri.parse(url),
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return cats;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,16 +1,69 @@
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:rogapp/model/auth_user.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 = {};
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/change-password/';
|
||||
print('++++++++$url');
|
||||
//print('++++++++$url');
|
||||
final http.Response response = await http.put(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
@ -24,28 +77,25 @@ class AuthService{
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
changePassword = json.decode(utf8.decode(response.bodyBytes));
|
||||
changePassword = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return changePassword;
|
||||
}
|
||||
|
||||
|
||||
static Future<Map<String, dynamic>> login(String email, String password) async {
|
||||
print("------- in logged email $email pwd $password ###### --------");
|
||||
static Future<Map<String, dynamic>> login(
|
||||
String email, String password) async {
|
||||
//print("------- in logged email $email pwd $password ###### --------");
|
||||
Map<String, dynamic> cats = {};
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/login/';
|
||||
print('++++++++$url');
|
||||
//print('++++++++$url');
|
||||
//String url = 'http://localhost:8100/api/login/';
|
||||
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
|
||||
}),
|
||||
body: jsonEncode(<String, String>{'email': email, 'password': password}),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
@ -54,41 +104,36 @@ class AuthService{
|
||||
return cats;
|
||||
}
|
||||
|
||||
|
||||
static Future<Map<String, dynamic>> register(String email, String password) async {
|
||||
static Future<Map<String, dynamic>> register(
|
||||
String email, String password) async {
|
||||
Map<String, dynamic> cats = {};
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/register/';
|
||||
print('++++++++$url');
|
||||
//print('++++++++$url');
|
||||
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
|
||||
}),
|
||||
body: jsonEncode(<String, String>{'email': email, 'password': password}),
|
||||
);
|
||||
print(response.body);
|
||||
//print(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return cats;
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> deleteUser(String token) async {
|
||||
static Future<Map<String, dynamic>> deleteUser(String token) async {
|
||||
Map<String, dynamic> cats = {};
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/delete-account/';
|
||||
print('++++++++$url');
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Token $token'
|
||||
}
|
||||
);
|
||||
//print('++++++++$url');
|
||||
final http.Response response =
|
||||
await http.get(Uri.parse(url), headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Token $token'
|
||||
});
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
@ -96,50 +141,45 @@ class AuthService{
|
||||
return cats;
|
||||
}
|
||||
|
||||
|
||||
static Future<List<dynamic>?> UserDetails(int userid) async {
|
||||
static Future<List<dynamic>?> userDetails(int userid) async {
|
||||
List<dynamic> cats = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/userdetials?user_id=$userid';
|
||||
print('++++++++$url');
|
||||
print("---- UserDetails url is $url");
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
//print("---- UserDetails url is $url");
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return cats;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static Future<List<dynamic>?> userForToken(String token) async {
|
||||
Map<String, dynamic> cats = {};
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/user/';
|
||||
print('++++++++$url');
|
||||
print("---- UserDetails url is $url");
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
//print("---- UserDetails url is $url");
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Token $token'
|
||||
'Authorization': 'Token $token'
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
print("--- eeeeee $cats ----");
|
||||
//print("--- eeeeee $cats ----");
|
||||
}
|
||||
return [{"user":cats}];
|
||||
return [
|
||||
{"user": cats, "token": token}
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -3,50 +3,42 @@ import 'package:http/http.dart' as http;
|
||||
|
||||
import '../utils/const.dart';
|
||||
|
||||
|
||||
class CatService{
|
||||
|
||||
static Future<List<dynamic>?> loadCats(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3, double lat4, double lon4) async {
|
||||
class CatService {
|
||||
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 = [];
|
||||
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';
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
String url =
|
||||
'$serverUrl/api/cats/?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>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return cats;
|
||||
}
|
||||
|
||||
|
||||
static Future<List<dynamic>?> loadCatByCity(String cityname)async {
|
||||
static Future<List<dynamic>?> loadCatByCity(String cityname) async {
|
||||
List<dynamic> cats = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/catbycity/?$cityname';
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return cats;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -8,20 +8,16 @@ import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
|
||||
import '../utils/const.dart';
|
||||
|
||||
|
||||
class DestinationService{
|
||||
|
||||
static Future<List<dynamic>> getDestinations(int userId) async {
|
||||
class DestinationService {
|
||||
static Future<List<dynamic>> getDestinations(int userId) async {
|
||||
List<dynamic> cats = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = "$serverUrl/api/destinations/?user_id=$userId";
|
||||
print('++++++++$url');
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
}
|
||||
);
|
||||
//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) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
@ -29,36 +25,33 @@ class DestinationService{
|
||||
return cats;
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> deleteDestination(int destId) async {
|
||||
static Future<Map<String, dynamic>> deleteDestination(int destId) async {
|
||||
Map<String, dynamic> cats = {};
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = "$serverUrl/api/delete_destination/?dest_id=$destId";
|
||||
print('++++++++$url');
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
}
|
||||
);
|
||||
//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) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
print("####### ---- $cats");
|
||||
//print("####### ---- $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;
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = "$serverUrl/api/updateorder/?user_action_id=$actionId&order=$order&dir=$dir";
|
||||
print('++++++++$url');
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
}
|
||||
);
|
||||
String url =
|
||||
"$serverUrl/api/updateorder/?user_action_id=$actionId&order=$order&dir=$dir";
|
||||
//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) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
@ -66,23 +59,25 @@ class DestinationService{
|
||||
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();
|
||||
|
||||
if(destinations.isEmpty){
|
||||
if (destinations.isEmpty) {
|
||||
return [];
|
||||
}
|
||||
|
||||
//print("##### @@@@@ ${destinations[0].lat}");
|
||||
PointLatLng origin = PointLatLng(destinations[0].lat!, destinations[0].lon!);
|
||||
PointLatLng dest = PointLatLng(destinations[destinations.length -1].lat!, destinations[destinations.length -1].lon!);
|
||||
|
||||
PointLatLng origin =
|
||||
PointLatLng(destinations[0].lat!, destinations[0].lon!);
|
||||
PointLatLng dest = PointLatLng(destinations[destinations.length - 1].lat!,
|
||||
destinations[destinations.length - 1].lon!);
|
||||
|
||||
List<PolylineWayPoint> wayPoints = [];
|
||||
int i=0;
|
||||
for(dynamic d in destinations){
|
||||
if(i == 0 || i == (destinations.length -1)){
|
||||
i+=1;
|
||||
int i = 0;
|
||||
for (dynamic d in destinations) {
|
||||
if (i == 0 || i == (destinations.length - 1)) {
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
double la = d.lat;
|
||||
@ -90,31 +85,31 @@ class DestinationService{
|
||||
|
||||
int j = 0;
|
||||
|
||||
PolylineWayPoint pwp = PolylineWayPoint(location: "$la,$ln", stopOver: false);
|
||||
|
||||
PolylineWayPoint pwp =
|
||||
PolylineWayPoint(location: "$la,$ln", stopOver: false);
|
||||
|
||||
//print("----- UUUUUU ${pwp}");
|
||||
//PointLatLng wp = PointLatLng(d["Location"]["geometry"][0][1], d["Location"]["geometry"][0][0]);
|
||||
wayPoints.add(pwp);
|
||||
i+=1;
|
||||
i += 1;
|
||||
j += 4;
|
||||
}
|
||||
|
||||
final DestinationController destinationController = Get.find<DestinationController>();
|
||||
int travMode = destinationController.travelMode.value;
|
||||
String _mode = "WALKING";
|
||||
if(travMode == 1){
|
||||
//_mode = TravelMode.driving;
|
||||
_mode = "DRIVING";
|
||||
}
|
||||
else if(travMode == 2) {
|
||||
//_mode = TravelMode.transit;
|
||||
_mode = "TRANSIT";
|
||||
}
|
||||
|
||||
final DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
// int travMode = destinationController.travelMode.value;
|
||||
// String mode = "WALKING";
|
||||
// if (travMode == 1) {
|
||||
// //_mode = TravelMode.driving;
|
||||
// mode = "DRIVING";
|
||||
// } else if (travMode == 2) {
|
||||
// //_mode = TravelMode.transit;
|
||||
// mode = "TRANSIT";
|
||||
// }
|
||||
|
||||
//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("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);
|
||||
@ -122,7 +117,4 @@ class DestinationService{
|
||||
//print("#####@@@@@ ${result.points}");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -5,9 +5,11 @@ import 'package:intl/intl.dart';
|
||||
import 'package:rogapp/model/rog.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/utils/database_gps.dart';
|
||||
import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import '../model/gps_data.dart';
|
||||
import '../utils/const.dart';
|
||||
|
||||
//
|
||||
@ -17,287 +19,412 @@ import '../utils/const.dart';
|
||||
class ExternalService {
|
||||
static final ExternalService _instance = ExternalService._internal();
|
||||
|
||||
factory ExternalService(){
|
||||
factory ExternalService() {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
ExternalService._internal();
|
||||
|
||||
String getFormatedTime(DateTime datetime){
|
||||
return DateFormat('yyyy-MM-dd HH:mm:ss').format(datetime);
|
||||
String getFormatedTime(DateTime 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>();
|
||||
|
||||
Map<String, dynamic> _res = {};
|
||||
Map<String, dynamic> res = {};
|
||||
|
||||
int userId = indexController.currentUser[0]["user"]["id"];
|
||||
//print("--- Pressed -----");
|
||||
String _team = indexController.currentUser[0]["user"]['team_name'];
|
||||
String team = indexController.currentUser[0]["user"]['team_name'];
|
||||
//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;
|
||||
Rog _rog = Rog(
|
||||
id:1,
|
||||
team_name: _team,
|
||||
event_code : _event_code,
|
||||
user_id: userId,
|
||||
cp_number: -1,
|
||||
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
||||
image: null,
|
||||
rog_action_type: 0
|
||||
);
|
||||
db.insertRogaining(_rog);
|
||||
}
|
||||
else {
|
||||
Rog rog = Rog(
|
||||
id: 1,
|
||||
team_name: team,
|
||||
event_code: eventCode,
|
||||
user_id: userId,
|
||||
cp_number: -1,
|
||||
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
||||
image: null,
|
||||
rog_action_type: 0);
|
||||
db.insertRogaining(rog);
|
||||
} else {
|
||||
String url = 'https://rogaining.sumasen.net/gifuroge/start_from_rogapp';
|
||||
print('++++++++$url');
|
||||
//print('++++++++$url');
|
||||
final http.Response response = await http.post(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
body: jsonEncode(<String, String>{
|
||||
'team_name': _team,
|
||||
'event_code': _event_code
|
||||
}),
|
||||
body: jsonEncode(
|
||||
<String, String>{'team_name': team, 'event_code': eventCode}),
|
||||
);
|
||||
|
||||
print("---- start rogianing api status ---- ${response.statusCode}");
|
||||
//print("---- start rogianing api status ---- ${response.statusCode}");
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
_res = json.decode(utf8.decode(response.bodyBytes));
|
||||
print('----_res : $_res ----');
|
||||
res = json.decode(utf8.decode(response.bodyBytes));
|
||||
//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(
|
||||
int userId,
|
||||
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}");
|
||||
Map<String, dynamic> _res = {};
|
||||
Map<String, dynamic> res = {};
|
||||
String url = 'https://rogaining.sumasen.net/gifuroge/checkin_from_rogapp';
|
||||
print('++++++++$url');
|
||||
//print('++++++++$url');
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
if(imageurl != null){
|
||||
|
||||
if(indexController.connectionStatusName != "wifi" && indexController.connectionStatusName != "mobile"){
|
||||
if (imageurl != null) {
|
||||
if (indexController.connectionStatusName.value != "wifi" &&
|
||||
indexController.connectionStatusName.value != "mobile") {
|
||||
DatabaseHelper db = DatabaseHelper.instance;
|
||||
Rog _rog = Rog(
|
||||
id:1,
|
||||
Rog rog = Rog(
|
||||
id: 1,
|
||||
team_name: teamname,
|
||||
event_code : eventcode,
|
||||
event_code: eventcode,
|
||||
user_id: userId,
|
||||
cp_number: cp,
|
||||
checkintime: DateTime.now().toUtc().microsecondsSinceEpoch,
|
||||
image: imageurl,
|
||||
rog_action_type: 1,
|
||||
);
|
||||
db.insertRogaining(_rog);
|
||||
}
|
||||
else {
|
||||
db.insertRogaining(rog);
|
||||
} else {
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url1 = "$serverUrl/api/checkinimage/";
|
||||
final im1Bytes = File(imageurl).readAsBytesSync();
|
||||
String im1_64 = base64Encode(im1Bytes);
|
||||
|
||||
//print("~~~~ before calling api 1 ~~~~");
|
||||
|
||||
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,
|
||||
'checkinimage' : im1_64,
|
||||
'checkintime' : checkinTime,
|
||||
'cp_number' : cp.toString()
|
||||
}),
|
||||
);
|
||||
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,
|
||||
'checkinimage': im1_64,
|
||||
'checkintime': checkinTime,
|
||||
'cp_number': cp.toString()
|
||||
}),
|
||||
);
|
||||
|
||||
_res = json.decode(utf8.decode(response.bodyBytes));
|
||||
res = json.decode(utf8.decode(response.bodyBytes));
|
||||
//print("~~~~ api1 result $res ~~~~");
|
||||
//print("-----@@@@@ checkin $_res -----");
|
||||
|
||||
print("-----@@@@@ $_res -----");
|
||||
|
||||
if(response.statusCode == 201){
|
||||
//print('---- toekn is ${token} -----');
|
||||
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("--json-- $vv");
|
||||
print("--- checnin response ${response2.statusCode}----");
|
||||
if (response2.statusCode == 200) {
|
||||
_res = json.decode(utf8.decode(response2.bodyBytes));
|
||||
print('----checkin res _res : $_res ----');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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 ----');
|
||||
}
|
||||
}
|
||||
}
|
||||
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"]} ----');
|
||||
if (response.statusCode == 201) {
|
||||
//print("~~~~ image from api1 ${res["checkinimage"].toString()} ~~~~");
|
||||
//print('---- toekn is ${token} -----');
|
||||
//print("~~~~ token is $token ~~~~");
|
||||
//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,
|
||||
'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));
|
||||
'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("エラーがおきました", "サーバーに更新できませんでした");
|
||||
}
|
||||
}
|
||||
//}
|
||||
destinationController.resetRogaining();
|
||||
return _res2;
|
||||
} else {
|
||||
if (indexController.connectionStatusName.value != "wifi" ||
|
||||
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 {
|
||||
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),
|
||||
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"
|
||||
}),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
_res = json.decode(utf8.decode(response.bodyBytes));
|
||||
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(
|
||||
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;
|
||||
}
|
||||
|
||||
Future<bool> removeCheckin(int cp) async {
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
//int userId = indexController.currentUser[0]["user"]["id"];
|
||||
//print("--- Pressed -----");
|
||||
String team = indexController.currentUser[0]["user"]['team_name'];
|
||||
//print("--- _team : ${_team}-----");
|
||||
String eventCode = indexController.currentUser[0]["user"]["event_code"];
|
||||
|
||||
if (indexController.connectionStatusName.value != "wifi" &&
|
||||
indexController.connectionStatusName.value != "mobile") {
|
||||
return Future.value(false);
|
||||
} else {
|
||||
String url =
|
||||
'https://rogaining.sumasen.net/gifuroge/remove_checkin_from_rogapp';
|
||||
//print('++++++++$url');
|
||||
final http.Response response = await http.post(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
body: jsonEncode(<String, String>{
|
||||
'event_code': eventCode,
|
||||
'team_name': team,
|
||||
'cp_number': cp.toString()
|
||||
}),
|
||||
);
|
||||
|
||||
//print("---- remove checkin ---- ${response.statusCode}");
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return Future.value(true);
|
||||
//print('----_res : $res ----');
|
||||
}
|
||||
}
|
||||
return Future.value(false);
|
||||
}
|
||||
|
||||
String timestampToTimeString(int timestamp) {
|
||||
// Convert timestamp to DateTime and format it as needed
|
||||
var dateTime = DateTime.fromMillisecondsSinceEpoch(timestamp);
|
||||
//print("^^^^ time ${dateTime}");
|
||||
// Format dateTime to a time string (e.g., '12:00:00')
|
||||
// Adjust the format as needed
|
||||
return "${dateTime.hour}:${dateTime.minute}:${dateTime.second}";
|
||||
}
|
||||
|
||||
Future<bool> pushGPS() async {
|
||||
//print("^^^^ pushed ^^^");
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
//int userId = indexController.currentUser[0]["user"]["id"];
|
||||
//print("--- Pressed -----");
|
||||
String team = indexController.currentUser[0]["user"]['team_name'];
|
||||
//print("--- _team : ${_team}-----");
|
||||
String eventCode = indexController.currentUser[0]["user"]["event_code"];
|
||||
|
||||
List<GpsData> gpsDataList = [];
|
||||
|
||||
if (indexController.connectionStatusName.value != "wifi" &&
|
||||
indexController.connectionStatusName.value != "mobile") {
|
||||
return Future.value(false);
|
||||
} else {
|
||||
// Step 1: Fetch data from the local database
|
||||
gpsDataList =
|
||||
await GpsDatabaseHelper.instance.getUnsyncedGPSData(team, eventCode);
|
||||
|
||||
// Step 2: Transform data into the required format
|
||||
var payload = {
|
||||
'team_name': team,
|
||||
'event_code': eventCode,
|
||||
'waypoints': gpsDataList.map((gpsData) {
|
||||
return {
|
||||
'latitude': gpsData.lat.toString(),
|
||||
'longitude': gpsData.lon.toString(),
|
||||
// Convert the timestamp to a formatted time string
|
||||
'time': timestampToTimeString(gpsData.created_at),
|
||||
};
|
||||
}).toList(),
|
||||
};
|
||||
|
||||
//print("calling push gps step 2 ${payload}");
|
||||
|
||||
String urlS =
|
||||
'https://rogaining.sumasen.net/gifuroge/get_waypoint_datas_from_rogapp';
|
||||
//print('++++++++$url');
|
||||
var url = Uri.parse(urlS); // Replace with your server URL
|
||||
var response = await http.post(
|
||||
url,
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: json.encode(payload),
|
||||
);
|
||||
|
||||
//print("GPS Data res ${response.statusCode}");
|
||||
if (response.statusCode == 200) {
|
||||
// Handle success
|
||||
// make local data as synced
|
||||
await GpsDatabaseHelper.instance.setSyncData(gpsDataList);
|
||||
//print("GPS Data sent successfully");
|
||||
} else {
|
||||
// Handle error
|
||||
//print("Failed to send data");
|
||||
}
|
||||
}
|
||||
return Future.value(false);
|
||||
}
|
||||
|
||||
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';
|
||||
|
||||
class LocationLineService{
|
||||
|
||||
static Future<GeoJsonFeature?> loadLocationLines() async {
|
||||
class LocationLineService {
|
||||
static Future<GeoJsonFeature?> loadLocationLines() async {
|
||||
final geo = GeoJson();
|
||||
GeoJsonFeature? fs;
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/location_line/';
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
geo.processedFeatures.listen((fst) {
|
||||
fs = fst;
|
||||
});
|
||||
|
||||
await geo.parse(response.body, verbose:true);
|
||||
await geo.parse(response.body, verbose: true);
|
||||
|
||||
return fs;
|
||||
|
||||
} else {
|
||||
throw Exception('Failed to create album.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,34 +3,31 @@ import 'package:http/http.dart' as http;
|
||||
|
||||
import '../utils/const.dart';
|
||||
|
||||
class LocationPolygonervice{
|
||||
|
||||
static Future<GeoJsonFeature?> loadLocationLines() async {
|
||||
class LocationPolygonervice {
|
||||
static Future<GeoJsonFeature?> loadLocationLines() async {
|
||||
final geo = GeoJson();
|
||||
GeoJsonFeature? fs;
|
||||
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/location_polygon/';
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
geo.processedFeatures.listen((fst) {
|
||||
fs = fst;
|
||||
});
|
||||
|
||||
await geo.parse(response.body, verbose:true);
|
||||
await geo.parse(response.body, verbose: true);
|
||||
|
||||
return fs;
|
||||
|
||||
} else {
|
||||
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/utils/const.dart';
|
||||
|
||||
class LocationService{
|
||||
|
||||
class LocationService {
|
||||
// static Future<GeoJsonFeatureCollection?> loadLocations() async {
|
||||
|
||||
// final IndexController indexController = Get.find<IndexController>();
|
||||
@ -34,42 +33,42 @@ class LocationService{
|
||||
// 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>();
|
||||
String url = "";
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
|
||||
if(cat.isNotEmpty){
|
||||
if(indexController.currentUser.isNotEmpty){
|
||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||
String r = _rog == true ? 'True': 'False';
|
||||
if (cat.isNotEmpty) {
|
||||
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 + '&cat=' + cat;
|
||||
url = '$serverUrl/api/inperf/?rog=$r&perf=$perfecture&cat=$cat';
|
||||
} else {
|
||||
url = '$serverUrl/api/inperf/?perf=$perfecture&cat=$cat';
|
||||
}
|
||||
else {
|
||||
url = '$serverUrl/api/inperf/?perf=' + perfecture + '&cat=' + cat;
|
||||
} 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'];
|
||||
url = '$serverUrl/api/inperf/?rog=$r&perf=$perfecture';
|
||||
} else {
|
||||
url = '$serverUrl/api/inperf/?perf=$perfecture';
|
||||
}
|
||||
}
|
||||
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'];
|
||||
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),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
GeoJsonFeatureCollection cc = await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
GeoJsonFeatureCollection cc =
|
||||
await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
//print(cc);
|
||||
return cc; //featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
@ -80,97 +79,104 @@ class LocationService{
|
||||
List<dynamic> ext = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/locsext/';
|
||||
print('++++++++$url');
|
||||
//print('++++++++$url');
|
||||
final response = await http.post(Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Token $token'
|
||||
},
|
||||
body: jsonEncode(<String, String>{
|
||||
'token': token,
|
||||
})
|
||||
);
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Token $token'
|
||||
},
|
||||
body: jsonEncode(<String, String>{
|
||||
'token': token,
|
||||
}));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
ext = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return ext;
|
||||
}
|
||||
|
||||
|
||||
static Future<GeoJsonFeatureCollection?> loadLocationsSubFor(String subperfecture, String cat) async {
|
||||
static Future<GeoJsonFeatureCollection?> loadLocationsSubFor(
|
||||
String subperfecture, String cat) async {
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
String url = "";
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
if(cat.isNotEmpty){
|
||||
if(indexController.currentUser.isNotEmpty){
|
||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||
String r = _rog == true ? 'True': 'False';
|
||||
if (cat.isNotEmpty) {
|
||||
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 + '&cat=' + cat;
|
||||
url = '$serverUrl/api/insubperf?rog=$r&subperf=$subperfecture&cat=$cat';
|
||||
} else {
|
||||
url = '$serverUrl/api/insubperf?subperf=$subperfecture&cat=$cat';
|
||||
}
|
||||
else{
|
||||
url = '$serverUrl/api/insubperf?subperf=' + subperfecture + '&cat=' + cat;
|
||||
} 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'];
|
||||
url = '$serverUrl/api/insubperf?rog=$r&subperf=$subperfecture';
|
||||
} else {
|
||||
url = '$serverUrl/api/insubperf?subperf=$subperfecture';
|
||||
}
|
||||
}
|
||||
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'];
|
||||
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),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
GeoJsonFeatureCollection cc = await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
GeoJsonFeatureCollection cc =
|
||||
await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
//print(cc);
|
||||
return cc; //featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
static Future<GeoJsonFeatureCollection?> loadLocationsBound(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3, double lat4, double lon4, String cat) async {
|
||||
print("-------- in location for bound -------------");
|
||||
static Future<GeoJsonFeatureCollection?> loadLocationsBound(
|
||||
double lat1,
|
||||
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>();
|
||||
String url = "";
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
if(cat.isNotEmpty){
|
||||
if(indexController.currentUser.isNotEmpty){
|
||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||
String r = _rog == true ? 'True': 'False';
|
||||
if (cat.isNotEmpty) {
|
||||
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/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{
|
||||
url = '$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4' '&cat=' + cat;
|
||||
} 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'];
|
||||
//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{
|
||||
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';
|
||||
}
|
||||
}
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
@ -181,11 +187,11 @@ class LocationService{
|
||||
}
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
GeoJsonFeatureCollection cc = await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
if(cc.collection.isEmpty){
|
||||
GeoJsonFeatureCollection cc =
|
||||
await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
if (cc.collection.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
//print("---- feature got from server is ${cc.collection[0].properties} ------");
|
||||
return cc;
|
||||
}
|
||||
@ -193,39 +199,37 @@ class LocationService{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
static Future<GeoJsonFeatureCollection?> loadCustomLocations(String name, String cat) async {
|
||||
static Future<GeoJsonFeatureCollection?> loadCustomLocations(
|
||||
String name, String cat) async {
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
String url = "";
|
||||
if(cat == "-all-"){
|
||||
if (cat == "-all-") {
|
||||
cat = "";
|
||||
}
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
print("loadCustomLocations url is ----- $cat");
|
||||
if(cat.isNotEmpty){
|
||||
if(indexController.currentUser.isNotEmpty){
|
||||
bool _rog = indexController.currentUser[0]['user']['is_rogaining'];
|
||||
String r = _rog == true ? 'True': 'False';
|
||||
//print("loadCustomLocations url is ----- $cat");
|
||||
if (cat.isNotEmpty) {
|
||||
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/custom_area/?rog=$r&&cat=' + cat;
|
||||
url = '$serverUrl/api/custom_area/?rog=$r&&cat=$cat';
|
||||
} else {
|
||||
url = '$serverUrl/api/custom_area/?&cat=$cat';
|
||||
}
|
||||
else{
|
||||
url = '$serverUrl/api/custom_area/?&cat=' + cat;
|
||||
}
|
||||
}
|
||||
else{
|
||||
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'];
|
||||
url = '$serverUrl/api/customarea?rog=$r&name=$name';
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
url = '$serverUrl/api/customarea?name=$name';
|
||||
}
|
||||
}
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
@ -236,18 +240,14 @@ class LocationService{
|
||||
}
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
GeoJsonFeatureCollection cc = await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
if(cc.collection.isEmpty){
|
||||
GeoJsonFeatureCollection cc =
|
||||
await featuresFromGeoJson(utf8.decode(response.bodyBytes));
|
||||
if (cc.collection.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return cc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,73 +1,66 @@
|
||||
|
||||
import 'dart:convert';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
|
||||
|
||||
class MatrixService{
|
||||
|
||||
static Future<Map<String, dynamic>> getDestinations(List<Destination> destinations) async {
|
||||
|
||||
final DestinationController destinationController = Get.find<DestinationController>();
|
||||
class MatrixService {
|
||||
static Future<Map<String, dynamic>> getDestinations(
|
||||
List<Destination> destinations) async {
|
||||
final DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
|
||||
String locs = "";
|
||||
String origin = "";
|
||||
String destination = "";
|
||||
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}";
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(i == (destinations.length - 1)){
|
||||
if (i == (destinations.length - 1)) {
|
||||
destination = "${d.lat}, ${d.lon}";
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
print("lat is ${d.lat}, long is ${d.lon}");
|
||||
//print("lat is ${d.lat}, long is ${d.lon}");
|
||||
locs += "${d.lat}, ${d.lon}|";
|
||||
i++;
|
||||
}
|
||||
|
||||
locs = "optimize:false|$locs";
|
||||
|
||||
String _mode = "walking";
|
||||
String mode = "walking";
|
||||
switch (destinationController.travelMode.value) {
|
||||
case 1:
|
||||
_mode = "driving";
|
||||
mode = "driving";
|
||||
break;
|
||||
case 2:
|
||||
_mode = "transit";
|
||||
break;
|
||||
mode = "transit";
|
||||
break;
|
||||
default:
|
||||
_mode = "walking";
|
||||
mode = "walking";
|
||||
break;
|
||||
}
|
||||
|
||||
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";
|
||||
print('++++++++$url');
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
}
|
||||
);
|
||||
String url =
|
||||
"https://maps.googleapis.com/maps/api/directions/json?destination=$destination&mode=$mode&waypoints=$locs&origin=$origin&key=AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE";
|
||||
//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) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return cats;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2,22 +2,20 @@ import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:rogapp/utils/const.dart';
|
||||
|
||||
|
||||
class PerfectureService{
|
||||
|
||||
class PerfectureService {
|
||||
static Future<List<dynamic>?> loadPerfectures() async {
|
||||
List<dynamic> perfs = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/perf_main/';
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return perfs;
|
||||
@ -26,35 +24,34 @@ class PerfectureService{
|
||||
static Future<List<dynamic>?> loadSubPerfectures(String area) async {
|
||||
List<dynamic> perfs = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/subperfinmain/?area=' + area;
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
String url = '$serverUrl/api/subperfinmain/?area=$area';
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return perfs;
|
||||
}
|
||||
|
||||
|
||||
static Future<List<dynamic>?> getMainPerfExt(String id) async {
|
||||
List<dynamic> perfs = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/mainperfext/?perf=' + id;
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
String url = '$serverUrl/api/mainperfext/?perf=$id';
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return perfs;
|
||||
@ -63,16 +60,16 @@ class PerfectureService{
|
||||
static Future<List<dynamic>?> loadGifuAreas(String perf) async {
|
||||
List<dynamic> perfs = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/allgifuareas/?perf=' + perf;
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
String url = '$serverUrl/api/allgifuareas/?perf=$perf';
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return perfs;
|
||||
@ -82,40 +79,35 @@ class PerfectureService{
|
||||
List<dynamic> perfs = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/customareanames';
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return perfs;
|
||||
}
|
||||
|
||||
|
||||
static Future<List<dynamic>?> getSubExt(String id) async {
|
||||
List<dynamic> perfs = [];
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/perfext/?sub_perf=' + id;
|
||||
print('++++++++$url');
|
||||
final response = await http.get(Uri.parse(url),
|
||||
String url = '$serverUrl/api/perfext/?sub_perf=$id';
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
perfs = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
return perfs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,27 +1,22 @@
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:rogapp/utils/const.dart';
|
||||
|
||||
|
||||
class TrackingService {
|
||||
|
||||
static Future<Map<String, dynamic>> addTrack(String userId, double lat, double lon) async {
|
||||
static Future<Map<String, dynamic>> addTrack(
|
||||
String userId, double lat, double lon) async {
|
||||
Map<String, dynamic> cats = {};
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = '$serverUrl/api/track/';
|
||||
print('++++++++$url');
|
||||
//print('++++++++$url');
|
||||
final geom = '{"type": "MULTIPOINT", "coordinates": [[$lon, $lat]]}';
|
||||
final http.Response response = await http.post(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
body: jsonEncode(<String, String>{
|
||||
'user_id': userId,
|
||||
'geom': geom
|
||||
}),
|
||||
body: jsonEncode(<String, String>{'user_id': userId, 'geom': geom}),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
@ -29,5 +24,4 @@ class TrackingService {
|
||||
}
|
||||
return cats;
|
||||
}
|
||||
|
||||
}
|
||||
@ -10,6 +10,7 @@ class ConstValues{
|
||||
static const dev_home_ip_mserver = "http://192.168.1.10:8100";
|
||||
|
||||
static String currentServer(){
|
||||
//return dev_ip_server;
|
||||
return server_uri;
|
||||
}
|
||||
}
|
||||
|
||||
96
lib/utils/database_gps.dart
Normal file
@ -0,0 +1,96 @@
|
||||
import 'dart:io';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:rogapp/model/gps_data.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
|
||||
class GpsDatabaseHelper {
|
||||
GpsDatabaseHelper._privateConstructor();
|
||||
static final GpsDatabaseHelper instance =
|
||||
GpsDatabaseHelper._privateConstructor();
|
||||
static Database? _database;
|
||||
Future<Database> get database async => _database ??= await _initDatabase();
|
||||
|
||||
Future<Database> _initDatabase() async {
|
||||
Directory documentDirectory = await getApplicationDocumentsDirectory();
|
||||
String path = join(documentDirectory.path, 'rog.db');
|
||||
// return await openDatabase(
|
||||
// path,
|
||||
// version: 1,
|
||||
// onCreate: _onCreate,
|
||||
// );
|
||||
return openDatabase(
|
||||
join(
|
||||
await getDatabasesPath(),
|
||||
'gps.db',
|
||||
),
|
||||
version: 1,
|
||||
onCreate: _onCreate);
|
||||
}
|
||||
|
||||
Future _onCreate(Database db, int version) async {
|
||||
await db.execute('''
|
||||
CREATE TABLE gps(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
team_name TEXT,
|
||||
event_code TEXT,
|
||||
lat REAL,
|
||||
lon REAL,
|
||||
is_checkin int,
|
||||
created_at INTEGER,
|
||||
is_synced INTEGER DEFAULT 0
|
||||
)
|
||||
''');
|
||||
}
|
||||
|
||||
Future<int> insertGps(GpsData gps) async {
|
||||
Database db = await instance.database;
|
||||
int? nextOrder =
|
||||
Sqflite.firstIntValue(await db.rawQuery('SELECT MAX(id) FROM gps'));
|
||||
nextOrder = nextOrder ?? 0;
|
||||
nextOrder = nextOrder + 1;
|
||||
gps.id = nextOrder;
|
||||
//print("---- insering ${gps.toMap()}");
|
||||
int res = await db.insert(
|
||||
'gps',
|
||||
gps.toMap(),
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
//print("------ database helper insert $res-----------::::::::");
|
||||
return res;
|
||||
}
|
||||
|
||||
Future<List<GpsData>> getGPSData(String team_name, String event_code) async {
|
||||
Database db = await instance.database;
|
||||
var gpss = await db.query('gps',
|
||||
where: "team_name = ? and event_code = ?",
|
||||
whereArgs: [team_name, event_code],
|
||||
orderBy: 'created_at');
|
||||
List<GpsData> gpsDatas =
|
||||
gpss.isNotEmpty ? gpss.map((e) => GpsData.fromMap(e)).toList() : [];
|
||||
//print("--------- db list $gpsDatas");
|
||||
return gpsDatas;
|
||||
}
|
||||
|
||||
Future<List<GpsData>> getUnsyncedGPSData(
|
||||
String team_name, String event_code) async {
|
||||
Database db = await instance.database;
|
||||
var gpss = await db.query('gps',
|
||||
where: 'team_name = ? and event_code = ? and is_synced = 0',
|
||||
whereArgs: [team_name, event_code],
|
||||
orderBy: 'created_at');
|
||||
return gpss.isNotEmpty ? gpss.map((e) => GpsData.fromMap(e)).toList() : [];
|
||||
}
|
||||
|
||||
Future<void> setSyncData(List<GpsData> data) async {
|
||||
Database db = await instance.database;
|
||||
for (var record in data) {
|
||||
await db.update(
|
||||
'gps',
|
||||
{'is_synced': 1},
|
||||
where: 'id = ?',
|
||||
whereArgs: [record.id],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,7 +6,7 @@ import 'package:path/path.dart';
|
||||
|
||||
import '../model/rog.dart';
|
||||
|
||||
class DatabaseHelper{
|
||||
class DatabaseHelper {
|
||||
DatabaseHelper._privateConstructor();
|
||||
static final DatabaseHelper instance = DatabaseHelper._privateConstructor();
|
||||
|
||||
@ -21,7 +21,13 @@ class DatabaseHelper{
|
||||
// version: 1,
|
||||
// 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 {
|
||||
@ -48,11 +54,16 @@ class DatabaseHelper{
|
||||
cp REAL,
|
||||
checkin_point REAL,
|
||||
buy_point REAL,
|
||||
hidden_location INTEGER
|
||||
hidden_location INTEGER,
|
||||
checkin_image TEXT,
|
||||
buypoint_image TEXT,
|
||||
forced_checkin INTEGER,
|
||||
recipt_times INTEGER,
|
||||
tags TEXT
|
||||
)
|
||||
''');
|
||||
|
||||
await db.execute('''
|
||||
await db.execute('''
|
||||
CREATE TABLE rogaining(
|
||||
rog_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
course_id INTEGER,
|
||||
@ -65,7 +76,7 @@ class DatabaseHelper{
|
||||
)
|
||||
''');
|
||||
|
||||
await db.execute('''
|
||||
await db.execute('''
|
||||
CREATE TABLE rog(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
team_name TEXT,
|
||||
@ -77,54 +88,41 @@ class DatabaseHelper{
|
||||
rog_action_type INTEGER
|
||||
)
|
||||
''');
|
||||
|
||||
}
|
||||
|
||||
Future<List<Rog>> allRogianing() async {
|
||||
Database db = await instance.database;
|
||||
var rog = await db.query('rog');
|
||||
List<Rog> roglist = rog.isNotEmpty ?
|
||||
rog.map((e) => Rog.fromMap(e)).toList() : [];
|
||||
print("--------- $rog");
|
||||
List<Rog> roglist =
|
||||
rog.isNotEmpty ? rog.map((e) => Rog.fromMap(e)).toList() : [];
|
||||
//print("--------- $rog");
|
||||
return roglist;
|
||||
}
|
||||
|
||||
|
||||
Future<List<Rog>> getRogainingByLatLon(double lat, double lon) async {
|
||||
Database db = await instance.database;
|
||||
var rog = await db.query('rog', where: "lat = $lat and lon= $lon");
|
||||
List<Rog> roglist = rog.isNotEmpty
|
||||
? rog.map((e) => Rog.fromMap(e)).toList() : [];
|
||||
List<Rog> roglist =
|
||||
rog.isNotEmpty ? rog.map((e) => Rog.fromMap(e)).toList() : [];
|
||||
return roglist;
|
||||
}
|
||||
|
||||
Future clearSelection() async {
|
||||
Database db = await instance.database;
|
||||
Map<String, dynamic> rowClear = {
|
||||
"selected": false
|
||||
};
|
||||
return await db.update(
|
||||
"destination",
|
||||
rowClear
|
||||
);
|
||||
Map<String, dynamic> rowClear = {"selected": false};
|
||||
return await db.update("destination", rowClear);
|
||||
}
|
||||
|
||||
Future<int> toggleSelecttion(Destination dest) async {
|
||||
Database db = await instance.database;
|
||||
|
||||
bool val = !dest.selected!;
|
||||
Map<String, dynamic> rowTarget = {
|
||||
"selected": val
|
||||
};
|
||||
Map<String, dynamic> rowTarget = {"selected": val};
|
||||
|
||||
await clearSelection();
|
||||
|
||||
return await db.update(
|
||||
"destination",
|
||||
rowTarget,
|
||||
where: 'location_id = ?',
|
||||
whereArgs: [dest.location_id!]
|
||||
);
|
||||
return await db.update("destination", rowTarget,
|
||||
where: 'location_id = ?', whereArgs: [dest.location_id!]);
|
||||
}
|
||||
|
||||
Future<int> deleteRogaining(int id) async {
|
||||
@ -135,28 +133,27 @@ class DatabaseHelper{
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Future<void> deleteAllRogaining() async {
|
||||
Database db = await instance.database;
|
||||
await db.delete('rog');
|
||||
}
|
||||
|
||||
|
||||
Future<bool>isRogAlreadyAvailable(int id) async{
|
||||
Future<bool> isRogAlreadyAvailable(int id) async {
|
||||
Database db = await instance.database;
|
||||
var rog = await db.query('rog', where: "id = $id");
|
||||
return rog.isNotEmpty ? true : false;
|
||||
}
|
||||
|
||||
Future<int?>latestGoal() async{
|
||||
Future<int?> latestGoal() async {
|
||||
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 {
|
||||
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 + 1;
|
||||
rog.id = nextOrder;
|
||||
@ -165,40 +162,41 @@ class DatabaseHelper{
|
||||
rog.toMap(),
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
print("------ database helper insert $res-----------::::::::");
|
||||
//print("------ database helper insert $res-----------::::::::");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Future<List<Destination>> getDestinations() async {
|
||||
Database db = await instance.database;
|
||||
var dest = await db.query('destination', orderBy: 'list_order');
|
||||
List<Destination> destList = dest.isNotEmpty ?
|
||||
dest.map((e) => Destination.fromMap(e)).toList() : [];
|
||||
print("--------- $destList");
|
||||
List<Destination> destList =
|
||||
dest.isNotEmpty ? dest.map((e) => Destination.fromMap(e)).toList() : [];
|
||||
//print("--------- $destList");
|
||||
return destList;
|
||||
}
|
||||
|
||||
Future<List<Destination>> getDestinationById(int id) async {
|
||||
Database db = await instance.database;
|
||||
var rog = await db.query('destination', where: "location_id = $id");
|
||||
List<Destination> deslist = rog.isNotEmpty
|
||||
? rog.map((e) => Destination.fromMap(e)).toList() : [];
|
||||
List<Destination> deslist =
|
||||
rog.isNotEmpty ? rog.map((e) => Destination.fromMap(e)).toList() : [];
|
||||
return deslist;
|
||||
}
|
||||
|
||||
|
||||
Future<List<Destination>> getDestinationByLatLon(double lat, double lon) async {
|
||||
Future<List<Destination>> getDestinationByLatLon(
|
||||
double lat, double lon) async {
|
||||
Database db = await instance.database;
|
||||
var dest = await db.query('destination', where: "lat = $lat and lon= $lon", orderBy: 'list_order');
|
||||
List<Destination> destList = dest.isNotEmpty
|
||||
? dest.map((e) => Destination.fromMap(e)).toList() : [];
|
||||
var dest = await db.query('destination',
|
||||
where: "lat = $lat and lon= $lon", orderBy: 'list_order');
|
||||
List<Destination> destList =
|
||||
dest.isNotEmpty ? dest.map((e) => Destination.fromMap(e)).toList() : [];
|
||||
return destList;
|
||||
}
|
||||
|
||||
Future<int> deleteDestination(int locationId) async {
|
||||
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;
|
||||
|
||||
//after deleting set correct order
|
||||
@ -207,26 +205,20 @@ class DatabaseHelper{
|
||||
return ret;
|
||||
}
|
||||
|
||||
Future<void>setOrder() async {
|
||||
Future<void> setOrder() async {
|
||||
Database db = await instance.database;
|
||||
var byOrder = await db.query('destination', orderBy: 'list_order');
|
||||
|
||||
List<Destination> desDb = byOrder.isNotEmpty
|
||||
? byOrder.map((e) => Destination.fromMap(e)).toList() : [];
|
||||
? byOrder.map((e) => Destination.fromMap(e)).toList()
|
||||
: [];
|
||||
|
||||
int order = 1;
|
||||
for( Destination d in desDb){
|
||||
for (Destination d in desDb) {
|
||||
Map<String, dynamic> rowTarget = {"list_order": order};
|
||||
|
||||
Map<String, dynamic> rowTarget = {
|
||||
"list_order": order
|
||||
};
|
||||
|
||||
await db.update(
|
||||
"destination",
|
||||
rowTarget,
|
||||
where: 'location_id = ?',
|
||||
whereArgs: [d.location_id]
|
||||
);
|
||||
await db.update("destination", rowTarget,
|
||||
where: 'location_id = ?', whereArgs: [d.location_id]);
|
||||
|
||||
order += 1;
|
||||
}
|
||||
@ -237,15 +229,18 @@ class DatabaseHelper{
|
||||
await db.delete('destination');
|
||||
}
|
||||
|
||||
Future<bool>isAlreadyAvailable(int locationId) async{
|
||||
Future<bool> isAlreadyAvailable(int locationId) async {
|
||||
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;
|
||||
}
|
||||
|
||||
Future<int> insertDestination(Destination dest) async {
|
||||
await deleteDestination(dest.location_id!);
|
||||
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 + 1;
|
||||
dest.list_order = nextOrder;
|
||||
@ -258,39 +253,50 @@ class DatabaseHelper{
|
||||
return res;
|
||||
}
|
||||
|
||||
Future<int> updateAction(Destination destination, bool checkin)async {
|
||||
Future<int> updateCancelBuyPoint(Destination destination) async {
|
||||
//print("---- updating puypint image in db -----");
|
||||
Database db = await instance.database;
|
||||
int act = checkin == false ? 0 : 1;
|
||||
Map<String, dynamic> row = {
|
||||
"checkedin": act
|
||||
};
|
||||
return await db.update(
|
||||
"destination",
|
||||
row,
|
||||
where: 'location_id = ?',
|
||||
whereArgs: [destination.location_id!]
|
||||
);
|
||||
Map<String, dynamic> row = {"buy_point": 0};
|
||||
return await db.update("destination", row,
|
||||
where: 'location_id = ?', whereArgs: [destination.location_id!]);
|
||||
}
|
||||
|
||||
Future<void> updateOrder(Destination d, int dir)async {
|
||||
Future<int> updateBuyPoint(Destination destination, String imageUrl) async {
|
||||
//print("---- updating puypint image in db -----");
|
||||
Database db = await instance.database;
|
||||
var target = await db.query('destination', where: "list_order = ${d.list_order! + dir}");
|
||||
var dest = await db.query('destination', where: "location_id = ${d.location_id}");
|
||||
Map<String, dynamic> row = {"buypoint_image": imageUrl};
|
||||
return await db.update("destination", row,
|
||||
where: 'location_id = ?', whereArgs: [destination.location_id!]);
|
||||
}
|
||||
|
||||
print("--- target in db is $target");
|
||||
print("--- destine in db is $dest");
|
||||
Future<int> updateAction(Destination destination, bool checkin) async {
|
||||
Database db = await instance.database;
|
||||
int act = checkin == false ? 0 : 1;
|
||||
Map<String, dynamic> row = {"checkedin": act};
|
||||
return await db.update("destination", row,
|
||||
where: 'location_id = ?', whereArgs: [destination.location_id!]);
|
||||
}
|
||||
|
||||
if(target.isNotEmpty){
|
||||
Future<void> updateOrder(Destination d, int dir) async {
|
||||
Database db = await instance.database;
|
||||
var target = await db.query('destination',
|
||||
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("--- destine in db is $dest");
|
||||
|
||||
if (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
|
||||
? dest.map((e) => Destination.fromMap(e)).toList() : [];
|
||||
? dest.map((e) => Destination.fromMap(e)).toList()
|
||||
: [];
|
||||
|
||||
Map<String, dynamic> rowTarget = {
|
||||
"list_order": d.list_order
|
||||
};
|
||||
Map<String, dynamic> rowTarget = {"list_order": d.list_order};
|
||||
|
||||
Map<String, dynamic> rowDes = {
|
||||
"list_order": destIndb[0].list_order! + dir
|
||||
@ -299,19 +305,11 @@ class DatabaseHelper{
|
||||
// print("--- target destination is ${target_indb[0].location_id}");
|
||||
// print("--- destine destination is is ${dest_indb[0].location_id}");
|
||||
|
||||
await db.update(
|
||||
"destination",
|
||||
rowTarget,
|
||||
where: 'location_id = ?',
|
||||
whereArgs: [targetIndb[0].location_id]
|
||||
);
|
||||
await db.update("destination", rowTarget,
|
||||
where: 'location_id = ?', whereArgs: [targetIndb[0].location_id]);
|
||||
|
||||
await db.update(
|
||||
"destination",
|
||||
rowDes,
|
||||
where: 'location_id = ?',
|
||||
whereArgs: [destIndb[0].location_id]
|
||||
);
|
||||
await db.update("destination", rowDes,
|
||||
where: 'location_id = ?', whereArgs: [destIndb[0].location_id]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -319,6 +317,4 @@ class DatabaseHelper{
|
||||
// Database db = await instance.database;
|
||||
// return await Sqflite.firstIntValue(await db.rawQuery("SELECT COUNT(*) FROM incidents"));
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,42 +1,39 @@
|
||||
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
|
||||
class TextUtils{
|
||||
|
||||
static String getDisplayTextFeture(GeoJsonFeature f){
|
||||
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||
String txt = "";
|
||||
// if(f.properties!["cp"] > 0){
|
||||
// //print("-- sub-- ${f.properties!["cp"]} ----");
|
||||
// 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, '')}";
|
||||
class TextUtils {
|
||||
static String getDisplayTextFeture(GeoJsonFeature f) {
|
||||
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||
String txt = "";
|
||||
// if(f.properties!["cp"] > 0){
|
||||
// //print("-- sub-- ${f.properties!["cp"]} ----");
|
||||
// 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, '')}";
|
||||
// }
|
||||
}
|
||||
@ -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(),
|
||||
134
lib/widgets/debug_widget.dart
Normal file
@ -0,0 +1,134 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LogManager {
|
||||
static final LogManager _instance = LogManager._internal();
|
||||
|
||||
factory LogManager() {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
LogManager._internal();
|
||||
|
||||
List<String> _logs = [];
|
||||
List<VoidCallback> _listeners = [];
|
||||
|
||||
List<String> get logs => _logs;
|
||||
|
||||
void addLog(String log) {
|
||||
_logs.add(log);
|
||||
_notifyListeners(); // Notify all listeners
|
||||
}
|
||||
|
||||
void clearLogs() {
|
||||
_logs.clear();
|
||||
_notifyListeners(); // Notify all listeners
|
||||
}
|
||||
|
||||
void addListener(VoidCallback listener) {
|
||||
_listeners.add(listener);
|
||||
}
|
||||
|
||||
void removeListener(VoidCallback listener) {
|
||||
_listeners.remove(listener);
|
||||
}
|
||||
|
||||
void _notifyListeners() {
|
||||
for (var listener in _listeners) {
|
||||
listener();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DebugWidget extends StatefulWidget {
|
||||
const DebugWidget({super.key});
|
||||
|
||||
@override
|
||||
State<DebugWidget> createState() => _DebugWidgetState();
|
||||
}
|
||||
|
||||
class _DebugWidgetState extends State<DebugWidget> {
|
||||
final LogManager logManager = LogManager();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
logManager.addListener(_updateLogs);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
logManager.removeListener(_updateLogs);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _updateLogs() {
|
||||
Future.delayed(Duration.zero, () {
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void toggleExpanded() {
|
||||
setState(() {
|
||||
isExpanded = !isExpanded;
|
||||
});
|
||||
}
|
||||
|
||||
void clearLogs() {
|
||||
logManager.clearLogs();
|
||||
}
|
||||
|
||||
bool isExpanded = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: GestureDetector(
|
||||
onTap: toggleExpanded,
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(milliseconds: 200),
|
||||
color: Colors.black54,
|
||||
height: isExpanded ? 450.0 : 50.0, // Adjust sizes as needed
|
||||
child: Column(
|
||||
children: [
|
||||
// Top bar with clear button
|
||||
if (isExpanded)
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||
color: Colors.blueGrey, // Adjust color as needed
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Debug Logs', style: TextStyle(color: Colors.white)),
|
||||
IconButton(
|
||||
icon: Icon(Icons.clear, color: Colors.white),
|
||||
onPressed: clearLogs,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// Log messages
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: logManager.logs.reversed
|
||||
.map((log) => Text(
|
||||
"${DateTime.now().hour}:${DateTime.now().minute}:${DateTime.now().second}:${DateTime.now().microsecond} - $log",
|
||||
style: const TextStyle(color: Colors.white)))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -23,10 +23,10 @@ class DestinationWidget extends StatelessWidget {
|
||||
destinationController.destinations[index].photos == "") {
|
||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||
} else {
|
||||
print(
|
||||
"------- image is ${destinationController.destinations[index].photos!}------");
|
||||
String _photo = destinationController.destinations[index].photos!;
|
||||
if (_photo.contains('http')) {
|
||||
// print(
|
||||
// "------- image is ${destinationController.destinations[index].photos!}------");
|
||||
String photo = destinationController.destinations[index].photos!;
|
||||
if (photo.contains('http')) {
|
||||
return Image(
|
||||
image:
|
||||
NetworkImage(destinationController.destinations[index].photos!),
|
||||
@ -39,8 +39,8 @@ class DestinationWidget extends StatelessWidget {
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
//print("==== photo is ${server_url + '/media/compressed/' + destinationController.destinations[index].photos!} ===");
|
||||
return Image(
|
||||
image: NetworkImage('$serverUrl/media/compressed/' +
|
||||
destinationController.destinations[index].photos!),
|
||||
image: NetworkImage(
|
||||
'$serverUrl/media/compressed/${destinationController.destinations[index].photos!}'),
|
||||
errorBuilder:
|
||||
(BuildContext context, Object exception, StackTrace? stackTrace) {
|
||||
return Image.asset("assets/images/empty_image.png");
|
||||
@ -84,7 +84,7 @@ class DestinationWidget extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
if (d != null) {
|
||||
print("--- selected destination is ${d.list_order}");
|
||||
//print("--- selected destination is ${d.list_order}");
|
||||
destinationController.makeOrder(d, -1);
|
||||
}
|
||||
}
|
||||
@ -98,7 +98,7 @@ class DestinationWidget extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
if (d != null) {
|
||||
print("--- selected destination is ${d.list_order}");
|
||||
//print("--- selected destination is ${d.list_order}");
|
||||
destinationController.makeOrder(d, 1);
|
||||
}
|
||||
}
|
||||
@ -145,8 +145,8 @@ class DestinationWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
print(
|
||||
"------ destination widget------ ${destinationController.destinationCount.value} ----------");
|
||||
//print(
|
||||
// "------ destination widget------ ${destinationController.destinationCount.value} ----------");
|
||||
|
||||
return Obx(() => Stack(
|
||||
children: [
|
||||
@ -161,12 +161,12 @@ class DestinationWidget extends StatelessWidget {
|
||||
isFirst: index == 0 ? true : false,
|
||||
indicatorStyle: IndicatorStyle(
|
||||
indicator: CircleAvatar(
|
||||
backgroundColor: Colors.red,
|
||||
child: Text(
|
||||
destinationController.destinations[index].list_order
|
||||
.toString(),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
),
|
||||
key: Key(index.toString()),
|
||||
@ -180,7 +180,7 @@ class DestinationWidget extends StatelessWidget {
|
||||
{
|
||||
Destination? fs =
|
||||
destinationController.destinations[index];
|
||||
print("----fsf-----$index");
|
||||
//print("----fsf-----$index");
|
||||
if (indexController
|
||||
.currentDestinationFeature.isNotEmpty) {
|
||||
indexController.currentDestinationFeature
|
||||
@ -188,17 +188,19 @@ class DestinationWidget extends StatelessWidget {
|
||||
}
|
||||
indexController.currentDestinationFeature
|
||||
.add(fs);
|
||||
print(
|
||||
"--- ndexController.currentDestinationFeature ----- ${indexController.currentDestinationFeature[0].name} ----");
|
||||
// print(
|
||||
// "--- ndexController.currentDestinationFeature ----- ${indexController.currentDestinationFeature[0].name} ----");
|
||||
//indexController.getAction();
|
||||
|
||||
showModalBottomSheet(
|
||||
constraints: BoxConstraints.loose(
|
||||
Size(Get.width, Get.height * 0.75)),
|
||||
Size(Get.width, Get.height * 0.85)),
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
//builder:((context) => BottomSheetWidget())
|
||||
builder: ((context) => BottomSheetNew()));
|
||||
builder: ((context) => BottomSheetNew(
|
||||
destination: fs,
|
||||
)));
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
|
||||
@ -28,13 +28,13 @@ class _ListWidgetState extends State<ListWidget> {
|
||||
"") {
|
||||
return const Image(image: AssetImage('assets/images/empty_image.png'));
|
||||
} else {
|
||||
print("==== photo index is $index ===");
|
||||
//print("==== photo index is $index ===");
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
GeoJsonFeature<dynamic> gf =
|
||||
indexController.locations[0].collection[index];
|
||||
String _photo = gf.properties!["photos"];
|
||||
String photo = gf.properties!["photos"];
|
||||
return Image(
|
||||
image: NetworkImage('$serverUrl/media/compressed/' + _photo),
|
||||
image: NetworkImage('$serverUrl/media/compressed/$photo'),
|
||||
errorBuilder:
|
||||
(BuildContext context, Object exception, StackTrace? stackTrace) {
|
||||
return Image.asset("assets/images/empty_image.png");
|
||||
@ -57,19 +57,19 @@ class _ListWidgetState extends State<ListWidget> {
|
||||
|
||||
Destination createDestination(GeoJsonFeature feature) {
|
||||
final props = feature.properties;
|
||||
GeoJsonMultiPoint _pt = feature.geometry;
|
||||
GeoJsonMultiPoint pt = feature.geometry;
|
||||
|
||||
return Destination(
|
||||
cp: props!['cp'],
|
||||
lat: _pt.geoSerie!.geoPoints.first.latitude,
|
||||
lon: _pt.geoSerie!.geoPoints.first.longitude,
|
||||
lat: pt.geoSerie!.geoPoints.first.latitude,
|
||||
lon: pt.geoSerie!.geoPoints.first.longitude,
|
||||
);
|
||||
}
|
||||
|
||||
Future<String> matrixDistance(int i) async {
|
||||
// Create two destinations directly from indexController.locations[0].collection
|
||||
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 dest2 =
|
||||
createDestination(indexController.locations[0].collection[i]);
|
||||
@ -82,7 +82,7 @@ class _ListWidgetState extends State<ListWidget> {
|
||||
}
|
||||
|
||||
Future<void> _pullRefresh() async {
|
||||
print("pull to refesh");
|
||||
//print("pull to refesh");
|
||||
indexController.locations[0].collection.sort((a, b) =>
|
||||
(a.properties!['cp'] as Comparable)
|
||||
.compareTo(b.properties!['cp'] as Comparable));
|
||||
@ -99,30 +99,34 @@ class _ListWidgetState extends State<ListWidget> {
|
||||
itemCount: indexController.locations[0].collection.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (_, index) {
|
||||
bool _is_found = false;
|
||||
bool isFound = false;
|
||||
for (Destination d in destinationController.destinations) {
|
||||
if (indexController.locations[0].collection[index]
|
||||
.properties!['location_id'] ==
|
||||
d.location_id) {
|
||||
_is_found = true;
|
||||
isFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Card(
|
||||
child: ListTile(
|
||||
selected: _is_found,
|
||||
selected: isFound,
|
||||
selectedTileColor: Colors.yellow.shade200,
|
||||
onTap: () {
|
||||
GeoJsonFeature gf =
|
||||
indexController.locations[0].collection[index];
|
||||
Destination des =
|
||||
destinationController.festuretoDestination(gf);
|
||||
changeCurrentFeature(gf);
|
||||
showModalBottomSheet(
|
||||
constraints: BoxConstraints.loose(
|
||||
Size(Get.width, Get.height * 0.75)),
|
||||
Size(Get.width, Get.height * 0.85)),
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
//builder: (context) => BottomSheetWidget(),
|
||||
builder: ((context) => BottomSheetNew()));
|
||||
builder: ((context) => BottomSheetNew(
|
||||
destination: des,
|
||||
)));
|
||||
},
|
||||
leading: getImage(index),
|
||||
title: indexController.locations[0].collection[index]
|
||||
|
||||
@ -7,11 +7,14 @@ import 'package:flutter_polyline_points/flutter_polyline_points.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'package:rogapp/utils/text_util.dart';
|
||||
import 'package:rogapp/widgets/base_layer_widget.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_new.dart';
|
||||
import 'package:rogapp/widgets/debug_widget.dart';
|
||||
|
||||
class MapWidget extends StatelessWidget {
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
@ -25,7 +28,7 @@ class MapWidget extends StatelessWidget {
|
||||
Widget getMarkerShape(GeoJsonFeature i, BuildContext context) {
|
||||
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
||||
//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(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
@ -34,23 +37,28 @@ class MapWidget extends StatelessWidget {
|
||||
GeoJsonFeature? fs = indexController.getFeatureForLatLong(
|
||||
p.geoSerie!.geoPoints[0].latitude,
|
||||
p.geoSerie!.geoPoints[0].longitude);
|
||||
print("------- fs $fs------");
|
||||
//print("------- fs $fs------");
|
||||
if (fs != null) {
|
||||
indexController.currentFeature.clear();
|
||||
indexController.currentFeature.add(fs);
|
||||
//print("----- fs is ${fs.properties!['photos']}");
|
||||
indexController.getAction();
|
||||
|
||||
showModalBottomSheet(
|
||||
constraints:
|
||||
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
isDismissible: true,
|
||||
builder: ((context) => BottomSheetNew())
|
||||
//builder:((context) => BottomSheetWidget())
|
||||
).whenComplete(() {
|
||||
destinationController.skip_gps = false;
|
||||
Destination des = destinationController.festuretoDestination(fs);
|
||||
|
||||
DatabaseHelper db = DatabaseHelper.instance;
|
||||
db.getDestinationByLatLon(des.lat!, des.lon!).then((value) {
|
||||
showModalBottomSheet(
|
||||
constraints: BoxConstraints.loose(
|
||||
Size(Get.width, Get.height * 0.85)),
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
isDismissible: true,
|
||||
builder: ((context) => BottomSheetNew(
|
||||
destination: des, isAlreadyCheckedIn: value.isNotEmpty))
|
||||
//builder:((context) => BottomSheetWidget())
|
||||
).whenComplete(() {
|
||||
destinationController.skipGps = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -90,19 +98,31 @@ class MapWidget extends StatelessWidget {
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
child: Text(TextUtils.getDisplayTextFeture(i),
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.red,
|
||||
))),
|
||||
color: Colors.purple.withOpacity(0.4),
|
||||
// child: Text(TextUtils.getDisplayTextFeture(i),
|
||||
// style: const TextStyle(
|
||||
// fontSize: 16,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// color: Colors.red,
|
||||
// ))),
|
||||
child: Text(
|
||||
TextUtils.getDisplayTextFeture(i),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
// アウトラインの色と幅を設定
|
||||
foreground: Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 1
|
||||
..color = Colors.white,
|
||||
),
|
||||
))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
List<LatLng>? getPoints() {
|
||||
print("##### --- route point ${indexController.routePoints.length}");
|
||||
//print("##### --- route point ${indexController.routePoints.length}");
|
||||
List<LatLng> pts = [];
|
||||
for (PointLatLng p in indexController.routePoints) {
|
||||
LatLng l = LatLng(p.latitude, p.longitude);
|
||||
@ -113,13 +133,13 @@ class MapWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
print(
|
||||
"---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
|
||||
// print(
|
||||
// "---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
|
||||
|
||||
final PopupController _popupController = PopupController();
|
||||
final PopupController popupController = PopupController();
|
||||
return Stack(
|
||||
children: [
|
||||
Obx(() => indexController.is_loading == true
|
||||
Obx(() => indexController.isLoading.value == true
|
||||
? const Padding(
|
||||
padding: EdgeInsets.only(top: 60.0),
|
||||
child: CircularProgressIndicator(),
|
||||
@ -129,19 +149,13 @@ class MapWidget extends StatelessWidget {
|
||||
options: MapOptions(
|
||||
maxZoom: 18.4,
|
||||
onMapReady: () {
|
||||
indexController.is_mapController_loaded.value = true;
|
||||
subscription = indexController.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);
|
||||
}
|
||||
if (mapEvent is MapEventMoveEnd) {}
|
||||
});
|
||||
},
|
||||
//center: LatLng(37.15319600454702, 139.58765950528198),
|
||||
@ -155,8 +169,10 @@ class MapWidget extends StatelessWidget {
|
||||
interactiveFlags:
|
||||
InteractiveFlag.pinchZoom | InteractiveFlag.drag,
|
||||
|
||||
onPositionChanged: (MapPosition pos, isvalue) {},
|
||||
onTap: (_, __) => _popupController
|
||||
onPositionChanged: (MapPosition pos, isvalue) {
|
||||
indexController.currentBound = [pos.bounds!];
|
||||
},
|
||||
onTap: (_, __) => popupController
|
||||
.hideAllPopups(), // Hide popup when the map is tapped.
|
||||
),
|
||||
children: [
|
||||
@ -173,19 +189,32 @@ class MapWidget extends StatelessWidget {
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
CurrentLocationLayer(),
|
||||
CurrentLocationLayer(
|
||||
followOnLocationUpdate: FollowOnLocationUpdate.never,
|
||||
turnOnHeadingUpdate: TurnOnHeadingUpdate.never,
|
||||
style: const LocationMarkerStyle(
|
||||
marker: DefaultLocationMarker(
|
||||
child: Icon(
|
||||
Icons.navigation,
|
||||
color: Colors.yellowAccent,
|
||||
),
|
||||
),
|
||||
markerSize: Size(27, 27),
|
||||
markerDirection: MarkerDirection.heading,
|
||||
),
|
||||
),
|
||||
indexController.locations.isNotEmpty &&
|
||||
indexController.locations[0].collection.isNotEmpty
|
||||
? MarkerLayer(
|
||||
markers:
|
||||
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)');
|
||||
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}");
|
||||
return Marker(
|
||||
anchorPos: AnchorPos.exactly(Anchor(108.0, 18.0)),
|
||||
height: 32.0,
|
||||
@ -200,7 +229,12 @@ class MapWidget extends StatelessWidget {
|
||||
)
|
||||
: const Center(child: CircularProgressIndicator()),
|
||||
],
|
||||
))
|
||||
)),
|
||||
const Positioned(
|
||||
bottom: 10,
|
||||
left: 0,
|
||||
child: DebugWidget(),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -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"
|
||||