├── .gitignore ├── .metadata ├── .vscode └── launch.json ├── README.md ├── android ├── .gitignore ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── app │ ├── .classpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── loicngou │ │ │ │ └── todo_app_getx │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets └── images │ ├── default_image.jpg │ └── loading_image.gif ├── gifs ├── demo.gif └── project_stucture.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── auth │ ├── auth.controller.dart │ ├── auth.service.dart │ ├── signin_enum.dart │ └── views │ │ ├── login.dart │ │ ├── register.dart │ │ └── views.dart ├── get_routes.dart ├── main.dart ├── product │ ├── models │ │ ├── category.model.dart │ │ ├── image.model.dart │ │ └── product.model.dart │ ├── product.controller.dart │ ├── product.service.dart │ ├── views │ │ ├── add_product.view.dart │ │ ├── edit_product.view.dart │ │ ├── product_details.view.dart │ │ ├── product_list.view.dart │ │ └── user_products.view.dart │ └── widgets │ │ └── single_product.dart ├── snap_sell.dart ├── splashscreen.dart ├── todo │ ├── models │ │ └── todo.model.dart │ ├── todo.controller.dart │ ├── todo.service.dart │ ├── views │ │ ├── add_todo.view.dart │ │ ├── edit_todo.view.dart │ │ ├── todo_list.view.dart │ │ └── views.dart │ └── widgets │ │ └── todo_item.dart └── widgets │ ├── app_cached_image.dart │ └── app_drawer.dart ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart └── windows ├── .gitignore ├── AppConfiguration.props ├── FlutterBuild.vcxproj ├── Runner.sln ├── Runner.vcxproj ├── Runner.vcxproj.filters ├── flutter ├── .template_version ├── GeneratedPlugins.props ├── generated_plugin_registrant.cc └── generated_plugin_registrant.h ├── runner ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources │ └── app_icon.ico ├── run_loop.cpp ├── run_loop.h ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp ├── win32_window.h ├── window_configuration.cpp └── window_configuration.h └── scripts ├── bundle_assets_and_deps.bat └── prepare_dependencies.bat /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9d58a87066d1da98eb06826918e4b90cc76ae0ef 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Flutter", 9 | "request": "launch", 10 | "type": "dart" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # todo_app_getx 2 | 3 | A todo app using Getx package for routing and state manager. 4 | 5 | ## Demo 6 | 7 | ![Todo with GetX Demo](./gifs/demo.gif) 8 | 9 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 10 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=D\:/setups/android-studio/jre 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.3)) 5 | connection.project.dir=.. 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=D\:/setups/android-studio/jre 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.loicngou.todo_app_getx" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | debug{ 55 | minifyEnabled true 56 | } 57 | } 58 | } 59 | 60 | flutter { 61 | source '../..' 62 | } 63 | 64 | dependencies { 65 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 66 | } 67 | 68 | // Add the following line: 69 | apply plugin: 'com.google.gms.google-services' // Google Services plugin 70 | 71 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "242186607519", 4 | "firebase_url": "https://acl40-1ea94.firebaseio.com", 5 | "project_id": "acl40-1ea94", 6 | "storage_bucket": "acl40-1ea94.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:242186607519:android:1511c55739f6077c", 12 | "android_client_info": { 13 | "package_name": "com.loicngou.alcchallenge2" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "242186607519-0er6nvekjmbndojosq370irh8ku2etib.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "com.loicngou.alcchallenge2", 22 | "certificate_hash": "0c92eaae31a3a14def5d26928dfecb608b17a716" 23 | } 24 | }, 25 | { 26 | "client_id": "242186607519-r8l03ml2i2g2vr32n6jvtq3c3u35ijcp.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyCHE7UO3-amW8vUc1bha5U_Ncjt7TSdXM0" 33 | } 34 | ], 35 | "services": { 36 | "appinvite_service": { 37 | "other_platform_oauth_client": [ 38 | { 39 | "client_id": "242186607519-r8l03ml2i2g2vr32n6jvtq3c3u35ijcp.apps.googleusercontent.com", 40 | "client_type": 3 41 | } 42 | ] 43 | } 44 | } 45 | }, 46 | { 47 | "client_info": { 48 | "mobilesdk_app_id": "1:242186607519:android:fd2378f2cbb4f0ee9bbbaa", 49 | "android_client_info": { 50 | "package_name": "com.loicngou.todo_app_getx" 51 | } 52 | }, 53 | "oauth_client": [ 54 | { 55 | "client_id": "242186607519-int118t4937904f85hjqe7t214v8lf49.apps.googleusercontent.com", 56 | "client_type": 1, 57 | "android_info": { 58 | "package_name": "com.loicngou.todo_app_getx", 59 | "certificate_hash": "7f19df5b69745b1b1329f2ec62433282bfa1992b" 60 | } 61 | }, 62 | { 63 | "client_id": "242186607519-r8l03ml2i2g2vr32n6jvtq3c3u35ijcp.apps.googleusercontent.com", 64 | "client_type": 3 65 | } 66 | ], 67 | "api_key": [ 68 | { 69 | "current_key": "AIzaSyCHE7UO3-amW8vUc1bha5U_Ncjt7TSdXM0" 70 | } 71 | ], 72 | "services": { 73 | "appinvite_service": { 74 | "other_platform_oauth_client": [ 75 | { 76 | "client_id": "242186607519-r8l03ml2i2g2vr32n6jvtq3c3u35ijcp.apps.googleusercontent.com", 77 | "client_type": 3 78 | } 79 | ] 80 | } 81 | } 82 | } 83 | ], 84 | "configuration_version": "1" 85 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 9 | 10 | 11 | 12 | 16 | 23 | 27 | 31 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/loicngou/todo_app_getx/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.loicngou.todo_app_getx 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | 10 | 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | // Add the following line: 14 | classpath 'com.google.gms:google-services:4.3.3' // Google Services plugin 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | rootProject.buildDir = '../build' 26 | subprojects { 27 | project.buildDir = "${rootProject.buildDir}/${project.name}" 28 | } 29 | subprojects { 30 | project.evaluationDependsOn(':app') 31 | } 32 | 33 | task clean(type: Delete) { 34 | delete rootProject.buildDir 35 | } 36 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | include ':app' 6 | 7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 8 | def properties = new Properties() 9 | 10 | assert localPropertiesFile.exists() 11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 12 | 13 | def flutterSdkPath = properties.getProperty("flutter.sdk") 14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 16 | -------------------------------------------------------------------------------- /assets/images/default_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/assets/images/default_image.jpg -------------------------------------------------------------------------------- /assets/images/loading_image.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/assets/images/loading_image.gif -------------------------------------------------------------------------------- /gifs/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/gifs/demo.gif -------------------------------------------------------------------------------- /gifs/project_stucture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/gifs/project_stucture.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.loicngou.todoAppGetx; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.loicngou.todoAppGetx; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.loicngou.todoAppGetx; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | 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. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | todo_app_getx 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/auth/auth.controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:todo_app_getx/auth/auth.service.dart'; 6 | import 'package:todo_app_getx/auth/signin_enum.dart'; 7 | 8 | class AuthController extends GetxController { 9 | static AuthController to = Get.find(); 10 | RxBool isLogged = false.obs; 11 | TextEditingController emailController; 12 | TextEditingController passwordController; 13 | AuthService _authService; 14 | Rx user = Rx(); 15 | 16 | AuthController() { 17 | _authService = AuthService(); 18 | } 19 | 20 | @override 21 | void onReady() async { 22 | ever(user, handleAuthChanged); 23 | user.value = await _authService.getCurrentUser(); 24 | 25 | user.bindStream(_authService.onAuthChanged()); 26 | emailController = TextEditingController(); 27 | passwordController = TextEditingController(); 28 | super.onInit(); 29 | } 30 | 31 | @override 32 | void onClose() { 33 | emailController?.dispose(); 34 | passwordController?.dispose(); 35 | super.onClose(); 36 | } 37 | 38 | handleAuthChanged(user) { 39 | if (user == null) { 40 | Get.offAllNamed("/login"); 41 | } else { 42 | Get.offAllNamed("/"); 43 | } 44 | } 45 | 46 | handleSignIn(SignInType type) async { 47 | if (type == SignInType.EMAIL_PASSWORD) { 48 | if (emailController.text == "" || passwordController.text == "") { 49 | Get.snackbar( 50 | "Error", 51 | "Empty email or password", 52 | ); 53 | return; 54 | } 55 | } 56 | 57 | Get.snackbar("Signing In", "Loading", 58 | showProgressIndicator: true, 59 | snackPosition: SnackPosition.BOTTOM, 60 | duration: Duration(minutes: 2)); 61 | try { 62 | if (type == SignInType.EMAIL_PASSWORD) { 63 | await _authService.signInWithEmailAndPassword( 64 | emailController.text.trim(), passwordController.text.trim()); 65 | emailController.clear(); 66 | passwordController.clear(); 67 | } 68 | if (type == SignInType.GOOGLE) { 69 | await _authService.signInWithGoogle(); 70 | } 71 | } catch (e) { 72 | Get.back(); 73 | Get.defaultDialog(title: "Error", middleText: e.message, actions: [ 74 | FlatButton( 75 | onPressed: () { 76 | Get.back(); 77 | }, 78 | child: Text("Close"), 79 | ), 80 | ]); 81 | print(e); 82 | } 83 | } 84 | 85 | handleSignUp() async { 86 | if (emailController.text == "" || passwordController.text == "") { 87 | Get.snackbar( 88 | "Error", 89 | "Empty email or password", 90 | ); 91 | return; 92 | } 93 | 94 | Get.snackbar("Signing Up", "Loading", 95 | showProgressIndicator: true, 96 | snackPosition: SnackPosition.BOTTOM, 97 | duration: Duration(minutes: 2)); 98 | try { 99 | await _authService.signUp( 100 | emailController.text.trim(), passwordController.text.trim()); 101 | emailController.clear(); 102 | passwordController.clear(); 103 | } catch (e) { 104 | Get.back(); 105 | Get.defaultDialog(title: "Error", middleText: e.message, actions: [ 106 | FlatButton( 107 | onPressed: () { 108 | Get.back(); 109 | }, 110 | child: Text("Close"), 111 | ), 112 | ]); 113 | print(e); 114 | } 115 | } 116 | 117 | handleSignOut() { 118 | _authService.signOut(); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /lib/auth/auth.service.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:google_sign_in/google_sign_in.dart'; 3 | 4 | class AuthService { 5 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance; 6 | final GoogleSignIn _googleSignIn = GoogleSignIn(); 7 | 8 | Stream onAuthChanged() { 9 | return _firebaseAuth.onAuthStateChanged; 10 | } 11 | 12 | Future signInWithEmailAndPassword( 13 | String email, String password) async { 14 | AuthResult result = await _firebaseAuth.signInWithEmailAndPassword( 15 | email: email, password: password); 16 | return result.user.uid; 17 | } 18 | 19 | Future signInWithGoogle() async { 20 | await _googleSignIn.signOut(); 21 | final GoogleSignInAccount googleUser = await _googleSignIn.signIn(); 22 | final GoogleSignInAuthentication googleAuth = 23 | await googleUser.authentication; 24 | final AuthCredential credential = GoogleAuthProvider.getCredential( 25 | accessToken: googleAuth.accessToken, 26 | idToken: googleAuth.idToken, 27 | ); 28 | await _firebaseAuth.signInWithCredential(credential); 29 | FirebaseUser user = await _firebaseAuth.currentUser(); 30 | return user.uid; 31 | } 32 | 33 | Future isSignedIn() async { 34 | final currentUser = await _firebaseAuth.currentUser(); 35 | return currentUser != null; 36 | } 37 | 38 | Future signUp( 39 | String email, 40 | String password, { 41 | String username, 42 | }) async { 43 | AuthResult result = await _firebaseAuth.createUserWithEmailAndPassword( 44 | email: email, 45 | password: password, 46 | ); 47 | return result.user.uid; 48 | } 49 | 50 | Future getCurrentUser() async { 51 | FirebaseUser user = await _firebaseAuth.currentUser(); 52 | return user; 53 | } 54 | 55 | Future getAccessToken() async { 56 | FirebaseUser user = await getCurrentUser(); 57 | IdTokenResult tokenResult = await user.getIdToken(); 58 | return tokenResult.token; 59 | } 60 | 61 | Future getRefreshToken() async { 62 | FirebaseUser user = await _firebaseAuth.currentUser(); 63 | IdTokenResult tokenResult = await user.getIdToken(refresh: true); 64 | return tokenResult.token; 65 | } 66 | 67 | Future signOut() async { 68 | return Future.wait([ 69 | _firebaseAuth.signOut(), 70 | _googleSignIn.signOut(), 71 | ]); 72 | } 73 | 74 | Future sendEmailVerification() async { 75 | FirebaseUser user = await _firebaseAuth.currentUser(); 76 | user.sendEmailVerification(); 77 | } 78 | 79 | Future isEmailVerified() async { 80 | FirebaseUser user = await _firebaseAuth.currentUser(); 81 | return user.isEmailVerified; 82 | } 83 | 84 | @override 85 | Future changeEmail(String email) async { 86 | FirebaseUser user = await _firebaseAuth.currentUser(); 87 | return user.updateEmail(email); 88 | } 89 | 90 | @override 91 | Future changePassword(String password) async { 92 | FirebaseUser user = await _firebaseAuth.currentUser(); 93 | user.updatePassword(password).then((_) { 94 | print("Succesfull changed password"); 95 | }).catchError((error) { 96 | print("Password can't be changed" + error.toString()); 97 | }); 98 | return null; 99 | } 100 | 101 | @override 102 | Future deleteUser() async { 103 | FirebaseUser user = await _firebaseAuth.currentUser(); 104 | user.delete().then((_) { 105 | print("Succesfull user deleted"); 106 | }).catchError((error) { 107 | print("user can't be delete" + error.toString()); 108 | }); 109 | return null; 110 | } 111 | 112 | @override 113 | Future sendPasswordResetMail(String email) async { 114 | await _firebaseAuth.sendPasswordResetEmail(email: email); 115 | return null; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /lib/auth/signin_enum.dart: -------------------------------------------------------------------------------- 1 | enum SignInType { EMAIL_PASSWORD, GOOGLE } 2 | -------------------------------------------------------------------------------- /lib/auth/views/login.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/auth/auth.controller.dart'; 4 | 5 | import '../signin_enum.dart'; 6 | 7 | class LoginPage extends StatelessWidget { 8 | final AuthController authController = AuthController.to; 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: Text("Login"), 14 | ), 15 | body: Padding( 16 | padding: const EdgeInsets.all(8.0), 17 | child: Column( 18 | mainAxisAlignment: MainAxisAlignment.center, 19 | children: [ 20 | TextField( 21 | controller: authController.emailController, 22 | decoration: InputDecoration(hintText: "Email"), 23 | ), 24 | TextField( 25 | controller: authController.passwordController, 26 | decoration: InputDecoration(hintText: "Password"), 27 | ), 28 | Padding( 29 | padding: const EdgeInsets.all(8.0), 30 | child: Row( 31 | mainAxisAlignment: MainAxisAlignment.spaceAround, 32 | children: [ 33 | FlatButton( 34 | padding: EdgeInsets.all(8), 35 | color: Colors.blue, 36 | onPressed: () { 37 | authController.handleSignIn(SignInType.EMAIL_PASSWORD); 38 | }, 39 | child: Text( 40 | "Sign In", 41 | style: TextStyle(color: Colors.white), 42 | ), 43 | ), 44 | FlatButton( 45 | padding: EdgeInsets.all(8), 46 | color: Colors.primaries[0], 47 | onPressed: () { 48 | authController.handleSignIn(SignInType.GOOGLE); 49 | }, 50 | child: Text( 51 | "SignIn with Google", 52 | style: TextStyle(color: Colors.white), 53 | ), 54 | ), 55 | ], 56 | ), 57 | ), 58 | GestureDetector( 59 | onTap: () { 60 | Get.toNamed("/register"); 61 | }, 62 | child: Padding( 63 | padding: const EdgeInsets.all(8.0), 64 | child: Text("No account ? Register Here!"), 65 | ), 66 | ) 67 | ], 68 | ), 69 | ), 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/auth/views/register.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:todo_app_getx/auth/auth.controller.dart'; 3 | 4 | class RegisterPage extends StatelessWidget { 5 | final AuthController authController = AuthController.to; 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text("Register"), 11 | ), 12 | body: Padding( 13 | padding: const EdgeInsets.all(8.0), 14 | child: Column( 15 | mainAxisAlignment: MainAxisAlignment.center, 16 | children: [ 17 | TextField( 18 | controller: authController.emailController, 19 | decoration: InputDecoration(hintText: "Email"), 20 | ), 21 | TextField( 22 | controller: authController.passwordController, 23 | decoration: InputDecoration(hintText: "Password"), 24 | ), 25 | Padding( 26 | padding: const EdgeInsets.all(8.0), 27 | child: Row( 28 | mainAxisAlignment: MainAxisAlignment.spaceAround, 29 | children: [ 30 | FlatButton( 31 | padding: EdgeInsets.all(8), 32 | color: Colors.blue, 33 | onPressed: () { 34 | authController.handleSignUp(); 35 | }, 36 | child: Text( 37 | "Sign Up", 38 | style: TextStyle(color: Colors.white), 39 | ), 40 | ), 41 | ], 42 | ), 43 | ), 44 | ], 45 | ), 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/auth/views/views.dart: -------------------------------------------------------------------------------- 1 | import "login.dart"; 2 | import 'register.dart'; 3 | -------------------------------------------------------------------------------- /lib/get_routes.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:todo_app_getx/auth/views/login.dart'; 3 | import 'package:todo_app_getx/auth/views/register.dart'; 4 | import 'package:todo_app_getx/product/views/product_details.view.dart'; 5 | import 'package:todo_app_getx/snap_sell.dart'; 6 | import 'package:todo_app_getx/splashscreen.dart'; 7 | import 'package:todo_app_getx/todo/views/views.dart'; 8 | 9 | class AppRoutes { 10 | static final routes = [ 11 | GetPage( 12 | name: '/splashscreen', 13 | page: () => SplashScreen(), 14 | ), 15 | GetPage( 16 | name: '/', 17 | page: () => SnapSell(), //(uncomment here to swith to todo app)TodoList(), 18 | ), 19 | GetPage( 20 | name: '/login', 21 | page: () => LoginPage(), 22 | ), 23 | GetPage( 24 | name: '/register', 25 | page: () => RegisterPage(), 26 | ), 27 | GetPage( 28 | name: '/todos', 29 | page: () => TodoList(), 30 | ), 31 | GetPage( 32 | name: '/todos/:id/edit', 33 | page: () => EditTodo(), 34 | ), 35 | GetPage( 36 | name: '/add-todo', 37 | page: () => AddTodo(), 38 | ), 39 | GetPage( 40 | name: "/products/:product_id/view", 41 | page: () => ProductDetailsPage(), 42 | ) 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/auth/auth.controller.dart'; 4 | import 'package:todo_app_getx/get_routes.dart'; 5 | import 'package:todo_app_getx/product/product.controller.dart'; 6 | 7 | void main() { 8 | WidgetsFlutterBinding.ensureInitialized(); 9 | 10 | runApp(MyApp()); 11 | } 12 | 13 | class MyApp extends StatelessWidget { 14 | final AuthController authController = 15 | Get.put(AuthController()); 16 | final ProductController productController = 17 | Get.put(ProductController()); 18 | @override 19 | Widget build(BuildContext context) { 20 | return GetMaterialApp( 21 | debugShowCheckedModeBanner: false, 22 | title: 'Todo App with Get Package', 23 | defaultTransition: Transition.rightToLeft, 24 | theme: ThemeData( 25 | primarySwatch: Colors.blue, 26 | visualDensity: VisualDensity.adaptivePlatformDensity, 27 | appBarTheme: AppBarTheme( 28 | elevation: 0, 29 | ), 30 | ), 31 | initialRoute: "/splashscreen", 32 | getPages: AppRoutes.routes, 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/product/models/category.model.dart: -------------------------------------------------------------------------------- 1 | class Category { 2 | String id; 3 | String name; 4 | } 5 | -------------------------------------------------------------------------------- /lib/product/models/image.model.dart: -------------------------------------------------------------------------------- 1 | class ImageModel { 2 | String id; 3 | String url; 4 | ImageModel({this.id, this.url}); 5 | 6 | factory ImageModel.fromJson(Map json) { 7 | return ImageModel( 8 | id: json["id"], 9 | url: json['url'], 10 | ); 11 | } 12 | toJson() { 13 | return {"id": id, "url": url}; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/product/models/product.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:todo_app_getx/product/models/category.model.dart'; 3 | import 'package:todo_app_getx/product/models/image.model.dart'; 4 | 5 | class Product { 6 | String id; 7 | String name; 8 | double price; 9 | String desc; 10 | int quantity; 11 | String userId; 12 | String username; 13 | Category category; 14 | List gallery; 15 | List likes; 16 | 17 | Product({ 18 | this.id, 19 | this.name, 20 | this.price, 21 | this.desc, 22 | this.quantity, 23 | this.userId, 24 | this.username, 25 | this.category, 26 | this.gallery, 27 | this.likes, 28 | }); 29 | 30 | factory Product.fromSnapshot(DocumentSnapshot snap) { 31 | return Product( 32 | id: snap.documentID, 33 | name: snap.data["name"], 34 | price: snap.data['price'], 35 | desc: snap.data['desc'], 36 | username: snap.data['username'], 37 | userId: snap.data['user_id'], 38 | gallery: List.from( 39 | snap.data['gallery'].map((e) => ImageModel.fromJson(e))), 40 | ); 41 | } 42 | 43 | toJson() { 44 | return {"name": name, "price": price, "desc": desc}; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/product/product.controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/product/product.service.dart'; 4 | import 'package:todo_app_getx/auth/auth.controller.dart'; 5 | import 'models/category.model.dart'; 6 | import 'models/product.model.dart'; 7 | 8 | class ProductController extends GetxController { 9 | static ProductController to = Get.find(); 10 | TextEditingController productName; 11 | TextEditingController productPrice; 12 | TextEditingController productDesc; 13 | TextEditingController productQty; 14 | Category productCategory; 15 | 16 | // 17 | bool isLoadingDetails = false; 18 | bool errorLoadingDetails = false; 19 | bool successLoadingDetails = false; 20 | Product activeProduct; 21 | 22 | // 23 | 24 | RxList productList = [].obs; 25 | RxList userProductsList = [].obs; 26 | ProductService productService; 27 | ProductController() { 28 | productService = ProductService(); 29 | } 30 | 31 | @override 32 | onReady() { 33 | productName = TextEditingController(); 34 | productPrice = TextEditingController(); 35 | productDesc = TextEditingController(); 36 | productQty = TextEditingController(); 37 | productList.bindStream(loadProducts()); 38 | } 39 | 40 | Stream> loadProducts() { 41 | return productService.findAll(); 42 | } 43 | 44 | loadDetails(String productId) async { 45 | try { 46 | isLoadingDetails = true; 47 | errorLoadingDetails = false; 48 | activeProduct = await productService.findOne(productId); 49 | print(activeProduct); 50 | isLoadingDetails = false; 51 | successLoadingDetails = true; 52 | } catch (e) { 53 | isLoadingDetails = false; 54 | successLoadingDetails = false; 55 | errorLoadingDetails = true; 56 | } 57 | } 58 | 59 | @override 60 | onClose() { 61 | productName?.dispose(); 62 | productPrice?.dispose(); 63 | productDesc?.dispose(); 64 | productQty?.dispose(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/product/product.service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | import 'package:todo_app_getx/product/models/image.model.dart'; 5 | import './models/product.model.dart'; 6 | 7 | class ProductService { 8 | CollectionReference productsRef = Firestore.instance.collection("products"); 9 | final StreamController> _productsController = 10 | StreamController>.broadcast(); 11 | Stream> findAll() { 12 | // Register the handler for when the products data changes 13 | productsRef.snapshots().listen((productsSnapshot) { 14 | if (productsSnapshot.documents.isNotEmpty) { 15 | var products = productsSnapshot.documents 16 | .map((snapshot) => Product.fromSnapshot(snapshot)) 17 | .toList(); 18 | print(products.length); 19 | // Add the products onto the controller 20 | _productsController.add(products); 21 | } 22 | }); 23 | // Return the stream underlying our _productsController. 24 | return _productsController.stream; 25 | } 26 | 27 | Future findOne(String id) async { 28 | var result = await productsRef.document(id).get(); 29 | return Product.fromSnapshot(result); 30 | } 31 | 32 | Future addOne({ 33 | String userId, 34 | String username, 35 | String name, 36 | String desc, 37 | double price, 38 | int quantity, 39 | }) async { 40 | var result = await productsRef.add({ 41 | "user_id": userId, 42 | "username": username, 43 | "name": name, 44 | "desc": desc, 45 | "price": price, 46 | "quantity": quantity, 47 | "created_at": DateTime.now().toUtc().toString(), 48 | }); 49 | return Product( 50 | id: result.documentID, 51 | name: name, 52 | desc: desc, 53 | userId: userId, 54 | username: username, 55 | price: price, 56 | quantity: quantity, 57 | ); 58 | } 59 | 60 | Future updateOne(Product product) async { 61 | productsRef.document(product.id).updateData(product.toJson()); 62 | } 63 | 64 | deleteOne(String id) { 65 | productsRef.document(id).delete(); 66 | } 67 | 68 | addGallery(String productId, List images) { 69 | productsRef.document(productId).updateData( 70 | { 71 | "gallery": images.map((e) => e.toJson()).toList(), 72 | }, 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/product/views/add_product.view.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:typed_data'; 3 | 4 | import 'package:firebase_storage/firebase_storage.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:get/get.dart'; 7 | import 'package:multi_image_picker/multi_image_picker.dart'; 8 | import 'package:todo_app_getx/auth/auth.controller.dart'; 9 | import 'package:todo_app_getx/product/models/image.model.dart'; 10 | import 'package:todo_app_getx/product/product.controller.dart'; 11 | import 'package:todo_app_getx/product/product.service.dart'; 12 | 13 | class AddProductPage extends StatefulWidget { 14 | @override 15 | _AddProductPageState createState() => _AddProductPageState(); 16 | } 17 | 18 | class _AddProductPageState extends State { 19 | final ProductController productController = ProductController.to; 20 | 21 | List images = List(); 22 | List remoteImages = List(); 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | appBar: AppBar( 27 | title: Text("Add Product"), 28 | centerTitle: true, 29 | actions: [ 30 | IconButton( 31 | icon: Icon(Icons.save), 32 | onPressed: () { 33 | saveProduct(); 34 | }, 35 | ) 36 | ], 37 | ), 38 | body: Padding( 39 | padding: const EdgeInsets.all(8.0), 40 | child: Column( 41 | children: [ 42 | TextFormField( 43 | controller: productController.productName, 44 | decoration: InputDecoration(hintText: "Name"), 45 | ), 46 | TextFormField( 47 | controller: productController.productPrice, 48 | decoration: InputDecoration(hintText: "Price"), 49 | keyboardType: TextInputType.number, 50 | ), 51 | TextFormField( 52 | controller: productController.productQty, 53 | decoration: InputDecoration(hintText: "Quantity"), 54 | keyboardType: TextInputType.number, 55 | ), 56 | TextFormField( 57 | controller: productController.productDesc, 58 | minLines: 3, 59 | maxLines: 10, 60 | decoration: InputDecoration( 61 | hintText: "Description", 62 | ), 63 | ), 64 | Expanded( 65 | child: Padding( 66 | padding: const EdgeInsets.all(8.0), 67 | child: buildGridView(), 68 | )), 69 | ], 70 | ), 71 | ), 72 | floatingActionButton: FloatingActionButton( 73 | onPressed: () { 74 | loadAssets(); 75 | }, 76 | child: Icon( 77 | Icons.camera_alt, 78 | ), 79 | ), 80 | ); 81 | } 82 | 83 | Widget buildGridView() { 84 | if (images != null) 85 | return GridView.count( 86 | crossAxisCount: 3, 87 | children: List.generate(images.length, (index) { 88 | Asset asset = images[index]; 89 | return Padding( 90 | padding: const EdgeInsets.all(4.0), 91 | child: Stack( 92 | children: [ 93 | AssetThumb( 94 | asset: asset, 95 | width: 300, 96 | height: 300, 97 | ), 98 | Positioned( 99 | child: Container( 100 | height: 30, 101 | width: 30, 102 | color: Colors.black.withOpacity(.5), 103 | child: Center( 104 | child: GestureDetector( 105 | child: Icon( 106 | Icons.remove, 107 | color: Colors.white, 108 | ), 109 | onTap: () { 110 | setState(() { 111 | images = images 112 | .where((element) => 113 | element.identifier != asset.identifier) 114 | .toList(); 115 | }); 116 | }), 117 | ), 118 | )) 119 | ], 120 | ), 121 | ); 122 | }), 123 | ); 124 | else 125 | return Container( 126 | child: Center( 127 | child: Icon( 128 | Icons.image, 129 | size: 50, 130 | color: Colors.black, 131 | ), 132 | ), 133 | ); 134 | } 135 | 136 | Future loadAssets() async { 137 | List resultList; 138 | String error; 139 | 140 | try { 141 | resultList = await MultiImagePicker.pickImages( 142 | maxImages: 300, 143 | enableCamera: true, 144 | ); 145 | } on Exception catch (e) { 146 | error = e.toString(); 147 | } 148 | 149 | // If the widget was removed from the tree while the asynchronous platform 150 | // message was in flight, we want to discard the reply rather than calling 151 | // setState to update our non-existent appearance. 152 | if (!mounted) return; 153 | if (resultList != null) { 154 | setState(() { 155 | resultList.addAll(images); 156 | images = resultList; 157 | }); 158 | } 159 | } 160 | 161 | void saveProduct() { 162 | var user = AuthController.to.user.value; 163 | ProductService productService = new ProductService(); 164 | Get.rawSnackbar( 165 | title: "Saving", 166 | messageText: Row( 167 | children: [ 168 | Container( 169 | child: Center( 170 | child: CircularProgressIndicator(), 171 | ), 172 | ) 173 | ], 174 | ), 175 | ); 176 | productService 177 | .addOne( 178 | userId: user.uid, 179 | name: productController.productName.text, 180 | price: double.parse(productController.productPrice.text), 181 | quantity: int.parse(productController.productQty.text), 182 | desc: productController.productDesc.text, 183 | username: user.displayName, 184 | ) 185 | .then((product) async { 186 | for (var i = 0; i < images.length; i++) { 187 | var img = await saveImage(images[i]); 188 | remoteImages.add(img); 189 | } 190 | productService.addGallery(product.id, remoteImages); 191 | setState(() { 192 | remoteImages = []; 193 | images = []; 194 | productController.productName.clear(); 195 | productController.productPrice.clear(); 196 | productController.productQty.clear(); 197 | productController.productDesc.clear(); 198 | }); 199 | Get.snackbar("Success", "Product saved"); 200 | }); 201 | } 202 | } 203 | 204 | Future saveImage(Asset asset) async { 205 | ByteData byteData = await asset.getByteData(); 206 | List imageData = byteData.buffer.asUint8List(); 207 | var now = DateTime.now().millisecondsSinceEpoch; 208 | StorageReference ref = FirebaseStorage.instance.ref().child("$now.jpg"); 209 | StorageUploadTask uploadTask = ref.putData(imageData); 210 | final StreamSubscription streamSubscription = 211 | uploadTask.events.listen((event) { 212 | // You can use this to notify yourself or your user in any kind of way. 213 | // For example: you could use the uploadTask.events stream in a StreamBuilder instead 214 | // to show your user what the current status is. In that case, you would not need to cancel any 215 | // subscription as StreamBuilder handles this automatically. 216 | 217 | // Here, every StorageTaskEvent concerning the upload is printed to the logs. 218 | print( 219 | "${(event.snapshot.bytesTransferred * 100 / event.snapshot.totalByteCount)}%"); 220 | print('EVENT ${event.type}'); 221 | }); 222 | var storageSnapshot = await uploadTask.onComplete; 223 | // Cancel your subscription when done. 224 | streamSubscription.cancel(); 225 | var url = await storageSnapshot.ref.getDownloadURL(); 226 | return ImageModel(id: "$now", url: url); 227 | } 228 | -------------------------------------------------------------------------------- /lib/product/views/edit_product.view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class EditProductPage extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Scaffold( 7 | appBar: AppBar(), 8 | body: Text("edit Product "), 9 | ); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/product/views/product_details.view.dart: -------------------------------------------------------------------------------- 1 | import 'package:carousel_slider/carousel_slider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:todo_app_getx/product/product.controller.dart'; 5 | 6 | class ProductDetailsPage extends StatefulWidget { 7 | ProductDetailsPage({Key key}) : super(key: key); 8 | 9 | @override 10 | _ProductDetailsPageState createState() => _ProductDetailsPageState(); 11 | } 12 | 13 | class _ProductDetailsPageState extends State { 14 | ProductController productController = ProductController.to; 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: AppBar( 19 | title: Text("Details"), 20 | ), 21 | body: GetX( 22 | initState: (state) { 23 | productController.loadDetails(Get.parameters["product_id"]); 24 | }, 25 | builder: (disposible) { 26 | if (productController.isLoadingDetails) { 27 | return Container( 28 | child: Center( 29 | child: CircularProgressIndicator(), 30 | ), 31 | ); 32 | } 33 | 34 | if (productController.errorLoadingDetails) { 35 | return Container( 36 | child: Center( 37 | child: FlatButton( 38 | child: Text("Relosd"), 39 | onPressed: () { 40 | productController.loadDetails(Get.parameters["product_id"]); 41 | }, 42 | ), 43 | ), 44 | ); 45 | } 46 | 47 | return Column( 48 | children: [ 49 | CarouselSlider( 50 | options: CarouselOptions(height: 200.0), 51 | items: productController.activeProduct.gallery.map((image) { 52 | return Builder( 53 | builder: (BuildContext context) { 54 | return Container( 55 | width: MediaQuery.of(context).size.width, 56 | margin: EdgeInsets.symmetric(horizontal: 5.0), 57 | decoration: BoxDecoration( 58 | color: Colors.amber, 59 | image: DecorationImage( 60 | image: NetworkImage( 61 | image.url, 62 | ), 63 | fit: BoxFit.cover, 64 | )), 65 | ); 66 | }, 67 | ); 68 | }).toList(), 69 | ), 70 | Text("${productController.activeProduct.name}"), 71 | ], 72 | ); 73 | }, 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/product/views/product_list.view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:todo_app_getx/product/product.controller.dart'; 5 | import 'package:todo_app_getx/product/widgets/single_product.dart'; 6 | import 'package:todo_app_getx/widgets/app_drawer.dart'; 7 | 8 | class ProductListPage extends StatelessWidget { 9 | final GlobalKey scaffoldKey = GlobalKey(); 10 | final ProductController productController = ProductController.to; 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | key: scaffoldKey, 15 | drawer: AppDrawer(), 16 | appBar: AppBar( 17 | title: Text("Snap Sell"), 18 | centerTitle: true, 19 | leading: IconButton( 20 | onPressed: () { 21 | scaffoldKey.currentState.openDrawer(); 22 | }, 23 | icon: Icon(Icons.menu)), 24 | ), 25 | body: Obx(() { 26 | return Padding( 27 | padding: const EdgeInsets.all(8.0), 28 | child: StaggeredGridView.countBuilder( 29 | crossAxisCount: 4, 30 | itemCount: productController.productList.length, 31 | itemBuilder: (BuildContext context, int index) => SingleProduct( 32 | product: productController.productList[index], 33 | ), 34 | staggeredTileBuilder: (int index) => 35 | new StaggeredTile.count(2, index == 2 ? 2 : 3), 36 | mainAxisSpacing: 4.0, 37 | crossAxisSpacing: 4.0, 38 | ), 39 | ); 40 | }), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/product/views/user_products.view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class UserProductsPage extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Scaffold( 7 | appBar: AppBar( 8 | title: Text("Your Products"), 9 | centerTitle: true, 10 | ), 11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/product/widgets/single_product.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/product/models/product.model.dart'; 4 | import 'package:todo_app_getx/widgets/app_cached_image.dart'; 5 | 6 | class SingleProduct extends StatelessWidget { 7 | final Product product; 8 | const SingleProduct({Key key, this.product}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return GestureDetector( 13 | onTap: () { 14 | Get.toNamed("products/${product.id}/view"); 15 | }, 16 | child: Container( 17 | decoration: BoxDecoration( 18 | borderRadius: BorderRadius.circular(20), 19 | border: Border.all( 20 | color: Colors.black, 21 | ), 22 | ), 23 | child: Column( 24 | children: [ 25 | Expanded( 26 | child: AppCachedImage( 27 | url: product.gallery.first.url, 28 | imageBuilder: (context, provider) { 29 | return Container( 30 | decoration: BoxDecoration( 31 | borderRadius: BorderRadius.only( 32 | topLeft: Radius.circular(20), 33 | topRight: Radius.circular(20), 34 | ), 35 | image: DecorationImage( 36 | image: provider, 37 | fit: BoxFit.cover, 38 | )), 39 | ); 40 | }), 41 | ), 42 | Text(product.name), 43 | Text(product.desc), 44 | Text("\$ ${product.price}"), 45 | ], 46 | ), 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/snap_sell.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:todo_app_getx/product/views/add_product.view.dart'; 3 | import 'package:todo_app_getx/product/views/edit_product.view.dart'; 4 | import 'package:todo_app_getx/product/views/product_list.view.dart'; 5 | import 'package:todo_app_getx/product/views/user_products.view.dart'; 6 | import 'package:todo_app_getx/widgets/app_drawer.dart'; 7 | 8 | class SnapSell extends StatefulWidget { 9 | @override 10 | _SnapSellState createState() => _SnapSellState(); 11 | } 12 | 13 | class _SnapSellState extends State { 14 | int _currentIndex = 0; 15 | final PageController pageController = PageController(); 16 | 17 | @override 18 | void initState() { 19 | pageController.addListener(() { 20 | setState(() { 21 | _currentIndex = pageController.page.toInt(); 22 | }); 23 | }); 24 | super.initState(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | body: PageView( 31 | controller: pageController, 32 | children: [ 33 | ProductListPage(), 34 | AddProductPage(), 35 | UserProductsPage(), 36 | ], 37 | ), 38 | bottomNavigationBar: BottomNavigationBar( 39 | elevation: 0, 40 | backgroundColor: Colors.blue.withOpacity(.1), 41 | currentIndex: _currentIndex, 42 | onTap: (value) { 43 | setState(() { 44 | _currentIndex = value; 45 | }); 46 | pageController.animateToPage( 47 | value, 48 | curve: Curves.easeIn, 49 | duration: Duration(milliseconds: 400), 50 | ); 51 | }, 52 | items: [ 53 | BottomNavigationBarItem( 54 | icon: Icon(Icons.shopping_cart), title: Text("Shop")), 55 | BottomNavigationBarItem( 56 | icon: Icon(Icons.add_a_photo), title: Text("Add")), 57 | BottomNavigationBarItem( 58 | icon: Icon(Icons.person), title: Text("Profile")), 59 | ], 60 | ), 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/splashscreen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/auth/auth.controller.dart'; 4 | 5 | class SplashScreen extends StatelessWidget { 6 | final AuthController authController = Get.put(AuthController()); 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | body: Container( 11 | child: Center( 12 | child: CircularProgressIndicator(), 13 | ), 14 | ), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/todo/models/todo.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | 3 | class Todo { 4 | String id; 5 | String title; 6 | bool done; 7 | String userId; 8 | Todo({this.id, this.userId, this.title, this.done = false}); 9 | copyWith({title, done}) { 10 | return Todo( 11 | id: id, 12 | title: title ?? this.title, 13 | userId: userId ?? this.userId, 14 | done: done ?? this.done, 15 | ); 16 | } 17 | 18 | factory Todo.fromSnapshot(DocumentSnapshot snap) { 19 | return Todo( 20 | id: snap.documentID, 21 | done: snap.data["done"], 22 | title: snap.data['title']); 23 | } 24 | 25 | toJson() { 26 | return {"title": title, "done": done}; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/todo/todo.controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:todo_app_getx/auth/auth.controller.dart'; 3 | import 'package:todo_app_getx/todo/models/todo.model.dart'; 4 | import 'package:todo_app_getx/todo/todo.service.dart'; 5 | 6 | class TodoController extends GetxController { 7 | static TodoController to = Get.find(); 8 | RxList todos = [].obs; 9 | RxBool isLoadingTodos = false.obs; 10 | RxBool isAddingTodo = false.obs; 11 | RxBool isLoadingDetails = false.obs; 12 | Todo activeTodo; 13 | TodoService _todoService; 14 | TodoController() { 15 | _todoService = TodoService(); 16 | } 17 | 18 | onInit() { 19 | todos.bindStream(loadTodos()); 20 | } 21 | 22 | Stream> loadTodos() { 23 | AuthController authController = AuthController.to; 24 | return _todoService.findAll(authController.user.value.uid); 25 | } 26 | 27 | Future loadDetails(String id) async { 28 | try { 29 | isLoadingDetails.value = true; 30 | activeTodo = await _todoService.findOne(id); 31 | print(activeTodo); 32 | isLoadingDetails.value = false; 33 | return activeTodo; 34 | } catch (e) {} 35 | } 36 | 37 | addTodo(String title) async { 38 | try { 39 | AuthController authController = AuthController.to; 40 | isAddingTodo.value = true; 41 | var todo = 42 | await _todoService.addOne(authController.user.value.uid, title); 43 | todos.add(todo); 44 | Get.snackbar("Success", todo.title, snackPosition: SnackPosition.BOTTOM); 45 | isAddingTodo.value = false; 46 | } catch (e) { 47 | isAddingTodo.value = false; 48 | print(e); 49 | } 50 | } 51 | 52 | updateTodo(Todo todo) async { 53 | try { 54 | isAddingTodo.value = true; 55 | await _todoService.updateOne(todo); 56 | int index = todos.value.indexWhere((element) => element.id == todo.id); 57 | 58 | todos[index] = todo; 59 | print(todos); 60 | Get.snackbar("Success", " updated", snackPosition: SnackPosition.BOTTOM); 61 | isAddingTodo.value = false; 62 | } catch (e) { 63 | isAddingTodo.value = false; 64 | print(e); 65 | } 66 | } 67 | 68 | deleteTodo(String id) async { 69 | try { 70 | await _todoService.deleteOne(id); 71 | int index = todos.value.indexWhere((element) => element.id == id); 72 | todos.removeAt(index); 73 | Get.snackbar("Success", "Deleted", snackPosition: SnackPosition.BOTTOM); 74 | } catch (e) { 75 | print(e); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/todo/todo.service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | import 'package:todo_app_getx/todo/models/todo.model.dart'; 5 | 6 | class TodoService { 7 | CollectionReference todosRef = Firestore.instance.collection("todos"); 8 | Stream> findAll(userId) { 9 | return todosRef 10 | .where("user_id", isEqualTo: userId) 11 | .getDocuments() 12 | .then((value) { 13 | return value.documents.map((e) => Todo.fromSnapshot(e)).toList(); 14 | }).asStream(); 15 | } 16 | 17 | Future findOne(String id) async { 18 | var result = await todosRef.document(id).get(); 19 | return Todo.fromSnapshot(result); 20 | } 21 | 22 | Future addOne(String userId, String title, {bool done = false}) async { 23 | var result = 24 | await todosRef.add({"user_id": userId, "title": title, "done": done}); 25 | return Todo(id: result.documentID, title: title, done: done); 26 | } 27 | 28 | Future updateOne(Todo todo) async { 29 | todosRef.document(todo.id).updateData(todo.toJson()); 30 | } 31 | 32 | deleteOne(String id) { 33 | todosRef.document(id).delete(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/todo/views/add_todo.view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/todo/todo.controller.dart'; 4 | import 'package:todo_app_getx/todo/models/todo.model.dart'; 5 | 6 | class AddTodo extends StatefulWidget { 7 | AddTodo({Key key}) : super(key: key); 8 | 9 | @override 10 | _AddTodoState createState() => _AddTodoState(); 11 | } 12 | 13 | class _AddTodoState extends State { 14 | TextEditingController titleController = new TextEditingController(); 15 | Todo todo; 16 | 17 | @override 18 | void initState() { 19 | print(Get.parameters); 20 | if (Get.parameters != null) { 21 | var id = Get.parameters["id"]; 22 | if (id != null) { 23 | TodoController.to.loadDetails(id).then((value) => setState(() { 24 | todo = value; 25 | titleController.text = value.title; 26 | })); 27 | } 28 | } 29 | super.initState(); 30 | } 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return Scaffold( 35 | appBar: AppBar( 36 | title: Text("Add Todo"), 37 | ), 38 | body: Padding( 39 | padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), 40 | child: Column( 41 | children: [ 42 | TextFormField( 43 | controller: titleController, 44 | decoration: InputDecoration( 45 | hintText: "Add title", 46 | border: OutlineInputBorder(), 47 | ), 48 | ), 49 | Padding( 50 | padding: const EdgeInsets.all(8.0), 51 | child: GestureDetector( 52 | onTap: () { 53 | if (titleController.text != "") { 54 | if (todo != null) { 55 | todo.title = titleController.text; 56 | TodoController.to.updateTodo(todo); 57 | titleController.clear(); 58 | } else { 59 | TodoController.to.addTodo(titleController.text); 60 | titleController.clear(); 61 | } 62 | } 63 | }, 64 | child: Container( 65 | width: MediaQuery.of(context).size.width * .6, 66 | height: 50, 67 | child: Center( 68 | child: Text( 69 | "Save", 70 | style: TextStyle( 71 | color: Colors.white, 72 | fontSize: 17, 73 | ), 74 | ), 75 | ), 76 | color: Colors.blue, 77 | ), 78 | ), 79 | ), 80 | Obx( 81 | () => TodoController.to.isAddingTodo.value 82 | ? Container( 83 | child: Center( 84 | child: CircularProgressIndicator( 85 | backgroundColor: Colors.green, 86 | )), 87 | ) 88 | : Container(), 89 | ) 90 | ], 91 | ), 92 | ), 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/todo/views/edit_todo.view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/todo/todo.controller.dart'; 4 | import 'package:todo_app_getx/todo/models/todo.model.dart'; 5 | 6 | class EditTodo extends StatelessWidget { 7 | EditTodo({Key key}) : super(key: key); 8 | TextEditingController titleController; 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | appBar: AppBar( 14 | title: Text("Edit Todo"), 15 | ), 16 | body: Padding( 17 | padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), 18 | child: GetX( 19 | initState: (state) => 20 | TodoController.to.loadDetails(Get.parameters["id"]), 21 | builder: (disposable) { 22 | if (TodoController.to.isLoadingDetails.value) { 23 | return Container( 24 | child: Center(child: CircularProgressIndicator()), 25 | ); 26 | } 27 | if (titleController == null) { 28 | titleController = TextEditingController( 29 | text: TodoController.to.activeTodo.title); 30 | } 31 | 32 | return Column( 33 | children: [ 34 | TextFormField( 35 | controller: titleController, 36 | decoration: InputDecoration( 37 | hintText: "Add title", 38 | border: OutlineInputBorder(), 39 | ), 40 | ), 41 | Padding( 42 | padding: const EdgeInsets.all(8.0), 43 | child: GestureDetector( 44 | onTap: () { 45 | if (titleController.text != "") { 46 | Todo todo = TodoController.to.activeTodo; 47 | todo.title = titleController.text; 48 | TodoController.to.updateTodo(todo); 49 | } 50 | }, 51 | child: Container( 52 | width: MediaQuery.of(context).size.width * .6, 53 | height: 50, 54 | child: Center( 55 | child: Text( 56 | "Update", 57 | style: TextStyle( 58 | color: Colors.white, 59 | fontSize: 17, 60 | ), 61 | ), 62 | ), 63 | color: Colors.blue, 64 | ), 65 | ), 66 | ), 67 | Obx( 68 | () => TodoController.to.isAddingTodo.value 69 | ? Container( 70 | child: Center( 71 | child: CircularProgressIndicator( 72 | backgroundColor: Colors.green, 73 | )), 74 | ) 75 | : Container(), 76 | ) 77 | ], 78 | ); 79 | }, 80 | )), 81 | ); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/todo/views/todo_list.view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/auth/auth.controller.dart'; 4 | 5 | import 'package:todo_app_getx/todo/todo.controller.dart'; 6 | import 'package:todo_app_getx/todo/widgets/todo_item.dart'; 7 | import 'package:todo_app_getx/widgets/app_drawer.dart'; 8 | 9 | class TodoList extends StatelessWidget { 10 | TodoList({Key key}) : super(key: key); 11 | AuthController authController = AuthController.to; 12 | final GlobalKey scaffoldKey = GlobalKey(); 13 | @override 14 | Widget build(BuildContext context) { 15 | TodoController c = Get.put(TodoController()); 16 | return Scaffold( 17 | key: scaffoldKey, 18 | drawer: AppDrawer(), 19 | appBar: AppBar( 20 | title: Obx(() => authController.user != null 21 | ? Text(" ${authController?.user?.value?.email}") 22 | : Container()), 23 | centerTitle: true, 24 | leading: IconButton( 25 | onPressed: () { 26 | scaffoldKey.currentState.openDrawer(); 27 | }, 28 | icon: Icon(Icons.menu)), 29 | actions: [ 30 | IconButton( 31 | icon: Icon(Icons.exit_to_app), 32 | onPressed: () { 33 | authController.handleSignOut(); 34 | }) 35 | ], 36 | ), 37 | body: Obx(() { 38 | if (c.isLoadingTodos.value) { 39 | return Container(child: Center(child: CircularProgressIndicator())); 40 | } 41 | 42 | if (c.todos.length == 0) { 43 | return Center(child: Text('Nothing to do')); 44 | } 45 | return ListView.builder( 46 | itemCount: c.todos.length, 47 | itemBuilder: (context, index) { 48 | return TodoItem(c.todos.elementAt(index)); 49 | }); 50 | }), 51 | floatingActionButton: FloatingActionButton( 52 | onPressed: () => Get.toNamed("/add-todo"), 53 | child: Icon( 54 | Icons.add, 55 | ), 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/todo/views/views.dart: -------------------------------------------------------------------------------- 1 | export 'add_todo.view.dart'; 2 | export 'edit_todo.view.dart'; 3 | export 'todo_list.view.dart'; 4 | -------------------------------------------------------------------------------- /lib/todo/widgets/todo_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:todo_app_getx/todo/todo.controller.dart'; 4 | import 'package:todo_app_getx/todo/models/todo.model.dart'; 5 | 6 | class TodoItem extends StatelessWidget { 7 | final Todo todo; 8 | const TodoItem(this.todo, {Key key}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Padding( 12 | padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2), 13 | child: GestureDetector( 14 | onTap: () { 15 | Get.toNamed("/todos/${todo.id}/edit"); 16 | }, 17 | child: Container( 18 | height: 50, 19 | decoration: BoxDecoration( 20 | color: todo.done ? Colors.grey : Colors.green[100], 21 | borderRadius: BorderRadius.circular(10), 22 | ), 23 | child: Row( 24 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 25 | children: [ 26 | Padding( 27 | padding: const EdgeInsets.all(8.0), 28 | child: Row(children: [ 29 | Text("${todo.title}"), 30 | ]), 31 | ), 32 | Row( 33 | children: [ 34 | Padding( 35 | padding: const EdgeInsets.all(8.0), 36 | child: Container( 37 | child: GestureDetector( 38 | onTap: () { 39 | TodoController.to 40 | .updateTodo(todo.copyWith(done: !todo.done)); 41 | }, 42 | child: !todo.done 43 | ? Icon(Icons.check_box_outline_blank) 44 | : Icon(Icons.check_box), 45 | ), 46 | ), 47 | ), 48 | Padding( 49 | padding: const EdgeInsets.all(8.0), 50 | child: Container( 51 | child: GestureDetector( 52 | onTap: () { 53 | TodoController.to.deleteTodo(todo.id); 54 | }, 55 | child: Icon(Icons.cancel)), 56 | ), 57 | ), 58 | ], 59 | ) 60 | ], 61 | ), 62 | ), 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/widgets/app_cached_image.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AppCachedImage extends StatefulWidget { 5 | final String url; 6 | final Widget Function(BuildContext, ImageProvider) imageBuilder; 7 | AppCachedImage({Key key, @required this.url, @required this.imageBuilder}) 8 | : super(key: key); 9 | 10 | @override 11 | _AppCachedImageState createState() => _AppCachedImageState(); 12 | } 13 | 14 | class _AppCachedImageState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return CachedNetworkImage( 18 | imageUrl: widget.url, 19 | placeholder: (context, url) { 20 | return widget.imageBuilder.call( 21 | context, 22 | AssetImage("assets/images/loading_image.gif"), 23 | ); 24 | }, 25 | errorWidget: (context, url, error) { 26 | return widget.imageBuilder.call( 27 | context, 28 | AssetImage("assets/images/default_image.jpg"), 29 | ); 30 | }, 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/widgets/app_drawer.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:todo_app_getx/auth/auth.controller.dart'; 5 | 6 | class AppDrawer extends StatelessWidget { 7 | final AuthController authController = AuthController.to; 8 | @override 9 | Widget build(BuildContext context) { 10 | FirebaseUser user = authController.user.value; 11 | return Drawer( 12 | child: ListView( 13 | children: [ 14 | DrawerHeader( 15 | decoration: BoxDecoration( 16 | color: Colors.blueGrey[500], 17 | ), 18 | child: Column( 19 | children: [ 20 | Container( 21 | height: 100, 22 | width: 100, 23 | decoration: BoxDecoration( 24 | color: Colors.blue, 25 | shape: BoxShape.circle, 26 | image: DecorationImage( 27 | image: NetworkImage( 28 | user.photoUrl, 29 | ), 30 | fit: BoxFit.cover, 31 | ), 32 | ), 33 | ), 34 | Padding( 35 | padding: const EdgeInsets.all(8.0), 36 | child: Text( 37 | user.email, 38 | style: TextStyle( 39 | fontSize: 16, 40 | color: Colors.white, 41 | ), 42 | ), 43 | ) 44 | ], 45 | ), 46 | ), 47 | ListTile( 48 | onTap: () { 49 | Get.offAllNamed("/"); 50 | }, 51 | title: Text("Switch to Snap Sell"), 52 | trailing: Icon(Icons.camera), 53 | ), 54 | Divider(), 55 | ListTile( 56 | onTap: () { 57 | Get.offAllNamed("/todos"); 58 | }, 59 | title: Text("Switch to Todo App"), 60 | trailing: Icon(Icons.swap_horizontal_circle), 61 | ), 62 | Divider(), 63 | ListTile( 64 | onTap: () { 65 | authController.handleSignOut(); 66 | }, 67 | title: Text("Logout"), 68 | trailing: Icon(Icons.exit_to_app), 69 | ), 70 | Divider(), 71 | ], 72 | )); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.13" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.6.0" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.1" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.0.0" 32 | cached_network_image: 33 | dependency: "direct main" 34 | description: 35 | name: cached_network_image 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.2.0+1" 39 | carousel_slider: 40 | dependency: "direct main" 41 | description: 42 | name: carousel_slider 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.2.1" 46 | charcode: 47 | dependency: transitive 48 | description: 49 | name: charcode 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.1.3" 53 | clock: 54 | dependency: transitive 55 | description: 56 | name: clock 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.0.1" 60 | cloud_firestore: 61 | dependency: "direct main" 62 | description: 63 | name: cloud_firestore 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.13.7" 67 | cloud_firestore_platform_interface: 68 | dependency: transitive 69 | description: 70 | name: cloud_firestore_platform_interface 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.1.2" 74 | cloud_firestore_web: 75 | dependency: transitive 76 | description: 77 | name: cloud_firestore_web 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.1.1+2" 81 | collection: 82 | dependency: transitive 83 | description: 84 | name: collection 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.14.12" 88 | convert: 89 | dependency: transitive 90 | description: 91 | name: convert 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "2.1.1" 95 | crypto: 96 | dependency: transitive 97 | description: 98 | name: crypto 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "2.1.4" 102 | cupertino_icons: 103 | dependency: "direct main" 104 | description: 105 | name: cupertino_icons 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "0.1.3" 109 | file: 110 | dependency: transitive 111 | description: 112 | name: file 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "5.2.1" 116 | firebase: 117 | dependency: transitive 118 | description: 119 | name: firebase 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "7.3.0" 123 | firebase_auth: 124 | dependency: "direct main" 125 | description: 126 | name: firebase_auth 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "0.16.1" 130 | firebase_auth_platform_interface: 131 | dependency: transitive 132 | description: 133 | name: firebase_auth_platform_interface 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.1.8" 137 | firebase_auth_web: 138 | dependency: transitive 139 | description: 140 | name: firebase_auth_web 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "0.1.3+1" 144 | firebase_core: 145 | dependency: "direct main" 146 | description: 147 | name: firebase_core 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "0.4.5" 151 | firebase_core_platform_interface: 152 | dependency: transitive 153 | description: 154 | name: firebase_core_platform_interface 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "1.0.4" 158 | firebase_core_web: 159 | dependency: transitive 160 | description: 161 | name: firebase_core_web 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "0.1.1+2" 165 | firebase_storage: 166 | dependency: "direct main" 167 | description: 168 | name: firebase_storage 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "3.1.6" 172 | flutter: 173 | dependency: "direct main" 174 | description: flutter 175 | source: sdk 176 | version: "0.0.0" 177 | flutter_cache_manager: 178 | dependency: transitive 179 | description: 180 | name: flutter_cache_manager 181 | url: "https://pub.dartlang.org" 182 | source: hosted 183 | version: "1.4.1" 184 | flutter_staggered_grid_view: 185 | dependency: "direct main" 186 | description: 187 | name: flutter_staggered_grid_view 188 | url: "https://pub.dartlang.org" 189 | source: hosted 190 | version: "0.3.0" 191 | flutter_test: 192 | dependency: "direct dev" 193 | description: flutter 194 | source: sdk 195 | version: "0.0.0" 196 | flutter_web_plugins: 197 | dependency: transitive 198 | description: flutter 199 | source: sdk 200 | version: "0.0.0" 201 | get: 202 | dependency: "direct main" 203 | description: 204 | name: get 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "3.1.1" 208 | google_sign_in: 209 | dependency: "direct main" 210 | description: 211 | name: google_sign_in 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "4.5.1" 215 | google_sign_in_platform_interface: 216 | dependency: transitive 217 | description: 218 | name: google_sign_in_platform_interface 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.1.2" 222 | google_sign_in_web: 223 | dependency: transitive 224 | description: 225 | name: google_sign_in_web 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "0.9.1+1" 229 | http: 230 | dependency: transitive 231 | description: 232 | name: http 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "0.12.1" 236 | http_parser: 237 | dependency: transitive 238 | description: 239 | name: http_parser 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "3.1.4" 243 | image: 244 | dependency: transitive 245 | description: 246 | name: image 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "2.1.12" 250 | intl: 251 | dependency: transitive 252 | description: 253 | name: intl 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "0.16.1" 257 | js: 258 | dependency: transitive 259 | description: 260 | name: js 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "0.6.2" 264 | matcher: 265 | dependency: transitive 266 | description: 267 | name: matcher 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "0.12.6" 271 | meta: 272 | dependency: transitive 273 | description: 274 | name: meta 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "1.1.8" 278 | multi_image_picker: 279 | dependency: "direct main" 280 | description: 281 | name: multi_image_picker 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "4.6.7" 285 | path: 286 | dependency: transitive 287 | description: 288 | name: path 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "1.6.4" 292 | path_provider: 293 | dependency: transitive 294 | description: 295 | name: path_provider 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "1.6.11" 299 | path_provider_linux: 300 | dependency: transitive 301 | description: 302 | name: path_provider_linux 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "0.0.1+2" 306 | path_provider_macos: 307 | dependency: transitive 308 | description: 309 | name: path_provider_macos 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "0.0.4+3" 313 | path_provider_platform_interface: 314 | dependency: transitive 315 | description: 316 | name: path_provider_platform_interface 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "1.0.2" 320 | pedantic: 321 | dependency: transitive 322 | description: 323 | name: pedantic 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "1.9.0" 327 | petitparser: 328 | dependency: transitive 329 | description: 330 | name: petitparser 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "2.4.0" 334 | platform: 335 | dependency: transitive 336 | description: 337 | name: platform 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "2.2.1" 341 | plugin_platform_interface: 342 | dependency: transitive 343 | description: 344 | name: plugin_platform_interface 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "1.0.2" 348 | process: 349 | dependency: transitive 350 | description: 351 | name: process 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "3.0.13" 355 | quiver: 356 | dependency: transitive 357 | description: 358 | name: quiver 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "2.1.3" 362 | rxdart: 363 | dependency: transitive 364 | description: 365 | name: rxdart 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "0.24.1" 369 | shimmer: 370 | dependency: "direct main" 371 | description: 372 | name: shimmer 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "1.1.1" 376 | sky_engine: 377 | dependency: transitive 378 | description: flutter 379 | source: sdk 380 | version: "0.0.99" 381 | source_span: 382 | dependency: transitive 383 | description: 384 | name: source_span 385 | url: "https://pub.dartlang.org" 386 | source: hosted 387 | version: "1.7.0" 388 | sqflite: 389 | dependency: transitive 390 | description: 391 | name: sqflite 392 | url: "https://pub.dartlang.org" 393 | source: hosted 394 | version: "1.3.1" 395 | sqflite_common: 396 | dependency: transitive 397 | description: 398 | name: sqflite_common 399 | url: "https://pub.dartlang.org" 400 | source: hosted 401 | version: "1.0.2+1" 402 | stack_trace: 403 | dependency: transitive 404 | description: 405 | name: stack_trace 406 | url: "https://pub.dartlang.org" 407 | source: hosted 408 | version: "1.9.3" 409 | stream_channel: 410 | dependency: transitive 411 | description: 412 | name: stream_channel 413 | url: "https://pub.dartlang.org" 414 | source: hosted 415 | version: "2.0.0" 416 | string_scanner: 417 | dependency: transitive 418 | description: 419 | name: string_scanner 420 | url: "https://pub.dartlang.org" 421 | source: hosted 422 | version: "1.0.5" 423 | synchronized: 424 | dependency: transitive 425 | description: 426 | name: synchronized 427 | url: "https://pub.dartlang.org" 428 | source: hosted 429 | version: "2.2.0+1" 430 | term_glyph: 431 | dependency: transitive 432 | description: 433 | name: term_glyph 434 | url: "https://pub.dartlang.org" 435 | source: hosted 436 | version: "1.1.0" 437 | test_api: 438 | dependency: transitive 439 | description: 440 | name: test_api 441 | url: "https://pub.dartlang.org" 442 | source: hosted 443 | version: "0.2.15" 444 | typed_data: 445 | dependency: transitive 446 | description: 447 | name: typed_data 448 | url: "https://pub.dartlang.org" 449 | source: hosted 450 | version: "1.1.6" 451 | uuid: 452 | dependency: transitive 453 | description: 454 | name: uuid 455 | url: "https://pub.dartlang.org" 456 | source: hosted 457 | version: "2.2.0" 458 | vector_math: 459 | dependency: transitive 460 | description: 461 | name: vector_math 462 | url: "https://pub.dartlang.org" 463 | source: hosted 464 | version: "2.0.8" 465 | xdg_directories: 466 | dependency: transitive 467 | description: 468 | name: xdg_directories 469 | url: "https://pub.dartlang.org" 470 | source: hosted 471 | version: "0.1.0" 472 | xml: 473 | dependency: transitive 474 | description: 475 | name: xml 476 | url: "https://pub.dartlang.org" 477 | source: hosted 478 | version: "3.6.1" 479 | sdks: 480 | dart: ">=2.8.0 <3.0.0" 481 | flutter: ">=1.12.13+hotfix.5 <2.0.0" 482 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: todo_app_getx 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.7.0 <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | get: ^3.1.1 15 | # Add the dependency for the Firebase Core Flutter SDK 16 | firebase_core: ^0.4.5 17 | firebase_auth: ^0.16.1 18 | google_sign_in: ^4.5.1 19 | cloud_firestore: ^0.13.7 20 | firebase_storage: ^3.1.6 21 | multi_image_picker: ^4.6.7 22 | carousel_slider: ^2.2.1 23 | flutter_staggered_grid_view: ^0.3.0 24 | shimmer: ^1.1.1 25 | cached_network_image: ^2.2.0+1 26 | cupertino_icons: ^0.1.3 27 | 28 | dev_dependencies: 29 | flutter_test: 30 | sdk: flutter 31 | 32 | # For information on the generic Dart part of this file, see the 33 | # following page: https://dart.dev/tools/pub/pubspec 34 | 35 | # The following section is specific to Flutter. 36 | flutter: 37 | # The following line ensures that the Material Icons font is 38 | # included with your application, so that you can use the icons in 39 | # the material Icons class. 40 | uses-material-design: true 41 | # To add assets to your application, add an assets section, like this: 42 | assets: 43 | - assets/images/ 44 | # - images/a_dot_ham.jpeg 45 | # An image asset can refer to one or more resolution-specific "variants", see 46 | # https://flutter.dev/assets-and-images/#resolution-aware. 47 | # For details regarding adding assets from package dependencies, see 48 | # https://flutter.dev/assets-and-images/#from-packages 49 | # To add custom fonts to your application, add a fonts section here, 50 | # in this "flutter" section. Each entry in this list should have a 51 | # "family" key with the font family name, and a "fonts" key with a 52 | # list giving the asset and other descriptors for the font. For 53 | # example: 54 | # fonts: 55 | # - family: Schyler 56 | # fonts: 57 | # - asset: fonts/Schyler-Regular.ttf 58 | # - asset: fonts/Schyler-Italic.ttf 59 | # style: italic 60 | # - family: Trajan Pro 61 | # fonts: 62 | # - asset: fonts/TrajanPro.ttf 63 | # - asset: fonts/TrajanPro_Bold.ttf 64 | # weight: 700 65 | # 66 | # For details regarding fonts from package dependencies, 67 | # see https://flutter.dev/custom-fonts/#from-packages 68 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:todo_app_getx/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/AppConfiguration.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | todo_app_getx 5 | 6 | 7 | -------------------------------------------------------------------------------- /windows/FlutterBuild.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Profile 10 | x64 11 | 12 | 13 | Release 14 | x64 15 | 16 | 17 | 18 | 15.0 19 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F} 20 | Flutter Build 21 | 10.0 22 | 23 | 24 | 25 | v141 26 | v142 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | "$(ProjectDir)scripts\prepare_dependencies" $(Configuration) 41 | Running Flutter backend build 42 | force_to_run_every_time 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /windows/Runner.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29709.97 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Runner", "Runner.vcxproj", "{5A827760-CF8B-408A-99A3-B6C0AD2271E7}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F} = {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flutter Build", "FlutterBuild.vcxproj", "{6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}" 12 | EndProject 13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Flutter Plugins", "Flutter Plugins", "{5C2E738A-1DD3-445A-AAC8-EEB9648DD07C}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|x64 = Debug|x64 18 | Profile|x64 = Profile|x64 19 | Release|x64 = Release|x64 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.ActiveCfg = Debug|x64 23 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.Build.0 = Debug|x64 24 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Profile|x64.ActiveCfg = Profile|x64 25 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Profile|x64.Build.0 = Profile|x64 26 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.ActiveCfg = Release|x64 27 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.Build.0 = Release|x64 28 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Debug|x64.ActiveCfg = Debug|x64 29 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Debug|x64.Build.0 = Debug|x64 30 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Profile|x64.ActiveCfg = Profile|x64 31 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Profile|x64.Build.0 = Profile|x64 32 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Release|x64.ActiveCfg = Release|x64 33 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Release|x64.Build.0 = Release|x64 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {B8A69CB0-A974-4774-9EBD-1E5EECACD186} 40 | EndGlobalSection 41 | GlobalSection(NestedProjects) = preSolution 42 | EndGlobalSection 43 | EndGlobal -------------------------------------------------------------------------------- /windows/Runner.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Profile 10 | x64 11 | 12 | 13 | Release 14 | x64 15 | 16 | 17 | 18 | 15.0 19 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7} 20 | todo_app_getx 21 | 10.0 22 | 23 | 24 | 25 | Application 26 | true 27 | v141 28 | v142 29 | Unicode 30 | 31 | 32 | Application 33 | false 34 | v141 35 | v142 36 | true 37 | Unicode 38 | 39 | 40 | Application 41 | false 42 | v141 43 | v142 44 | true 45 | Unicode 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\ 73 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\ 74 | 75 | 76 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\ 77 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\ 78 | 79 | 80 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\ 81 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\ 82 | 83 | 84 | 85 | Level4 86 | Disabled 87 | true 88 | true 89 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories) 90 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) 91 | true 92 | 4100 93 | 94 | 95 | flutter_windows.dll.lib;%(AdditionalDependencies) 96 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories) 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)" 120 | 121 | 122 | Bundling dependencies 123 | Dummy_Run_Always 124 | 125 | 126 | 127 | 128 | 129 | 130 | Level4 131 | MaxSpeed 132 | true 133 | true 134 | true 135 | true 136 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories) 137 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) 138 | true 139 | 4100 140 | 141 | 142 | true 143 | true 144 | flutter_windows.dll.lib;%(AdditionalDependencies) 145 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories) 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)" 169 | 170 | 171 | Bundling dependencies 172 | Dummy_Run_Always 173 | 174 | 175 | 176 | 177 | 178 | 179 | Level4 180 | MaxSpeed 181 | true 182 | true 183 | true 184 | true 185 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories) 186 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) 187 | true 188 | 4100 189 | 190 | 191 | true 192 | true 193 | flutter_windows.dll.lib;%(AdditionalDependencies) 194 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories) 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)" 218 | 219 | 220 | Bundling dependencies 221 | Dummy_Run_Always 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | $(SolutionDir) 261 | 262 | 263 | -------------------------------------------------------------------------------- /windows/Runner.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {2761a4b5-57b2-4d50-a677-d20ddc17a7f1} 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files\Client Wrapper 44 | 45 | 46 | Source Files\Client Wrapper 47 | 48 | 49 | Source Files\Client Wrapper 50 | 51 | 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | Header Files 64 | 65 | 66 | Header Files 67 | 68 | 69 | Header Files 70 | 71 | 72 | Header Files 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | Resource Files 81 | 82 | 83 | 84 | 85 | Resource Files 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /windows/flutter/.template_version: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /windows/flutter/GeneratedPlugins.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #include "generated_plugin_registrant.h" 6 | 7 | 8 | void RegisterPlugins(flutter::PluginRegistry* registry) { 9 | } 10 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 6 | #define GENERATED_PLUGIN_REGISTRANT_ 7 | 8 | #include 9 | 10 | // Registers Flutter plugins. 11 | void RegisterPlugins(flutter::PluginRegistry* registry); 12 | 13 | #endif // GENERATED_PLUGIN_REGISTRANT_ 14 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | #endif // English (United States) resources 58 | ///////////////////////////////////////////////////////////////////////////// 59 | 60 | 61 | 62 | #ifndef APSTUDIO_INVOKED 63 | ///////////////////////////////////////////////////////////////////////////// 64 | // 65 | // Generated from the TEXTINCLUDE 3 resource. 66 | // 67 | 68 | 69 | ///////////////////////////////////////////////////////////////////////////// 70 | #endif // not APSTUDIO_INVOKED 71 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include "flutter/generated_plugin_registrant.h" 4 | 5 | FlutterWindow::FlutterWindow(RunLoop* run_loop, 6 | const flutter::DartProject& project) 7 | : run_loop_(run_loop), project_(project) {} 8 | 9 | FlutterWindow::~FlutterWindow() {} 10 | 11 | void FlutterWindow::OnCreate() { 12 | Win32Window::OnCreate(); 13 | 14 | // The size here is arbitrary since SetChildContent will resize it. 15 | flutter_controller_ = 16 | std::make_unique(100, 100, project_); 17 | RegisterPlugins(flutter_controller_.get()); 18 | run_loop_->RegisterFlutterInstance(flutter_controller_.get()); 19 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 20 | } 21 | 22 | void FlutterWindow::OnDestroy() { 23 | if (flutter_controller_) { 24 | run_loop_->UnregisterFlutterInstance(flutter_controller_.get()); 25 | flutter_controller_ = nullptr; 26 | } 27 | 28 | Win32Window::OnDestroy(); 29 | } 30 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_WINDOW_H_ 2 | #define FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "run_loop.h" 8 | #include "win32_window.h" 9 | 10 | #include 11 | 12 | // A window that does nothing but host a Flutter view. 13 | class FlutterWindow : public Win32Window { 14 | public: 15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a 16 | // Flutter view running |project|. 17 | explicit FlutterWindow(RunLoop* run_loop, 18 | const flutter::DartProject& project); 19 | virtual ~FlutterWindow(); 20 | 21 | protected: 22 | // Win32Window: 23 | void OnCreate() override; 24 | void OnDestroy() override; 25 | 26 | private: 27 | // The run loop driving events for this window. 28 | RunLoop* run_loop_; 29 | 30 | // The project to run. 31 | flutter::DartProject project_; 32 | 33 | // The Flutter instance hosted by this window. 34 | std::unique_ptr flutter_controller_; 35 | }; 36 | 37 | #endif // FLUTTER_WINDOW_H_ 38 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "run_loop.h" 7 | #include "utils.h" 8 | #include "window_configuration.h" 9 | 10 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 11 | _In_ wchar_t *command_line, _In_ int show_command) { 12 | // Attach to console when present (e.g., 'flutter run') or create a 13 | // new console when running with a debugger. 14 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 15 | CreateAndAttachConsole(); 16 | } 17 | 18 | // Initialize COM, so that it is available for use in the library and/or 19 | // plugins. 20 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 21 | 22 | RunLoop run_loop; 23 | 24 | flutter::DartProject project(L"data"); 25 | FlutterWindow window(&run_loop, project); 26 | Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY); 27 | Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight); 28 | if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) { 29 | return EXIT_FAILURE; 30 | } 31 | window.SetQuitOnClose(true); 32 | 33 | run_loop.Run(); 34 | 35 | ::CoUninitialize(); 36 | return EXIT_SUCCESS; 37 | } 38 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loicgeek/todo_getx/c7e9949b43882babc1a11e6e983f815f537e9f42/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/run_loop.cpp: -------------------------------------------------------------------------------- 1 | #include "run_loop.h" 2 | 3 | #include 4 | // Don't stomp std::min/std::max 5 | #undef max 6 | #undef min 7 | 8 | #include 9 | 10 | RunLoop::RunLoop() {} 11 | 12 | RunLoop::~RunLoop() {} 13 | 14 | void RunLoop::Run() { 15 | bool keep_running = true; 16 | TimePoint next_flutter_event_time = TimePoint::clock::now(); 17 | while (keep_running) { 18 | std::chrono::nanoseconds wait_duration = 19 | std::max(std::chrono::nanoseconds(0), 20 | next_flutter_event_time - TimePoint::clock::now()); 21 | ::MsgWaitForMultipleObjects( 22 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), 23 | QS_ALLINPUT); 24 | bool processed_events = false; 25 | MSG message; 26 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects 27 | // won't return again for items left in the queue after PeekMessage. 28 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 29 | processed_events = true; 30 | if (message.message == WM_QUIT) { 31 | keep_running = false; 32 | break; 33 | } 34 | ::TranslateMessage(&message); 35 | ::DispatchMessage(&message); 36 | // Allow Flutter to process messages each time a Windows message is 37 | // processed, to prevent starvation. 38 | next_flutter_event_time = 39 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 40 | } 41 | // If the PeekMessage loop didn't run, process Flutter messages. 42 | if (!processed_events) { 43 | next_flutter_event_time = 44 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 45 | } 46 | } 47 | } 48 | 49 | void RunLoop::RegisterFlutterInstance( 50 | flutter::FlutterViewController* flutter_instance) { 51 | flutter_instances_.insert(flutter_instance); 52 | } 53 | 54 | void RunLoop::UnregisterFlutterInstance( 55 | flutter::FlutterViewController* flutter_instance) { 56 | flutter_instances_.erase(flutter_instance); 57 | } 58 | 59 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { 60 | TimePoint next_event_time = TimePoint::max(); 61 | for (auto flutter_controller : flutter_instances_) { 62 | std::chrono::nanoseconds wait_duration = 63 | flutter_controller->ProcessMessages(); 64 | if (wait_duration != std::chrono::nanoseconds::max()) { 65 | next_event_time = 66 | std::min(next_event_time, TimePoint::clock::now() + wait_duration); 67 | } 68 | } 69 | return next_event_time; 70 | } 71 | -------------------------------------------------------------------------------- /windows/runner/run_loop.h: -------------------------------------------------------------------------------- 1 | #ifndef RUN_LOOP_H_ 2 | #define RUN_LOOP_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // A runloop that will service events for Flutter instances as well 10 | // as native messages. 11 | class RunLoop { 12 | public: 13 | RunLoop(); 14 | ~RunLoop(); 15 | 16 | // Prevent copying 17 | RunLoop(RunLoop const&) = delete; 18 | RunLoop& operator=(RunLoop const&) = delete; 19 | 20 | // Runs the run loop until the application quits. 21 | void Run(); 22 | 23 | // Registers the given Flutter instance for event servicing. 24 | void RegisterFlutterInstance( 25 | flutter::FlutterViewController* flutter_instance); 26 | 27 | // Unregisters the given Flutter instance from event servicing. 28 | void UnregisterFlutterInstance( 29 | flutter::FlutterViewController* flutter_instance); 30 | 31 | private: 32 | using TimePoint = std::chrono::steady_clock::time_point; 33 | 34 | // Processes all currently pending messages for registered Flutter instances. 35 | TimePoint ProcessFlutterMessages(); 36 | 37 | std::set flutter_instances_; 38 | }; 39 | 40 | #endif // RUN_LOOP_H_ 41 | -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef CONSOLE_UTILS_H_ 2 | #define CONSOLE_UTILS_H_ 3 | 4 | // Creates a console for the process, and redirects stdout and stderr to 5 | // it for both the runner and the Flutter library. 6 | void CreateAndAttachConsole(); 7 | 8 | #endif // CONSOLE_UTILS_H_ 9 | -------------------------------------------------------------------------------- /windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | OnCreate(); 126 | 127 | return window != nullptr; 128 | } 129 | 130 | // static 131 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 132 | UINT const message, 133 | WPARAM const wparam, 134 | LPARAM const lparam) noexcept { 135 | if (message == WM_NCCREATE) { 136 | auto window_struct = reinterpret_cast(lparam); 137 | SetWindowLongPtr(window, GWLP_USERDATA, 138 | reinterpret_cast(window_struct->lpCreateParams)); 139 | 140 | auto that = static_cast(window_struct->lpCreateParams); 141 | EnableFullDpiSupportIfAvailable(window); 142 | that->window_handle_ = window; 143 | } else if (Win32Window* that = GetThisFromHandle(window)) { 144 | return that->MessageHandler(window, message, wparam, lparam); 145 | } 146 | 147 | return DefWindowProc(window, message, wparam, lparam); 148 | } 149 | 150 | LRESULT 151 | Win32Window::MessageHandler(HWND hwnd, 152 | UINT const message, 153 | WPARAM const wparam, 154 | LPARAM const lparam) noexcept { 155 | auto window = 156 | reinterpret_cast(GetWindowLongPtr(hwnd, GWLP_USERDATA)); 157 | 158 | if (window == nullptr) { 159 | return 0; 160 | } 161 | 162 | switch (message) { 163 | case WM_DESTROY: 164 | window_handle_ = nullptr; 165 | Destroy(); 166 | if (quit_on_close_) { 167 | PostQuitMessage(0); 168 | } 169 | return 0; 170 | 171 | case WM_DPICHANGED: { 172 | auto newRectSize = reinterpret_cast(lparam); 173 | LONG newWidth = newRectSize->right - newRectSize->left; 174 | LONG newHeight = newRectSize->bottom - newRectSize->top; 175 | 176 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 177 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 178 | 179 | return 0; 180 | } 181 | case WM_SIZE: 182 | RECT rect; 183 | GetClientRect(hwnd, &rect); 184 | if (child_content_ != nullptr) { 185 | // Size and position the child window. 186 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 187 | rect.bottom - rect.top, TRUE); 188 | } 189 | return 0; 190 | 191 | case WM_ACTIVATE: 192 | if (child_content_ != nullptr) { 193 | SetFocus(child_content_); 194 | } 195 | return 0; 196 | 197 | // Messages that are directly forwarded to embedding. 198 | case WM_FONTCHANGE: 199 | SendMessage(child_content_, WM_FONTCHANGE, NULL, NULL); 200 | return 0; 201 | } 202 | 203 | return DefWindowProc(window_handle_, message, wparam, lparam); 204 | } 205 | 206 | void Win32Window::Destroy() { 207 | OnDestroy(); 208 | 209 | if (window_handle_) { 210 | DestroyWindow(window_handle_); 211 | window_handle_ = nullptr; 212 | } 213 | if (g_active_window_count == 0) { 214 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 215 | } 216 | } 217 | 218 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 219 | return reinterpret_cast( 220 | GetWindowLongPtr(window, GWLP_USERDATA)); 221 | } 222 | 223 | void Win32Window::SetChildContent(HWND content) { 224 | child_content_ = content; 225 | SetParent(content, window_handle_); 226 | RECT frame; 227 | GetClientRect(window_handle_, &frame); 228 | 229 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 230 | frame.bottom - frame.top, true); 231 | 232 | SetFocus(child_content_); 233 | } 234 | 235 | HWND Win32Window::GetHandle() { 236 | return window_handle_; 237 | } 238 | 239 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 240 | quit_on_close_ = quit_on_close; 241 | } 242 | 243 | void Win32Window::OnCreate() { 244 | // No-op; provided for subclasses. 245 | } 246 | 247 | void Win32Window::OnDestroy() { 248 | // No-op; provided for subclasses. 249 | } 250 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN32_WINDOW_H_ 2 | #define WIN32_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 12 | // inherited from by classes that wish to specialize with custom 13 | // rendering and input handling 14 | class Win32Window { 15 | public: 16 | struct Point { 17 | unsigned int x; 18 | unsigned int y; 19 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 20 | }; 21 | 22 | struct Size { 23 | unsigned int width; 24 | unsigned int height; 25 | Size(unsigned int width, unsigned int height) 26 | : width(width), height(height) {} 27 | }; 28 | 29 | Win32Window(); 30 | virtual ~Win32Window(); 31 | 32 | // Creates and shows a win32 window with |title| and position and size using 33 | // |origin| and |size|. New windows are created on the default monitor. Window 34 | // sizes are specified to the OS in physical pixels, hence to ensure a 35 | // consistent size to will treat the width height passed in to this function 36 | // as logical pixels and scale to appropriate for the default monitor. Returns 37 | // true if the window was created successfully. 38 | bool CreateAndShow(const std::wstring& title, 39 | const Point& origin, 40 | const Size& size); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | protected: 56 | // Processes and route salient window messages for mouse handling, 57 | // size change and DPI. Delegates handling of these to member overloads that 58 | // inheriting classes can handle. 59 | virtual LRESULT MessageHandler(HWND window, 60 | UINT const message, 61 | WPARAM const wparam, 62 | LPARAM const lparam) noexcept; 63 | 64 | // Called when CreateAndShow is called, allowing subclass window-related 65 | // setup. 66 | virtual void OnCreate(); 67 | 68 | // Called when Destroy is called. 69 | virtual void OnDestroy(); 70 | 71 | private: 72 | friend class WindowClassRegistrar; 73 | 74 | // OS callback called by message pump. Handles the WM_NCCREATE message which 75 | // is passed when the non-client area is being created and enables automatic 76 | // non-client DPI scaling so that the non-client area automatically 77 | // responsponds to changes in DPI. All other messages are handled by 78 | // MessageHandler. 79 | static LRESULT CALLBACK WndProc(HWND const window, 80 | UINT const message, 81 | WPARAM const wparam, 82 | LPARAM const lparam) noexcept; 83 | 84 | // Retrieves a class instance pointer for |window| 85 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 86 | 87 | bool quit_on_close_ = false; 88 | 89 | // window handle for top level window. 90 | HWND window_handle_ = nullptr; 91 | 92 | // window handle for hosted content. 93 | HWND child_content_ = nullptr; 94 | }; 95 | 96 | #endif // WIN32_WINDOW_H_ 97 | -------------------------------------------------------------------------------- /windows/runner/window_configuration.cpp: -------------------------------------------------------------------------------- 1 | #include "window_configuration.h" 2 | 3 | const wchar_t* kFlutterWindowTitle = L"todo_app_getx"; 4 | const unsigned int kFlutterWindowOriginX = 10; 5 | const unsigned int kFlutterWindowOriginY = 10; 6 | const unsigned int kFlutterWindowWidth = 1280; 7 | const unsigned int kFlutterWindowHeight = 720; 8 | -------------------------------------------------------------------------------- /windows/runner/window_configuration.h: -------------------------------------------------------------------------------- 1 | #ifndef WINDOW_CONFIGURATION_ 2 | #define WINDOW_CONFIGURATION_ 3 | 4 | // This is a temporary approach to isolate changes that people are likely to 5 | // make to main.cpp, where the APIs are still in flux. This will reduce the 6 | // need to resolve conflicts or re-create changes slightly differently every 7 | // time the Windows Flutter API surface changes. 8 | // 9 | // Longer term there should be simpler configuration options for common 10 | // customizations like this, without requiring native code changes. 11 | 12 | extern const wchar_t* kFlutterWindowTitle; 13 | extern const unsigned int kFlutterWindowOriginX; 14 | extern const unsigned int kFlutterWindowOriginY; 15 | extern const unsigned int kFlutterWindowWidth; 16 | extern const unsigned int kFlutterWindowHeight; 17 | 18 | #endif // WINDOW_CONFIGURATION_ 19 | -------------------------------------------------------------------------------- /windows/scripts/bundle_assets_and_deps.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set FLUTTER_CACHE_DIR=%~1 4 | set BUNDLE_DIR=%~2 5 | set PLUGIN_DIR=%~3 6 | set EXE_NAME=%~4 7 | 8 | set DATA_DIR=%BUNDLE_DIR%data 9 | 10 | if not exist "%DATA_DIR%" call mkdir "%DATA_DIR%" 11 | if %errorlevel% neq 0 exit /b %errorlevel% 12 | 13 | :: Write the executable name to the location expected by the Flutter tool. 14 | echo %EXE_NAME%>"%FLUTTER_CACHE_DIR%exe_filename" 15 | 16 | :: Copy the Flutter assets to the data directory. 17 | set FLUTTER_APP_DIR=%~dp0..\.. 18 | set ASSET_DIR_NAME=flutter_assets 19 | set TARGET_ASSET_DIR=%DATA_DIR%\%ASSET_DIR_NAME% 20 | if exist "%TARGET_ASSET_DIR%" call rmdir /s /q "%TARGET_ASSET_DIR%" 21 | if %errorlevel% neq 0 exit /b %errorlevel% 22 | call xcopy /s /e /i /q "%FLUTTER_APP_DIR%\build\%ASSET_DIR_NAME%" "%TARGET_ASSET_DIR%" 23 | if %errorlevel% neq 0 exit /b %errorlevel% 24 | 25 | :: Copy the icudtl.dat file from the Flutter tree to the data directory. 26 | call xcopy /y /d /q "%FLUTTER_CACHE_DIR%icudtl.dat" "%DATA_DIR%" 27 | if %errorlevel% neq 0 exit /b %errorlevel% 28 | 29 | :: Copy the Flutter DLL to the target location. 30 | call xcopy /y /d /q "%FLUTTER_CACHE_DIR%flutter_windows.dll" "%BUNDLE_DIR%" 31 | if %errorlevel% neq 0 exit /b %errorlevel% 32 | 33 | :: Copy any Plugin DLLs to the target location. 34 | if exist "%PLUGIN_DIR%" ( 35 | call xcopy /y /d /q "%PLUGIN_DIR%"*.dll "%BUNDLE_DIR%" 36 | if %errorlevel% neq 0 exit /b %errorlevel% 37 | ) 38 | -------------------------------------------------------------------------------- /windows/scripts/prepare_dependencies.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: Run flutter tool backend. 4 | set BUILD_MODE=%~1 5 | "%FLUTTER_ROOT%\packages\flutter_tools\bin\tool_backend" windows-x64 %BUILD_MODE% 6 | --------------------------------------------------------------------------------