├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── mvvm_app │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── 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-night │ │ │ └── styles.xml │ │ │ └── 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 ├── data │ ├── app_exceptions.dart │ ├── network │ │ ├── base_api_services.dart │ │ └── network_api_services.dart │ └── response │ │ ├── api_response.dart │ │ └── status.dart ├── main.dart ├── models │ ├── movies_model.dart │ └── user_model.dart ├── repository │ ├── auth_repository.dart │ └── home_repository.dart ├── res │ └── widgets │ │ ├── app_urls.dart │ │ ├── coloors.dart │ │ └── round_button.dart ├── utils │ ├── routes │ │ ├── routes.dart │ │ └── routes_names.dart │ └── utils.dart ├── view │ ├── home_screen.dart │ ├── login_screen.dart │ ├── signup_screen.dart │ └── splash_screen.dart └── viewModel │ ├── auth_viewmodel.dart │ ├── home_view_model.dart │ ├── splash_service.dart │ └── user_view_model.dart ├── pubspec.lock ├── pubspec.yaml └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 17 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 18 | - platform: android 19 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 20 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 21 | - platform: ios 22 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 23 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 24 | - platform: linux 25 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 26 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 27 | - platform: macos 28 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 29 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 30 | - platform: web 31 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 32 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 33 | - platform: windows 34 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 35 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mvvm_app 2 | 3 | A Flutter Project that enforces the idea of MVVM Software Architecture Pattern for maintaining Clean Code. 4 | - It focuses on: 5 | ``` dart 6 | 1. Maintainability 7 | 2. Scallability 8 | 3. Separation of Concerns 9 | 4. Unit Testing 10 | ``` 11 | 12 | 13 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.example.mvvm_app" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 50 | minSdkVersion flutter.minSdkVersion 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies { 70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 71 | } 72 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/mvvm_app/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.mvvm_app 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.2.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 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.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | 11.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 = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1300; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | alwaysOutOfDate = 1; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | ); 178 | inputPaths = ( 179 | ); 180 | name = "Thin Binary"; 181 | outputPaths = ( 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | shellPath = /bin/sh; 185 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 186 | }; 187 | 9740EEB61CF901F6004384FC /* Run Script */ = { 188 | isa = PBXShellScriptBuildPhase; 189 | alwaysOutOfDate = 1; 190 | buildActionMask = 2147483647; 191 | files = ( 192 | ); 193 | inputPaths = ( 194 | ); 195 | name = "Run Script"; 196 | outputPaths = ( 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | shellPath = /bin/sh; 200 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 201 | }; 202 | /* End PBXShellScriptBuildPhase section */ 203 | 204 | /* Begin PBXSourcesBuildPhase section */ 205 | 97C146EA1CF9000F007C117D /* Sources */ = { 206 | isa = PBXSourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 210 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | }; 214 | /* End PBXSourcesBuildPhase section */ 215 | 216 | /* Begin PBXVariantGroup section */ 217 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 218 | isa = PBXVariantGroup; 219 | children = ( 220 | 97C146FB1CF9000F007C117D /* Base */, 221 | ); 222 | name = Main.storyboard; 223 | sourceTree = ""; 224 | }; 225 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 226 | isa = PBXVariantGroup; 227 | children = ( 228 | 97C147001CF9000F007C117D /* Base */, 229 | ); 230 | name = LaunchScreen.storyboard; 231 | sourceTree = ""; 232 | }; 233 | /* End PBXVariantGroup section */ 234 | 235 | /* Begin XCBuildConfiguration section */ 236 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 237 | isa = XCBuildConfiguration; 238 | buildSettings = { 239 | ALWAYS_SEARCH_USER_PATHS = NO; 240 | CLANG_ANALYZER_NONNULL = YES; 241 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 242 | CLANG_CXX_LIBRARY = "libc++"; 243 | CLANG_ENABLE_MODULES = YES; 244 | CLANG_ENABLE_OBJC_ARC = YES; 245 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 246 | CLANG_WARN_BOOL_CONVERSION = YES; 247 | CLANG_WARN_COMMA = YES; 248 | CLANG_WARN_CONSTANT_CONVERSION = YES; 249 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 250 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 251 | CLANG_WARN_EMPTY_BODY = YES; 252 | CLANG_WARN_ENUM_CONVERSION = YES; 253 | CLANG_WARN_INFINITE_RECURSION = YES; 254 | CLANG_WARN_INT_CONVERSION = YES; 255 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 257 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 258 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 259 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 260 | CLANG_WARN_STRICT_PROTOTYPES = YES; 261 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 262 | CLANG_WARN_UNREACHABLE_CODE = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 265 | COPY_PHASE_STRIP = NO; 266 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 267 | ENABLE_NS_ASSERTIONS = NO; 268 | ENABLE_STRICT_OBJC_MSGSEND = YES; 269 | GCC_C_LANGUAGE_STANDARD = gnu99; 270 | GCC_NO_COMMON_BLOCKS = YES; 271 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 272 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 273 | GCC_WARN_UNDECLARED_SELECTOR = YES; 274 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 275 | GCC_WARN_UNUSED_FUNCTION = YES; 276 | GCC_WARN_UNUSED_VARIABLE = YES; 277 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 278 | MTL_ENABLE_DEBUG_INFO = NO; 279 | SDKROOT = iphoneos; 280 | SUPPORTED_PLATFORMS = iphoneos; 281 | TARGETED_DEVICE_FAMILY = "1,2"; 282 | VALIDATE_PRODUCT = YES; 283 | }; 284 | name = Profile; 285 | }; 286 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 287 | isa = XCBuildConfiguration; 288 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 289 | buildSettings = { 290 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 291 | CLANG_ENABLE_MODULES = YES; 292 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 293 | ENABLE_BITCODE = NO; 294 | INFOPLIST_FILE = Runner/Info.plist; 295 | LD_RUNPATH_SEARCH_PATHS = ( 296 | "$(inherited)", 297 | "@executable_path/Frameworks", 298 | ); 299 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mvvmApp; 300 | PRODUCT_NAME = "$(TARGET_NAME)"; 301 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 302 | SWIFT_VERSION = 5.0; 303 | VERSIONING_SYSTEM = "apple-generic"; 304 | }; 305 | name = Profile; 306 | }; 307 | 97C147031CF9000F007C117D /* Debug */ = { 308 | isa = XCBuildConfiguration; 309 | buildSettings = { 310 | ALWAYS_SEARCH_USER_PATHS = NO; 311 | CLANG_ANALYZER_NONNULL = YES; 312 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 313 | CLANG_CXX_LIBRARY = "libc++"; 314 | CLANG_ENABLE_MODULES = YES; 315 | CLANG_ENABLE_OBJC_ARC = YES; 316 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 317 | CLANG_WARN_BOOL_CONVERSION = YES; 318 | CLANG_WARN_COMMA = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 321 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INFINITE_RECURSION = YES; 325 | CLANG_WARN_INT_CONVERSION = YES; 326 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 327 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 328 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 329 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 330 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 331 | CLANG_WARN_STRICT_PROTOTYPES = YES; 332 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 333 | CLANG_WARN_UNREACHABLE_CODE = YES; 334 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 335 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 336 | COPY_PHASE_STRIP = NO; 337 | DEBUG_INFORMATION_FORMAT = dwarf; 338 | ENABLE_STRICT_OBJC_MSGSEND = YES; 339 | ENABLE_TESTABILITY = YES; 340 | GCC_C_LANGUAGE_STANDARD = gnu99; 341 | GCC_DYNAMIC_NO_PIC = NO; 342 | GCC_NO_COMMON_BLOCKS = YES; 343 | GCC_OPTIMIZATION_LEVEL = 0; 344 | GCC_PREPROCESSOR_DEFINITIONS = ( 345 | "DEBUG=1", 346 | "$(inherited)", 347 | ); 348 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 349 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 350 | GCC_WARN_UNDECLARED_SELECTOR = YES; 351 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 352 | GCC_WARN_UNUSED_FUNCTION = YES; 353 | GCC_WARN_UNUSED_VARIABLE = YES; 354 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 355 | MTL_ENABLE_DEBUG_INFO = YES; 356 | ONLY_ACTIVE_ARCH = YES; 357 | SDKROOT = iphoneos; 358 | TARGETED_DEVICE_FAMILY = "1,2"; 359 | }; 360 | name = Debug; 361 | }; 362 | 97C147041CF9000F007C117D /* Release */ = { 363 | isa = XCBuildConfiguration; 364 | buildSettings = { 365 | ALWAYS_SEARCH_USER_PATHS = NO; 366 | CLANG_ANALYZER_NONNULL = YES; 367 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 368 | CLANG_CXX_LIBRARY = "libc++"; 369 | CLANG_ENABLE_MODULES = YES; 370 | CLANG_ENABLE_OBJC_ARC = YES; 371 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 372 | CLANG_WARN_BOOL_CONVERSION = YES; 373 | CLANG_WARN_COMMA = YES; 374 | CLANG_WARN_CONSTANT_CONVERSION = YES; 375 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 376 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 377 | CLANG_WARN_EMPTY_BODY = YES; 378 | CLANG_WARN_ENUM_CONVERSION = YES; 379 | CLANG_WARN_INFINITE_RECURSION = YES; 380 | CLANG_WARN_INT_CONVERSION = YES; 381 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 382 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 383 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 384 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 385 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 386 | CLANG_WARN_STRICT_PROTOTYPES = YES; 387 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 388 | CLANG_WARN_UNREACHABLE_CODE = YES; 389 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 390 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 391 | COPY_PHASE_STRIP = NO; 392 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 393 | ENABLE_NS_ASSERTIONS = NO; 394 | ENABLE_STRICT_OBJC_MSGSEND = YES; 395 | GCC_C_LANGUAGE_STANDARD = gnu99; 396 | GCC_NO_COMMON_BLOCKS = YES; 397 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 398 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 399 | GCC_WARN_UNDECLARED_SELECTOR = YES; 400 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 401 | GCC_WARN_UNUSED_FUNCTION = YES; 402 | GCC_WARN_UNUSED_VARIABLE = YES; 403 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 404 | MTL_ENABLE_DEBUG_INFO = NO; 405 | SDKROOT = iphoneos; 406 | SUPPORTED_PLATFORMS = iphoneos; 407 | SWIFT_COMPILATION_MODE = wholemodule; 408 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 409 | TARGETED_DEVICE_FAMILY = "1,2"; 410 | VALIDATE_PRODUCT = YES; 411 | }; 412 | name = Release; 413 | }; 414 | 97C147061CF9000F007C117D /* Debug */ = { 415 | isa = XCBuildConfiguration; 416 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 417 | buildSettings = { 418 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 419 | CLANG_ENABLE_MODULES = YES; 420 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 421 | ENABLE_BITCODE = NO; 422 | INFOPLIST_FILE = Runner/Info.plist; 423 | LD_RUNPATH_SEARCH_PATHS = ( 424 | "$(inherited)", 425 | "@executable_path/Frameworks", 426 | ); 427 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mvvmApp; 428 | PRODUCT_NAME = "$(TARGET_NAME)"; 429 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 430 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 431 | SWIFT_VERSION = 5.0; 432 | VERSIONING_SYSTEM = "apple-generic"; 433 | }; 434 | name = Debug; 435 | }; 436 | 97C147071CF9000F007C117D /* Release */ = { 437 | isa = XCBuildConfiguration; 438 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 439 | buildSettings = { 440 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 441 | CLANG_ENABLE_MODULES = YES; 442 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 443 | ENABLE_BITCODE = NO; 444 | INFOPLIST_FILE = Runner/Info.plist; 445 | LD_RUNPATH_SEARCH_PATHS = ( 446 | "$(inherited)", 447 | "@executable_path/Frameworks", 448 | ); 449 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mvvmApp; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 452 | SWIFT_VERSION = 5.0; 453 | VERSIONING_SYSTEM = "apple-generic"; 454 | }; 455 | name = Release; 456 | }; 457 | /* End XCBuildConfiguration section */ 458 | 459 | /* Begin XCConfigurationList section */ 460 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 461 | isa = XCConfigurationList; 462 | buildConfigurations = ( 463 | 97C147031CF9000F007C117D /* Debug */, 464 | 97C147041CF9000F007C117D /* Release */, 465 | 249021D3217E4FDB00AE95B9 /* Profile */, 466 | ); 467 | defaultConfigurationIsVisible = 0; 468 | defaultConfigurationName = Release; 469 | }; 470 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 471 | isa = XCConfigurationList; 472 | buildConfigurations = ( 473 | 97C147061CF9000F007C117D /* Debug */, 474 | 97C147071CF9000F007C117D /* Release */, 475 | 249021D4217E4FDB00AE95B9 /* Profile */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | /* End XCConfigurationList section */ 481 | }; 482 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 483 | } 484 | -------------------------------------------------------------------------------- /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 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahzaneer/MVVM-Architecture-Provider-in-Flutter/63273d03a1184e200ad466a3231a1835b29e7f30/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 | CFBundleDisplayName 8 | Mvvm App 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | mvvm_app 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/data/app_exceptions.dart: -------------------------------------------------------------------------------- 1 | class AppExceptions implements Exception { 2 | final String? _prefix, _message; 3 | 4 | AppExceptions([this._message, this._prefix]); 5 | // Recalling dart's Constructors 6 | // {} -> named Optional 7 | // [] -> positional Optional 8 | 9 | @override 10 | String toString() { 11 | return "$_prefix: $_message"; 12 | } 13 | } 14 | 15 | class InternetException extends AppExceptions { 16 | InternetException([String? message]) : super(message, "no Internet"); 17 | } 18 | 19 | class ServerTimeOut extends AppExceptions { 20 | ServerTimeOut([String? message]) : super(message, "server Timeout"); 21 | 22 | // ServerTimeOut([String? message]) : // (this is list initiallizer in dart) super(message, "server Timeout"); 23 | } 24 | 25 | class BadRequestException extends AppExceptions { 26 | BadRequestException([String? message]) : super(message, "Bad Request Exception"); 27 | } 28 | 29 | 30 | class InvalidInputException extends AppExceptions { 31 | InvalidInputException([String? message]) 32 | : super(message, "Invalid input Exception Exception"); 33 | } 34 | 35 | class UnauthorizedException extends AppExceptions { 36 | UnauthorizedException([String? message]) 37 | : super(message, "Unauthorized Exception"); 38 | } 39 | 40 | 41 | // Accordingly other exception classes can be made here -------------------------------------------------------------------------------- /lib/data/network/base_api_services.dart: -------------------------------------------------------------------------------- 1 | abstract class BaseApiServices { 2 | Future getGetApiResponse(String url); 3 | Future getPostApiResponse(String url, dynamic data); 4 | 5 | 6 | } 7 | -------------------------------------------------------------------------------- /lib/data/network/network_api_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | import 'package:http/http.dart' as http; 4 | import 'package:mvvm_app/data/app_exceptions.dart'; 5 | import 'package:mvvm_app/data/network/base_api_services.dart'; 6 | 7 | class NetworkApiServices extends BaseApiServices { 8 | @override 9 | Future getGetApiResponse(String url) async { 10 | dynamic responsejson; 11 | try { 12 | final response = 13 | await http.get(Uri.parse(url)).timeout(const Duration(seconds: 10)); 14 | responsejson = responseJson(response); 15 | } on SocketException { 16 | throw InternetException("NO Internet is available right now"); 17 | } 18 | 19 | return responsejson; 20 | } 21 | 22 | @override 23 | Future getPostApiResponse(String url, dynamic data) async { 24 | dynamic responsejson; 25 | try { 26 | final response = await http 27 | .post(Uri.parse(url), body: data) 28 | .timeout(const Duration(seconds: 10)); 29 | responsejson = responseJson(response); 30 | } on SocketException { 31 | throw InternetException("NO Internet is available right now"); 32 | } 33 | 34 | return responsejson; 35 | } 36 | 37 | dynamic responseJson(http.Response response) { 38 | switch (response.statusCode) { 39 | case 200: 40 | dynamic jsonResponse = jsonDecode(response.body); 41 | return jsonResponse; 42 | case 400: 43 | throw BadRequestException("achi request nhi hai yeh"); 44 | default: 45 | throw InternetException("${response.statusCode} : ${response.reasonPhrase}"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/data/response/api_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:mvvm_app/data/response/status.dart'; 2 | 3 | class ApiResponse { 4 | //! Data members with T as generics 5 | Status? status; 6 | String? message; 7 | T? data; 8 | 9 | // ! Contructor 10 | ApiResponse(this.status, this.message, this.data); 11 | 12 | // ! Named Constructors with initializer list 13 | ApiResponse.loading() : status = Status.loading; 14 | ApiResponse.completed(this.data) : status = Status.completed; 15 | ApiResponse.error(this.message) : status = Status.error; 16 | 17 | @override 18 | String toString() { 19 | return "status : $status\n message : $message\n data : $data "; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/data/response/status.dart: -------------------------------------------------------------------------------- 1 | enum Status {loading, completed, error} 2 | 3 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/utils/routes/routes.dart'; 3 | import 'package:mvvm_app/utils/routes/routes_names.dart'; 4 | import 'package:mvvm_app/viewModel/auth_viewmodel.dart'; 5 | import 'package:mvvm_app/viewModel/home_view_model.dart'; 6 | import 'package:mvvm_app/viewModel/user_view_model.dart'; 7 | import 'package:provider/provider.dart'; 8 | 9 | void main() { 10 | runApp(const MyApp()); 11 | } 12 | 13 | class MyApp extends StatelessWidget { 14 | const MyApp({super.key}); 15 | 16 | // This widget is the root of your application. 17 | @override 18 | Widget build(BuildContext context) { 19 | return MultiProvider( 20 | providers: [ 21 | ChangeNotifierProvider(create: (_) => AuthViewModel()), 22 | ChangeNotifierProvider(create: (_) => UserViewModel()), 23 | ChangeNotifierProvider(create: (_) => HomeViewModel()) 24 | ], 25 | child: WillPopScope( 26 | onWillPop: () async { 27 | Navigator.pop(context); 28 | return true; 29 | }, 30 | child: MaterialApp( 31 | title: 'Flutter Demo', 32 | theme: ThemeData( 33 | primarySwatch: Colors.blue, 34 | ), 35 | initialRoute: RouteNames.splashScreen, 36 | onGenerateRoute: Routes.generateRoutes, 37 | ), 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/models/movies_model.dart: -------------------------------------------------------------------------------- 1 | class MovieListModel { 2 | List? movies; 3 | 4 | MovieListModel({this.movies}); 5 | 6 | MovieListModel.fromJson(Map json) { 7 | if (json['movies'] != null) { 8 | movies = []; 9 | json['movies'].forEach((v) { 10 | movies!.add(Movies.fromJson(v)); 11 | }); 12 | } 13 | } 14 | 15 | Map toJson() { 16 | final Map data = {}; 17 | if (movies != null) { 18 | data['movies'] = movies!.map((v) => v.toJson()).toList(); 19 | } 20 | return data; 21 | } 22 | } 23 | 24 | class Movies { 25 | String? id; 26 | String? title; 27 | String? year; 28 | List? genres; 29 | List? ratings; 30 | String? poster; 31 | dynamic contentRating; 32 | String? duration; 33 | String? releaseDate; 34 | dynamic averageRating; 35 | String? originalTitle; 36 | String? storyline; 37 | List? actors; 38 | dynamic imdbRating; 39 | String? posterurl; 40 | 41 | Movies( 42 | {this.id, 43 | this.title, 44 | this.year, 45 | this.genres, 46 | this.ratings, 47 | this.poster, 48 | this.contentRating, 49 | this.duration, 50 | this.releaseDate, 51 | this.averageRating, 52 | this.originalTitle, 53 | this.storyline, 54 | this.actors, 55 | this.imdbRating, 56 | this.posterurl}); 57 | 58 | Movies.fromJson(Map json) { 59 | id = json['id']; 60 | title = json['title']; 61 | year = json['year']; 62 | genres = json['genres'].cast(); 63 | ratings = json['ratings'].cast(); 64 | poster = json['poster']; 65 | contentRating = json['contentRating']; 66 | duration = json['duration']; 67 | releaseDate = json['releaseDate']; 68 | averageRating = json['averageRating']; 69 | originalTitle = json['originalTitle']; 70 | storyline = json['storyline']; 71 | actors = json['actors'].cast(); 72 | imdbRating = json['imdbRating']; 73 | posterurl = json['posterurl']; 74 | } 75 | 76 | Map toJson() { 77 | final Map data = {}; 78 | data['id'] = id; 79 | data['title'] = title; 80 | data['year'] = year; 81 | data['genres'] = genres; 82 | data['ratings'] = ratings; 83 | data['poster'] = poster; 84 | data['contentRating'] = contentRating; 85 | data['duration'] = duration; 86 | data['releaseDate'] = releaseDate; 87 | data['averageRating'] = averageRating; 88 | data['originalTitle'] = originalTitle; 89 | data['storyline'] = storyline; 90 | data['actors'] = actors; 91 | data['imdbRating'] = imdbRating; 92 | data['posterurl'] = posterurl; 93 | return data; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/models/user_model.dart: -------------------------------------------------------------------------------- 1 | class UserModel { 2 | String? token; 3 | 4 | UserModel({this.token}); 5 | 6 | UserModel.fromJson(Map json) { 7 | token = json['token']; 8 | } 9 | 10 | Map toJson() { 11 | final Map data = {}; 12 | data['token'] = token; 13 | return data; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/repository/auth_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:mvvm_app/data/network/network_api_services.dart'; 2 | import 'package:mvvm_app/res/widgets/app_urls.dart'; 3 | 4 | class AuthRepository { 5 | final NetworkApiServices _network = NetworkApiServices(); 6 | Future apiLogin(dynamic data) async { 7 | try { 8 | final response = await _network.getPostApiResponse(AppUrls.loginEndPoint, data); 9 | return response; 10 | } catch (e) { 11 | rethrow; //Big Brain 12 | } 13 | } 14 | 15 | 16 | Future signUp(dynamic data) async { 17 | try { 18 | final response = 19 | await _network.getPostApiResponse(AppUrls.registerEndPoint, data); 20 | return response; 21 | } catch (e) { 22 | rethrow; //Big Brain 23 | } 24 | } 25 | } 26 | 27 | 28 | 29 | // ! Testing Purposes 30 | 31 | // void main(List args) async { 32 | // AuthRepository auth = AuthRepository(); 33 | // final data = await auth.apiLogin(); 34 | // print(data["data"][1]["year"]); 35 | // } 36 | -------------------------------------------------------------------------------- /lib/repository/home_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:mvvm_app/data/network/base_api_services.dart'; 2 | import 'package:mvvm_app/data/network/network_api_services.dart'; 3 | import 'package:mvvm_app/models/movies_model.dart'; 4 | import 'package:mvvm_app/res/widgets/app_urls.dart'; 5 | 6 | class HomeRepository { 7 | final BaseApiServices _apiServices = NetworkApiServices(); 8 | Future fetchMoviesList() async { 9 | try { 10 | print("first line fetchMoviesList function"); 11 | dynamic response = 12 | await _apiServices.getGetApiResponse(AppUrls.moviesListEndPoint); 13 | return response = MovieListModel.fromJson(response); 14 | } catch (e) { 15 | rethrow; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/res/widgets/app_urls.dart: -------------------------------------------------------------------------------- 1 | class AppUrls { 2 | static const baseUrl = "https://reqres.in"; 3 | static const loginEndPoint = "$baseUrl/api/login"; 4 | static const registerEndPoint = "$baseUrl/api/register"; 5 | 6 | static var moviesBaseUrl = 7 | 'https://dea91516-1da3-444b-ad94-c6d0c4dfab81.mock.pstmn.io/'; 8 | static var moviesListEndPoint = '${moviesBaseUrl}movies_list'; 9 | } 10 | -------------------------------------------------------------------------------- /lib/res/widgets/coloors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppColors { 4 | static final buttonColor = Colors.greenAccent.shade700; 5 | } 6 | -------------------------------------------------------------------------------- /lib/res/widgets/round_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/res/widgets/coloors.dart'; 3 | 4 | class RoundButton extends StatelessWidget { 5 | final String title; 6 | final VoidCallback onPress; 7 | final bool loading; 8 | const RoundButton( 9 | {super.key, 10 | required this.title, 11 | required this.onPress, 12 | this.loading = false}); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return InkWell( 17 | onTap: onPress, 18 | child: Ink( 19 | height: 50, 20 | width: 200, 21 | decoration: BoxDecoration( 22 | borderRadius: BorderRadius.circular(12), 23 | color: AppColors.buttonColor), 24 | child: loading 25 | ? const CircularProgressIndicator( 26 | color: Colors.white, 27 | ) 28 | : Center( 29 | child: Text( 30 | title.toString(), 31 | style: const TextStyle(color: Colors.white), 32 | ), 33 | ), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/utils/routes/routes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/utils/routes/routes_names.dart'; 3 | import 'package:mvvm_app/view/home_screen.dart'; 4 | import 'package:mvvm_app/view/login_screen.dart'; 5 | import 'package:mvvm_app/view/signup_screen.dart'; 6 | import 'package:mvvm_app/view/splash_screen.dart'; 7 | 8 | class Routes { 9 | static Route generateRoutes(RouteSettings settings) { 10 | switch (settings.name) { 11 | case (RouteNames.home): 12 | return MaterialPageRoute( 13 | builder: (BuildContext context) => const HomeScreen()); 14 | case (RouteNames.login): 15 | return MaterialPageRoute( 16 | builder: (BuildContext context) => const LoginScreen()); 17 | case (RouteNames.signupScreen): 18 | return MaterialPageRoute( 19 | builder: (BuildContext context) => const SignUpScreen()); 20 | case (RouteNames.splashScreen): 21 | return MaterialPageRoute( 22 | builder: (BuildContext context) => const SplashScreen()); 23 | 24 | default: 25 | return MaterialPageRoute( 26 | builder: (_) => const Scaffold( 27 | body: Center( 28 | child: Text("No route is configured"), 29 | ), 30 | ), 31 | ); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/utils/routes/routes_names.dart: -------------------------------------------------------------------------------- 1 | class RouteNames { 2 | static const String login = "login_screen"; 3 | static const String home = "home_screen"; 4 | static const String signupScreen = "sign_up_screen"; 5 | static const String splashScreen = "splash_screen"; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /lib/utils/utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:another_flushbar/flushbar.dart'; 2 | import 'package:another_flushbar/flushbar_route.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:fluttertoast/fluttertoast.dart'; 5 | 6 | class Utils { 7 | // ! It contains all the utilities which help you in your project 8 | 9 | static void changeNodeFocus(BuildContext context, 10 | {FocusNode? current, FocusNode? next}) { 11 | current!.unfocus(); 12 | FocusScope.of(context).requestFocus(next); 13 | } 14 | 15 | static toastMessage(String message) { 16 | Fluttertoast.showToast( 17 | msg: message, 18 | backgroundColor: Colors.black, 19 | textColor: Colors.white, 20 | ); 21 | } 22 | 23 | static void flushBarErrorMessage(String message, BuildContext context) { 24 | showFlushbar( 25 | context: context, 26 | flushbar: Flushbar( 27 | forwardAnimationCurve: Curves.decelerate, 28 | margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), 29 | padding: const EdgeInsets.all(15), 30 | message: message, 31 | duration: const Duration(seconds: 3), 32 | borderRadius: BorderRadius.circular(8), 33 | flushbarPosition: FlushbarPosition.BOTTOM, 34 | backgroundColor: Colors.red, 35 | reverseAnimationCurve: Curves.easeInOut, 36 | positionOffset: 20, 37 | icon: const Icon( 38 | Icons.error, 39 | size: 28, 40 | color: Colors.white, 41 | ), 42 | )..show(context), 43 | ); 44 | } 45 | 46 | static snackBar(String message, BuildContext context) { 47 | return ScaffoldMessenger.of(context).showSnackBar( 48 | SnackBar(backgroundColor: Colors.red, content: Text(message))); 49 | } 50 | 51 | // average for ratings 52 | 53 | static double averageRatings(List ratings) { 54 | double avg = 0; 55 | for (int i = 0; i < ratings.length; i++) { 56 | avg += ratings[i]; 57 | } 58 | avg /= ratings.length; 59 | 60 | return avg; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/view/home_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/utils/routes/routes_names.dart'; 3 | import 'package:mvvm_app/utils/utils.dart'; 4 | import 'package:mvvm_app/viewModel/home_view_model.dart'; 5 | import 'package:mvvm_app/viewModel/user_view_model.dart'; 6 | import 'package:provider/provider.dart'; 7 | 8 | import '../data/response/status.dart'; 9 | 10 | class HomeScreen extends StatefulWidget { 11 | const HomeScreen({super.key}); 12 | 13 | @override 14 | State createState() => _HomeScreenState(); 15 | } 16 | 17 | class _HomeScreenState extends State { 18 | HomeViewModel hm = HomeViewModel(); 19 | 20 | @override 21 | void initState() { 22 | hm.fetchMoviesListApi(); 23 | super.initState(); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | final preferences = Provider.of(context); 29 | 30 | return Scaffold( 31 | appBar: AppBar( 32 | title: const Text("Home Screen"), 33 | centerTitle: true, 34 | automaticallyImplyLeading: false, 35 | actions: [ 36 | InkWell( 37 | onTap: () { 38 | preferences.removeUser().then((value) { 39 | Navigator.pop(context); 40 | Navigator.pushNamed(context, RouteNames.login); 41 | }); 42 | }, 43 | child: Padding( 44 | padding: const EdgeInsets.only(top: 12), 45 | child: Ink( 46 | child: const Text("Logout"), 47 | ), 48 | ), 49 | ), 50 | const SizedBox( 51 | width: 20, 52 | ) 53 | ], 54 | ), 55 | body: ChangeNotifierProvider( 56 | create: (context) => hm, 57 | child: Consumer( 58 | builder: (context, value, child) { 59 | switch (value.moviesList.status) { 60 | case Status.loading: 61 | return const Center( 62 | child: CircularProgressIndicator( 63 | color: Colors.grey, 64 | ), 65 | ); 66 | case Status.error: 67 | return Center( 68 | child: Text( 69 | value.moviesList.message.toString(), 70 | ), 71 | ); 72 | case Status.completed: 73 | return ListView.builder( 74 | itemCount: value.moviesList.data!.movies!.length, 75 | itemBuilder: (context, index) { 76 | return Card( 77 | child: ListTile( 78 | title: Text(value.moviesList.data!.movies![index].title 79 | .toString()), 80 | subtitle: Text(value 81 | .moviesList.data!.movies![index].year 82 | .toString()), 83 | leading: Image.network( 84 | value.moviesList.data!.movies![index].posterurl 85 | .toString(), 86 | errorBuilder: (context, error, stackTrace) { 87 | return const Icon( 88 | Icons.error, 89 | color: Colors.red, 90 | ); 91 | }, 92 | height: 40, 93 | width: 40, 94 | fit: BoxFit.cover, 95 | ), 96 | trailing: Row( 97 | mainAxisSize: MainAxisSize.min, 98 | children: [ 99 | Text( 100 | Utils.averageRatings(value 101 | .moviesList.data!.movies![index].ratings!) 102 | .toStringAsFixed(1), 103 | ), 104 | const Icon( 105 | Icons.star, 106 | color: Colors.yellow, 107 | ) 108 | ], 109 | ), 110 | ), 111 | ); 112 | }); 113 | 114 | default: 115 | return Container(); 116 | } 117 | }, 118 | ), 119 | ), 120 | ); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/view/login_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/res/widgets/round_button.dart'; 3 | import 'package:mvvm_app/utils/routes/routes_names.dart'; 4 | import 'package:mvvm_app/utils/utils.dart'; 5 | import 'package:mvvm_app/viewModel/auth_viewmodel.dart'; 6 | import 'package:provider/provider.dart'; 7 | 8 | class LoginScreen extends StatefulWidget { 9 | const LoginScreen({super.key}); 10 | 11 | @override 12 | State createState() => _LoginScreenState(); 13 | } 14 | 15 | class _LoginScreenState extends State { 16 | final ValueNotifier _obsecureNotifier = ValueNotifier(false); 17 | final TextEditingController _emailController = TextEditingController(); 18 | final TextEditingController _passwordController = TextEditingController(); 19 | 20 | final FocusNode _emailFocus = FocusNode(); 21 | final FocusNode _passwordFocus = FocusNode(); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | final height = MediaQuery.of(context).size.height * 1; 26 | final authviewmodel = Provider.of(context); 27 | 28 | return Scaffold( 29 | appBar: AppBar( 30 | title: const Text("Login"), 31 | centerTitle: true, 32 | automaticallyImplyLeading: false, 33 | ), 34 | body: SafeArea( 35 | child: Column( 36 | mainAxisAlignment: MainAxisAlignment.center, 37 | crossAxisAlignment: CrossAxisAlignment.center, 38 | children: [ 39 | Padding( 40 | padding: const EdgeInsets.all(8), 41 | child: TextFormField( 42 | controller: _emailController, 43 | focusNode: _emailFocus, 44 | keyboardType: TextInputType.emailAddress, 45 | onFieldSubmitted: (value) { 46 | Utils.changeNodeFocus(context, 47 | current: _emailFocus, next: _passwordFocus); 48 | }, 49 | decoration: InputDecoration( 50 | prefixIcon: const Icon(Icons.email), 51 | label: const Text("Email"), 52 | hintText: "shahzaneer.dev@gmail.com", 53 | border: OutlineInputBorder( 54 | borderRadius: BorderRadius.circular(12), 55 | ), 56 | ), 57 | ), 58 | ), 59 | const SizedBox( 60 | height: 10, 61 | ), 62 | Padding( 63 | padding: const EdgeInsets.all(8.0), 64 | child: ValueListenableBuilder( 65 | valueListenable: _obsecureNotifier, 66 | builder: ((context, value, child) { 67 | return TextFormField( 68 | controller: _passwordController, 69 | focusNode: _passwordFocus, 70 | obscureText: _obsecureNotifier.value, 71 | obscuringCharacter: "*", 72 | decoration: InputDecoration( 73 | prefixIcon: const Icon(Icons.lock_outline), 74 | suffixIcon: _obsecureNotifier.value 75 | ? InkWell( 76 | onTap: () { 77 | _obsecureNotifier.value = 78 | !_obsecureNotifier.value; 79 | }, 80 | child: const Icon(Icons.visibility), 81 | ) 82 | : InkWell( 83 | onTap: () { 84 | _obsecureNotifier.value = 85 | !_obsecureNotifier.value; 86 | }, 87 | child: const Icon(Icons.visibility_off), 88 | ), 89 | label: const Text("Password"), 90 | border: OutlineInputBorder( 91 | borderRadius: BorderRadius.circular(12), 92 | ), 93 | ), 94 | ); 95 | }), 96 | ), 97 | ), 98 | SizedBox( 99 | height: height * 0.08, 100 | ), 101 | RoundButton( 102 | title: "Login", 103 | loading: authviewmodel.loading, 104 | onPress: () { 105 | if (_emailController.text.isEmpty && 106 | _passwordController.text.isEmpty) { 107 | Utils.flushBarErrorMessage( 108 | "email aur password de bhai", context); 109 | } else if (_passwordController.text.isEmpty) { 110 | Utils.flushBarErrorMessage("Password de bhai", context); 111 | } else if (_emailController.text.isEmpty) { 112 | Utils.flushBarErrorMessage("email de bhai", context); 113 | } else { 114 | Map data = { 115 | "email": _emailController.text.toString(), 116 | "password": _passwordController.text.toString() 117 | }; 118 | authviewmodel.apilogin(data, context); 119 | debugPrint("hit API"); 120 | } 121 | }), 122 | SizedBox( 123 | height: height * 0.02, 124 | ), 125 | InkWell( 126 | onTap: () { 127 | Navigator.pushNamed(context, RouteNames.signupScreen); 128 | }, 129 | child: const Text("Don't have an account yet? Sign Up!")) 130 | ], 131 | ), 132 | ), 133 | ); 134 | } 135 | 136 | @override 137 | void dispose() { 138 | super.dispose(); 139 | _emailController.dispose(); 140 | _emailFocus.dispose(); 141 | _passwordController.dispose(); 142 | _passwordFocus.dispose(); 143 | } 144 | } 145 | 146 | 147 | 148 | //! Recalling Providers 149 | // used for state Management (efficicent) 150 | // valueNotifier (for single value) 151 | // valueListenerBuilder (which listens to this value) -------------------------------------------------------------------------------- /lib/view/signup_screen.dart: -------------------------------------------------------------------------------- 1 | import "package:flutter/material.dart"; 2 | import "package:mvvm_app/utils/routes/routes_names.dart"; 3 | import "package:provider/provider.dart"; 4 | 5 | import "../res/widgets/round_button.dart"; 6 | import "../utils/utils.dart"; 7 | import "../viewModel/auth_viewmodel.dart"; 8 | 9 | class SignUpScreen extends StatefulWidget { 10 | const SignUpScreen({super.key}); 11 | 12 | @override 13 | State createState() => _SignUpScreenState(); 14 | } 15 | 16 | class _SignUpScreenState extends State { 17 | final ValueNotifier _obsecureNotifier = ValueNotifier(false); 18 | final TextEditingController _emailController = TextEditingController(); 19 | final TextEditingController _passwordController = TextEditingController(); 20 | 21 | final FocusNode _emailFocus = FocusNode(); 22 | final FocusNode _passwordFocus = FocusNode(); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | final height = MediaQuery.of(context).size.height * 1; 27 | final authviewmodel = Provider.of(context); 28 | 29 | return Scaffold( 30 | appBar: AppBar( 31 | title: const Text("Sign up"), 32 | centerTitle: true, 33 | automaticallyImplyLeading: false, 34 | ), 35 | body: SafeArea( 36 | child: Column( 37 | mainAxisAlignment: MainAxisAlignment.center, 38 | crossAxisAlignment: CrossAxisAlignment.center, 39 | children: [ 40 | Padding( 41 | padding: const EdgeInsets.all(8), 42 | child: TextFormField( 43 | controller: _emailController, 44 | focusNode: _emailFocus, 45 | keyboardType: TextInputType.emailAddress, 46 | onFieldSubmitted: (value) { 47 | Utils.changeNodeFocus(context, 48 | current: _emailFocus, next: _passwordFocus); 49 | }, 50 | decoration: InputDecoration( 51 | prefixIcon: const Icon(Icons.email), 52 | label: const Text("Email"), 53 | hintText: "shahzaneer.dev@gmail.com", 54 | border: OutlineInputBorder( 55 | borderRadius: BorderRadius.circular(12), 56 | ), 57 | ), 58 | ), 59 | ), 60 | const SizedBox( 61 | height: 10, 62 | ), 63 | Padding( 64 | padding: const EdgeInsets.all(8.0), 65 | child: ValueListenableBuilder( 66 | valueListenable: _obsecureNotifier, 67 | builder: ((context, value, child) { 68 | return TextFormField( 69 | controller: _passwordController, 70 | focusNode: _passwordFocus, 71 | obscureText: _obsecureNotifier.value, 72 | obscuringCharacter: "*", 73 | decoration: InputDecoration( 74 | prefixIcon: const Icon(Icons.lock_outline), 75 | suffixIcon: _obsecureNotifier.value 76 | ? InkWell( 77 | onTap: () { 78 | _obsecureNotifier.value = 79 | !_obsecureNotifier.value; 80 | }, 81 | child: const Icon(Icons.visibility), 82 | ) 83 | : InkWell( 84 | onTap: () { 85 | _obsecureNotifier.value = 86 | !_obsecureNotifier.value; 87 | }, 88 | child: const Icon(Icons.visibility_off), 89 | ), 90 | label: const Text("Password"), 91 | border: OutlineInputBorder( 92 | borderRadius: BorderRadius.circular(12), 93 | ), 94 | ), 95 | ); 96 | }), 97 | ), 98 | ), 99 | SizedBox( 100 | height: height * 0.08, 101 | ), 102 | RoundButton( 103 | title: "Login", 104 | loading: authviewmodel.signupLoading, 105 | onPress: () { 106 | //Keyboard off krne k liay 107 | _passwordFocus.unfocus(); 108 | 109 | if (_emailController.text.isEmpty && 110 | _passwordController.text.isEmpty) { 111 | Utils.flushBarErrorMessage( 112 | "email aur password de bhai", context); 113 | } else if (_passwordController.text.isEmpty) { 114 | Utils.flushBarErrorMessage("Password de bhai", context); 115 | } else if (_emailController.text.isEmpty) { 116 | Utils.flushBarErrorMessage("email de bhai", context); 117 | } else { 118 | Map data = { 119 | "email": _emailController.text.toString(), 120 | "password": _passwordController.text.toString() 121 | }; 122 | authviewmodel.apiSignUp(data, context); 123 | debugPrint("hit API"); 124 | } 125 | }), 126 | SizedBox( 127 | height: height * 0.02, 128 | ), 129 | InkWell( 130 | onTap: () { 131 | Navigator.pushNamed(context, RouteNames.login); 132 | }, 133 | child: const Text("Already have an account? Login Up!")) 134 | ], 135 | ), 136 | ), 137 | ); 138 | } 139 | 140 | @override 141 | void dispose() { 142 | super.dispose(); 143 | _emailController.dispose(); 144 | _emailFocus.dispose(); 145 | _passwordController.dispose(); 146 | _passwordFocus.dispose(); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /lib/view/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/viewModel/splash_service.dart'; 3 | 4 | class SplashScreen extends StatefulWidget { 5 | const SplashScreen({super.key}); 6 | 7 | @override 8 | State createState() => _SplashScreenState(); 9 | } 10 | 11 | class _SplashScreenState extends State { 12 | @override 13 | void initState() { 14 | super.initState(); 15 | SplashService.checkAuthentication(context); 16 | } 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | body: SafeArea( 22 | child: Column( 23 | mainAxisAlignment: MainAxisAlignment.center, 24 | crossAxisAlignment: CrossAxisAlignment.center, 25 | children: [ 26 | Center( 27 | child: Text( 28 | "Splash Screen", 29 | style: TextStyle( 30 | fontSize: 20, 31 | color: Colors.grey.shade700, 32 | fontWeight: FontWeight.bold), 33 | ), 34 | ) 35 | ], 36 | )), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/viewModel/auth_viewmodel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/models/user_model.dart'; 3 | import 'package:mvvm_app/repository/auth_repository.dart'; 4 | import 'package:mvvm_app/utils/routes/routes_names.dart'; 5 | import 'package:mvvm_app/utils/utils.dart'; 6 | import 'package:mvvm_app/viewModel/user_view_model.dart'; 7 | import 'package:provider/provider.dart'; 8 | 9 | class AuthViewModel with ChangeNotifier { 10 | final _auth = AuthRepository(); 11 | 12 | bool _loginLoading = false; 13 | bool _signupLoading = false; 14 | 15 | get loading => _loginLoading; 16 | get signupLoading => _signupLoading; 17 | 18 | void setLoginLoading(bool value) { 19 | _loginLoading = value; 20 | notifyListeners(); 21 | } 22 | 23 | void setSignUpLoading(bool value) { 24 | _signupLoading = value; 25 | notifyListeners(); 26 | } 27 | 28 | Future apilogin(dynamic data, BuildContext context) async { 29 | setLoginLoading(true); 30 | _auth.apiLogin(data).then((value) { 31 | setLoginLoading(false); 32 | 33 | //! Api hit krtay huay sharedPreferences safe bhi krne hain! 34 | 35 | final userPreference = Provider.of(context, listen: false); 36 | userPreference.saveUser(UserModel(token: value['token'].toString())); 37 | 38 | Utils.flushBarErrorMessage("Login Successfull", context); 39 | 40 | Navigator.pushNamed(context, RouteNames.home); 41 | }).onError((error, stackTrace) { 42 | Utils.flushBarErrorMessage(error.toString(), context); 43 | setLoginLoading(false); 44 | }); 45 | } 46 | 47 | Future apiSignUp(dynamic data, BuildContext context) async { 48 | setSignUpLoading(true); 49 | _auth.signUp(data).then((value) { 50 | Utils.flushBarErrorMessage("Sign Up Successfull", context); 51 | 52 | Navigator.pushNamed(context, RouteNames.home); 53 | setSignUpLoading(false); 54 | }).onError((error, stackTrace) { 55 | Utils.flushBarErrorMessage(error.toString(), context); 56 | setSignUpLoading(false); 57 | }); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/viewModel/home_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/repository/home_repository.dart'; 3 | 4 | import '../data/response/api_response.dart'; 5 | import '../models/movies_model.dart'; 6 | 7 | class HomeViewModel with ChangeNotifier { 8 | final _homeRepository = HomeRepository(); 9 | 10 | ApiResponse moviesList = ApiResponse.loading(); 11 | 12 | setMoviesList(ApiResponse response) { 13 | moviesList = response; 14 | notifyListeners(); 15 | } 16 | 17 | void fetchMoviesListApi() async { 18 | setMoviesList(ApiResponse.loading()); 19 | 20 | _homeRepository.fetchMoviesList().then((data) { 21 | print("before completed im here!"); 22 | setMoviesList(ApiResponse.completed(data)); 23 | }).onError((error, stackTrace) { 24 | setMoviesList(ApiResponse.error(error.toString())); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/viewModel/splash_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mvvm_app/utils/routes/routes_names.dart'; 3 | import 'package:mvvm_app/viewModel/user_view_model.dart'; 4 | 5 | class SplashService { 6 | static void checkAuthentication(BuildContext context) async { 7 | final userViewModel = UserViewModel(); 8 | 9 | final user = await userViewModel.getUser(); 10 | 11 | if (user!.token.toString() == "null" || user.token.toString() == "") { 12 | await Future.delayed(const Duration(seconds: 3)); 13 | Navigator.pushNamed(context, RouteNames.login); 14 | } else { 15 | await Future.delayed(const Duration(seconds: 3)); 16 | Navigator.pushNamed(context, RouteNames.home); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/viewModel/user_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:mvvm_app/models/user_model.dart'; 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | class UserViewModel with ChangeNotifier { 6 | // !SAVE THE USER and set the state! 7 | Future saveUser(UserModel user) async { 8 | final SharedPreferences sp = await SharedPreferences.getInstance(); 9 | sp.setString("token", user.token.toString()); 10 | notifyListeners(); // so that theuser is saved! 11 | 12 | return true; 13 | } 14 | 15 | // ! REMOVE THE USER and set the state 16 | Future removeUser() async { 17 | final SharedPreferences sp = await SharedPreferences.getInstance(); 18 | sp.remove("token"); 19 | notifyListeners(); //so that the user is removed! 20 | return true; 21 | } 22 | 23 | // ! get The User 24 | 25 | Future getUser() async { 26 | final SharedPreferences sp = await SharedPreferences.getInstance(); 27 | final String? token = sp.getString("token"); 28 | return UserModel(token: token.toString()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | another_flushbar: 5 | dependency: "direct main" 6 | description: 7 | name: another_flushbar 8 | sha256: fa09f8a4ca582c417669b7b1d0e85ce65bd074d80bb0dcbb1302ad1b22bdc3ef 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "1.12.29" 12 | async: 13 | dependency: transitive 14 | description: 15 | name: async 16 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.10.0" 20 | boolean_selector: 21 | dependency: transitive 22 | description: 23 | name: boolean_selector 24 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "2.1.1" 28 | characters: 29 | dependency: transitive 30 | description: 31 | name: characters 32 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.2.1" 36 | clock: 37 | dependency: transitive 38 | description: 39 | name: clock 40 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.1.1" 44 | collection: 45 | dependency: transitive 46 | description: 47 | name: collection 48 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.17.0" 52 | cupertino_icons: 53 | dependency: "direct main" 54 | description: 55 | name: cupertino_icons 56 | sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.0.5" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "1.3.1" 68 | ffi: 69 | dependency: transitive 70 | description: 71 | name: ffi 72 | sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 73 | url: "https://pub.dev" 74 | source: hosted 75 | version: "2.0.1" 76 | file: 77 | dependency: transitive 78 | description: 79 | name: file 80 | sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" 81 | url: "https://pub.dev" 82 | source: hosted 83 | version: "6.1.4" 84 | flutter: 85 | dependency: "direct main" 86 | description: flutter 87 | source: sdk 88 | version: "0.0.0" 89 | flutter_lints: 90 | dependency: "direct dev" 91 | description: 92 | name: flutter_lints 93 | sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c 94 | url: "https://pub.dev" 95 | source: hosted 96 | version: "2.0.1" 97 | flutter_test: 98 | dependency: "direct dev" 99 | description: flutter 100 | source: sdk 101 | version: "0.0.0" 102 | flutter_web_plugins: 103 | dependency: transitive 104 | description: flutter 105 | source: sdk 106 | version: "0.0.0" 107 | fluttertoast: 108 | dependency: "direct main" 109 | description: 110 | name: fluttertoast 111 | sha256: "2f9c4d3f4836421f7067a28f8939814597b27614e021da9d63e5d3fb6e212d25" 112 | url: "https://pub.dev" 113 | source: hosted 114 | version: "8.2.1" 115 | get: 116 | dependency: "direct main" 117 | description: 118 | name: get 119 | sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" 120 | url: "https://pub.dev" 121 | source: hosted 122 | version: "4.6.5" 123 | http: 124 | dependency: "direct main" 125 | description: 126 | name: http 127 | sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" 128 | url: "https://pub.dev" 129 | source: hosted 130 | version: "0.13.5" 131 | http_parser: 132 | dependency: transitive 133 | description: 134 | name: http_parser 135 | sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "4.0.2" 139 | js: 140 | dependency: transitive 141 | description: 142 | name: js 143 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "0.6.5" 147 | lints: 148 | dependency: transitive 149 | description: 150 | name: lints 151 | sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "2.0.1" 155 | matcher: 156 | dependency: transitive 157 | description: 158 | name: matcher 159 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "0.12.13" 163 | material_color_utilities: 164 | dependency: transitive 165 | description: 166 | name: material_color_utilities 167 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "0.2.0" 171 | meta: 172 | dependency: transitive 173 | description: 174 | name: meta 175 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 176 | url: "https://pub.dev" 177 | source: hosted 178 | version: "1.8.0" 179 | nested: 180 | dependency: transitive 181 | description: 182 | name: nested 183 | sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" 184 | url: "https://pub.dev" 185 | source: hosted 186 | version: "1.0.0" 187 | path: 188 | dependency: transitive 189 | description: 190 | name: path 191 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 192 | url: "https://pub.dev" 193 | source: hosted 194 | version: "1.8.2" 195 | path_provider_linux: 196 | dependency: transitive 197 | description: 198 | name: path_provider_linux 199 | sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1" 200 | url: "https://pub.dev" 201 | source: hosted 202 | version: "2.1.10" 203 | path_provider_platform_interface: 204 | dependency: transitive 205 | description: 206 | name: path_provider_platform_interface 207 | sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" 208 | url: "https://pub.dev" 209 | source: hosted 210 | version: "2.0.6" 211 | path_provider_windows: 212 | dependency: transitive 213 | description: 214 | name: path_provider_windows 215 | sha256: f53720498d5a543f9607db4b0e997c4b5438884de25b0f73098cc2671a51b130 216 | url: "https://pub.dev" 217 | source: hosted 218 | version: "2.1.5" 219 | platform: 220 | dependency: transitive 221 | description: 222 | name: platform 223 | sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" 224 | url: "https://pub.dev" 225 | source: hosted 226 | version: "3.1.0" 227 | plugin_platform_interface: 228 | dependency: transitive 229 | description: 230 | name: plugin_platform_interface 231 | sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" 232 | url: "https://pub.dev" 233 | source: hosted 234 | version: "2.1.4" 235 | process: 236 | dependency: transitive 237 | description: 238 | name: process 239 | sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" 240 | url: "https://pub.dev" 241 | source: hosted 242 | version: "4.2.4" 243 | provider: 244 | dependency: "direct main" 245 | description: 246 | name: provider 247 | sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f 248 | url: "https://pub.dev" 249 | source: hosted 250 | version: "6.0.5" 251 | shared_preferences: 252 | dependency: "direct main" 253 | description: 254 | name: shared_preferences 255 | sha256: ee6257848f822b8481691f20c3e6d2bfee2e9eccb2a3d249907fcfb198c55b41 256 | url: "https://pub.dev" 257 | source: hosted 258 | version: "2.0.18" 259 | shared_preferences_android: 260 | dependency: transitive 261 | description: 262 | name: shared_preferences_android 263 | sha256: ad423a80fe7b4e48b50d6111b3ea1027af0e959e49d485712e134863d9c1c521 264 | url: "https://pub.dev" 265 | source: hosted 266 | version: "2.0.17" 267 | shared_preferences_foundation: 268 | dependency: transitive 269 | description: 270 | name: shared_preferences_foundation 271 | sha256: "1e755f8583229f185cfca61b1d80fb2344c9d660e1c69ede5450d8f478fa5310" 272 | url: "https://pub.dev" 273 | source: hosted 274 | version: "2.1.5" 275 | shared_preferences_linux: 276 | dependency: transitive 277 | description: 278 | name: shared_preferences_linux 279 | sha256: "3a59ed10890a8409ad0faad7bb2957dab4b92b8fbe553257b05d30ed8af2c707" 280 | url: "https://pub.dev" 281 | source: hosted 282 | version: "2.1.5" 283 | shared_preferences_platform_interface: 284 | dependency: transitive 285 | description: 286 | name: shared_preferences_platform_interface 287 | sha256: "824bfd02713e37603b2bdade0842e47d56e7db32b1dcdd1cae533fb88e2913fc" 288 | url: "https://pub.dev" 289 | source: hosted 290 | version: "2.1.1" 291 | shared_preferences_web: 292 | dependency: transitive 293 | description: 294 | name: shared_preferences_web 295 | sha256: "0dc2633f215a3d4aa3184c9b2c5766f4711e4e5a6b256e62aafee41f89f1bfb8" 296 | url: "https://pub.dev" 297 | source: hosted 298 | version: "2.0.6" 299 | shared_preferences_windows: 300 | dependency: transitive 301 | description: 302 | name: shared_preferences_windows 303 | sha256: "71bcd669bb9cdb6b39f22c4a7728b6d49e934f6cba73157ffa5a54f1eed67436" 304 | url: "https://pub.dev" 305 | source: hosted 306 | version: "2.1.5" 307 | sky_engine: 308 | dependency: transitive 309 | description: flutter 310 | source: sdk 311 | version: "0.0.99" 312 | source_span: 313 | dependency: transitive 314 | description: 315 | name: source_span 316 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 317 | url: "https://pub.dev" 318 | source: hosted 319 | version: "1.9.1" 320 | stack_trace: 321 | dependency: transitive 322 | description: 323 | name: stack_trace 324 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 325 | url: "https://pub.dev" 326 | source: hosted 327 | version: "1.11.0" 328 | stream_channel: 329 | dependency: transitive 330 | description: 331 | name: stream_channel 332 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 333 | url: "https://pub.dev" 334 | source: hosted 335 | version: "2.1.1" 336 | string_scanner: 337 | dependency: transitive 338 | description: 339 | name: string_scanner 340 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 341 | url: "https://pub.dev" 342 | source: hosted 343 | version: "1.2.0" 344 | term_glyph: 345 | dependency: transitive 346 | description: 347 | name: term_glyph 348 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 349 | url: "https://pub.dev" 350 | source: hosted 351 | version: "1.2.1" 352 | test_api: 353 | dependency: transitive 354 | description: 355 | name: test_api 356 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 357 | url: "https://pub.dev" 358 | source: hosted 359 | version: "0.4.16" 360 | typed_data: 361 | dependency: transitive 362 | description: 363 | name: typed_data 364 | sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" 365 | url: "https://pub.dev" 366 | source: hosted 367 | version: "1.3.1" 368 | vector_math: 369 | dependency: transitive 370 | description: 371 | name: vector_math 372 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 373 | url: "https://pub.dev" 374 | source: hosted 375 | version: "2.1.4" 376 | win32: 377 | dependency: transitive 378 | description: 379 | name: win32 380 | sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 381 | url: "https://pub.dev" 382 | source: hosted 383 | version: "3.1.3" 384 | xdg_directories: 385 | dependency: transitive 386 | description: 387 | name: xdg_directories 388 | sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 389 | url: "https://pub.dev" 390 | source: hosted 391 | version: "1.0.0" 392 | sdks: 393 | dart: ">=2.19.3 <3.0.0" 394 | flutter: ">=3.0.0" 395 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mvvm_app 2 | description: A new Flutter project. 3 | # The following line prevents the package from being accidentally published to 4 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # In Android, build-name is used as versionName while build-number used as versionCode. 13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 15 | # Read more about iOS versioning at 16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 17 | # In Windows, build-name is used as the major, minor, and patch parts 18 | # of the product and file versions while build-number is used as the build suffix. 19 | version: 1.0.0+1 20 | 21 | environment: 22 | sdk: '>=2.19.3 <3.0.0' 23 | 24 | # Dependencies specify other packages that your package needs in order to work. 25 | # To automatically upgrade your package dependencies to the latest versions 26 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 27 | # dependencies can be manually updated by changing the version numbers below to 28 | # the latest version available on pub.dev. To see which dependencies have newer 29 | # versions available, run `flutter pub outdated`. 30 | dependencies: 31 | flutter: 32 | sdk: flutter 33 | 34 | 35 | # The following adds the Cupertino Icons font to your application. 36 | # Use with the CupertinoIcons class for iOS style icons. 37 | cupertino_icons: ^1.0.2 38 | http: ^0.13.5 39 | fluttertoast: ^8.2.1 40 | get: ^4.6.5 41 | shared_preferences: ^2.0.18 42 | another_flushbar: ^1.12.29 43 | provider: ^6.0.5 44 | 45 | dev_dependencies: 46 | flutter_test: 47 | sdk: flutter 48 | 49 | # The "flutter_lints" package below contains a set of recommended lints to 50 | # encourage good coding practices. The lint set provided by the package is 51 | # activated in the `analysis_options.yaml` file located at the root of your 52 | # package. See that file for information about deactivating specific lint 53 | # rules and activating additional ones. 54 | flutter_lints: ^2.0.0 55 | 56 | # For information on the generic Dart part of this file, see the 57 | # following page: https://dart.dev/tools/pub/pubspec 58 | 59 | # The following section is specific to Flutter packages. 60 | flutter: 61 | 62 | # The following line ensures that the Material Icons font is 63 | # included with your application, so that you can use the icons in 64 | # the material Icons class. 65 | uses-material-design: true 66 | 67 | # To add assets to your application, add an assets section, like this: 68 | # assets: 69 | # - images/a_dot_burr.jpeg 70 | # - images/a_dot_ham.jpeg 71 | 72 | # An image asset can refer to one or more resolution-specific "variants", see 73 | # https://flutter.dev/assets-and-images/#resolution-aware 74 | 75 | # For details regarding adding assets from package dependencies, see 76 | # https://flutter.dev/assets-and-images/#from-packages 77 | 78 | # To add custom fonts to your application, add a fonts section here, 79 | # in this "flutter" section. Each entry in this list should have a 80 | # "family" key with the font family name, and a "fonts" key with a 81 | # list giving the asset and other descriptors for the font. For 82 | # example: 83 | # fonts: 84 | # - family: Schyler 85 | # fonts: 86 | # - asset: fonts/Schyler-Regular.ttf 87 | # - asset: fonts/Schyler-Italic.ttf 88 | # style: italic 89 | # - family: Trajan Pro 90 | # fonts: 91 | # - asset: fonts/TrajanPro.ttf 92 | # - asset: fonts/TrajanPro_Bold.ttf 93 | # weight: 700 94 | # 95 | # For details regarding fonts from package dependencies, 96 | # see https://flutter.dev/custom-fonts/#from-packages 97 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:mvvm_app/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------