diff --git a/place_tracker/.gitignore b/place_tracker/.gitignore new file mode 100644 index 000000000..47e0b4d62 --- /dev/null +++ b/place_tracker/.gitignore @@ -0,0 +1,71 @@ +# Miscellaneous +*.class +*.lock +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# Visual Studio Code related +.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/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/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# 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 diff --git a/place_tracker/.metadata b/place_tracker/.metadata new file mode 100644 index 000000000..80b83dd9c --- /dev/null +++ b/place_tracker/.metadata @@ -0,0 +1,10 @@ +# 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: b95b67a66b64c94f9bbe1c011bbfddb593a64429 + channel: master + +project_type: app diff --git a/place_tracker/README.md b/place_tracker/README.md new file mode 100644 index 000000000..7ae0aa4ca --- /dev/null +++ b/place_tracker/README.md @@ -0,0 +1,10 @@ +# Place Tracker + +A sample place tracking app that uses the [google_maps_flutter](https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter) plugin. + +## Getting Started + +For help setting up the plugin, see the plugin's [README](https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter) page. + +For help getting started with Flutter, view our online +[documentation](https://flutter.io/). diff --git a/place_tracker/android/app/build.gradle b/place_tracker/android/app/build.gradle new file mode 100644 index 000000000..75aec0985 --- /dev/null +++ b/place_tracker/android/app/build.gradle @@ -0,0 +1,61 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 27 + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.placetracker" + minSdkVersion 16 + targetSdkVersion 27 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/place_tracker/android/app/src/main/AndroidManifest.xml b/place_tracker/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..2c2e60bb5 --- /dev/null +++ b/place_tracker/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + diff --git a/place_tracker/android/app/src/main/java/com/example/placetracker/MainActivity.java b/place_tracker/android/app/src/main/java/com/example/placetracker/MainActivity.java new file mode 100644 index 000000000..e874a7bfe --- /dev/null +++ b/place_tracker/android/app/src/main/java/com/example/placetracker/MainActivity.java @@ -0,0 +1,13 @@ +package com.example.placetracker; + +import android.os.Bundle; +import io.flutter.app.FlutterActivity; +import io.flutter.plugins.GeneratedPluginRegistrant; + +public class MainActivity extends FlutterActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + GeneratedPluginRegistrant.registerWith(this); + } +} diff --git a/place_tracker/android/app/src/main/res/drawable/launch_background.xml b/place_tracker/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/place_tracker/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/place_tracker/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/place_tracker/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..db77bb4b7 Binary files /dev/null and b/place_tracker/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/place_tracker/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/place_tracker/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..17987b79b Binary files /dev/null and b/place_tracker/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/place_tracker/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/place_tracker/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..09d439148 Binary files /dev/null and b/place_tracker/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/place_tracker/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/place_tracker/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..d5f1c8d34 Binary files /dev/null and b/place_tracker/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/place_tracker/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/place_tracker/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..4d6372eeb Binary files /dev/null and b/place_tracker/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/place_tracker/android/app/src/main/res/values/styles.xml b/place_tracker/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..00fa4417c --- /dev/null +++ b/place_tracker/android/app/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + diff --git a/place_tracker/android/build.gradle b/place_tracker/android/build.gradle new file mode 100644 index 000000000..d4225c790 --- /dev/null +++ b/place_tracker/android/build.gradle @@ -0,0 +1,29 @@ +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.1.2' + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/place_tracker/android/gradle.properties b/place_tracker/android/gradle.properties new file mode 100644 index 000000000..8bd86f680 --- /dev/null +++ b/place_tracker/android/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx1536M diff --git a/place_tracker/android/gradle/wrapper/gradle-wrapper.properties b/place_tracker/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..9372d0f3f --- /dev/null +++ b/place_tracker/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/place_tracker/android/settings.gradle b/place_tracker/android/settings.gradle new file mode 100644 index 000000000..5a2f14fb1 --- /dev/null +++ b/place_tracker/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/place_tracker/ios/Flutter/AppFrameworkInfo.plist b/place_tracker/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..9367d483e --- /dev/null +++ b/place_tracker/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/place_tracker/ios/Flutter/Debug.xcconfig b/place_tracker/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..e8efba114 --- /dev/null +++ b/place_tracker/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/place_tracker/ios/Flutter/Release.xcconfig b/place_tracker/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..399e9340e --- /dev/null +++ b/place_tracker/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/place_tracker/ios/Podfile b/place_tracker/ios/Podfile new file mode 100644 index 000000000..7c6cb6f63 --- /dev/null +++ b/place_tracker/ios/Podfile @@ -0,0 +1,63 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +def parse_KV_file(file, separator='=') + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return []; + end + pods_ary = [] + skip_line_start_symbols = ["#", "/"] + File.foreach(file_abs_path) { |line| + next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } + plugin = line.split(pattern=separator) + if plugin.length == 2 + podname = plugin[0].strip() + path = plugin[1].strip() + podpath = File.expand_path("#{path}", file_abs_path) + pods_ary.push({:name => podname, :path => podpath}); + else + puts "Invalid plugin specification: #{line}" + end + } + return pods_ary +end + +target 'Runner' do + # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock + # referring to absolute paths on developers' machines. + system('rm -rf .symlinks') + system('mkdir -p .symlinks/plugins') + + # Flutter Pods + generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') + if generated_xcode_build_settings.empty? + puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." + end + generated_xcode_build_settings.map { |p| + if p[:name] == 'FLUTTER_FRAMEWORK_DIR' + symlink = File.join('.symlinks', 'flutter') + File.symlink(File.dirname(p[:path]), symlink) + pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) + end + } + + # Plugin Pods + plugin_pods = parse_KV_file('../.flutter-plugins') + plugin_pods.map { |p| + symlink = File.join('.symlinks', 'plugins', p[:name]) + File.symlink(p[:path], symlink) + pod p[:name], :path => File.join(symlink, 'ios') + } +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['ENABLE_BITCODE'] = 'NO' + end + end +end diff --git a/place_tracker/ios/Runner.xcodeproj/project.pbxproj b/place_tracker/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..0b3a21f11 --- /dev/null +++ b/place_tracker/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,436 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; + 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, ); }; }; + 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 */; }; + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; + 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 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 */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, + 3B80C3931E831B6300D905FE /* App.framework */, + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEBA1CF902C7004384FC /* Flutter.framework */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 97C146F21CF9000F007C117D /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0910; + ORGANIZATIONNAME = "The Chromium Authors"; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + 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"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, + 97C146F31CF9000F007C117D /* main.m in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + 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_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + 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_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + 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_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + 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_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.placeTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.placeTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/place_tracker/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/place_tracker/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..1d526a16e --- /dev/null +++ b/place_tracker/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/place_tracker/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/place_tracker/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000..1263ac84b --- /dev/null +++ b/place_tracker/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/place_tracker/ios/Runner.xcworkspace/contents.xcworkspacedata b/place_tracker/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..1d526a16e --- /dev/null +++ b/place_tracker/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/place_tracker/ios/Runner/AppDelegate.h b/place_tracker/ios/Runner/AppDelegate.h new file mode 100644 index 000000000..36e21bbf9 --- /dev/null +++ b/place_tracker/ios/Runner/AppDelegate.h @@ -0,0 +1,6 @@ +#import +#import + +@interface AppDelegate : FlutterAppDelegate + +@end diff --git a/place_tracker/ios/Runner/AppDelegate.m b/place_tracker/ios/Runner/AppDelegate.m new file mode 100644 index 000000000..59a72e90b --- /dev/null +++ b/place_tracker/ios/Runner/AppDelegate.m @@ -0,0 +1,13 @@ +#include "AppDelegate.h" +#include "GeneratedPluginRegistrant.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [GeneratedPluginRegistrant registerWithRegistry:self]; + // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; +} + +@end diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000..3d43d11e6 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000..28c6bf030 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000..2ccbfd967 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000..f091b6b0b Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000..4cde12118 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000..d0ef06e7e Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000..dcdc2306c Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000..2ccbfd967 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000..c8f9ed8f5 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000..a6d6b8609 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000..a6d6b8609 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000..75b2d164a Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000..c4df70d39 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000..6a84f41e1 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000..d0e1f5853 Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/place_tracker/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/place_tracker/ios/Runner/Base.lproj/LaunchScreen.storyboard b/place_tracker/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/place_tracker/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/place_tracker/ios/Runner/Base.lproj/Main.storyboard b/place_tracker/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/place_tracker/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/place_tracker/ios/Runner/Info.plist b/place_tracker/ios/Runner/Info.plist new file mode 100644 index 000000000..5c35fac65 --- /dev/null +++ b/place_tracker/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + place_tracker + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/place_tracker/ios/Runner/main.m b/place_tracker/ios/Runner/main.m new file mode 100644 index 000000000..dff6597e4 --- /dev/null +++ b/place_tracker/ios/Runner/main.m @@ -0,0 +1,9 @@ +#import +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/place_tracker/lib/main.dart b/place_tracker/lib/main.dart new file mode 100644 index 000000000..ba1426c55 --- /dev/null +++ b/place_tracker/lib/main.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'place_map.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class _Home extends StatelessWidget { + const _Home({ Key key }) : super(key: key); + + @override + Widget build(BuildContext context) { + return PlaceMap( + center: const LatLng(45.521563, -122.677433), + ); + } +} + +void main() { + runApp( + MaterialApp( + debugShowCheckedModeBanner: false, + title: 'Place Tracker', + home: _Home(), + ) + ); +} diff --git a/place_tracker/lib/place.dart b/place_tracker/lib/place.dart new file mode 100644 index 000000000..1068d96e5 --- /dev/null +++ b/place_tracker/lib/place.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +enum PlaceCategory { + favorite, + visited, + wantToGo, +} + +class Place { + const Place({ + @required this.latLng, + @required this.name, + @required this.category, + this.description, + this.starRating = 0, + }) : assert(latLng != null), + assert(name != null), + assert(category != null), + assert(starRating != null && starRating >= 0 && starRating <= 5); + + final LatLng latLng; + final String name; + final PlaceCategory category; + final String description; + final int starRating; + + double get latitude => latLng.latitude; + double get longitude => latLng.longitude; + + Place copyWith({ + LatLng latLng, + String name, + PlaceCategory category, + String description, + int starRating, + }) { + return Place( + latLng: latLng ?? this.latLng, + name: name ?? this.name, + category: category ?? this.category, + description: description ?? this.description, + starRating: starRating ?? this.starRating, + ); + } +} diff --git a/place_tracker/lib/place_details.dart b/place_tracker/lib/place_details.dart new file mode 100644 index 000000000..b7c9679cc --- /dev/null +++ b/place_tracker/lib/place_details.dart @@ -0,0 +1,238 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +import 'place.dart'; + +class PlaceDetails extends StatefulWidget { + const PlaceDetails({ + Key key, + @required this.place, + @required this.onChanged, + }) : assert(place != null), + assert(onChanged != null), + super(key: key); + + final Place place; + final ValueChanged onChanged; + + @override + PlaceDetailsState createState() => PlaceDetailsState(); +} + +class PlaceDetailsState extends State { + + Place _place; + GoogleMapController _mapController; + + final TextEditingController _nameController = TextEditingController(); + final TextEditingController _descriptionController = TextEditingController(); + + @override + void initState() { + _place = widget.place; + _nameController.text = _place.name; + _descriptionController.text = _place.description; + return super.initState(); + } + + void _onMapCreated(GoogleMapController controller) { + setState(() { + _mapController = controller; + _mapController.addMarker(MarkerOptions(position: _place.latLng)); + }); + } + + Widget _detailsBody() { + return ListView( + padding: const EdgeInsets.fromLTRB(24.0, 12.0, 24.0, 12.0), + children: [ + _NameTextField( + controller: _nameController, + onChanged: (String value) { + setState(() { + _place = _place.copyWith(name: value); + }); + }, + ), + _DescriptionTextField( + controller: _descriptionController, + onChanged: (String value) { + setState(() { + _place = _place.copyWith(description: value); + }); + }, + ), + _StarBar( + rating: _place.starRating, + onChanged: (int value) { + setState(() { + _place = _place.copyWith(starRating: value); + }); + }, + ), + _Map( + center: _place.latLng, + mapController: _mapController, + onMapCreated: _onMapCreated, + ), + ], + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('${_place.name}'), + backgroundColor: Colors.green[700], + actions: [ + Padding( + padding: const EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 0.0), + child: IconButton( + icon: const Icon(Icons.save, size: 30.0), + onPressed: () { + widget.onChanged(_place); + Navigator.pop(context); + }, + ), + ), + ], + ), + body: GestureDetector( + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: _detailsBody(), + ), + ); + } +} + +class _NameTextField extends StatelessWidget { + _NameTextField({ + @required this.controller, + @required this.onChanged, + }); + + final TextEditingController controller; + final ValueChanged onChanged; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 16.0), + child: TextField( + decoration: InputDecoration( + labelText: 'Name', + labelStyle: const TextStyle(fontSize: 18.0), + ), + style: const TextStyle(fontSize: 20.0, color: Colors.black87), + autocorrect: true, + controller: controller, + onChanged: (String value) { + onChanged(value); + }, + ), + ); + } +} + +class _DescriptionTextField extends StatelessWidget { + _DescriptionTextField({ + @required this.controller, + @required this.onChanged, + }); + + final TextEditingController controller; + final ValueChanged onChanged; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 16.0), + child: TextField( + decoration: InputDecoration( + labelText: 'Description', + labelStyle: const TextStyle(fontSize: 18.0), + ), + style: const TextStyle(fontSize: 20.0, color: Colors.black87), + maxLines: null, + autocorrect: true, + controller: controller, + onChanged: (String value) { + onChanged(value); + }, + ), + ); + } +} + +class _StarBar extends StatelessWidget { + const _StarBar({ + Key key, + @required this.rating, + @required this.onChanged, + }) : assert(rating != null && rating >= 0 && rating <= 5), + super(key: key); + + static const int maxStars = 5; + final int rating; + final ValueChanged onChanged; + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: List.generate(maxStars, (int index) { + return IconButton( + icon: const Icon(Icons.star), + iconSize: 40.0, + color: rating > index ? Colors.amber : Colors.grey[400], + onPressed: () { + onChanged(index + 1); + }, + ); + }).toList(), + ); + } +} + +class _Map extends StatelessWidget { + _Map({ + Key key, + @required this.center, + @required this.mapController, + @required this.onMapCreated, + }) : assert(center != null); + + final LatLng center; + final GoogleMapController mapController; + final ArgumentCallback onMapCreated; + + @override + Widget build(BuildContext context) { + return Card( + margin: const EdgeInsets.symmetric(vertical: 16.0), + elevation: 4.0, + child: SizedBox( + width: 340.0, + height: 240.0, + child: GoogleMap( + onMapCreated: onMapCreated, + options: GoogleMapOptions( + cameraPosition: CameraPosition( + target: center, + zoom: 16.0, + ), + zoomGesturesEnabled: false, + rotateGesturesEnabled: false, + tiltGesturesEnabled: false, + scrollGesturesEnabled: false, + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/place_tracker/lib/place_map.dart b/place_tracker/lib/place_map.dart new file mode 100644 index 000000000..4ec46583f --- /dev/null +++ b/place_tracker/lib/place_map.dart @@ -0,0 +1,433 @@ +import 'dart:math'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +import 'place.dart'; +import 'place_stub_data.dart'; +import 'place_details.dart'; + +class PlaceMap extends StatefulWidget { + const PlaceMap({ + Key key, + this.center, + }) : super(key: key); + + final LatLng center; + + @override + PlaceMapState createState() => PlaceMapState(); +} + +class PlaceMapState extends State { + + static BitmapDescriptor _getPlaceMarkerIcon(PlaceCategory category) { + // TODO(kenzieschmoll): use custom marker assets. + double markerHue; + switch (category) { + case PlaceCategory.favorite: + markerHue = BitmapDescriptor.hueRed; + break; + case PlaceCategory.visited: + markerHue = BitmapDescriptor.hueViolet; + break; + case PlaceCategory.wantToGo: + default: + markerHue = BitmapDescriptor.hueAzure; + } + return BitmapDescriptor.defaultMarkerWithHue(markerHue); + } + + static List _getPlacesForCategory(PlaceCategory category, Map places) { + return places.values.where((Place place) => place.category == category).toList(); + } + + GoogleMapController mapController; + PlaceCategory _selectedPlaceCategory = PlaceCategory.favorite; + Map _places = Map(); + Marker _pendingMarker; + + void onMapCreated(GoogleMapController controller) async { + mapController = controller; + mapController.onInfoWindowTapped.add(_onInfoWindowTapped); + + // Add stub data on creation so we have something interesting to look at. + final Map places = await _initializeStubPlaces(); + _zoomToFitPlaces(_getPlacesForCategory(_selectedPlaceCategory, places)); + } + + Future> _initializeStubPlaces() async { + await Future.wait(PlaceStubData.places.map((Place place) => _initializeStubPlace(place))); + return _places; + } + + Future _initializeStubPlace(Place place) async { + final Marker marker = await mapController.addMarker( + MarkerOptions( + position: place.latLng, + icon: _getPlaceMarkerIcon(place.category), + infoWindowText: InfoWindowText( + place.name, + '${place.starRating} Star Rating', + ), + visible: place.category == _selectedPlaceCategory, + ), + ); + _places[marker] = place; + } + + void _onInfoWindowTapped(Marker marker) async { + _pushPlaceDetailsScreen(marker); + } + + Future _pushPlaceDetailsScreen(Marker marker) async { + assert(marker != null); + + Navigator.push( + context, + MaterialPageRoute(builder: (context) { + return PlaceDetails( + place: _places[marker], + onChanged: (Place value) { + _updatePlaceAndMarker(value, marker); + }, + ); + }), + ); + } + + Future _updatePlaceAndMarker(Place place, Marker marker) async { + _places[marker] = place; + + // Set marker visibility to false to ensure the info window is hidden. Once + // the plugin fully supports the Google Maps API, use hideInfoWindow() + // instead. + await mapController.updateMarker( + marker, + MarkerOptions( + visible: false, + ), + ); + await mapController.updateMarker( + marker, + MarkerOptions( + infoWindowText: InfoWindowText( + place.name, + place.starRating != 0 + ? '${place.starRating} Star Rating' + : null, + ), + visible: true, + ), + ); + } + + void _updatePlaces(PlaceCategory category) { + setState(() { + _selectedPlaceCategory = category; + _showPlacesForSelectedCategory(); + }); + } + + void _showPlacesForSelectedCategory() { + _places.forEach((Marker marker, Place place) { + mapController.updateMarker( + marker, + MarkerOptions( + visible: place.category == _selectedPlaceCategory, + ), + ); + }); + _zoomToFitPlaces(_getPlacesForCategory(_selectedPlaceCategory, _places)); + } + + void _zoomToFitPlaces(List places) { + // Default min/max values to latitude and longitude of center. + double minLat = widget.center.latitude; + double maxLat = widget.center.latitude; + double minLong = widget.center.longitude; + double maxLong = widget.center.longitude; + + for (Place place in places) { + minLat = min(minLat, place.latitude); + maxLat = max(maxLat, place.latitude); + minLong = min(minLong, place.longitude); + maxLong = max(maxLong, place.longitude); + } + + mapController.animateCamera( + CameraUpdate.newLatLngBounds( + LatLngBounds( + southwest: LatLng(minLat, minLong), + northeast: LatLng(maxLat, maxLong), + ), + 48.0, + ), + ); + } + + void _onAddPlaceFabPressed() async { + Marker newMarker = await mapController.addMarker( + MarkerOptions( + position: LatLng( + mapController.cameraPosition.target.latitude, + mapController.cameraPosition.target.longitude, + ), + draggable: true, + icon: BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueGreen), + ), + ); + setState(() { + _pendingMarker = newMarker; + }); + } + + void _confirmAddPlace(BuildContext context) async { + if (_pendingMarker != null) { + await mapController.updateMarker( + _pendingMarker, + MarkerOptions( + icon: _getPlaceMarkerIcon(_selectedPlaceCategory), + infoWindowText: InfoWindowText('New Place', null), + draggable: false, + ), + ); + + // Store a reference to the new marker so that we can pass it to the + // snackbar action. We cannot pass [_pendingMarker] since it will get + // reset to null. + Marker newMarker = _pendingMarker; + Scaffold.of(context).showSnackBar( + SnackBar( + duration: Duration(seconds: 3), + content: const Text( + 'New place added.', + style: const TextStyle(fontSize: 16.0) + ), + action: SnackBarAction( + label: 'Edit', + onPressed: () async { + _pushPlaceDetailsScreen(newMarker); + }, + ), + ), + ); + + setState(() { + // Create a new Place and map it to the marker we just added. + _places[_pendingMarker] = Place( + latLng: _pendingMarker.options.position, + name: _pendingMarker.options.infoWindowText.title, + category: _selectedPlaceCategory, + ); + _pendingMarker = null; + }); + } + } + + void _cancelAddPlace() { + if (_pendingMarker != null) { + mapController.removeMarker(_pendingMarker); + setState(() { + _pendingMarker = null; + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: const [ + Padding( + padding: EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 0.0), + child: Icon(Icons.pin_drop, size: 24.0), + ), + Text('Place Tracker'), + ], + ), + backgroundColor: Colors.green[700], + ), + // We need this additional builder here so that we can pass its context to + // _AddPlaceButtonBar's onSavePressed callback. This callback shows a + // SnackBar and to do this, we need a build context that has Scaffold as + // an ancestor. + body: Builder(builder: (BuildContext context) { + return Center( + child: Stack( + children: [ + GoogleMap( + onMapCreated: onMapCreated, + options: GoogleMapOptions( + trackCameraPosition: true, + cameraPosition: CameraPosition( + target: widget.center, + zoom: 11.0, + ), + ), + ), + _CategoryButtonBar( + selectedPlaceCategory: _selectedPlaceCategory, + visible: _pendingMarker == null, + onChanged: _updatePlaces, + ), + _AddPlaceButtonBar( + visible: _pendingMarker != null, + onSavePressed: () => _confirmAddPlace(context), + onCancelPressed: _cancelAddPlace, + ), + _AddPlaceFab( + visible: _pendingMarker == null, + onPressed: _onAddPlaceFabPressed, + ), + ], + ), + ); + }), + ); + } +} + +class _CategoryButtonBar extends StatelessWidget { + const _CategoryButtonBar({ + Key key, + @required this.selectedPlaceCategory, + @required this.visible, + @required this.onChanged, + }) : assert(selectedPlaceCategory != null), + assert(visible != null), + assert(onChanged != null), + super(key: key); + + final PlaceCategory selectedPlaceCategory; + final bool visible; + final ValueChanged onChanged; + + @override + Widget build(BuildContext context) { + return Opacity( + opacity: visible ? 1.0 : 0.0, + child: Container( + padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 14.0), + alignment: Alignment.bottomCenter, + child: ButtonBar( + alignment: MainAxisAlignment.center, + children: [ + RaisedButton( + color: selectedPlaceCategory == PlaceCategory.favorite + ? Colors.green[700] + : Colors.lightGreen, + child: const Text( + 'Favorites', + style: TextStyle(color: Colors.white, fontSize: 14.0), + ), + onPressed: () => onChanged(PlaceCategory.favorite), + ), + RaisedButton( + color: selectedPlaceCategory == PlaceCategory.visited + ? Colors.green[700] + : Colors.lightGreen, + child: const Text( + 'Visited', + style: TextStyle(color: Colors.white, fontSize: 14.0), + ), + onPressed: () => onChanged(PlaceCategory.visited), + ), + RaisedButton( + color: selectedPlaceCategory == PlaceCategory.wantToGo + ? Colors.green[700] + : Colors.lightGreen, + child: const Text( + 'Want To Go', + style: TextStyle(color: Colors.white, fontSize: 14.0), + ), + onPressed: () => onChanged(PlaceCategory.wantToGo), + ), + ], + ), + ), + ); + } +} + +class _AddPlaceButtonBar extends StatelessWidget { + const _AddPlaceButtonBar({ + Key key, + @required this.visible, + @required this.onSavePressed, + @required this.onCancelPressed, + }) : assert(visible != null), + assert(onSavePressed != null), + assert(onCancelPressed != null), + super(key: key); + + final bool visible; + final VoidCallback onSavePressed; + final VoidCallback onCancelPressed; + + @override + Widget build(BuildContext context) { + return Opacity( + opacity: visible ? 1.0 : 0.0, + child: Container( + padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 14.0), + alignment: Alignment.bottomCenter, + child: ButtonBar( + alignment: MainAxisAlignment.center, + children: [ + RaisedButton( + color: Colors.blue, + child: const Text( + 'Save', + style: TextStyle(color: Colors.white, fontSize: 16.0), + ), + onPressed: onSavePressed, + ), + RaisedButton( + color: Colors.red, + child: const Text( + 'Cancel', + style: TextStyle(color: Colors.white, fontSize: 16.0), + ), + onPressed: onCancelPressed, + ), + ], + ), + ), + ); + } +} + +class _AddPlaceFab extends StatelessWidget { + const _AddPlaceFab({ + Key key, + @required this.visible, + @required this.onPressed, + }) : assert(visible != null), + assert(onPressed != null), + super(key: key); + + final bool visible; + final VoidCallback onPressed; + + @override + Widget build(BuildContext context) { + return Opacity( + opacity: visible ? 1.0 : 0.0, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Align( + alignment: Alignment.topRight, + child: FloatingActionButton( + onPressed: onPressed, + materialTapTargetSize: MaterialTapTargetSize.padded, + backgroundColor: Colors.green, + child: const Icon(Icons.add_location, size: 36.0), + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/place_tracker/lib/place_stub_data.dart b/place_tracker/lib/place_stub_data.dart new file mode 100644 index 000000000..6ed3c496e --- /dev/null +++ b/place_tracker/lib/place_stub_data.dart @@ -0,0 +1,99 @@ +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +import 'place.dart'; + +class PlaceStubData { + static const List places = [ + Place( + latLng: LatLng(45.524676, -122.681922), + name: 'Deschutes Brewery', + description: + 'Beers brewed on-site & gourmet pub grub in a converted auto-body shop with a fireplace & wood beams.', + category: PlaceCategory.favorite, + starRating: 5), + Place( + latLng: LatLng(45.525253, -122.684423), + name: 'TILT', + description: + 'This stylish American eatery offers unfussy breakfast fare, cocktails & burgers in industrial-themed digs.', + category: PlaceCategory.favorite, + starRating: 4), + Place( + latLng: LatLng(45.528952, -122.698344), + name: 'Salt & Straw', + description: + 'Quirky flavors & handmade waffle cones draw crowds to this artisinal ice cream maker\'s 3 parlors.', + category: PlaceCategory.favorite, + starRating: 5), + Place( + latLng: LatLng(45.513485, -122.657982), + name: 'White Owl Social Club', + description: + 'Chill haunt with local beers, burgers & vegan eats, plus live music & an airy patio with a fire pit.', + category: PlaceCategory.favorite, + starRating: 4), + Place( + latLng: LatLng(45.383030, -122.758372), + name: 'Thai Cuisine', + description: + 'Informal restaurant offering Thai standards in a modest setting, plus takeout & delivery.', + category: PlaceCategory.visited, + starRating: 4), + Place( + latLng: LatLng(45.416986, -122.743171), + name: 'Chevys', + description: + 'Lively, informal Mexican chain with a colorful, family-friendly setting plus tequilas & margaritas.', + category: PlaceCategory.visited, + starRating: 4), + Place( + latLng: LatLng(45.430489, -122.831802), + name: 'Cinetopia', + description: + 'Moviegoers can take food from the on-site eatery to their seats, with table service in 21+ theaters.', + category: PlaceCategory.visited, + starRating: 4), + Place( + latLng: LatLng(45.487137, -122.799940), + name: 'Buffalo Wild Wings', + description: + 'Lively sports-bar chain dishing up wings & other American pub grub amid lots of large-screen TVs.', + category: PlaceCategory.visited, + starRating: 5), + Place( + latLng: LatLng(45.493321, -122.669330), + name: 'The Old Spaghetti Factory', + description: + 'Family-friendly chain eatery featuring traditional Italian entrees amid turn-of-the-century decor.', + category: PlaceCategory.visited, + starRating: 4), + Place( + latLng: LatLng(45.548606, -122.675286), + name: 'Mississippi Pizza', + description: + 'Music, trivia & other all-ages events featured at pizzeria with lounge & vegan & gluten-free pies.', + category: PlaceCategory.wantToGo, + starRating: 4), + Place( + latLng: LatLng(45.559783, -122.924103), + name: 'TopGolf', + description: + 'Sprawling entertainment venue with a high-tech driving range & swanky lounge with drinks & games.', + category: PlaceCategory.wantToGo, + starRating: 5), + Place( + latLng: LatLng(45.420226, -122.740347), + name: 'Oswego Grill', + description: + 'Wood-grilled steakhouse favorites served in a casual, romantic restaurant with a popular happy hour.', + category: PlaceCategory.wantToGo, + starRating: 4), + Place( + latLng: LatLng(45.541202, -122.676432), + name: 'The Widmer Brothers Brewery', + description: + 'Popular, enduring gastropub serving craft beers, sandwiches & eclectic entrees in a laid-back space.', + category: PlaceCategory.wantToGo, + starRating: 4), + ]; +} diff --git a/place_tracker/pubspec.yaml b/place_tracker/pubspec.yaml new file mode 100644 index 000000000..46130ef26 --- /dev/null +++ b/place_tracker/pubspec.yaml @@ -0,0 +1,26 @@ +name: place_tracker +description: A new Flutter project. + +version: 1.0.0+1 + +environment: + sdk: ">=2.0.0-dev.68.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + + cupertino_icons: ^0.1.2 + + google_maps_flutter: + git: + url: git://github.com/flutter/plugins + path: packages/google_maps_flutter + +dev_dependencies: + flutter_test: + sdk: flutter + +flutter: + + uses-material-design: true \ No newline at end of file