Big update, everything should be working perfectly smooth
45
.gitignore
vendored
@ -18,56 +18,21 @@
|
|||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
# The .vscode folder contains launch configuration and tasks you configure in
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
# VS Code which you may wish to be included in version control, so this line
|
||||||
# is commented out by default.
|
# is commented out by default.
|
||||||
#.vscode/
|
.vscode/
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
# Flutter/Dart/Pub related
|
||||||
**/doc/api/
|
**/doc/api/
|
||||||
.dart_tool/
|
.dart_tool/
|
||||||
.flutter-plugins
|
.flutter-plugins
|
||||||
|
.flutter-plugins-dependencies
|
||||||
.packages
|
.packages
|
||||||
.pub-cache/
|
.pub-cache/
|
||||||
.pub/
|
.pub/
|
||||||
/build/
|
/build/
|
||||||
|
|
||||||
# Android related
|
# Web related
|
||||||
**/android/**/gradle-wrapper.jar
|
lib/generated_plugin_registrant.dart
|
||||||
**/android/.gradle
|
|
||||||
**/android/captures/
|
|
||||||
**/android/gradlew
|
|
||||||
**/android/gradlew.bat
|
|
||||||
**/android/local.properties
|
|
||||||
**/android/**/GeneratedPluginRegistrant.java
|
|
||||||
|
|
||||||
# iOS/XCode related
|
|
||||||
**/ios/**/*.mode1v3
|
|
||||||
**/ios/**/*.mode2v3
|
|
||||||
**/ios/**/*.moved-aside
|
|
||||||
**/ios/**/*.pbxuser
|
|
||||||
**/ios/**/*.perspectivev3
|
|
||||||
**/ios/**/*sync/
|
|
||||||
**/ios/**/.sconsign.dblite
|
|
||||||
**/ios/**/.tags*
|
|
||||||
**/ios/**/.vagrant/
|
|
||||||
**/ios/**/DerivedData/
|
|
||||||
**/ios/**/Icon?
|
|
||||||
**/ios/**/Pods/
|
|
||||||
**/ios/**/.symlinks/
|
|
||||||
**/ios/**/profile
|
|
||||||
**/ios/**/xcuserdata
|
|
||||||
**/ios/.generated/
|
|
||||||
**/ios/Flutter/App.framework
|
|
||||||
**/ios/Flutter/Flutter.framework
|
|
||||||
**/ios/Flutter/Generated.xcconfig
|
|
||||||
**/ios/Flutter/app.flx
|
|
||||||
**/ios/Flutter/app.zip
|
|
||||||
**/ios/Flutter/flutter_assets/
|
|
||||||
**/ios/Flutter/flutter_export_environment.sh
|
|
||||||
**/ios/ServiceDefinitions.json
|
|
||||||
**/ios/Runner/GeneratedPluginRegistrant.*
|
|
||||||
|
|
||||||
# Exceptions to above rules.
|
# Exceptions to above rules.
|
||||||
!**/ios/**/default.mode1v3
|
|
||||||
!**/ios/**/default.mode2v3
|
|
||||||
!**/ios/**/default.pbxuser
|
|
||||||
!**/ios/**/default.perspectivev3
|
|
||||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
||||||
|
.gradle
|
10
.metadata
@ -1,10 +0,0 @@
|
|||||||
# This file tracks properties of this Flutter project.
|
|
||||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
|
||||||
#
|
|
||||||
# This file should be version controlled and should not be manually edited.
|
|
||||||
|
|
||||||
version:
|
|
||||||
revision: 68587a0916366e9512a78df22c44163d041dd5f3
|
|
||||||
channel: stable
|
|
||||||
|
|
||||||
project_type: app
|
|
@ -1,8 +1,15 @@
|
|||||||
# GEO Smart App
|
![Show Case](https://i.ibb.co/4ZBZCFj/Whats-App-Image-2020-07-08-at-8-08-55-PM.jpg)
|
||||||
|
|
||||||
This is the Mobile Application for [Geo Smart System](https://github.com/supanadit/geosmartsystem) and [Geo Smart Map](https://github.com/supanadit/geosmartmap)
|
This is the Mobile Application for [Geo Smart System](https://github.com/supanadit/geosmartsystem) and [Geo Smart Map](https://github.com/supanadit/geosmartmap)
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- Android 6.0.1+
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
- Clone this repository
|
||||||
|
- `flutter pub get`
|
||||||
|
- `flutter run`
|
||||||
|
|
||||||
## Todo
|
## Todo
|
||||||
- Integration With Geo Smart System ( OK )
|
- Integration With Geo Smart System ( OK )
|
||||||
|
@ -23,7 +23,6 @@ if (flutterVersionName == null) {
|
|||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'com.android.application'
|
|
||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@ -39,12 +38,11 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "com.supanadit.geo_app"
|
applicationId "com.example.geosmart"
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@ -62,10 +60,4 @@ flutter {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
implementation 'com.google.firebase:firebase-analytics:17.2.0'
|
|
||||||
testImplementation 'junit:junit:4.12'
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"project_info": {
|
|
||||||
"project_number": "908118791305",
|
|
||||||
"firebase_url": "https://geo-app-supanadit.firebaseio.com",
|
|
||||||
"project_id": "geo-app-supanadit",
|
|
||||||
"storage_bucket": "geo-app-supanadit.appspot.com"
|
|
||||||
},
|
|
||||||
"client": [
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:908118791305:android:d230276ba7f053e3e9e258",
|
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "com.supanadit.geo_app"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "908118791305-pif2888l3d7qs7hjqs4pkcbcc74ga10h.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyDqOWFq6PaPeSIn14jcXSaTovDYU9S1tYU"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "908118791305-pif2888l3d7qs7hjqs4pkcbcc74ga10h.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configuration_version": "1"
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.supanadit.geo_app">
|
package="com.example.geosmart">
|
||||||
<!-- Flutter needs it to communicate with the running application
|
<!-- Flutter needs it to communicate with the running application
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
-->
|
-->
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.supanadit.geo_app">
|
package="com.example.geosmart">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
@ -12,29 +12,42 @@
|
|||||||
<application
|
<application
|
||||||
android:name="io.flutter.app.FlutterApplication"
|
android:name="io.flutter.app.FlutterApplication"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="Geo Smart"
|
||||||
android:usesCleartextTraffic="true">
|
android:usesCleartextTraffic="true">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.geo.API_KEY"
|
android:name="com.google.android.geo.API_KEY"
|
||||||
android:value="@string/api_key" />
|
android:value="@string/api_key" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize">
|
||||||
<!-- This keeps the window background of the activity showing
|
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||||
until Flutter renders its first frame. It can be removed if
|
the Android process has started. This theme is visible to the user
|
||||||
there is no splash screen (such as the default splash screen
|
while the Flutter UI initializes. After that, this theme continues
|
||||||
defined in @style/LaunchTheme). -->
|
to determine the Window background behind the Flutter UI. -->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
android:value="true" />
|
android:resource="@style/NormalTheme" />
|
||||||
|
<!-- Displays an Android View that continues showing the launch screen
|
||||||
|
Drawable until Flutter paints its first frame, then this splash
|
||||||
|
screen fades out. A splash screen is useful to avoid any visual
|
||||||
|
gap between the end of Android's launch screen and the painting of
|
||||||
|
Flutter's first frame. -->
|
||||||
|
<meta-data
|
||||||
|
android:name="io.flutter.embedding.android.SplashScreenDrawable"
|
||||||
|
android:resource="@drawable/launch_background" />
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<!-- Don't delete the meta-data below.
|
||||||
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
|
<meta-data
|
||||||
|
android:name="flutterEmbedding"
|
||||||
|
android:value="2" />
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
BIN
android/app/src/main/ic_launcher-playstore.png
Normal file
After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 48 KiB |
@ -1,13 +0,0 @@
|
|||||||
package com.supanadit.geo_app
|
|
||||||
|
|
||||||
import android.os.Bundle
|
|
||||||
|
|
||||||
import io.flutter.app.FlutterActivity
|
|
||||||
import io.flutter.plugins.GeneratedPluginRegistrant
|
|
||||||
|
|
||||||
class MainActivity: FlutterActivity() {
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
GeneratedPluginRegistrant.registerWith(this)
|
|
||||||
}
|
|
||||||
}
|
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@ -1,8 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting -->
|
||||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
Flutter draws its first frame -->
|
Flutter draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
</style>
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">@android:color/white</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.supanadit.geo_app">
|
package="com.example.geosmart">
|
||||||
<!-- Flutter needs it to communicate with the running application
|
<!-- Flutter needs it to communicate with the running application
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
-->
|
-->
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.2.71'
|
ext.kotlin_version = '1.3.50'
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.google.gms:google-services:4.3.2'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,16 +25,6 @@ subprojects {
|
|||||||
subprojects {
|
subprojects {
|
||||||
project.evaluationDependsOn(':app')
|
project.evaluationDependsOn(':app')
|
||||||
}
|
}
|
||||||
subprojects {
|
|
||||||
project.configurations.all {
|
|
||||||
resolutionStrategy.eachDependency { details ->
|
|
||||||
if (details.requested.group == 'androidx.core' &&
|
|
||||||
!details.requested.name.contains('androidx')) {
|
|
||||||
details.useVersion "1.0.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
org.gradle.jvmargs=-Xmx1536M
|
org.gradle.jvmargs=-Xmx1536M
|
||||||
|
|
||||||
android.enableR8=true
|
android.enableR8=true
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
|
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
include ':app'
|
include ':app'
|
||||||
|
|
||||||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
|
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||||
|
def properties = new Properties()
|
||||||
|
|
||||||
def plugins = new Properties()
|
assert localPropertiesFile.exists()
|
||||||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
|
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||||
if (pluginsFile.exists()) {
|
|
||||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins.each { name, path ->
|
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
|
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||||
include ":$name"
|
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||||
project(":$name").projectDir = pluginDirectory
|
|
||||||
}
|
|
||||||
|
@ -9,12 +9,7 @@
|
|||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
|
|
||||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
|
||||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
|
|
||||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
|
||||||
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
|
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
@ -27,8 +22,6 @@
|
|||||||
dstPath = "";
|
dstPath = "";
|
||||||
dstSubfolderSpec = 10;
|
dstSubfolderSpec = 10;
|
||||||
files = (
|
files = (
|
||||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
|
|
||||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
|
|
||||||
);
|
);
|
||||||
name = "Embed Frameworks";
|
name = "Embed Frameworks";
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@ -39,13 +32,11 @@
|
|||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
|
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
|
|
||||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
@ -58,8 +49,6 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
|
||||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -69,9 +58,7 @@
|
|||||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
3B80C3931E831B6300D905FE /* App.framework */,
|
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||||
9740EEBA1CF902C7004384FC /* Flutter.framework */,
|
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||||
@ -149,16 +136,16 @@
|
|||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 1020;
|
LastUpgradeCheck = 1020;
|
||||||
ORGANIZATIONNAME = "The Chromium Authors";
|
ORGANIZATIONNAME = "";
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
97C146ED1CF9000F007C117D = {
|
97C146ED1CF9000F007C117D = {
|
||||||
CreatedOnToolsVersion = 7.3.1;
|
CreatedOnToolsVersion = 7.3.1;
|
||||||
LastSwiftMigration = 0910;
|
LastSwiftMigration = 1100;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||||
compatibilityVersion = "Xcode 3.2";
|
compatibilityVersion = "Xcode 9.3";
|
||||||
developmentRegion = en;
|
developmentRegion = en;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
@ -182,7 +169,6 @@
|
|||||||
files = (
|
files = (
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||||
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
|
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||||
);
|
);
|
||||||
@ -203,7 +189,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||||
};
|
};
|
||||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
@ -298,6 +284,7 @@
|
|||||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
};
|
};
|
||||||
@ -321,10 +308,10 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Flutter",
|
"$(PROJECT_DIR)/Flutter",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.supanadit.geoApp;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.geosmart;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 5.0;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
name = Profile;
|
name = Profile;
|
||||||
@ -430,6 +417,7 @@
|
|||||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
@ -454,11 +442,11 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Flutter",
|
"$(PROJECT_DIR)/Flutter",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.supanadit.geoApp;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.geosmart;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 5.0;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@ -481,10 +469,10 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Flutter",
|
"$(PROJECT_DIR)/Flutter",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.supanadit.geoApp;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.geosmart;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 5.0;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@ -513,7 +501,6 @@
|
|||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
|
|
||||||
};
|
};
|
||||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import Flutter
|
|||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
|
GMSServices.provideAPIKey("AIzaSyCjhBV5aq1gsTCYsr6QCCxYusFlBa3DEMs")
|
||||||
GeneratedPluginRegistrant.register(with: self)
|
GeneratedPluginRegistrant.register(with: self)
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>geo_app</string>
|
<string>geosmart</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
|
@ -1 +1 @@
|
|||||||
#import "GeneratedPluginRegistrant.h"
|
#import "GeneratedPluginRegistrant.h"
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
import 'package:geo_app/model/response.dart';
|
|
||||||
import 'package:geo_app/model/setting.dart';
|
|
||||||
import 'package:geo_app/repository/position_repository.dart';
|
|
||||||
import 'package:rxdart/rxdart.dart';
|
|
||||||
|
|
||||||
class PositionBloc {
|
|
||||||
PositionRepository _repository;
|
|
||||||
final PublishSubject<ResponseModel> _subject =
|
|
||||||
PublishSubject<ResponseModel>();
|
|
||||||
|
|
||||||
SettingModel _settingModel;
|
|
||||||
|
|
||||||
PositionBloc(this._settingModel) {
|
|
||||||
this._repository = PositionRepository(this._settingModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose() {
|
|
||||||
_subject.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
sendPosition(String lat, String lng) async {
|
|
||||||
ResponseModel response = await _repository.sendPosition(lat, lng);
|
|
||||||
_subject.sink.add(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
stopTracking() async {
|
|
||||||
ResponseModel response = await _repository.stopTracking();
|
|
||||||
_subject.sink.add(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
PublishSubject<ResponseModel> get subject => _subject;
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
import 'package:geo_app/model/setting.dart';
|
|
||||||
import 'package:geo_app/model/unique_id_model.dart';
|
|
||||||
import 'package:geo_app/repository/unique_id_repository.dart';
|
|
||||||
import 'package:rxdart/rxdart.dart';
|
|
||||||
|
|
||||||
class UniqueIDBloc {
|
|
||||||
UniqueIDRepository _repository;
|
|
||||||
final PublishSubject<UniqueIDModel> _subject =
|
|
||||||
PublishSubject<UniqueIDModel>();
|
|
||||||
|
|
||||||
SettingModel _settingModel;
|
|
||||||
|
|
||||||
UniqueIDBloc(this._settingModel) {
|
|
||||||
this._repository = UniqueIDRepository(this._settingModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose() {
|
|
||||||
_subject.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
getUniqueID() async {
|
|
||||||
UniqueIDModel response = await _repository.getUniqueID();
|
|
||||||
_subject.sink.add(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
PublishSubject<UniqueIDModel> get subject => _subject;
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:geo_app/page/startup.dart';
|
import 'package:geosmart/page/startup.dart';
|
||||||
|
|
||||||
void main() => runApp(MyApp());
|
void main() => runApp(MyApp());
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:geo_app/config.dart';
|
import 'package:geosmart/config.dart';
|
||||||
import 'package:geo_app/model/response.dart';
|
import 'package:geosmart/model/response.dart';
|
||||||
import 'package:geo_app/model/unique_id_model.dart';
|
import 'package:geosmart/model/unique_id_model.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
@ -1,19 +1,14 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:background_location/background_location.dart';
|
|
||||||
import 'package:device_info/device_info.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:geo_app/bloc/position_bloc.dart';
|
import 'package:geolocator/geolocator.dart' as geo;
|
||||||
import 'package:geo_app/bloc/setting.dart';
|
import 'package:geosmart/model/position.dart';
|
||||||
import 'package:geo_app/model/position.dart';
|
import 'package:geosmart/model/setting.dart';
|
||||||
import 'package:geo_app/page/setting.dart';
|
import 'package:geosmart/page/setting.dart';
|
||||||
|
import 'package:geosmart/service/position_service.dart';
|
||||||
|
import 'package:geosmart/service/setting_service.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:flutter_background_geolocation/flutter_background_geolocation.dart'
|
|
||||||
as bg;
|
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
|
||||||
import 'package:rxdart/rxdart.dart';
|
|
||||||
|
|
||||||
class Map extends StatefulWidget {
|
class Map extends StatefulWidget {
|
||||||
Map({Key key, this.title}) : super(key: key);
|
Map({Key key, this.title}) : super(key: key);
|
||||||
@ -32,172 +27,74 @@ class _MapState extends State<Map> {
|
|||||||
double accuracy = 0.0;
|
double accuracy = 0.0;
|
||||||
double bearing = 0.0;
|
double bearing = 0.0;
|
||||||
double speed = 0.0;
|
double speed = 0.0;
|
||||||
Position _position;
|
PositionService _positionService;
|
||||||
PositionBloc _positionBloc;
|
SettingService _settingService;
|
||||||
SettingBloc _settingBloc;
|
|
||||||
PublishSubject<bool> _checkDevice;
|
|
||||||
bool isChecking = true;
|
bool isChecking = true;
|
||||||
|
Position _position;
|
||||||
|
|
||||||
String id;
|
String id;
|
||||||
String host;
|
String host;
|
||||||
|
|
||||||
bool isGranted = false;
|
bool isGranted = false;
|
||||||
bool isTracking = false;
|
bool isTracking = false;
|
||||||
int androidSDKVersion = 0;
|
|
||||||
|
|
||||||
_MapState() {
|
|
||||||
_checkDevice = PublishSubject<bool>();
|
|
||||||
}
|
|
||||||
|
|
||||||
getPermission() {
|
|
||||||
BackgroundLocation.getPermissions(
|
|
||||||
onDenied: () {
|
|
||||||
isGranted = false;
|
|
||||||
print("Denied");
|
|
||||||
},
|
|
||||||
onGranted: () {
|
|
||||||
isGranted = true;
|
|
||||||
print("Granted");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
PermissionHandler()
|
setState(() {
|
||||||
.requestPermissions([PermissionGroup.location]).then((permissions) {
|
isChecking = true;
|
||||||
permissions.forEach((group, status) {
|
|
||||||
print("$group With Status $status");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
if (Platform.isAndroid) {
|
_settingService = new SettingService();
|
||||||
PermissionHandler()
|
_positionService = new PositionService();
|
||||||
.shouldShowRequestPermissionRationale(PermissionGroup.location)
|
// geo.Geolocator()..forceAndroidLocationManager = true;
|
||||||
.then((isShow) {
|
geo.Geolocator().checkGeolocationPermissionStatus().then(
|
||||||
print("Is Show $isShow");
|
(v) {
|
||||||
});
|
setState(() {
|
||||||
DeviceInfoPlugin().androidInfo.then((androidInfo) {
|
isGranted = true;
|
||||||
var release = androidInfo.version.release;
|
});
|
||||||
var sdkInt = androidInfo.version.sdkInt;
|
var geolocator = geo.Geolocator();
|
||||||
var manufacturer = androidInfo.manufacturer;
|
var locationOptions = geo.LocationOptions(
|
||||||
var model = androidInfo.model;
|
accuracy: geo.LocationAccuracy.high,
|
||||||
print('Android $release (SDK $sdkInt), $manufacturer $model');
|
);
|
||||||
androidSDKVersion = sdkInt;
|
|
||||||
if (sdkInt > 21) {
|
|
||||||
getPermission();
|
|
||||||
BackgroundLocation.getLocationUpdates((location) async {
|
|
||||||
print("Location Updated");
|
|
||||||
if (!isTracking) {
|
|
||||||
this.isTracking = true;
|
|
||||||
}
|
|
||||||
if (!isGranted) {
|
|
||||||
this.isGranted = true;
|
|
||||||
}
|
|
||||||
this.latitude = location.latitude;
|
|
||||||
this.longitude = location.longitude;
|
|
||||||
this.accuracy = location.accuracy;
|
|
||||||
this.altitude = location.altitude;
|
|
||||||
this.bearing = location.bearing;
|
|
||||||
this.speed = location.speed;
|
|
||||||
|
|
||||||
if (this.id != null) {
|
geolocator
|
||||||
|
.getPositionStream(locationOptions)
|
||||||
|
.listen((geo.Position position) {
|
||||||
|
if (this.id != null) {
|
||||||
|
setState(() {
|
||||||
this._position = Position(
|
this._position = Position(
|
||||||
id: this.id,
|
id: this.id,
|
||||||
lat: this.latitude.toString(),
|
lat: position.latitude.toString(),
|
||||||
lng: this.longitude.toString(),
|
lng: position.longitude.toString(),
|
||||||
type: "user",
|
type: "user",
|
||||||
);
|
);
|
||||||
} else {
|
});
|
||||||
stopLocationService();
|
} else {
|
||||||
settingPage();
|
stopLocationService();
|
||||||
}
|
settingPage();
|
||||||
|
}
|
||||||
|
print(
|
||||||
|
"New position detected with lat ${position.latitude} and lng ${position.longitude}");
|
||||||
|
sendLastPosition();
|
||||||
|
});
|
||||||
|
|
||||||
if (this._position != null) {
|
_settingService.getSetting().then((v) {
|
||||||
if (this._position.isValid()) {
|
this.id = v.id;
|
||||||
if (_positionBloc != null) {
|
this.host = v.host;
|
||||||
_positionBloc.sendPosition(
|
|
||||||
this._position.lat.toString(),
|
|
||||||
this._position.lng.toString(),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
Fluttertoast.showToast(
|
|
||||||
msg: "Failed to start position service",
|
|
||||||
);
|
|
||||||
settingPage();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print("Invalid Position");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
setState(() {
|
|
||||||
isChecking = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (sdkInt <= 21) {
|
|
||||||
bg.BackgroundGeolocation.onLocation((bg.Location location) {
|
|
||||||
print('[location] - $location');
|
|
||||||
});
|
|
||||||
|
|
||||||
bg.BackgroundGeolocation.onMotionChange((bg.Location location) {
|
if (v.isNullId()) {
|
||||||
print('[motionchange] - $location');
|
settingPage();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
bg.BackgroundGeolocation.onProviderChange(
|
},
|
||||||
(bg.ProviderChangeEvent event) {
|
).catchError((e) {
|
||||||
print('[providerchange] - $event');
|
setState(() {
|
||||||
});
|
isGranted = false;
|
||||||
|
|
||||||
bg.BackgroundGeolocation.ready(
|
|
||||||
bg.Config(
|
|
||||||
desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
|
|
||||||
distanceFilter: 10.0,
|
|
||||||
stopOnTerminate: false,
|
|
||||||
startOnBoot: true,
|
|
||||||
debug: true,
|
|
||||||
logLevel: bg.Config.LOG_LEVEL_VERBOSE,
|
|
||||||
),
|
|
||||||
).then(
|
|
||||||
(bg.State state) {
|
|
||||||
if (!state.enabled) {
|
|
||||||
isGranted = true;
|
|
||||||
isChecking = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
}).whenComplete(() {
|
||||||
getPermission();
|
|
||||||
setState(() {
|
setState(() {
|
||||||
isChecking = false;
|
isChecking = false;
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
_settingBloc = new SettingBloc();
|
|
||||||
|
|
||||||
_settingBloc.getSetting();
|
|
||||||
|
|
||||||
_settingBloc.subject.listen((settingModel) {
|
|
||||||
this.id = settingModel.id;
|
|
||||||
this.host = settingModel.host;
|
|
||||||
|
|
||||||
if (settingModel.isNullId()) {
|
|
||||||
settingPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.host != null && this.host != "") {
|
|
||||||
setState(() {
|
|
||||||
_positionBloc = new PositionBloc(settingModel);
|
|
||||||
_positionBloc.subject.listen((position) {
|
|
||||||
if (position.isError()) {
|
|
||||||
stopLocationService();
|
|
||||||
settingPage();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +130,7 @@ class _MapState extends State<Map> {
|
|||||||
onPressed: toggleTracking,
|
onPressed: toggleTracking,
|
||||||
child: Text(
|
child: Text(
|
||||||
(isChecking)
|
(isChecking)
|
||||||
? "Pleasewait"
|
? "Please wait"
|
||||||
: ((isTracking) ? "Stop Tracking" : "Start Tracking"),
|
: ((isTracking) ? "Stop Tracking" : "Start Tracking"),
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
@ -246,55 +143,65 @@ class _MapState extends State<Map> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
stopLocationService() {
|
|
||||||
if (androidSDKVersion > 21 || !Platform.isAndroid) {
|
|
||||||
BackgroundLocation.stopLocationService();
|
|
||||||
}
|
|
||||||
if (androidSDKVersion <= 21) {
|
|
||||||
bg.BackgroundGeolocation.stop();
|
|
||||||
}
|
|
||||||
if (_positionBloc != null) {
|
|
||||||
_positionBloc.stopTracking();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
startLocationService() {
|
|
||||||
if (androidSDKVersion > 21 || !Platform.isAndroid) {
|
|
||||||
BackgroundLocation.startLocationService();
|
|
||||||
}
|
|
||||||
if (androidSDKVersion <= 21) {
|
|
||||||
bg.BackgroundGeolocation.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleTracking() {
|
toggleTracking() {
|
||||||
if (!isChecking) {
|
if (!isChecking) {
|
||||||
if (isGranted) {
|
if (isGranted) {
|
||||||
if (isTracking) {
|
if (isTracking) {
|
||||||
stopLocationService();
|
stopLocationService();
|
||||||
} else {
|
} else {
|
||||||
startLocationService();
|
sendLastPosition();
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
isTracking = !isTracking;
|
isTracking = !isTracking;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Fluttertoast.showToast(
|
FlutterToast.showToast(
|
||||||
msg: "Make sure you have turn on location services",
|
msg: "Make sure you have turn on location services",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stopLocationService() {
|
||||||
|
if (_positionService != null) {
|
||||||
|
_positionService.stopTracking();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
settingPage() {
|
settingPage() {
|
||||||
Navigator.of(context).pushReplacement(new MaterialPageRoute(
|
Navigator.of(context).pushReplacement(new MaterialPageRoute(
|
||||||
builder: (BuildContext context) => Setting(),
|
builder: (BuildContext context) => Setting(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendLastPosition() async {
|
||||||
|
SettingModel m = await _settingService.getSetting();
|
||||||
|
print("Prepare to Send last location with ID : ${m.id} to ${m.host}");
|
||||||
|
if (this._position != null) {
|
||||||
|
if (this._position.isValid()) {
|
||||||
|
if (_positionService != null) {
|
||||||
|
print("Lat ${_position.lat}, Lng ${_position.lng}");
|
||||||
|
if (isTracking) {
|
||||||
|
print("Send tracking location");
|
||||||
|
_positionService.sendPosition(
|
||||||
|
this._position.lat.toString(),
|
||||||
|
this._position.lng.toString(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
FlutterToast.showToast(
|
||||||
|
msg: "Failed to start position service",
|
||||||
|
);
|
||||||
|
settingPage();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print("Invalid Position");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
print("Disposed");
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
stopLocationService();
|
stopLocationService();
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:geo_app/bloc/setting.dart';
|
import 'package:geosmart/config.dart';
|
||||||
import 'package:geo_app/bloc/unique_id_bloc.dart';
|
import 'package:geosmart/model/setting.dart';
|
||||||
import 'package:geo_app/config.dart';
|
import 'package:geosmart/page/map.dart';
|
||||||
import 'package:geo_app/model/setting.dart';
|
import 'package:geosmart/service/setting_service.dart';
|
||||||
import 'package:geo_app/page/map.dart';
|
import 'package:geosmart/service/unique_id_service.dart';
|
||||||
|
|
||||||
class Setting extends StatefulWidget {
|
class Setting extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
@ -16,22 +16,20 @@ class Setting extends StatefulWidget {
|
|||||||
|
|
||||||
class _SettingState extends State<Setting> {
|
class _SettingState extends State<Setting> {
|
||||||
final _hostController = TextEditingController();
|
final _hostController = TextEditingController();
|
||||||
SettingBloc _settingBloc;
|
SettingService _settingBloc;
|
||||||
UniqueIDBloc _uniqueIDBloc;
|
UniqueIDService _uniqueIDBloc;
|
||||||
String id;
|
String id;
|
||||||
String host;
|
String host;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_settingBloc = new SettingBloc();
|
_settingBloc = new SettingService();
|
||||||
|
|
||||||
_settingBloc.getSetting();
|
|
||||||
|
|
||||||
if (!Config.dynamicHostSetting) {
|
if (!Config.dynamicHostSetting) {
|
||||||
_settingBloc.setSetting(new SettingModel(Config.api, null));
|
_settingBloc.setSetting(new SettingModel(Config.api, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
_settingBloc.subject.listen((settingModel) {
|
_settingBloc.getSetting().then((settingModel) {
|
||||||
if (!settingModel.isNullId()) {
|
if (!settingModel.isNullId()) {
|
||||||
this.id = settingModel.id;
|
this.id = settingModel.id;
|
||||||
}
|
}
|
||||||
@ -42,11 +40,10 @@ class _SettingState extends State<Setting> {
|
|||||||
_hostController.text = this.host;
|
_hostController.text = this.host;
|
||||||
|
|
||||||
if (!settingModel.isNullHost()) {
|
if (!settingModel.isNullHost()) {
|
||||||
_uniqueIDBloc = new UniqueIDBloc(settingModel);
|
_uniqueIDBloc = new UniqueIDService(settingModel);
|
||||||
_uniqueIDBloc.getUniqueID();
|
|
||||||
|
|
||||||
if (_uniqueIDBloc != null) {
|
if (_uniqueIDBloc != null) {
|
||||||
this._uniqueIDBloc.subject.listen((uniqueId) {
|
this._uniqueIDBloc.getUniqueID().then((uniqueId) {
|
||||||
print("Your Unique ID " + uniqueId.id.toString());
|
print("Your Unique ID " + uniqueId.id.toString());
|
||||||
if (uniqueId.id != null && uniqueId.id != "") {
|
if (uniqueId.id != null && uniqueId.id != "") {
|
||||||
if (!settingModel.isNullId()) {
|
if (!settingModel.isNullId()) {
|
||||||
@ -58,7 +55,7 @@ class _SettingState extends State<Setting> {
|
|||||||
mapPage();
|
mapPage();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Fluttertoast.showToast(msg: "Invalid host address");
|
FlutterToast.showToast(msg: "Invalid host address");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -107,9 +104,48 @@ class _SettingState extends State<Setting> {
|
|||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
color: Colors.blueAccent,
|
color: Colors.blueAccent,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
this._settingBloc.setSetting(
|
this
|
||||||
|
._settingBloc
|
||||||
|
.setSetting(
|
||||||
new SettingModel(this._hostController.text, null),
|
new SettingModel(this._hostController.text, null),
|
||||||
);
|
)
|
||||||
|
.then((settingModel) {
|
||||||
|
if (!settingModel.isNullId()) {
|
||||||
|
this.id = settingModel.id;
|
||||||
|
}
|
||||||
|
if (!settingModel.isNullHost()) {
|
||||||
|
this.host = settingModel.host;
|
||||||
|
}
|
||||||
|
|
||||||
|
_hostController.text = this.host;
|
||||||
|
|
||||||
|
if (!settingModel.isNullHost()) {
|
||||||
|
_uniqueIDBloc = new UniqueIDService(settingModel);
|
||||||
|
|
||||||
|
if (_uniqueIDBloc != null) {
|
||||||
|
this._uniqueIDBloc.getUniqueID().then((uniqueId) {
|
||||||
|
print("Your Unique ID " + uniqueId.id.toString());
|
||||||
|
if (uniqueId.id != null && uniqueId.id != "") {
|
||||||
|
if (!settingModel.isNullId()) {
|
||||||
|
mapPage();
|
||||||
|
} else {
|
||||||
|
this._settingBloc.setSetting(
|
||||||
|
new SettingModel(
|
||||||
|
this._hostController.text,
|
||||||
|
uniqueId.id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
mapPage();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
FlutterToast.showToast(
|
||||||
|
msg: "Invalid host address",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Save",
|
"Save",
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geo_app/bloc/setting.dart';
|
import 'package:geosmart/component/loader.dart';
|
||||||
import 'package:geo_app/component/loader.dart';
|
import 'package:geosmart/page/map.dart';
|
||||||
import 'package:geo_app/page/map.dart';
|
import 'package:geosmart/page/setting.dart';
|
||||||
import 'package:geo_app/page/setting.dart';
|
import 'package:geosmart/service/setting_service.dart';
|
||||||
|
|
||||||
class Startup extends StatefulWidget {
|
class Startup extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
@ -13,15 +13,13 @@ class Startup extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _StartupState extends State<Startup> {
|
class _StartupState extends State<Startup> {
|
||||||
SettingBloc _settingBloc;
|
SettingService _settingService;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_settingBloc = new SettingBloc();
|
_settingService = new SettingService();
|
||||||
|
|
||||||
_settingBloc.getSetting();
|
_settingService.getSetting().then((settingModel) {
|
||||||
|
|
||||||
_settingBloc.subject.listen((settingModel) {
|
|
||||||
if (settingModel.isNullHost() && settingModel.isNullId()) {
|
if (settingModel.isNullHost() && settingModel.isNullId()) {
|
||||||
Navigator.of(context).pushReplacement(new MaterialPageRoute(
|
Navigator.of(context).pushReplacement(new MaterialPageRoute(
|
||||||
builder: (BuildContext context) => Setting(),
|
builder: (BuildContext context) => Setting(),
|
||||||
@ -32,7 +30,6 @@ class _StartupState extends State<Startup> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +55,6 @@ class _StartupState extends State<Startup> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_settingBloc.dispose();
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
import 'package:geo_app/model/response.dart';
|
|
||||||
import 'package:geo_app/model/setting.dart';
|
|
||||||
import 'package:geo_app/provider/position_provider.dart';
|
|
||||||
|
|
||||||
class PositionRepository {
|
|
||||||
PositionProvider _provider;
|
|
||||||
SettingModel _settingModel;
|
|
||||||
|
|
||||||
PositionRepository(this._settingModel) {
|
|
||||||
this._provider = PositionProvider(this._settingModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<ResponseModel> sendPosition(String lat, String lng) {
|
|
||||||
return this._provider.sendPosition(lat, lng);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<ResponseModel> stopTracking() {
|
|
||||||
return this._provider.stopTracking();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
import 'package:geo_app/model/setting.dart';
|
|
||||||
import 'package:geo_app/provider/unique_id_provider.dart';
|
|
||||||
import 'package:geo_app/model/unique_id_model.dart';
|
|
||||||
|
|
||||||
class UniqueIDRepository {
|
|
||||||
UniqueIDProvider _uniqueIDProvider;
|
|
||||||
SettingModel _settingModel;
|
|
||||||
|
|
||||||
UniqueIDRepository(this._settingModel) {
|
|
||||||
this._uniqueIDProvider = UniqueIDProvider(this._settingModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<UniqueIDModel> getUniqueID() {
|
|
||||||
return this._uniqueIDProvider.getUniqueID();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +1,25 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:geo_app/model/position.dart';
|
import 'package:geosmart/model/position.dart';
|
||||||
import 'package:geo_app/model/response.dart';
|
import 'package:geosmart/model/response.dart';
|
||||||
import 'package:geo_app/model/setting.dart';
|
import 'package:geosmart/service/setting_service.dart';
|
||||||
|
|
||||||
class PositionProvider {
|
class PositionService {
|
||||||
final Dio _dio = Dio();
|
final Dio _dio = Dio();
|
||||||
SettingModel _settingModel;
|
final SettingService _settingBloc = SettingService();
|
||||||
|
|
||||||
PositionProvider(this._settingModel);
|
PositionService();
|
||||||
|
|
||||||
Future<ResponseModel> sendPosition(String lat, String lng) async {
|
Future<ResponseModel> sendPosition(String lat, String lng) async {
|
||||||
|
var m = await _settingBloc.getSetting();
|
||||||
Position position = new Position(
|
Position position = new Position(
|
||||||
id: this._settingModel.id,
|
id: m.id,
|
||||||
type: "user",
|
type: "user",
|
||||||
lat: lat,
|
lat: lat,
|
||||||
lng: lng,
|
lng: lng,
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
Response response = await _dio.post(
|
Response response = await _dio.post(
|
||||||
this._settingModel.host + "/point/set",
|
m.host + "/point/set",
|
||||||
data: position.toJson(),
|
data: position.toJson(),
|
||||||
);
|
);
|
||||||
return ResponseModel.fromJson(response.data);
|
return ResponseModel.fromJson(response.data);
|
||||||
@ -33,11 +34,12 @@ class PositionProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<ResponseModel> stopTracking() async {
|
Future<ResponseModel> stopTracking() async {
|
||||||
|
var m = await _settingBloc.getSetting();
|
||||||
try {
|
try {
|
||||||
Response response = await _dio.post(
|
Response response = await _dio.post(
|
||||||
this._settingModel.host + "/point/unset",
|
m.host + "/point/unset",
|
||||||
data: {
|
data: {
|
||||||
"id": this._settingModel.id,
|
"id": m.id,
|
||||||
"type": "user",
|
"type": "user",
|
||||||
},
|
},
|
||||||
);
|
);
|
@ -1,39 +1,26 @@
|
|||||||
import 'package:rxdart/rxdart.dart';
|
import 'package:geosmart/model/setting.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:geo_app/model/setting.dart';
|
|
||||||
|
|
||||||
class SettingBloc {
|
|
||||||
PublishSubject<SettingModel> _subject;
|
|
||||||
|
|
||||||
|
class SettingService {
|
||||||
final String _host = "host";
|
final String _host = "host";
|
||||||
final String _id = "id";
|
final String _id = "id";
|
||||||
|
|
||||||
SettingBloc() {
|
|
||||||
this._subject = PublishSubject<SettingModel>();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<SharedPreferences> getSharedPreferences() async {
|
Future<SharedPreferences> getSharedPreferences() async {
|
||||||
return await SharedPreferences.getInstance();
|
return await SharedPreferences.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
setSetting(SettingModel setting) async {
|
Future<SettingModel> setSetting(SettingModel setting) async {
|
||||||
SharedPreferences sharedPreferences = await this.getSharedPreferences();
|
SharedPreferences sharedPreferences = await this.getSharedPreferences();
|
||||||
sharedPreferences.setString(_host, setting.host);
|
sharedPreferences.setString(_host, setting.host);
|
||||||
sharedPreferences.setString(_id, setting.id);
|
sharedPreferences.setString(_id, setting.id);
|
||||||
this.getSetting();
|
return await getSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
getSetting() async {
|
Future<SettingModel> getSetting() async {
|
||||||
SharedPreferences sharedPreferences = await this.getSharedPreferences();
|
SharedPreferences sharedPreferences = await this.getSharedPreferences();
|
||||||
_subject.sink.add(new SettingModel(
|
return new SettingModel(
|
||||||
sharedPreferences.getString(_host),
|
sharedPreferences.getString(_host),
|
||||||
sharedPreferences.getString(_id),
|
sharedPreferences.getString(_id),
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose() {
|
|
||||||
_subject.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
PublishSubject<SettingModel> get subject => _subject;
|
|
||||||
}
|
}
|
@ -1,13 +1,13 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:geo_app/model/setting.dart';
|
import 'package:geosmart/model/setting.dart';
|
||||||
import 'package:geo_app/model/unique_id_model.dart';
|
import 'package:geosmart/model/unique_id_model.dart';
|
||||||
|
|
||||||
class UniqueIDProvider {
|
class UniqueIDService {
|
||||||
final String _endpoint = "/id/get/unique";
|
final String _endpoint = "/id/get/unique";
|
||||||
final Dio _dio = Dio();
|
final Dio _dio = Dio();
|
||||||
SettingModel _settingModel;
|
SettingModel _settingModel;
|
||||||
|
|
||||||
UniqueIDProvider(this._settingModel);
|
UniqueIDService(this._settingModel);
|
||||||
|
|
||||||
Future<UniqueIDModel> getUniqueID() async {
|
Future<UniqueIDModel> getUniqueID() async {
|
||||||
try {
|
try {
|
252
pubspec.lock
@ -1,97 +1,48 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
_fe_analyzer_shared:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: _fe_analyzer_shared
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
analyzer:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: analyzer
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.39.2+1"
|
|
||||||
archive:
|
archive:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.11"
|
version: "2.0.13"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: args
|
name: args
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.2"
|
version: "1.6.0"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.0"
|
version: "2.4.1"
|
||||||
background_fetch:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: background_fetch
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.4.0"
|
|
||||||
background_location:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: background_location
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.0.9+1"
|
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: boolean_selector
|
name: boolean_selector
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "2.0.0"
|
||||||
build:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: build
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.2"
|
|
||||||
build_config:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: build_config
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.4.1+1"
|
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.1.3"
|
||||||
checked_yaml:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: checked_yaml
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.2"
|
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.14.11"
|
version: "1.14.12"
|
||||||
convert:
|
convert:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -105,14 +56,7 @@ packages:
|
|||||||
name: crypto
|
name: crypto
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.4"
|
||||||
csslib:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: csslib
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.16.1"
|
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -120,39 +64,32 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.3"
|
version: "0.1.3"
|
||||||
dart_style:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: dart_style
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.3"
|
|
||||||
device_info:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: device_info
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.4.1+4"
|
|
||||||
dio:
|
dio:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: dio
|
name: dio
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.8"
|
version: "3.0.9"
|
||||||
|
equatable:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: equatable
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.0"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
flutter_background_geolocation:
|
flutter_plugin_android_lifecycle:
|
||||||
dependency: "direct main"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_background_geolocation
|
name: flutter_plugin_android_lifecycle
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.0"
|
version: "1.0.8"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@ -169,77 +106,63 @@ packages:
|
|||||||
name: fluttertoast
|
name: fluttertoast
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.3"
|
version: "5.0.1"
|
||||||
glob:
|
geolocator:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: glob
|
name: geolocator
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "5.3.2+2"
|
||||||
|
google_api_availability:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: google_api_availability
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.4"
|
||||||
google_maps_flutter:
|
google_maps_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: google_maps_flutter
|
name: google_maps_flutter
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.21+15"
|
version: "0.5.28+1"
|
||||||
html:
|
google_maps_flutter_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: html
|
name: google_maps_flutter_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.14.0+3"
|
version: "1.0.2"
|
||||||
http:
|
http:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.0+3"
|
version: "0.12.1"
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http_parser
|
name: http_parser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.3"
|
version: "3.1.4"
|
||||||
image:
|
image:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.12"
|
||||||
js:
|
location_permissions:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: js
|
name: location_permissions
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.1+1"
|
version: "3.0.0+1"
|
||||||
json_annotation:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: json_annotation
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.1"
|
|
||||||
json_serializable:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: json_serializable
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.2.5"
|
|
||||||
logging:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: logging
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.11.3+2"
|
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -254,27 +177,6 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.8"
|
version: "1.1.8"
|
||||||
node_interop:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: node_interop
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.3"
|
|
||||||
node_io:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: node_io
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1+2"
|
|
||||||
package_config:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: package_config
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -288,14 +190,7 @@ packages:
|
|||||||
name: pedantic
|
name: pedantic
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0+1"
|
version: "1.9.0"
|
||||||
permission_handler:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: permission_handler
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "4.0.0"
|
|
||||||
petitparser:
|
petitparser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -303,81 +198,67 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.0"
|
version: "2.4.0"
|
||||||
pub_semver:
|
plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pub_semver
|
name: plugin_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.2"
|
version: "1.0.2"
|
||||||
pubspec_parse:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: pubspec_parse
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.5"
|
|
||||||
quiver:
|
quiver:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: quiver
|
name: quiver
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.5"
|
version: "2.1.3"
|
||||||
rxdart:
|
rxdart:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: rxdart
|
name: rxdart
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.23.1"
|
version: "0.24.1"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: shared_preferences
|
name: shared_preferences
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.6"
|
version: "0.5.7+3"
|
||||||
shared_preferences_macos:
|
shared_preferences_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_macos
|
name: shared_preferences_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.1+3"
|
version: "0.0.1+10"
|
||||||
shared_preferences_platform_interface:
|
shared_preferences_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_platform_interface
|
name: shared_preferences_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.1"
|
version: "1.0.4"
|
||||||
shared_preferences_web:
|
shared_preferences_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_web
|
name: shared_preferences_web
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.2+2"
|
version: "0.1.2+7"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.99"
|
version: "0.0.99"
|
||||||
source_gen:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: source_gen
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.9.4+7"
|
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.5"
|
version: "1.7.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -392,6 +273,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.0"
|
||||||
|
stream_transform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stream_transform
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.0"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -412,7 +300,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.11"
|
version: "0.2.15"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -427,27 +315,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.8"
|
version: "2.0.8"
|
||||||
watcher:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: watcher
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.9.7+13"
|
|
||||||
xml:
|
xml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.5.0"
|
version: "3.6.1"
|
||||||
yaml:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: yaml
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.2.0"
|
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.6.0 <3.0.0"
|
dart: ">=2.7.0 <3.0.0"
|
||||||
flutter: ">=1.12.13+hotfix.4 <2.0.0"
|
flutter: ">=1.16.3 <2.0.0"
|
||||||
|
32
pubspec.yaml
@ -1,5 +1,9 @@
|
|||||||
name: geo_app
|
name: geosmart
|
||||||
description: GEO Smart App
|
description: A new Flutter project.
|
||||||
|
|
||||||
|
# The following line prevents the package from being accidentally published to
|
||||||
|
# pub.dev using `pub publish`. This is preferred for private packages.
|
||||||
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
# The following defines the version and build number for your application.
|
# The following defines the version and build number for your application.
|
||||||
# A version number is three numbers separated by dots, like 1.2.43
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
@ -14,32 +18,28 @@ description: GEO Smart App
|
|||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.1.0 <3.0.0"
|
sdk: ">=2.7.0 <3.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^0.1.2
|
cupertino_icons: ^0.1.3
|
||||||
google_maps_flutter: ^0.5.21+15
|
geolocator: ^5.3.2+2
|
||||||
background_location: ^0.0.9
|
http: ^0.12.1
|
||||||
http: ^0.12.0+2
|
google_maps_flutter: ^0.5.28+1
|
||||||
json_serializable: ^3.2.3
|
shared_preferences: ^0.5.7+3
|
||||||
shared_preferences: ^0.5.6
|
rxdart: ^0.24.1
|
||||||
rxdart: ^0.23.1
|
dio: ^3.0.9
|
||||||
dio: ^3.0.7
|
fluttertoast: ^5.0.1
|
||||||
fluttertoast: ^3.1.3
|
|
||||||
device_info: ^0.4.1+4
|
|
||||||
flutter_background_geolocation: ^1.5.0
|
|
||||||
permission_handler: ^4.0.0
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'package:geo_app/main.dart';
|
import 'package:geosmart/main.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||||
|