├── .gitignore ├── .metadata ├── DIO.pptx ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── dio_example │ │ │ │ └── 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 ├── 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 ├── app │ ├── app_controller.dart │ ├── app_controller.g.dart │ ├── app_module.dart │ ├── app_widget.dart │ ├── modules │ │ ├── home │ │ │ ├── home_controller.dart │ │ │ ├── home_controller.g.dart │ │ │ ├── home_module.dart │ │ │ ├── home_page.dart │ │ │ ├── models │ │ │ │ └── product_model.dart │ │ │ ├── pages │ │ │ │ └── product │ │ │ │ │ ├── product_controller.dart │ │ │ │ │ ├── product_controller.g.dart │ │ │ │ │ └── product_page.dart │ │ │ ├── repositories │ │ │ │ ├── interfaces │ │ │ │ │ └── product_repository_interface.dart │ │ │ │ ├── product_repository.dart │ │ │ │ └── product_repository.g.dart │ │ │ └── services │ │ │ │ ├── interfaces │ │ │ │ └── product_service_interface.dart │ │ │ │ ├── product_service.dart │ │ │ │ └── product_service.g.dart │ │ └── login │ │ │ ├── login_controller.dart │ │ │ ├── login_controller.g.dart │ │ │ ├── login_module.dart │ │ │ └── login_page.dart │ └── shared │ │ ├── components │ │ ├── loading_dialog.dart │ │ └── loading_dialog.g.dart │ │ ├── errors │ │ └── errors.dart │ │ ├── http │ │ ├── custom_dio.dart │ │ ├── custom_dio.g.dart │ │ └── interceptors │ │ │ ├── cache_interceptor.dart │ │ │ └── custom_interceptor.dart │ │ ├── models │ │ ├── authenticate_model.dart │ │ ├── dio_response.dart │ │ └── user_model.dart │ │ ├── repositories │ │ ├── interfaces │ │ │ └── user_repository_interface.dart │ │ ├── user_repository.dart │ │ └── user_repository.g.dart │ │ ├── services │ │ ├── interfaces │ │ │ └── user_service_interface.dart │ │ ├── local_storage_service.dart │ │ ├── user_service.dart │ │ └── user_service.g.dart │ │ └── stores │ │ ├── user_store.dart │ │ └── user_store.g.dart └── main.dart ├── mockoon.json ├── pubspec.lock ├── pubspec.yaml └── swagger.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Slidy History Files 2 | .slidy/ 3 | 4 | # Miscellaneous 5 | *.class 6 | *.log 7 | *.pyc 8 | *.swp 9 | .DS_Store 10 | .atom/ 11 | .buildlog/ 12 | .history 13 | .svn/ 14 | 15 | # IntelliJ related 16 | *.iml 17 | *.ipr 18 | *.iws 19 | .idea/ 20 | 21 | # The .vscode folder contains launch configuration and tasks you configure in 22 | # VS Code which you may wish to be included in version control, so this line 23 | # is commented out by default. 24 | #.vscode/ 25 | 26 | # Flutter/Dart/Pub related 27 | **/doc/api/ 28 | .dart_tool/ 29 | .flutter-plugins 30 | .flutter-plugins-dependencies 31 | .packages 32 | .pub-cache/ 33 | .pub/ 34 | /build/ 35 | 36 | # Web related 37 | lib/generated_plugin_registrant.dart 38 | 39 | # Symbolication related 40 | app.*.symbols 41 | 42 | # Obfuscation related 43 | app.*.map.json 44 | 45 | # Exceptions to above rules. 46 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages -------------------------------------------------------------------------------- /.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: 8af6b2f038c1172e61d418869363a28dffec3cb4 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /DIO.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/DIO.pptx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Para mockar a API utilizei o **mockoon** (https://mockoon.com/), basta importar o arquivo **mockoon.json** dentro do **mockoon** 2 | Rodar flutter pub get 3 | 4 | 5 | Trocar baseUrl no app_module.dart apontando para o endereço da sua API 6 | ```class AppModule extends MainModule { 7 | @override 8 | List get binds => [ 9 | $UserStore, 10 | $UserService, 11 | $UserRepository, 12 | $AppController, 13 | $CustomDio, 14 | $LoadingDialog, 15 | Bind( 16 | (i) => BaseOptions( 17 | baseUrl: 'http://192.168.15.12:3001/', 18 | connectTimeout: 5000, 19 | ), 20 | ), 21 | ]; 22 | 23 | @override 24 | List get routers => [ 25 | Router(Modular.initialRoute, module: LoginModule()), 26 | Router('/home', module: HomeModule()), 27 | ]; 28 | 29 | @override 30 | Widget get bootstrap => AppWidget(); 31 | 32 | static Inject get to => Inject.of(); 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:effective_dart/analysis_options.yaml 2 | 3 | analyzer: 4 | errors: 5 | todo: ignore 6 | exclude: 7 | - "lib\\app\\shared\\locale\\**" 8 | - "*_test.dart" 9 | linter: 10 | rules: 11 | public_member_api_docs: false 12 | use_setters_to_change_properties: false 13 | one_member_abstracts: false 14 | type_annotate_public_apis: false 15 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /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.example.dio_example" 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 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/dio_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.dio_example 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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 97C146F11CF9000F007C117D /* Supporting Files */, 94 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 95 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 96 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 97 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 98 | ); 99 | path = Runner; 100 | sourceTree = ""; 101 | }; 102 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | /* End PBXGroup section */ 110 | 111 | /* Begin PBXNativeTarget section */ 112 | 97C146ED1CF9000F007C117D /* Runner */ = { 113 | isa = PBXNativeTarget; 114 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 115 | buildPhases = ( 116 | 9740EEB61CF901F6004384FC /* Run Script */, 117 | 97C146EA1CF9000F007C117D /* Sources */, 118 | 97C146EB1CF9000F007C117D /* Frameworks */, 119 | 97C146EC1CF9000F007C117D /* Resources */, 120 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 121 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 122 | ); 123 | buildRules = ( 124 | ); 125 | dependencies = ( 126 | ); 127 | name = Runner; 128 | productName = Runner; 129 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 130 | productType = "com.apple.product-type.application"; 131 | }; 132 | /* End PBXNativeTarget section */ 133 | 134 | /* Begin PBXProject section */ 135 | 97C146E61CF9000F007C117D /* Project object */ = { 136 | isa = PBXProject; 137 | attributes = { 138 | LastUpgradeCheck = 1020; 139 | ORGANIZATIONNAME = ""; 140 | TargetAttributes = { 141 | 97C146ED1CF9000F007C117D = { 142 | CreatedOnToolsVersion = 7.3.1; 143 | LastSwiftMigration = 1100; 144 | }; 145 | }; 146 | }; 147 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 148 | compatibilityVersion = "Xcode 9.3"; 149 | developmentRegion = en; 150 | hasScannedForEncodings = 0; 151 | knownRegions = ( 152 | en, 153 | Base, 154 | ); 155 | mainGroup = 97C146E51CF9000F007C117D; 156 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 157 | projectDirPath = ""; 158 | projectRoot = ""; 159 | targets = ( 160 | 97C146ED1CF9000F007C117D /* Runner */, 161 | ); 162 | }; 163 | /* End PBXProject section */ 164 | 165 | /* Begin PBXResourcesBuildPhase section */ 166 | 97C146EC1CF9000F007C117D /* Resources */ = { 167 | isa = PBXResourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 171 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 172 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 173 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | /* End PBXResourcesBuildPhase section */ 178 | 179 | /* Begin PBXShellScriptBuildPhase section */ 180 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 181 | isa = PBXShellScriptBuildPhase; 182 | buildActionMask = 2147483647; 183 | files = ( 184 | ); 185 | inputPaths = ( 186 | ); 187 | name = "Thin Binary"; 188 | outputPaths = ( 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | shellPath = /bin/sh; 192 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 193 | }; 194 | 9740EEB61CF901F6004384FC /* Run Script */ = { 195 | isa = PBXShellScriptBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | ); 199 | inputPaths = ( 200 | ); 201 | name = "Run Script"; 202 | outputPaths = ( 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | shellPath = /bin/sh; 206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 207 | }; 208 | /* End PBXShellScriptBuildPhase section */ 209 | 210 | /* Begin PBXSourcesBuildPhase section */ 211 | 97C146EA1CF9000F007C117D /* Sources */ = { 212 | isa = PBXSourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 216 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXSourcesBuildPhase section */ 221 | 222 | /* Begin PBXVariantGroup section */ 223 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C146FB1CF9000F007C117D /* Base */, 227 | ); 228 | name = Main.storyboard; 229 | sourceTree = ""; 230 | }; 231 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 232 | isa = PBXVariantGroup; 233 | children = ( 234 | 97C147001CF9000F007C117D /* Base */, 235 | ); 236 | name = LaunchScreen.storyboard; 237 | sourceTree = ""; 238 | }; 239 | /* End PBXVariantGroup section */ 240 | 241 | /* Begin XCBuildConfiguration section */ 242 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 243 | isa = XCBuildConfiguration; 244 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 245 | buildSettings = { 246 | ALWAYS_SEARCH_USER_PATHS = NO; 247 | CLANG_ANALYZER_NONNULL = YES; 248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 249 | CLANG_CXX_LIBRARY = "libc++"; 250 | CLANG_ENABLE_MODULES = YES; 251 | CLANG_ENABLE_OBJC_ARC = YES; 252 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 253 | CLANG_WARN_BOOL_CONVERSION = YES; 254 | CLANG_WARN_COMMA = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 258 | CLANG_WARN_EMPTY_BODY = YES; 259 | CLANG_WARN_ENUM_CONVERSION = YES; 260 | CLANG_WARN_INFINITE_RECURSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 263 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 264 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 265 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 266 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 267 | CLANG_WARN_STRICT_PROTOTYPES = YES; 268 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 272 | COPY_PHASE_STRIP = NO; 273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 274 | ENABLE_NS_ASSERTIONS = NO; 275 | ENABLE_STRICT_OBJC_MSGSEND = YES; 276 | GCC_C_LANGUAGE_STANDARD = gnu99; 277 | GCC_NO_COMMON_BLOCKS = YES; 278 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 279 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 280 | GCC_WARN_UNDECLARED_SELECTOR = YES; 281 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 282 | GCC_WARN_UNUSED_FUNCTION = YES; 283 | GCC_WARN_UNUSED_VARIABLE = YES; 284 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 285 | MTL_ENABLE_DEBUG_INFO = NO; 286 | SDKROOT = iphoneos; 287 | SUPPORTED_PLATFORMS = iphoneos; 288 | TARGETED_DEVICE_FAMILY = "1,2"; 289 | VALIDATE_PRODUCT = YES; 290 | }; 291 | name = Profile; 292 | }; 293 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 294 | isa = XCBuildConfiguration; 295 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | CLANG_ENABLE_MODULES = YES; 299 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 300 | ENABLE_BITCODE = NO; 301 | FRAMEWORK_SEARCH_PATHS = ( 302 | "$(inherited)", 303 | "$(PROJECT_DIR)/Flutter", 304 | ); 305 | INFOPLIST_FILE = Runner/Info.plist; 306 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 307 | LIBRARY_SEARCH_PATHS = ( 308 | "$(inherited)", 309 | "$(PROJECT_DIR)/Flutter", 310 | ); 311 | PRODUCT_BUNDLE_IDENTIFIER = com.example.dioExample; 312 | PRODUCT_NAME = "$(TARGET_NAME)"; 313 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 314 | SWIFT_VERSION = 5.0; 315 | VERSIONING_SYSTEM = "apple-generic"; 316 | }; 317 | name = Profile; 318 | }; 319 | 97C147031CF9000F007C117D /* Debug */ = { 320 | isa = XCBuildConfiguration; 321 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 322 | buildSettings = { 323 | ALWAYS_SEARCH_USER_PATHS = NO; 324 | CLANG_ANALYZER_NONNULL = YES; 325 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 326 | CLANG_CXX_LIBRARY = "libc++"; 327 | CLANG_ENABLE_MODULES = YES; 328 | CLANG_ENABLE_OBJC_ARC = YES; 329 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 330 | CLANG_WARN_BOOL_CONVERSION = YES; 331 | CLANG_WARN_COMMA = YES; 332 | CLANG_WARN_CONSTANT_CONVERSION = YES; 333 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INFINITE_RECURSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 340 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 341 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 342 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 343 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 344 | CLANG_WARN_STRICT_PROTOTYPES = YES; 345 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 346 | CLANG_WARN_UNREACHABLE_CODE = YES; 347 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 348 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 349 | COPY_PHASE_STRIP = NO; 350 | DEBUG_INFORMATION_FORMAT = dwarf; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | ENABLE_TESTABILITY = YES; 353 | GCC_C_LANGUAGE_STANDARD = gnu99; 354 | GCC_DYNAMIC_NO_PIC = NO; 355 | GCC_NO_COMMON_BLOCKS = YES; 356 | GCC_OPTIMIZATION_LEVEL = 0; 357 | GCC_PREPROCESSOR_DEFINITIONS = ( 358 | "DEBUG=1", 359 | "$(inherited)", 360 | ); 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 368 | MTL_ENABLE_DEBUG_INFO = YES; 369 | ONLY_ACTIVE_ARCH = YES; 370 | SDKROOT = iphoneos; 371 | TARGETED_DEVICE_FAMILY = "1,2"; 372 | }; 373 | name = Debug; 374 | }; 375 | 97C147041CF9000F007C117D /* Release */ = { 376 | isa = XCBuildConfiguration; 377 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_ANALYZER_NONNULL = YES; 381 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 382 | CLANG_CXX_LIBRARY = "libc++"; 383 | CLANG_ENABLE_MODULES = YES; 384 | CLANG_ENABLE_OBJC_ARC = YES; 385 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 386 | CLANG_WARN_BOOL_CONVERSION = YES; 387 | CLANG_WARN_COMMA = YES; 388 | CLANG_WARN_CONSTANT_CONVERSION = YES; 389 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 391 | CLANG_WARN_EMPTY_BODY = YES; 392 | CLANG_WARN_ENUM_CONVERSION = YES; 393 | CLANG_WARN_INFINITE_RECURSION = YES; 394 | CLANG_WARN_INT_CONVERSION = YES; 395 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 397 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 398 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 399 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 400 | CLANG_WARN_STRICT_PROTOTYPES = YES; 401 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 405 | COPY_PHASE_STRIP = NO; 406 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 407 | ENABLE_NS_ASSERTIONS = NO; 408 | ENABLE_STRICT_OBJC_MSGSEND = YES; 409 | GCC_C_LANGUAGE_STANDARD = gnu99; 410 | GCC_NO_COMMON_BLOCKS = YES; 411 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 412 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 413 | GCC_WARN_UNDECLARED_SELECTOR = YES; 414 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 415 | GCC_WARN_UNUSED_FUNCTION = YES; 416 | GCC_WARN_UNUSED_VARIABLE = YES; 417 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 418 | MTL_ENABLE_DEBUG_INFO = NO; 419 | SDKROOT = iphoneos; 420 | SUPPORTED_PLATFORMS = iphoneos; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 422 | TARGETED_DEVICE_FAMILY = "1,2"; 423 | VALIDATE_PRODUCT = YES; 424 | }; 425 | name = Release; 426 | }; 427 | 97C147061CF9000F007C117D /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | FRAMEWORK_SEARCH_PATHS = ( 436 | "$(inherited)", 437 | "$(PROJECT_DIR)/Flutter", 438 | ); 439 | INFOPLIST_FILE = Runner/Info.plist; 440 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 441 | LIBRARY_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(PROJECT_DIR)/Flutter", 444 | ); 445 | PRODUCT_BUNDLE_IDENTIFIER = com.example.dioExample; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 448 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 449 | SWIFT_VERSION = 5.0; 450 | VERSIONING_SYSTEM = "apple-generic"; 451 | }; 452 | name = Debug; 453 | }; 454 | 97C147071CF9000F007C117D /* Release */ = { 455 | isa = XCBuildConfiguration; 456 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 457 | buildSettings = { 458 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 459 | CLANG_ENABLE_MODULES = YES; 460 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 461 | ENABLE_BITCODE = NO; 462 | FRAMEWORK_SEARCH_PATHS = ( 463 | "$(inherited)", 464 | "$(PROJECT_DIR)/Flutter", 465 | ); 466 | INFOPLIST_FILE = Runner/Info.plist; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 468 | LIBRARY_SEARCH_PATHS = ( 469 | "$(inherited)", 470 | "$(PROJECT_DIR)/Flutter", 471 | ); 472 | PRODUCT_BUNDLE_IDENTIFIER = com.example.dioExample; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 475 | SWIFT_VERSION = 5.0; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | 249021D3217E4FDB00AE95B9 /* Profile */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 97C147061CF9000F007C117D /* Debug */, 497 | 97C147071CF9000F007C117D /* Release */, 498 | 249021D4217E4FDB00AE95B9 /* Profile */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | /* End XCConfigurationList section */ 504 | }; 505 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 506 | } 507 | -------------------------------------------------------------------------------- /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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterDioExample/54162e6f16e6b1b4de27bfcb2181505dde4ddb1a/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 | dio_example 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/app/app_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:mobx/mobx.dart'; 3 | 4 | part 'app_controller.g.dart'; 5 | 6 | @Injectable() 7 | class AppController = _AppControllerBase with _$AppController; 8 | 9 | abstract class _AppControllerBase with Store { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lib/app/app_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'app_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $AppController = BindInject( 10 | (i) => AppController(), 11 | singleton: true, 12 | lazy: true, 13 | ); 14 | 15 | // ************************************************************************** 16 | // StoreGenerator 17 | // ************************************************************************** 18 | 19 | // ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 20 | 21 | mixin _$AppController on _AppControllerBase, Store { 22 | @override 23 | String toString() { 24 | return ''' 25 | 26 | '''; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/app/app_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | 5 | import 'app_controller.dart'; 6 | import 'app_widget.dart'; 7 | import 'modules/home/home_module.dart'; 8 | import 'modules/login/login_module.dart'; 9 | import 'shared/components/loading_dialog.dart'; 10 | import 'shared/http/custom_dio.dart'; 11 | import 'shared/repositories/user_repository.dart'; 12 | import 'shared/services/user_service.dart'; 13 | import 'shared/stores/user_store.dart'; 14 | 15 | class AppModule extends MainModule { 16 | @override 17 | List get binds => [ 18 | $UserStore, 19 | $UserService, 20 | $UserRepository, 21 | $AppController, 22 | $CustomDio, 23 | $LoadingDialog, 24 | Bind( 25 | (i) => BaseOptions( 26 | baseUrl: 'http://192.168.15.15:3001/', 27 | connectTimeout: 5000, 28 | ), 29 | ), 30 | ]; 31 | 32 | @override 33 | List get routers => [ 34 | Router(Modular.initialRoute, module: LoginModule()), 35 | Router('/home', module: HomeModule()), 36 | ]; 37 | 38 | @override 39 | Widget get bootstrap => AppWidget(); 40 | 41 | static Inject get to => Inject.of(); 42 | } 43 | -------------------------------------------------------------------------------- /lib/app/app_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | import 'package:asuka/asuka.dart' as asuka show builder; 4 | 5 | class AppWidget extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return MaterialApp( 9 | navigatorKey: Modular.navigatorKey, 10 | title: 'Flutter Slidy', 11 | theme: ThemeData( 12 | primarySwatch: Colors.blue, 13 | ), 14 | initialRoute: '/', 15 | builder: asuka.builder, 16 | onGenerateRoute: Modular.generateRoute, 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/app/modules/home/home_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:asuka/asuka.dart' as asuka; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'package:mobx/mobx.dart'; 5 | import 'package:open_file/open_file.dart'; 6 | 7 | // import '../../shared/components/loading_dialog.dart'; 8 | import 'models/product_model.dart'; 9 | import 'services/interfaces/product_service_interface.dart'; 10 | 11 | part 'home_controller.g.dart'; 12 | 13 | @Injectable() 14 | class HomeController = _HomeControllerBase with _$HomeController; 15 | 16 | abstract class _HomeControllerBase with Store { 17 | final IProductService _productService; 18 | //final ILoadingDialog _loading; 19 | 20 | _HomeControllerBase(this._productService); 21 | 22 | @observable 23 | ObservableList listProducts; 24 | @observable 25 | bool loading = false; 26 | @action 27 | Future load() async { 28 | //_loading.show(); 29 | loading = true; 30 | await Future.delayed(Duration(seconds: 1)); 31 | var result = await _productService.get(); 32 | 33 | result.fold((failure) { 34 | asuka.showSnackBar(SnackBar(content: Text(failure.message))); 35 | }, (p) { 36 | listProducts = p.asObservable(); 37 | }); 38 | loading = false; 39 | } 40 | 41 | Future downloadPDF() async { 42 | try { 43 | loading = true; 44 | 45 | var result = await _productService.downloadPdf(); 46 | var path = ''; 47 | 48 | result.fold((failure) { 49 | asuka.showSnackBar(SnackBar(content: Text(failure.message))); 50 | }, (p) { 51 | path = p; 52 | 53 | OpenFile.open(p, type: "application/pdf"); 54 | }); 55 | 56 | return path; 57 | } on Exception { 58 | asuka.showSnackBar(SnackBar(content: Text('Falha ao fazer download'))); 59 | } finally { 60 | loading = false; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/app/modules/home/home_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'home_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $HomeController = BindInject( 10 | (i) => HomeController(i()), 11 | singleton: true, 12 | lazy: true, 13 | ); 14 | 15 | // ************************************************************************** 16 | // StoreGenerator 17 | // ************************************************************************** 18 | 19 | // ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 20 | 21 | mixin _$HomeController on _HomeControllerBase, Store { 22 | final _$listProductsAtom = Atom(name: '_HomeControllerBase.listProducts'); 23 | 24 | @override 25 | ObservableList get listProducts { 26 | _$listProductsAtom.reportRead(); 27 | return super.listProducts; 28 | } 29 | 30 | @override 31 | set listProducts(ObservableList value) { 32 | _$listProductsAtom.reportWrite(value, super.listProducts, () { 33 | super.listProducts = value; 34 | }); 35 | } 36 | 37 | final _$loadingAtom = Atom(name: '_HomeControllerBase.loading'); 38 | 39 | @override 40 | bool get loading { 41 | _$loadingAtom.reportRead(); 42 | return super.loading; 43 | } 44 | 45 | @override 46 | set loading(bool value) { 47 | _$loadingAtom.reportWrite(value, super.loading, () { 48 | super.loading = value; 49 | }); 50 | } 51 | 52 | final _$loadAsyncAction = AsyncAction('_HomeControllerBase.load'); 53 | 54 | @override 55 | Future load() { 56 | return _$loadAsyncAction.run(() => super.load()); 57 | } 58 | 59 | @override 60 | String toString() { 61 | return ''' 62 | listProducts: ${listProducts}, 63 | loading: ${loading} 64 | '''; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/app/modules/home/home_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | 3 | import 'home_controller.dart'; 4 | import 'home_page.dart'; 5 | import 'pages/product/product_controller.dart'; 6 | import 'pages/product/product_page.dart'; 7 | import 'repositories/product_repository.dart'; 8 | import 'services/product_service.dart'; 9 | 10 | class HomeModule extends ChildModule { 11 | @override 12 | List get binds => [ 13 | $ProductController, 14 | $ProductService, 15 | $ProductRepository, 16 | $HomeController, 17 | ]; 18 | 19 | @override 20 | List get routers => [ 21 | Router(Modular.initialRoute, child: (_, args) => HomePage()), 22 | Router('/product/:id', child: (_, args) => ProductPage()), 23 | Router('/product', child: (_, args) => ProductPage()), 24 | ]; 25 | 26 | static Inject get to => Inject.of(); 27 | } 28 | -------------------------------------------------------------------------------- /lib/app/modules/home/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_mobx/flutter_mobx.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'home_controller.dart'; 5 | 6 | class HomePage extends StatefulWidget { 7 | final String title; 8 | const HomePage({Key key, this.title = "Home"}) : super(key: key); 9 | 10 | @override 11 | _HomePageState createState() => _HomePageState(); 12 | } 13 | 14 | class _HomePageState extends ModularState { 15 | //use 'controller' variable to access controller 16 | 17 | @override 18 | void initState() { 19 | super.initState(); 20 | controller.load(); 21 | } 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | appBar: AppBar( 27 | title: Text(widget.title), 28 | actions: [ 29 | IconButton( 30 | icon: Icon(Icons.picture_as_pdf), 31 | onPressed: controller.downloadPDF), 32 | ], 33 | ), 34 | body: Observer(builder: (_) { 35 | if (controller.loading || controller.listProducts == null) { 36 | return Center( 37 | child: CircularProgressIndicator(), 38 | ); 39 | } else { 40 | return RefreshIndicator( 41 | child: ListView.builder( 42 | itemCount: controller.listProducts.length, 43 | itemBuilder: (_, i) { 44 | return ListTile( 45 | title: Text(controller.listProducts[i].description), 46 | onTap: () async { 47 | await Modular.link 48 | .pushNamed('/product/${controller.listProducts[i].id}'); 49 | controller.load(); 50 | }, 51 | ); 52 | }, 53 | ), 54 | onRefresh: () async { 55 | await controller.load(); 56 | }, 57 | ); 58 | } 59 | }), 60 | floatingActionButton: FloatingActionButton( 61 | child: Icon(Icons.add), 62 | onPressed: () async { 63 | await Modular.link.pushNamed('/product/-1'); 64 | controller.load(); 65 | }, 66 | ), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/app/modules/home/models/product_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final productsModel = productsModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | class ProductModel { 8 | ProductModel({ 9 | this.id, 10 | this.description, 11 | }); 12 | 13 | final int id; 14 | final String description; 15 | 16 | ProductModel copyWith({ 17 | int id, 18 | String description, 19 | }) => 20 | ProductModel( 21 | id: id ?? this.id, 22 | description: description ?? this.description, 23 | ); 24 | 25 | factory ProductModel.fromRawJson(String str) => 26 | ProductModel.fromJson(json.decode(str)); 27 | 28 | String toRawJson() => json.encode(toJson()); 29 | 30 | factory ProductModel.fromJson(Map json) => ProductModel( 31 | id: json["id"], 32 | description: json["description"], 33 | ); 34 | 35 | Map toJson() => { 36 | "id": id, 37 | "description": description, 38 | }; 39 | 40 | bool get isValidDescription => 41 | description != null && description.isNotEmpty && description.length > 3; 42 | } 43 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/product/product_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:asuka/asuka.dart' as asuka; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'package:mobx/mobx.dart'; 5 | 6 | import '../../models/product_model.dart'; 7 | import '../../services/interfaces/product_service_interface.dart'; 8 | 9 | part 'product_controller.g.dart'; 10 | 11 | @Injectable() 12 | class ProductController = _ProductControllerBase with _$ProductController; 13 | 14 | abstract class _ProductControllerBase with Store { 15 | final String id; 16 | final IProductService _productService; 17 | 18 | _ProductControllerBase(this._productService, {@Param this.id}) { 19 | if (id != null && id != '-1') load(); 20 | } 21 | TextEditingController txtDescricao = TextEditingController(); 22 | 23 | @observable 24 | int idProduct; 25 | @observable 26 | String description; 27 | @observable 28 | bool loading = false; 29 | 30 | @computed 31 | ProductModel get product => 32 | ProductModel(description: description, id: idProduct); 33 | 34 | @computed 35 | bool get isValid => product.isValidDescription; 36 | 37 | @action 38 | void setDescription(String v) => description = v; 39 | 40 | @action 41 | Future load() async { 42 | loading = true; 43 | idProduct = int.parse(id); 44 | var result = await _productService.getById(1); 45 | 46 | result.fold((failure) { 47 | asuka.showSnackBar(SnackBar(content: Text(failure.message))); 48 | loading = false; 49 | }, (product) { 50 | description = product.description; 51 | txtDescricao.text = description; 52 | loading = false; 53 | }); 54 | } 55 | 56 | save() { 57 | if (id != null && id != '-1') { 58 | _productService.put(product); 59 | } else { 60 | _productService.post(product); 61 | } 62 | Modular.to.pop(); 63 | asuka.showSnackBar(SnackBar(content: Text('Salvo com sucesso'))); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/product/product_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'product_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $ProductController = BindInject( 10 | (i) => ProductController(i(), id: i.args.params['id']), 11 | singleton: true, 12 | lazy: true, 13 | ); 14 | 15 | // ************************************************************************** 16 | // StoreGenerator 17 | // ************************************************************************** 18 | 19 | // ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 20 | 21 | mixin _$ProductController on _ProductControllerBase, Store { 22 | Computed _$productComputed; 23 | 24 | @override 25 | ProductModel get product => 26 | (_$productComputed ??= Computed(() => super.product, 27 | name: '_ProductControllerBase.product')) 28 | .value; 29 | Computed _$isValidComputed; 30 | 31 | @override 32 | bool get isValid => (_$isValidComputed ??= Computed(() => super.isValid, 33 | name: '_ProductControllerBase.isValid')) 34 | .value; 35 | 36 | final _$idProductAtom = Atom(name: '_ProductControllerBase.idProduct'); 37 | 38 | @override 39 | int get idProduct { 40 | _$idProductAtom.reportRead(); 41 | return super.idProduct; 42 | } 43 | 44 | @override 45 | set idProduct(int value) { 46 | _$idProductAtom.reportWrite(value, super.idProduct, () { 47 | super.idProduct = value; 48 | }); 49 | } 50 | 51 | final _$descriptionAtom = Atom(name: '_ProductControllerBase.description'); 52 | 53 | @override 54 | String get description { 55 | _$descriptionAtom.reportRead(); 56 | return super.description; 57 | } 58 | 59 | @override 60 | set description(String value) { 61 | _$descriptionAtom.reportWrite(value, super.description, () { 62 | super.description = value; 63 | }); 64 | } 65 | 66 | final _$loadingAtom = Atom(name: '_ProductControllerBase.loading'); 67 | 68 | @override 69 | bool get loading { 70 | _$loadingAtom.reportRead(); 71 | return super.loading; 72 | } 73 | 74 | @override 75 | set loading(bool value) { 76 | _$loadingAtom.reportWrite(value, super.loading, () { 77 | super.loading = value; 78 | }); 79 | } 80 | 81 | final _$loadAsyncAction = AsyncAction('_ProductControllerBase.load'); 82 | 83 | @override 84 | Future load() { 85 | return _$loadAsyncAction.run(() => super.load()); 86 | } 87 | 88 | final _$_ProductControllerBaseActionController = 89 | ActionController(name: '_ProductControllerBase'); 90 | 91 | @override 92 | void setDescription(String v) { 93 | final _$actionInfo = _$_ProductControllerBaseActionController.startAction( 94 | name: '_ProductControllerBase.setDescription'); 95 | try { 96 | return super.setDescription(v); 97 | } finally { 98 | _$_ProductControllerBaseActionController.endAction(_$actionInfo); 99 | } 100 | } 101 | 102 | @override 103 | String toString() { 104 | return ''' 105 | idProduct: ${idProduct}, 106 | description: ${description}, 107 | loading: ${loading}, 108 | product: ${product}, 109 | isValid: ${isValid} 110 | '''; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/product/product_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_mobx/flutter_mobx.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'product_controller.dart'; 5 | 6 | class ProductPage extends StatefulWidget { 7 | final String title; 8 | 9 | const ProductPage({Key key, this.title = "Product"}) : super(key: key); 10 | 11 | @override 12 | _ProductPageState createState() => _ProductPageState(); 13 | } 14 | 15 | class _ProductPageState extends ModularState { 16 | //use 'controller' variable to access controller 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: AppBar( 22 | title: Observer(builder: (_) { 23 | return Text(controller.id == null || controller.id == "-1" 24 | ? 'Cadastrar' 25 | : 'Editar #${controller.product?.id ?? ''}'); 26 | }), 27 | actions: [ 28 | IconButton( 29 | icon: Icon(Icons.save), 30 | onPressed: controller.save, 31 | ) 32 | ], 33 | ), 34 | body: Padding( 35 | padding: const EdgeInsets.all(8.0), 36 | child: Observer(builder: (_) { 37 | if (controller.loading) { 38 | return Center( 39 | child: CircularProgressIndicator(), 40 | ); 41 | } else { 42 | return Column( 43 | children: [ 44 | TextField( 45 | onChanged: controller.setDescription, 46 | controller: controller.txtDescricao, 47 | decoration: InputDecoration( 48 | border: OutlineInputBorder(), 49 | labelText: "Descrição", 50 | ), 51 | ), 52 | ], 53 | ); 54 | } 55 | }), 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/interfaces/product_repository_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | 4 | import '../../../../shared/errors/errors.dart'; 5 | import '../../models/product_model.dart'; 6 | 7 | abstract class IProductRepository implements Disposable { 8 | Future>> get(); 9 | Future> getById(int i); 10 | 11 | Future> put(ProductModel product); 12 | Future> post(ProductModel product); 13 | Future> delete(int id); 14 | Future> active(int id); 15 | Future> downloadPdf(); 16 | } 17 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/product_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:dio/dio.dart'; 3 | import 'package:path_provider/path_provider.dart'; 4 | import 'package:dio/native_imp.dart'; 5 | import 'package:flutter_modular/flutter_modular.dart'; 6 | import '../../../shared/errors/errors.dart'; 7 | import '../models/product_model.dart'; 8 | import 'interfaces/product_repository_interface.dart'; 9 | 10 | part 'product_repository.g.dart'; 11 | 12 | @Injectable() 13 | class ProductRepository implements IProductRepository { 14 | final DioForNative _client; 15 | 16 | ProductRepository(this._client); 17 | 18 | @override 19 | void dispose() {} 20 | 21 | @override 22 | Future> delete(int id) async { 23 | try { 24 | var _ = await _client.delete('/products/$id'); 25 | return Right(true); 26 | } on DioError catch (err) { 27 | return Left(DioFailure( 28 | message: err.response.data, statusCode: err.response.statusCode)); 29 | } 30 | } 31 | 32 | @override 33 | Future>> get() async { 34 | try { 35 | var response = await _client.get('/products', 36 | options: Options(extra: {"refresh": true})); 37 | var result = (response.data as List).map((item) { 38 | return ProductModel.fromJson(item); 39 | }).toList(); 40 | 41 | return Right(result); 42 | } on DioError catch (err) { 43 | return Left(DioFailure( 44 | message: err.response.data, statusCode: err.response.statusCode)); 45 | } 46 | } 47 | 48 | @override 49 | Future> getById(int id) async { 50 | try { 51 | 52 | var response = await _client.get('/products/$id'); 53 | var result = ProductModel.fromJson(response.data); 54 | return Right(result); 55 | } on DioError catch (err) { 56 | return Left(DioFailure( 57 | message: err.response.data, statusCode: err.response.statusCode)); 58 | } 59 | } 60 | 61 | @override 62 | Future> post(ProductModel product) async { 63 | try { 64 | var response = await _client.post('/products', data: product.toJson()); 65 | return Right(response.data["id"]); 66 | } on DioError catch (err) { 67 | return Left(DioFailure( 68 | message: err.response.data, statusCode: err.response.statusCode)); 69 | } 70 | } 71 | 72 | @override 73 | Future> active(int id) async { 74 | try { 75 | var _ = await _client.patch('/products/$id'); 76 | return Right(true); 77 | } on DioError catch (err) { 78 | return Left(DioFailure( 79 | message: err.response.data, statusCode: err.response.statusCode)); 80 | } 81 | } 82 | 83 | @override 84 | Future> put(ProductModel product) async { 85 | try { 86 | var _ = await _client.post('/products', data: product.toJson()); 87 | return Right(true); 88 | } on DioError catch (err) { 89 | return Left(DioFailure( 90 | message: err.response.data, statusCode: err.response.statusCode)); 91 | } 92 | } 93 | 94 | @override 95 | Future> downloadPdf() async { 96 | try { 97 | var appDocDir = await getApplicationDocumentsDirectory(); 98 | var appDocPath = '${appDocDir.path}/teste.pdf'; 99 | await _client.download( 100 | 'http://www.rrsantos.com.br/holerite/holerite.pdf', 101 | appDocPath, 102 | onReceiveProgress: (received, total) { 103 | if (total != -1) { 104 | print("${(received / total * 100).toStringAsFixed(0)}%"); 105 | } 106 | }, 107 | deleteOnError: true, 108 | ); 109 | 110 | return Right(appDocPath); 111 | } on DioError catch (err) { 112 | return Left(DioFailure( 113 | message: err.response.data, statusCode: err.response.statusCode)); 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/product_repository.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'product_repository.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $ProductRepository = BindInject( 10 | (i) => ProductRepository(i()), 11 | singleton: true, 12 | lazy: true, 13 | ); 14 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/interfaces/product_service_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | 4 | import '../../../../shared/errors/errors.dart'; 5 | import '../../models/product_model.dart'; 6 | 7 | abstract class IProductService implements Disposable { 8 | Future>> get(); 9 | Future> getById(int i); 10 | 11 | Future> put(ProductModel product); 12 | Future> post(ProductModel product); 13 | Future> delete(int id); 14 | Future> active(int id); 15 | Future> downloadPdf(); 16 | } 17 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/product_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | 4 | import '../../../shared/errors/errors.dart'; 5 | import '../models/product_model.dart'; 6 | import '../repositories/interfaces/product_repository_interface.dart'; 7 | import 'interfaces/product_service_interface.dart'; 8 | 9 | part 'product_service.g.dart'; 10 | 11 | @Injectable() 12 | class ProductService implements IProductService { 13 | final IProductRepository _productRepository; 14 | 15 | ProductService(this._productRepository); 16 | //dispose will be called automatically 17 | @override 18 | void dispose() {} 19 | 20 | @override 21 | Future> active(int id) { 22 | return _productRepository.active(id); 23 | } 24 | 25 | @override 26 | Future> delete(int id) { 27 | return _productRepository.delete(id); 28 | } 29 | 30 | @override 31 | Future>> get() { 32 | return _productRepository.get(); 33 | } 34 | 35 | @override 36 | Future> getById(int id) { 37 | return _productRepository.getById(id); 38 | } 39 | 40 | @override 41 | Future> post(ProductModel product) { 42 | return _productRepository.post(product); 43 | } 44 | 45 | @override 46 | Future> put(ProductModel product) { 47 | return _productRepository.put(product); 48 | } 49 | 50 | @override 51 | Future> downloadPdf() { 52 | return _productRepository.downloadPdf(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/product_service.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'product_service.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $ProductService = BindInject( 10 | (i) => ProductService(i()), 11 | singleton: true, 12 | lazy: true, 13 | ); 14 | -------------------------------------------------------------------------------- /lib/app/modules/login/login_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:asuka/asuka.dart' as asuka; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'package:mobx/mobx.dart'; 5 | 6 | import '../../shared/components/loading_dialog.dart'; 7 | import '../../shared/models/authenticate_model.dart'; 8 | import '../../shared/services/interfaces/user_service_interface.dart'; 9 | import '../../shared/stores/user_store.dart'; 10 | 11 | part 'login_controller.g.dart'; 12 | 13 | @Injectable(singleton: false) 14 | class LoginController = _LoginControllerBase with _$LoginController; 15 | 16 | abstract class _LoginControllerBase with Store { 17 | final ILoadingDialog _loading; 18 | final IUserService _userService; 19 | final UserStore userStore; 20 | 21 | @observable 22 | String login; 23 | @observable 24 | String password; 25 | 26 | _LoginControllerBase(this._loading, this._userService, this.userStore); 27 | @computed 28 | AuthenticateModel get credential => 29 | AuthenticateModel(login: login, password: password); 30 | 31 | @computed 32 | bool get isValid => credential.isValidEmail && credential.isValidPassword; 33 | 34 | @action 35 | void setLogin(String v) => login = v; 36 | @action 37 | void setPassword(String v) => password = v; 38 | 39 | Future authenticate() async { 40 | try { 41 | _loading.show(); 42 | await Future.delayed(Duration(seconds: 1)); 43 | var result = await _userService.login(credential); 44 | result.fold((failure) { 45 | asuka.showSnackBar(SnackBar(content: Text(failure.message))); 46 | }, (user) { 47 | userStore.setUser(user); 48 | Modular.to.pushReplacementNamed('/home'); 49 | }); 50 | } catch (e) { 51 | asuka.showSnackBar(SnackBar(content: Text(e.toString()))); 52 | } finally { 53 | await _loading.hide(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/app/modules/login/login_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'login_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $LoginController = BindInject( 10 | (i) => 11 | LoginController(i(), i(), i()), 12 | singleton: false, 13 | lazy: true, 14 | ); 15 | 16 | // ************************************************************************** 17 | // StoreGenerator 18 | // ************************************************************************** 19 | 20 | // ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 21 | 22 | mixin _$LoginController on _LoginControllerBase, Store { 23 | Computed _$credentialComputed; 24 | 25 | @override 26 | AuthenticateModel get credential => (_$credentialComputed ??= 27 | Computed(() => super.credential, 28 | name: '_LoginControllerBase.credential')) 29 | .value; 30 | Computed _$isValidComputed; 31 | 32 | @override 33 | bool get isValid => (_$isValidComputed ??= Computed(() => super.isValid, 34 | name: '_LoginControllerBase.isValid')) 35 | .value; 36 | 37 | final _$loginAtom = Atom(name: '_LoginControllerBase.login'); 38 | 39 | @override 40 | String get login { 41 | _$loginAtom.reportRead(); 42 | return super.login; 43 | } 44 | 45 | @override 46 | set login(String value) { 47 | _$loginAtom.reportWrite(value, super.login, () { 48 | super.login = value; 49 | }); 50 | } 51 | 52 | final _$passwordAtom = Atom(name: '_LoginControllerBase.password'); 53 | 54 | @override 55 | String get password { 56 | _$passwordAtom.reportRead(); 57 | return super.password; 58 | } 59 | 60 | @override 61 | set password(String value) { 62 | _$passwordAtom.reportWrite(value, super.password, () { 63 | super.password = value; 64 | }); 65 | } 66 | 67 | final _$_LoginControllerBaseActionController = 68 | ActionController(name: '_LoginControllerBase'); 69 | 70 | @override 71 | void setLogin(String v) { 72 | final _$actionInfo = _$_LoginControllerBaseActionController.startAction( 73 | name: '_LoginControllerBase.setLogin'); 74 | try { 75 | return super.setLogin(v); 76 | } finally { 77 | _$_LoginControllerBaseActionController.endAction(_$actionInfo); 78 | } 79 | } 80 | 81 | @override 82 | void setPassword(String v) { 83 | final _$actionInfo = _$_LoginControllerBaseActionController.startAction( 84 | name: '_LoginControllerBase.setPassword'); 85 | try { 86 | return super.setPassword(v); 87 | } finally { 88 | _$_LoginControllerBaseActionController.endAction(_$actionInfo); 89 | } 90 | } 91 | 92 | @override 93 | String toString() { 94 | return ''' 95 | login: ${login}, 96 | password: ${password}, 97 | credential: ${credential}, 98 | isValid: ${isValid} 99 | '''; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/app/modules/login/login_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | 3 | import 'login_controller.dart'; 4 | import 'login_page.dart'; 5 | 6 | class LoginModule extends ChildModule { 7 | @override 8 | List get binds => [ 9 | $LoginController, 10 | ]; 11 | 12 | @override 13 | List get routers => [ 14 | Router(Modular.initialRoute, child: (_, args) => LoginPage()), 15 | ]; 16 | 17 | static Inject get to => Inject.of(); 18 | } 19 | -------------------------------------------------------------------------------- /lib/app/modules/login/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_mobx/flutter_mobx.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'login_controller.dart'; 5 | 6 | class LoginPage extends StatefulWidget { 7 | final String title; 8 | const LoginPage({Key key, this.title = "Login"}) : super(key: key); 9 | 10 | @override 11 | _LoginPageState createState() => _LoginPageState(); 12 | } 13 | 14 | class _LoginPageState extends ModularState { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: AppBar( 19 | title: Text("Login"), 20 | ), 21 | body: Padding( 22 | padding: const EdgeInsets.all(8.0), 23 | child: Center( 24 | child: Column( 25 | mainAxisAlignment: MainAxisAlignment.center, 26 | children: [ 27 | TextField( 28 | onChanged: controller.setLogin, 29 | decoration: InputDecoration( 30 | border: OutlineInputBorder(), 31 | labelText: "Email", 32 | ), 33 | ), 34 | SizedBox( 35 | height: 10, 36 | ), 37 | TextField( 38 | onChanged: controller.setPassword, 39 | obscureText: true, 40 | decoration: InputDecoration( 41 | border: OutlineInputBorder(), 42 | labelText: "Password", 43 | ), 44 | ), 45 | SizedBox( 46 | height: 20, 47 | ), 48 | SizedBox( 49 | height: 20, 50 | ), 51 | Observer(builder: (_) { 52 | return RaisedButton( 53 | onPressed: controller.isValid ? login : null, 54 | child: Text("Entrar"), 55 | ); 56 | }) 57 | ], 58 | ), 59 | ), 60 | ), 61 | ); 62 | } 63 | 64 | void login() { 65 | controller.authenticate(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/app/shared/components/loading_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:asuka/asuka.dart' as asuka; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | 5 | part 'loading_dialog.g.dart'; 6 | 7 | abstract class ILoadingDialog { 8 | void show(); 9 | Future hide(); 10 | } 11 | 12 | @Injectable(singleton: false) 13 | class LoadingDialog implements ILoadingDialog { 14 | OverlayEntry _entry; 15 | 16 | LoadingDialog() { 17 | _entry = OverlayEntry( 18 | builder: (context) { 19 | return Container( 20 | color: Colors.black.withOpacity(.3), 21 | alignment: Alignment.center, 22 | child: CircularProgressIndicator(), 23 | ); 24 | }, 25 | ); 26 | } 27 | 28 | @override 29 | Future hide() async { 30 | _entry.remove(); 31 | await Future.delayed(Duration(milliseconds: 500)); 32 | } 33 | 34 | @override 35 | void show() { 36 | FocusManager.instance.primaryFocus.unfocus(); 37 | asuka.addOverlay(_entry); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/app/shared/components/loading_dialog.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'loading_dialog.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $LoadingDialog = BindInject( 10 | (i) => LoadingDialog(), 11 | singleton: false, 12 | lazy: true, 13 | ); 14 | -------------------------------------------------------------------------------- /lib/app/shared/errors/errors.dart: -------------------------------------------------------------------------------- 1 | abstract class Failure implements Exception { 2 | String get message; 3 | } 4 | 5 | class DioFailure extends Failure { 6 | final String message; 7 | final int statusCode; 8 | DioFailure({ 9 | this.message, 10 | this.statusCode, 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/shared/http/custom_dio.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:dio/native_imp.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'interceptors/cache_interceptor.dart'; 5 | 6 | import 'interceptors/custom_interceptor.dart'; 7 | 8 | part 'custom_dio.g.dart'; 9 | 10 | @Injectable() 11 | class CustomDio extends DioForNative { 12 | CustomDio([BaseOptions options]) : super(options) { 13 | interceptors.add(CustomInterceptors()); 14 | interceptors.add(CacheInterceptor()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/app/shared/http/custom_dio.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'custom_dio.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $CustomDio = BindInject( 10 | (i) => CustomDio(i()), 11 | singleton: true, 12 | lazy: true, 13 | ); 14 | -------------------------------------------------------------------------------- /lib/app/shared/http/interceptors/cache_interceptor.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/cupertino.dart'; 5 | 6 | import '../../models/dio_response.dart'; 7 | import '../../services/local_storage_service.dart'; 8 | 9 | class CacheInterceptor extends InterceptorsWrapper { 10 | @override 11 | Future onRequest(RequestOptions options) async { 12 | print('Request[${options.method}] => PATH: ${options.path}'); 13 | 14 | var uri = options.uri; 15 | 16 | if (options.extra.containsKey('refresh')) { 17 | var cache = await _getCache(uri); 18 | 19 | if (options.extra['refresh'] && cache == null) { 20 | return super.onRequest(options); 21 | } else { 22 | var data = await _getCache(uri); 23 | 24 | if (data != null && !data.expired) { 25 | return Response(data: data.data, statusCode: 200); 26 | } else { 27 | return super.onRequest(options); 28 | } 29 | } 30 | } 31 | 32 | return super.onRequest(options); 33 | } 34 | 35 | @override 36 | Future onResponse(Response response) async { 37 | print('Response[${response.statusCode}] => PATH: ${response.request.path}'); 38 | if (response.request.extra.containsKey('refresh') && 39 | response.request.extra['refresh']) { 40 | var cache = await _getCache(response.request.uri); 41 | 42 | if (cache == null || cache.expired) { 43 | save(response.request.uri.toString(), response.data); 44 | } 45 | } 46 | return super.onResponse(response); 47 | } 48 | 49 | Future _getCache(Uri uri) async { 50 | var containsCache = await LocalStorageService.cointains(uri.toString()); 51 | if (containsCache) { 52 | var data = await LocalStorageService.getValue(uri.toString()); 53 | var expire = await LocalStorageService.getValue('${uri}_expire'); 54 | var json = jsonDecode("$data"); 55 | var res = DioResponse(data: json, expire: DateTime.parse(expire)); 56 | debugPrint("Recuperando do Cache $uri"); 57 | 58 | return res; 59 | } else { 60 | return null; 61 | } 62 | } 63 | 64 | void save(String uri, dynamic data) { 65 | var dateTime = DateTime.now().add(Duration(minutes: 1)); 66 | LocalStorageService.setValue(uri, jsonEncode(data)); 67 | LocalStorageService.setValue('${uri}_expire', dateTime.toString()); 68 | debugPrint("Atualizando em cache $uri"); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/app/shared/http/interceptors/custom_interceptor.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:dio/native_imp.dart'; 5 | import 'package:flutter/foundation.dart'; 6 | import 'package:flutter_modular/flutter_modular.dart'; 7 | 8 | import '../../models/authenticate_model.dart'; 9 | import '../../services/interfaces/user_service_interface.dart'; 10 | 11 | class CustomInterceptors extends InterceptorsWrapper { 12 | @override 13 | Future onRequest(RequestOptions options) async { 14 | var userService = Modular.get(); 15 | var user = await userService.getCurrentUser(); 16 | 17 | if (user?.token != null && user.token.isNotEmpty) { 18 | var headerAuth = genToken(user.token); 19 | options.headers['Authorization'] = headerAuth; 20 | } 21 | if (kDebugMode) { 22 | debugPrint(json.encode("BaseURL: ${options.baseUrl}")); 23 | debugPrint(json.encode("Endpoint: ${options.path}")); 24 | if (options.headers['Authorization'] != null) { 25 | debugPrint("Authorization: ${options.headers['Authorization']}"); 26 | } 27 | if (options.data != null) { 28 | debugPrint("Payload ${json.encode(options.data)}"); 29 | } 30 | } 31 | 32 | return super.onRequest(options); 33 | } 34 | 35 | @override 36 | Future onResponse(Response response) { 37 | return super.onResponse(response); 38 | } 39 | 40 | @override 41 | Future onError(DioError err) async { 42 | if (err.response.statusCode == 401) { 43 | var dio = Modular.get(); 44 | var userService = Modular.get(); 45 | var user = await userService.getCurrentUser(); 46 | if (user != null && err.response.statusCode == 401) { 47 | var options = err.response.request; 48 | 49 | if (user.token == options.headers['Authorization']) { 50 | options.headers['Authorization'] = user.token; 51 | return dio.request(options.path, options: options); 52 | } 53 | dio.lock(); 54 | dio.interceptors.responseLock.lock(); 55 | dio.interceptors.errorLock.lock(); 56 | 57 | return userService 58 | .login( 59 | AuthenticateModel(login: user.login, password: user.password)) 60 | .then((result) { 61 | result.fold( 62 | (_) {}, 63 | (user) { 64 | var _newToken = user.token; 65 | 66 | if (_newToken != null && _newToken.isNotEmpty) { 67 | var headerAuth = genToken(_newToken); 68 | options.headers['Authorization'] = headerAuth; 69 | } 70 | }, 71 | ); 72 | }).whenComplete(() { 73 | dio.unlock(); 74 | dio.interceptors.responseLock.unlock(); 75 | dio.interceptors.errorLock.unlock(); 76 | }).then((e) => dio.request(options.path, options: options)); 77 | } 78 | } else { 79 | throw err; 80 | } 81 | } 82 | 83 | String genToken(String token) { 84 | return 'Bearer $token'; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/app/shared/models/authenticate_model.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:string_validator/string_validator.dart' as validator; 3 | 4 | class AuthenticateModel { 5 | AuthenticateModel({ 6 | this.login, 7 | this.password, 8 | }); 9 | 10 | final String login; 11 | final String password; 12 | 13 | AuthenticateModel copyWith({ 14 | String login, 15 | String password, 16 | }) => 17 | AuthenticateModel( 18 | login: login ?? this.login, 19 | password: password ?? this.password, 20 | ); 21 | 22 | String toRawJson() => json.encode(toJson()); 23 | 24 | Map toJson() => { 25 | "login": login, 26 | "password": password, 27 | }; 28 | 29 | bool get isValidEmail => validator.isEmail(login ?? ""); 30 | bool get isValidPassword => 31 | password != null && password.isNotEmpty && password.length > 3; 32 | } 33 | -------------------------------------------------------------------------------- /lib/app/shared/models/dio_response.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class DioResponse { 4 | DioResponse({ 5 | this.data, 6 | this.expire, 7 | }); 8 | 9 | final dynamic data; 10 | final DateTime expire; 11 | bool get expired => expire.difference(DateTime.now()).inMinutes < 0; 12 | 13 | DioResponse copyWith({ 14 | dynamic data, 15 | DateTime expire, 16 | }) => 17 | DioResponse( 18 | data: data ?? this.data, 19 | expire: expire ?? this.expire, 20 | ); 21 | 22 | String toRawJson() => json.encode(toJson()); 23 | 24 | Map toJson() => { 25 | "data": data, 26 | "expire": expire.toString(), 27 | }; 28 | 29 | factory DioResponse.fromRawJson(String str) => 30 | DioResponse.fromJson(json.decode(str)); 31 | 32 | factory DioResponse.fromJson(Map json) => DioResponse( 33 | data: json["data"], 34 | expire: DateTime.parse(json["expire"]), 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /lib/app/shared/models/user_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final userModel = userModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | class UserModel { 8 | UserModel({ 9 | this.login, 10 | this.token, 11 | this.refreshToken, 12 | this.password, 13 | }); 14 | 15 | final String login; 16 | final String password; 17 | final String token; 18 | final String refreshToken; 19 | 20 | UserModel copyWith({ 21 | String login, 22 | String token, 23 | String refreshToken, 24 | String password, 25 | }) => 26 | UserModel( 27 | login: login ?? this.login, 28 | token: token ?? this.token, 29 | refreshToken: refreshToken ?? this.refreshToken, 30 | password: password ?? this.password, 31 | ); 32 | 33 | factory UserModel.fromRawJson(String str) => 34 | UserModel.fromJson(json.decode(str)); 35 | 36 | String toRawJson() => json.encode(toJson()); 37 | 38 | factory UserModel.fromJson(Map json) => UserModel( 39 | login: json["login"], 40 | token: json["token"], 41 | refreshToken: json["refreshToken"], 42 | password: json['password'], 43 | ); 44 | 45 | Map toJson() => { 46 | "login": login, 47 | "token": token, 48 | "password": password, 49 | "refreshToken": refreshToken, 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /lib/app/shared/repositories/interfaces/user_repository_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | 4 | import '../../errors/errors.dart'; 5 | 6 | import '../../models/authenticate_model.dart'; 7 | import '../../models/user_model.dart'; 8 | 9 | abstract class IUserRepository implements Disposable { 10 | Future> login(AuthenticateModel login); 11 | } 12 | -------------------------------------------------------------------------------- /lib/app/shared/repositories/user_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:dio/dio.dart'; 3 | import 'package:dio/native_imp.dart'; 4 | import 'package:flutter_modular/flutter_modular.dart'; 5 | 6 | import '../errors/errors.dart'; 7 | import '../models/authenticate_model.dart'; 8 | import '../models/user_model.dart'; 9 | import 'interfaces/user_repository_interface.dart'; 10 | 11 | part 'user_repository.g.dart'; 12 | 13 | @Injectable() 14 | class UserRepository implements IUserRepository { 15 | final DioForNative _client; 16 | 17 | UserRepository(this._client); 18 | 19 | @override 20 | void dispose() {} 21 | 22 | @override 23 | Future> login(AuthenticateModel login) async { 24 | try { 25 | var response = await _client.post('/user/login', data: login.toJson()); 26 | var result = UserModel.fromJson(response.data); 27 | return Right(result); 28 | } on DioError catch (err) { 29 | return Left(DioFailure( 30 | message: err.response.data, statusCode: err.response.statusCode)); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/app/shared/repositories/user_repository.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_repository.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $UserRepository = BindInject( 10 | (i) => UserRepository(i()), 11 | singleton: true, 12 | lazy: true, 13 | ); 14 | -------------------------------------------------------------------------------- /lib/app/shared/services/interfaces/user_service_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | import '../../errors/errors.dart'; 4 | import '../../models/authenticate_model.dart'; 5 | import '../../models/user_model.dart'; 6 | 7 | abstract class IUserService implements Disposable { 8 | Future getCurrentUser(); 9 | Future saveLocalDB(UserModel user); 10 | Future> login(AuthenticateModel login); 11 | } 12 | -------------------------------------------------------------------------------- /lib/app/shared/services/local_storage_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class LocalStorageService { 4 | static Future getValue(String key) async { 5 | return await setInstance().then((sharedPreferences) { 6 | switch (T) { 7 | case double: 8 | return sharedPreferences.getDouble(key) ?? 0; 9 | break; 10 | case int: 11 | return sharedPreferences.getInt(key) ?? 0; 12 | break; 13 | case String: 14 | return sharedPreferences.getString(key) ?? ''; 15 | break; 16 | case List: 17 | return sharedPreferences.getStringList(key) ?? []; 18 | break; 19 | case bool: 20 | return sharedPreferences.getBool(key) ?? false; 21 | break; 22 | default: 23 | return sharedPreferences.getString(key) ?? ''; 24 | } 25 | }); 26 | } 27 | 28 | static Future setInstance() async { 29 | return await SharedPreferences.getInstance(); 30 | } 31 | 32 | static Future setValue(String key, dynamic value) async { 33 | return await setInstance().then((sharedPreferences) { 34 | switch (T) { 35 | case double: 36 | return sharedPreferences.setDouble(key, value); 37 | break; 38 | case int: 39 | return sharedPreferences.setInt(key, value); 40 | break; 41 | case String: 42 | return sharedPreferences.setString(key, value); 43 | break; 44 | case List: 45 | return sharedPreferences.setStringList(key, value); 46 | break; 47 | case bool: 48 | return sharedPreferences.setBool(key, value); 49 | break; 50 | default: 51 | return sharedPreferences.setString(key, value); 52 | } 53 | }); 54 | } 55 | 56 | static Future cointains(String key) async { 57 | return await setInstance().then((sharedPreferences) { 58 | return sharedPreferences.containsKey(key); 59 | }); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/app/shared/services/user_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:dartz/dartz.dart'; 4 | import 'package:flutter_modular/flutter_modular.dart'; 5 | import 'package:shared_preferences/shared_preferences.dart'; 6 | 7 | import '../errors/errors.dart'; 8 | import '../models/authenticate_model.dart'; 9 | import '../models/user_model.dart'; 10 | import '../repositories/interfaces/user_repository_interface.dart'; 11 | import 'interfaces/user_service_interface.dart'; 12 | import 'local_storage_service.dart'; 13 | 14 | part 'user_service.g.dart'; 15 | 16 | @Injectable() 17 | class UserService implements IUserService { 18 | final IUserRepository _userRepository; 19 | 20 | UserService(this._userRepository); 21 | //dispose will be called automatically 22 | @override 23 | void dispose() {} 24 | 25 | @override 26 | Future getCurrentUser() async { 27 | var contains = await LocalStorageService.cointains('current_user'); 28 | if (contains) { 29 | var res = jsonDecode( 30 | await LocalStorageService.getValue('current_user')); 31 | return UserModel.fromJson(res); 32 | } else { 33 | return null; 34 | } 35 | } 36 | 37 | @override 38 | Future saveLocalDB(UserModel user) async { 39 | LocalStorageService.setValue( 40 | 'current_user', jsonEncode(user.toJson())); 41 | } 42 | 43 | @override 44 | Future> login(AuthenticateModel login) async { 45 | var result = await _userRepository.login(login); 46 | 47 | return result; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/app/shared/services/user_service.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_service.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $UserService = BindInject( 10 | (i) => UserService(i()), 11 | singleton: true, 12 | lazy: true, 13 | ); 14 | -------------------------------------------------------------------------------- /lib/app/shared/stores/user_store.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:mobx/mobx.dart'; 3 | 4 | import '../models/user_model.dart'; 5 | import '../services/interfaces/user_service_interface.dart'; 6 | 7 | part 'user_store.g.dart'; 8 | 9 | @Injectable(singleton: false) 10 | class UserStore = _UserStoreBase with _$UserStore; 11 | 12 | abstract class _UserStoreBase with Store { 13 | final IUserService _userService; 14 | 15 | @observable 16 | UserModel user; 17 | 18 | _UserStoreBase(this._userService); 19 | @action 20 | void setUser(UserModel v) { 21 | user = v; 22 | _userService.saveLocalDB(v); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/shared/stores/user_store.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_store.dart'; 4 | 5 | // ************************************************************************** 6 | // InjectionGenerator 7 | // ************************************************************************** 8 | 9 | final $UserStore = BindInject( 10 | (i) => UserStore(i()), 11 | singleton: false, 12 | lazy: true, 13 | ); 14 | 15 | // ************************************************************************** 16 | // StoreGenerator 17 | // ************************************************************************** 18 | 19 | // ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 20 | 21 | mixin _$UserStore on _UserStoreBase, Store { 22 | final _$userAtom = Atom(name: '_UserStoreBase.user'); 23 | 24 | @override 25 | UserModel get user { 26 | _$userAtom.reportRead(); 27 | return super.user; 28 | } 29 | 30 | @override 31 | set user(UserModel value) { 32 | _$userAtom.reportWrite(value, super.user, () { 33 | super.user = value; 34 | }); 35 | } 36 | 37 | final _$_UserStoreBaseActionController = 38 | ActionController(name: '_UserStoreBase'); 39 | 40 | @override 41 | void setUser(UserModel v) { 42 | final _$actionInfo = _$_UserStoreBaseActionController.startAction( 43 | name: '_UserStoreBase.setUser'); 44 | try { 45 | return super.setUser(v); 46 | } finally { 47 | _$_UserStoreBaseActionController.endAction(_$actionInfo); 48 | } 49 | } 50 | 51 | @override 52 | String toString() { 53 | return ''' 54 | user: ${user} 55 | '''; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | 4 | import 'app/app_module.dart'; 5 | 6 | void main() => runApp(ModularApp(module: AppModule())); 7 | -------------------------------------------------------------------------------- /mockoon.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "mockoon:1.8.0", 3 | "data": [ 4 | { 5 | "type": "environment", 6 | "item": { 7 | "uuid": "", 8 | "lastMigration": 10, 9 | "name": "New environment", 10 | "endpointPrefix": "", 11 | "latency": 0, 12 | "port": 3001, 13 | "routes": [ 14 | { 15 | "uuid": "", 16 | "documentation": "", 17 | "method": "get", 18 | "endpoint": "", 19 | "responses": [ 20 | { 21 | "uuid": "", 22 | "body": "{}", 23 | "latency": 0, 24 | "statusCode": "200", 25 | "label": "", 26 | "headers": [ 27 | { 28 | "key": "", 29 | "value": "" 30 | } 31 | ], 32 | "filePath": "", 33 | "sendFileAsBody": false, 34 | "rules": [] 35 | } 36 | ], 37 | "enabled": true 38 | }, 39 | { 40 | "uuid": "", 41 | "documentation": "", 42 | "method": "post", 43 | "endpoint": "user/login", 44 | "responses": [ 45 | { 46 | "uuid": "", 47 | "body": "{\n \"login\": \"toshiossada\",\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQsIm5hbWUiOiJNYXJjaW8gTi4gU2FsZXMiLCJlbWFpbCI6InRlY3NvZml4QGdtYWlsLmNvbSIsImV4cCI6MTU5NTU1ODAyOH0.7b3CHs-x4WtZ0OesoiHr5BuZTR1vY1vPTuYgWZqndhI\",\n \"refreshToken\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQsIm5hbWUiOiJNYXJjaW8gTi4gU2FsZXMiLCJlbWFpbCI6InRlY3NvZml4QGdtYWlsLmNvbSIsImV4cCI6MTU5NTU1ODAyOH0.7b3CHs-x4WtZ0OesoiHr5BuZTR1vY1vPTuYgWZqndhI\"\n}", 48 | "latency": 0, 49 | "statusCode": "200", 50 | "label": "", 51 | "headers": [ 52 | { 53 | "key": "", 54 | "value": "" 55 | } 56 | ], 57 | "filePath": "", 58 | "sendFileAsBody": false, 59 | "rules": [] 60 | } 61 | ], 62 | "enabled": true 63 | }, 64 | { 65 | "uuid": "", 66 | "documentation": "", 67 | "method": "get", 68 | "endpoint": "products", 69 | "responses": [ 70 | { 71 | "uuid": "", 72 | "body": "[\n {\n \"id\": 1,\n \"description\": \"Curso Flutter Basico\"\n },\n {\n \"id\": 2,\n \"description\": \"Curso Flutter Intermediario\"\n },\n {\n \"id\": 3,\n \"description\": \"Curso Flutter Avançado\"\n },\n {\n \"id\": 4,\n \"description\": \"Curso Mobx\"\n },\n {\n \"id\": 5,\n \"description\": \"Curso Modular\"\n },\n {\n \"id\": 6,\n \"description\": \"Curso DIO\"\n }\n]", 73 | "latency": 0, 74 | "statusCode": "200", 75 | "label": "", 76 | "headers": [ 77 | { 78 | "key": "", 79 | "value": "" 80 | } 81 | ], 82 | "filePath": "", 83 | "sendFileAsBody": false, 84 | "rules": [] 85 | } 86 | ], 87 | "enabled": true 88 | }, 89 | { 90 | "uuid": "", 91 | "documentation": "", 92 | "method": "post", 93 | "endpoint": "products", 94 | "responses": [ 95 | { 96 | "uuid": "", 97 | "body": "{\n \"id\": 10\n}", 98 | "latency": 0, 99 | "statusCode": "201", 100 | "label": "", 101 | "headers": [ 102 | { 103 | "key": "", 104 | "value": "" 105 | } 106 | ], 107 | "filePath": "", 108 | "sendFileAsBody": false, 109 | "rules": [] 110 | } 111 | ], 112 | "enabled": true 113 | }, 114 | { 115 | "uuid": "", 116 | "documentation": "", 117 | "method": "put", 118 | "endpoint": "products", 119 | "responses": [ 120 | { 121 | "uuid": "", 122 | "body": "{}", 123 | "latency": 0, 124 | "statusCode": "204", 125 | "label": "", 126 | "headers": [ 127 | { 128 | "key": "", 129 | "value": "" 130 | } 131 | ], 132 | "filePath": "", 133 | "sendFileAsBody": false, 134 | "rules": [] 135 | } 136 | ], 137 | "enabled": true 138 | }, 139 | { 140 | "uuid": "", 141 | "documentation": "", 142 | "method": "patch", 143 | "endpoint": "products", 144 | "responses": [ 145 | { 146 | "uuid": "", 147 | "body": "{}", 148 | "latency": 0, 149 | "statusCode": "204", 150 | "label": "", 151 | "headers": [ 152 | { 153 | "key": "", 154 | "value": "" 155 | } 156 | ], 157 | "filePath": "", 158 | "sendFileAsBody": false, 159 | "rules": [] 160 | } 161 | ], 162 | "enabled": true 163 | }, 164 | { 165 | "uuid": "", 166 | "documentation": "", 167 | "method": "get", 168 | "endpoint": "products/1", 169 | "responses": [ 170 | { 171 | "uuid": "", 172 | "body": "{\n \"id\": 1,\n \"description\": \"Curso Flutter Basico\"\n}", 173 | "latency": 0, 174 | "statusCode": "200", 175 | "label": "", 176 | "headers": [ 177 | { 178 | "key": "", 179 | "value": "" 180 | } 181 | ], 182 | "filePath": "", 183 | "sendFileAsBody": false, 184 | "rules": [] 185 | } 186 | ], 187 | "enabled": true 188 | } 189 | ], 190 | "proxyMode": false, 191 | "proxyHost": "", 192 | "https": false, 193 | "cors": true, 194 | "headers": [ 195 | { 196 | "key": "Content-Type", 197 | "value": "application/json" 198 | } 199 | ], 200 | "proxyReqHeaders": [ 201 | { 202 | "key": "", 203 | "value": "" 204 | } 205 | ], 206 | "proxyResHeaders": [ 207 | { 208 | "key": "", 209 | "value": "" 210 | } 211 | ] 212 | } 213 | } 214 | ] 215 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "6.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.39.14" 18 | args: 19 | dependency: transitive 20 | description: 21 | name: args 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.6.0" 25 | asuka: 26 | dependency: "direct main" 27 | description: 28 | name: asuka 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.4" 32 | async: 33 | dependency: transitive 34 | description: 35 | name: async 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.4.2" 39 | boolean_selector: 40 | dependency: transitive 41 | description: 42 | name: boolean_selector 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.0.0" 46 | build: 47 | dependency: transitive 48 | description: 49 | name: build 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.3.0" 53 | build_config: 54 | dependency: transitive 55 | description: 56 | name: build_config 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.4.2" 60 | build_daemon: 61 | dependency: transitive 62 | description: 63 | name: build_daemon 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.4" 67 | build_resolvers: 68 | dependency: transitive 69 | description: 70 | name: build_resolvers 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.3.10" 74 | build_runner: 75 | dependency: "direct dev" 76 | description: 77 | name: build_runner 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.10.0" 81 | build_runner_core: 82 | dependency: transitive 83 | description: 84 | name: build_runner_core 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "5.2.0" 88 | built_collection: 89 | dependency: transitive 90 | description: 91 | name: built_collection 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "4.3.2" 95 | built_value: 96 | dependency: transitive 97 | description: 98 | name: built_value 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "7.1.0" 102 | characters: 103 | dependency: transitive 104 | description: 105 | name: characters 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.0.0" 109 | charcode: 110 | dependency: transitive 111 | description: 112 | name: charcode 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.1.3" 116 | checked_yaml: 117 | dependency: transitive 118 | description: 119 | name: checked_yaml 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "1.0.2" 123 | cli_util: 124 | dependency: transitive 125 | description: 126 | name: cli_util 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "0.1.4" 130 | clock: 131 | dependency: transitive 132 | description: 133 | name: clock 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.0.1" 137 | code_builder: 138 | dependency: transitive 139 | description: 140 | name: code_builder 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "3.4.0" 144 | collection: 145 | dependency: transitive 146 | description: 147 | name: collection 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "1.14.13" 151 | convert: 152 | dependency: transitive 153 | description: 154 | name: convert 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "2.1.1" 158 | crypto: 159 | dependency: transitive 160 | description: 161 | name: crypto 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "2.1.4" 165 | csslib: 166 | dependency: transitive 167 | description: 168 | name: csslib 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "0.16.1" 172 | dart_style: 173 | dependency: transitive 174 | description: 175 | name: dart_style 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "1.3.6" 179 | dartz: 180 | dependency: "direct main" 181 | description: 182 | name: dartz 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "0.9.1" 186 | dio: 187 | dependency: "direct main" 188 | description: 189 | name: dio 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "3.0.9" 193 | effective_dart: 194 | dependency: "direct dev" 195 | description: 196 | name: effective_dart 197 | url: "https://pub.dartlang.org" 198 | source: hosted 199 | version: "1.2.4" 200 | fake_async: 201 | dependency: transitive 202 | description: 203 | name: fake_async 204 | url: "https://pub.dartlang.org" 205 | source: hosted 206 | version: "1.1.0" 207 | ffi: 208 | dependency: transitive 209 | description: 210 | name: ffi 211 | url: "https://pub.dartlang.org" 212 | source: hosted 213 | version: "0.1.3" 214 | file: 215 | dependency: transitive 216 | description: 217 | name: file 218 | url: "https://pub.dartlang.org" 219 | source: hosted 220 | version: "5.2.1" 221 | fixnum: 222 | dependency: transitive 223 | description: 224 | name: fixnum 225 | url: "https://pub.dartlang.org" 226 | source: hosted 227 | version: "0.10.11" 228 | flutter: 229 | dependency: "direct main" 230 | description: flutter 231 | source: sdk 232 | version: "0.0.0" 233 | flutter_mobx: 234 | dependency: "direct main" 235 | description: 236 | name: flutter_mobx 237 | url: "https://pub.dartlang.org" 238 | source: hosted 239 | version: "1.1.0+1" 240 | flutter_modular: 241 | dependency: "direct main" 242 | description: 243 | name: flutter_modular 244 | url: "https://pub.dartlang.org" 245 | source: hosted 246 | version: "1.3.1" 247 | flutter_test: 248 | dependency: "direct dev" 249 | description: flutter 250 | source: sdk 251 | version: "0.0.0" 252 | flutter_web_plugins: 253 | dependency: transitive 254 | description: flutter 255 | source: sdk 256 | version: "0.0.0" 257 | font_awesome_flutter: 258 | dependency: "direct main" 259 | description: 260 | name: font_awesome_flutter 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "8.8.1" 264 | glob: 265 | dependency: transitive 266 | description: 267 | name: glob 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "1.2.0" 271 | graphs: 272 | dependency: transitive 273 | description: 274 | name: graphs 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "0.2.0" 278 | html: 279 | dependency: transitive 280 | description: 281 | name: html 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "0.14.0+3" 285 | http_multi_server: 286 | dependency: transitive 287 | description: 288 | name: http_multi_server 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "2.2.0" 292 | http_parser: 293 | dependency: transitive 294 | description: 295 | name: http_parser 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "3.1.4" 299 | intl: 300 | dependency: transitive 301 | description: 302 | name: intl 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "0.16.1" 306 | io: 307 | dependency: transitive 308 | description: 309 | name: io 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "0.3.4" 313 | js: 314 | dependency: transitive 315 | description: 316 | name: js 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "0.6.2" 320 | json_annotation: 321 | dependency: transitive 322 | description: 323 | name: json_annotation 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "3.0.1" 327 | logging: 328 | dependency: transitive 329 | description: 330 | name: logging 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "0.11.4" 334 | matcher: 335 | dependency: transitive 336 | description: 337 | name: matcher 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "0.12.8" 341 | meta: 342 | dependency: transitive 343 | description: 344 | name: meta 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "1.1.8" 348 | mime: 349 | dependency: transitive 350 | description: 351 | name: mime 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "0.9.6+3" 355 | mobx: 356 | dependency: "direct main" 357 | description: 358 | name: mobx 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "1.2.1+1" 362 | mobx_codegen: 363 | dependency: "direct dev" 364 | description: 365 | name: mobx_codegen 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "1.1.0+1" 369 | mockito: 370 | dependency: "direct dev" 371 | description: 372 | name: mockito 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "4.1.1" 376 | modular_codegen: 377 | dependency: "direct dev" 378 | description: 379 | name: modular_codegen 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "1.0.1+3" 383 | node_interop: 384 | dependency: transitive 385 | description: 386 | name: node_interop 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "1.1.1" 390 | node_io: 391 | dependency: transitive 392 | description: 393 | name: node_io 394 | url: "https://pub.dartlang.org" 395 | source: hosted 396 | version: "1.1.1" 397 | open_file: 398 | dependency: "direct main" 399 | description: 400 | name: open_file 401 | url: "https://pub.dartlang.org" 402 | source: hosted 403 | version: "3.0.1" 404 | package_config: 405 | dependency: transitive 406 | description: 407 | name: package_config 408 | url: "https://pub.dartlang.org" 409 | source: hosted 410 | version: "1.9.3" 411 | path: 412 | dependency: transitive 413 | description: 414 | name: path 415 | url: "https://pub.dartlang.org" 416 | source: hosted 417 | version: "1.7.0" 418 | path_provider: 419 | dependency: "direct main" 420 | description: 421 | name: path_provider 422 | url: "https://pub.dartlang.org" 423 | source: hosted 424 | version: "1.6.11" 425 | path_provider_linux: 426 | dependency: transitive 427 | description: 428 | name: path_provider_linux 429 | url: "https://pub.dartlang.org" 430 | source: hosted 431 | version: "0.0.1+2" 432 | path_provider_macos: 433 | dependency: transitive 434 | description: 435 | name: path_provider_macos 436 | url: "https://pub.dartlang.org" 437 | source: hosted 438 | version: "0.0.4+3" 439 | path_provider_platform_interface: 440 | dependency: transitive 441 | description: 442 | name: path_provider_platform_interface 443 | url: "https://pub.dartlang.org" 444 | source: hosted 445 | version: "1.0.2" 446 | pedantic: 447 | dependency: transitive 448 | description: 449 | name: pedantic 450 | url: "https://pub.dartlang.org" 451 | source: hosted 452 | version: "1.9.0" 453 | platform: 454 | dependency: transitive 455 | description: 456 | name: platform 457 | url: "https://pub.dartlang.org" 458 | source: hosted 459 | version: "2.2.1" 460 | plugin_platform_interface: 461 | dependency: transitive 462 | description: 463 | name: plugin_platform_interface 464 | url: "https://pub.dartlang.org" 465 | source: hosted 466 | version: "1.0.2" 467 | pool: 468 | dependency: transitive 469 | description: 470 | name: pool 471 | url: "https://pub.dartlang.org" 472 | source: hosted 473 | version: "1.4.0" 474 | process: 475 | dependency: transitive 476 | description: 477 | name: process 478 | url: "https://pub.dartlang.org" 479 | source: hosted 480 | version: "3.0.13" 481 | pub_semver: 482 | dependency: transitive 483 | description: 484 | name: pub_semver 485 | url: "https://pub.dartlang.org" 486 | source: hosted 487 | version: "1.4.4" 488 | pubspec_parse: 489 | dependency: transitive 490 | description: 491 | name: pubspec_parse 492 | url: "https://pub.dartlang.org" 493 | source: hosted 494 | version: "0.1.5" 495 | quiver: 496 | dependency: transitive 497 | description: 498 | name: quiver 499 | url: "https://pub.dartlang.org" 500 | source: hosted 501 | version: "2.1.3" 502 | shared_preferences: 503 | dependency: "direct main" 504 | description: 505 | name: shared_preferences 506 | url: "https://pub.dartlang.org" 507 | source: hosted 508 | version: "0.5.8" 509 | shared_preferences_linux: 510 | dependency: transitive 511 | description: 512 | name: shared_preferences_linux 513 | url: "https://pub.dartlang.org" 514 | source: hosted 515 | version: "0.0.2+1" 516 | shared_preferences_macos: 517 | dependency: transitive 518 | description: 519 | name: shared_preferences_macos 520 | url: "https://pub.dartlang.org" 521 | source: hosted 522 | version: "0.0.1+10" 523 | shared_preferences_platform_interface: 524 | dependency: transitive 525 | description: 526 | name: shared_preferences_platform_interface 527 | url: "https://pub.dartlang.org" 528 | source: hosted 529 | version: "1.0.4" 530 | shared_preferences_web: 531 | dependency: transitive 532 | description: 533 | name: shared_preferences_web 534 | url: "https://pub.dartlang.org" 535 | source: hosted 536 | version: "0.1.2+7" 537 | shelf: 538 | dependency: transitive 539 | description: 540 | name: shelf 541 | url: "https://pub.dartlang.org" 542 | source: hosted 543 | version: "0.7.7" 544 | shelf_web_socket: 545 | dependency: transitive 546 | description: 547 | name: shelf_web_socket 548 | url: "https://pub.dartlang.org" 549 | source: hosted 550 | version: "0.2.3" 551 | sky_engine: 552 | dependency: transitive 553 | description: flutter 554 | source: sdk 555 | version: "0.0.99" 556 | source_gen: 557 | dependency: transitive 558 | description: 559 | name: source_gen 560 | url: "https://pub.dartlang.org" 561 | source: hosted 562 | version: "0.9.6" 563 | source_span: 564 | dependency: transitive 565 | description: 566 | name: source_span 567 | url: "https://pub.dartlang.org" 568 | source: hosted 569 | version: "1.7.0" 570 | stack_trace: 571 | dependency: transitive 572 | description: 573 | name: stack_trace 574 | url: "https://pub.dartlang.org" 575 | source: hosted 576 | version: "1.9.5" 577 | stream_channel: 578 | dependency: transitive 579 | description: 580 | name: stream_channel 581 | url: "https://pub.dartlang.org" 582 | source: hosted 583 | version: "2.0.0" 584 | stream_transform: 585 | dependency: transitive 586 | description: 587 | name: stream_transform 588 | url: "https://pub.dartlang.org" 589 | source: hosted 590 | version: "1.2.0" 591 | string_scanner: 592 | dependency: transitive 593 | description: 594 | name: string_scanner 595 | url: "https://pub.dartlang.org" 596 | source: hosted 597 | version: "1.0.5" 598 | string_validator: 599 | dependency: "direct main" 600 | description: 601 | name: string_validator 602 | url: "https://pub.dartlang.org" 603 | source: hosted 604 | version: "0.1.4" 605 | term_glyph: 606 | dependency: transitive 607 | description: 608 | name: term_glyph 609 | url: "https://pub.dartlang.org" 610 | source: hosted 611 | version: "1.1.0" 612 | test_api: 613 | dependency: transitive 614 | description: 615 | name: test_api 616 | url: "https://pub.dartlang.org" 617 | source: hosted 618 | version: "0.2.17" 619 | timing: 620 | dependency: transitive 621 | description: 622 | name: timing 623 | url: "https://pub.dartlang.org" 624 | source: hosted 625 | version: "0.1.1+2" 626 | typed_data: 627 | dependency: transitive 628 | description: 629 | name: typed_data 630 | url: "https://pub.dartlang.org" 631 | source: hosted 632 | version: "1.2.0" 633 | vector_math: 634 | dependency: transitive 635 | description: 636 | name: vector_math 637 | url: "https://pub.dartlang.org" 638 | source: hosted 639 | version: "2.0.8" 640 | watcher: 641 | dependency: transitive 642 | description: 643 | name: watcher 644 | url: "https://pub.dartlang.org" 645 | source: hosted 646 | version: "0.9.7+15" 647 | web_socket_channel: 648 | dependency: transitive 649 | description: 650 | name: web_socket_channel 651 | url: "https://pub.dartlang.org" 652 | source: hosted 653 | version: "1.1.0" 654 | xdg_directories: 655 | dependency: transitive 656 | description: 657 | name: xdg_directories 658 | url: "https://pub.dartlang.org" 659 | source: hosted 660 | version: "0.1.0" 661 | yaml: 662 | dependency: transitive 663 | description: 664 | name: yaml 665 | url: "https://pub.dartlang.org" 666 | source: hosted 667 | version: "2.2.1" 668 | sdks: 669 | dart: ">=2.9.0-14.0.dev <3.0.0" 670 | flutter: ">=1.12.13+hotfix.5 <2.0.0" 671 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dio_example 2 | description: A new Flutter project. Created by Slidy 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.7.0 <3.0.0" 22 | 23 | dependencies: 24 | font_awesome_flutter: ^8.8.1 25 | open_file: ^3.0.1 26 | dio: ^3.0.9 27 | path_provider: ^1.6.11 28 | asuka: ^1.0.4 29 | string_validator: ^0.1.4 30 | shared_preferences: ^0.5.8 31 | dartz: ^0.9.1 32 | flutter_mobx: ^1.1.0+1 33 | mobx: ^1.2.1+1 34 | flutter_modular: ^1.3.1 35 | flutter: 36 | sdk: flutter 37 | 38 | 39 | # The following adds the Cupertino Icons font to your application. 40 | # Use with the CupertinoIcons class for iOS style icons. 41 | 42 | dev_dependencies: 43 | modular_codegen: ^1.0.1+3 44 | effective_dart: ^1.2.4 45 | mockito: ^4.1.1 46 | mobx_codegen: ^1.1.0+1 47 | build_runner: ^1.10.0 48 | flutter_test: 49 | sdk: flutter 50 | 51 | # For information on the generic Dart part of this file, see the 52 | # following page: https://dart.dev/tools/pub/pubspec 53 | 54 | # The following section is specific to Flutter. 55 | flutter: 56 | 57 | # The following line ensures that the Material Icons font is 58 | # included with your application, so that you can use the icons in 59 | # the material Icons class. 60 | uses-material-design: true 61 | vars: 62 | clean: flutter clean 63 | get: flutter pub get 64 | runner: flutter pub run build_runner 65 | scripts: 66 | mobx_build: $clean & $get & $runner build --delete-conflicting-outputs 67 | mobx_watch: $clean & $get & $runner watch --delete-conflicting-outputs 68 | 69 | # To add assets to your application, add an assets section, like this: 70 | # assets: 71 | # - images/a_dot_burr.jpeg 72 | # - images/a_dot_ham.jpeg 73 | 74 | # An image asset can refer to one or more resolution-specific "variants", see 75 | # https://flutter.dev/assets-and-images/#resolution-aware. 76 | 77 | # For details regarding adding assets from package dependencies, see 78 | # https://flutter.dev/assets-and-images/#from-packages 79 | 80 | # To add custom fonts to your application, add a fonts section here, 81 | # in this "flutter" section. Each entry in this list should have a 82 | # "family" key with the font family name, and a "fonts" key with a 83 | # list giving the asset and other descriptors for the font. For 84 | # example: 85 | # fonts: 86 | # - family: Schyler 87 | # fonts: 88 | # - asset: fonts/Schyler-Regular.ttf 89 | # - asset: fonts/Schyler-Italic.ttf 90 | # style: italic 91 | # - family: Trajan Pro 92 | # fonts: 93 | # - asset: fonts/TrajanPro.ttf 94 | # - asset: fonts/TrajanPro_Bold.ttf 95 | # weight: 700 96 | # 97 | # For details regarding fonts from package dependencies, 98 | # see https://flutter.dev/custom-fonts/#from-packages 99 | -------------------------------------------------------------------------------- /swagger.json: -------------------------------------------------------------------------------- 1 | {"openapi":"3.0.0","info":{"title":"New environment","version":"1.0.0"},"servers":[{"url":"http://localhost:3001/"}],"paths":{"/":{"get":{"description":"","responses":{"200":{"description":"","content":{"application/json":{}},"headers":{"":{"schema":{"type":"string"},"example":""}}}}}},"/user/login":{"post":{"description":"","responses":{"200":{"description":"","content":{"application/json":{}},"headers":{"":{"schema":{"type":"string"},"example":""}}}}}},"/products":{"get":{"description":"","responses":{"200":{"description":"","content":{"application/json":{}},"headers":{"":{"schema":{"type":"string"},"example":""}}}}},"post":{"description":"","responses":{"201":{"description":"","content":{"application/json":{}},"headers":{"":{"schema":{"type":"string"},"example":""}}}}},"put":{"description":"","responses":{"204":{"description":"","content":{"application/json":{}},"headers":{"":{"schema":{"type":"string"},"example":""}}}}},"patch":{"description":"","responses":{"204":{"description":"","content":{"application/json":{}},"headers":{"":{"schema":{"type":"string"},"example":""}}}}}},"/products/1":{"get":{"description":"","responses":{"200":{"description":"","content":{"application/json":{}},"headers":{"":{"schema":{"type":"string"},"example":""}}}}}}}} 2 | --------------------------------------------------------------------------------