├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── gokberkyagci
│ │ │ │ └── flutter_generic_api_response
│ │ │ │ └── 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
├── extensions
│ └── safe_call_extensions.dart
├── main.dart
├── model
│ ├── user_entity.dart
│ ├── user_entity.freezed.dart
│ └── user_entity.g.dart
├── network
│ ├── api_client.dart
│ ├── base
│ │ ├── api_error.dart
│ │ ├── api_error.freezed.dart
│ │ ├── api_error.g.dart
│ │ ├── api_result.dart
│ │ └── safe_call.dart
│ └── services
│ │ └── user_services
│ │ ├── model
│ │ ├── login_request.dart
│ │ ├── login_request.freezed.dart
│ │ ├── login_request.g.dart
│ │ ├── login_response.dart
│ │ ├── login_response.freezed.dart
│ │ └── login_response.g.dart
│ │ └── user_services.dart
└── ui
│ └── page
│ └── login
│ ├── login_page.dart
│ └── login_page_bloc.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 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 5464c5bac742001448fe4fc0597be939379f88ea
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # flutter_generic_api_response
2 |
3 | This project has been built that has been proof of building Generic Api Response with freeze plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/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 |
31 | analyzer:
32 | errors:
33 | invalid_annotation_target: ignore
--------------------------------------------------------------------------------
/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 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | kotlinOptions {
37 | jvmTarget = '1.8'
38 | }
39 |
40 | sourceSets {
41 | main.java.srcDirs += 'src/main/kotlin'
42 | }
43 |
44 | defaultConfig {
45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46 | applicationId "com.gokberkyagci.flutter_generic_api_response"
47 | minSdkVersion flutter.minSdkVersion
48 | targetSdkVersion flutter.targetSdkVersion
49 | versionCode flutterVersionCode.toInteger()
50 | versionName flutterVersionName
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68 | }
69 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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/gokberkyagci/flutter_generic_api_response/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.gokberkyagci.flutter_generic_api_response
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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.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 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/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 | 9.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 = 50;
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 | buildActionMask = 2147483647;
175 | files = (
176 | );
177 | inputPaths = (
178 | );
179 | name = "Thin Binary";
180 | outputPaths = (
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | shellPath = /bin/sh;
184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
185 | };
186 | 9740EEB61CF901F6004384FC /* Run Script */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputPaths = (
192 | );
193 | name = "Run Script";
194 | outputPaths = (
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | shellPath = /bin/sh;
198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199 | };
200 | /* End PBXShellScriptBuildPhase section */
201 |
202 | /* Begin PBXSourcesBuildPhase section */
203 | 97C146EA1CF9000F007C117D /* Sources */ = {
204 | isa = PBXSourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXSourcesBuildPhase section */
213 |
214 | /* Begin PBXVariantGroup section */
215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
216 | isa = PBXVariantGroup;
217 | children = (
218 | 97C146FB1CF9000F007C117D /* Base */,
219 | );
220 | name = Main.storyboard;
221 | sourceTree = "";
222 | };
223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C147001CF9000F007C117D /* Base */,
227 | );
228 | name = LaunchScreen.storyboard;
229 | sourceTree = "";
230 | };
231 | /* End PBXVariantGroup section */
232 |
233 | /* Begin XCBuildConfiguration section */
234 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
235 | isa = XCBuildConfiguration;
236 | buildSettings = {
237 | ALWAYS_SEARCH_USER_PATHS = NO;
238 | CLANG_ANALYZER_NONNULL = YES;
239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
240 | CLANG_CXX_LIBRARY = "libc++";
241 | CLANG_ENABLE_MODULES = YES;
242 | CLANG_ENABLE_OBJC_ARC = YES;
243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
244 | CLANG_WARN_BOOL_CONVERSION = YES;
245 | CLANG_WARN_COMMA = YES;
246 | CLANG_WARN_CONSTANT_CONVERSION = YES;
247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
249 | CLANG_WARN_EMPTY_BODY = YES;
250 | CLANG_WARN_ENUM_CONVERSION = YES;
251 | CLANG_WARN_INFINITE_RECURSION = YES;
252 | CLANG_WARN_INT_CONVERSION = YES;
253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
258 | CLANG_WARN_STRICT_PROTOTYPES = YES;
259 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
260 | CLANG_WARN_UNREACHABLE_CODE = YES;
261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
263 | COPY_PHASE_STRIP = NO;
264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
265 | ENABLE_NS_ASSERTIONS = NO;
266 | ENABLE_STRICT_OBJC_MSGSEND = YES;
267 | GCC_C_LANGUAGE_STANDARD = gnu99;
268 | GCC_NO_COMMON_BLOCKS = YES;
269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
271 | GCC_WARN_UNDECLARED_SELECTOR = YES;
272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273 | GCC_WARN_UNUSED_FUNCTION = YES;
274 | GCC_WARN_UNUSED_VARIABLE = YES;
275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
276 | MTL_ENABLE_DEBUG_INFO = NO;
277 | SDKROOT = iphoneos;
278 | SUPPORTED_PLATFORMS = iphoneos;
279 | TARGETED_DEVICE_FAMILY = "1,2";
280 | VALIDATE_PRODUCT = YES;
281 | };
282 | name = Profile;
283 | };
284 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
285 | isa = XCBuildConfiguration;
286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
287 | buildSettings = {
288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289 | CLANG_ENABLE_MODULES = YES;
290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
291 | DEVELOPMENT_TEAM = Z39Q2A6NB8;
292 | ENABLE_BITCODE = NO;
293 | INFOPLIST_FILE = Runner/Info.plist;
294 | LD_RUNPATH_SEARCH_PATHS = (
295 | "$(inherited)",
296 | "@executable_path/Frameworks",
297 | );
298 | PRODUCT_BUNDLE_IDENTIFIER = com.gokberkyagci.flutterGenericApiResponse;
299 | PRODUCT_NAME = "$(TARGET_NAME)";
300 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
301 | SWIFT_VERSION = 5.0;
302 | VERSIONING_SYSTEM = "apple-generic";
303 | };
304 | name = Profile;
305 | };
306 | 97C147031CF9000F007C117D /* Debug */ = {
307 | isa = XCBuildConfiguration;
308 | buildSettings = {
309 | ALWAYS_SEARCH_USER_PATHS = NO;
310 | CLANG_ANALYZER_NONNULL = YES;
311 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
312 | CLANG_CXX_LIBRARY = "libc++";
313 | CLANG_ENABLE_MODULES = YES;
314 | CLANG_ENABLE_OBJC_ARC = YES;
315 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
316 | CLANG_WARN_BOOL_CONVERSION = YES;
317 | CLANG_WARN_COMMA = YES;
318 | CLANG_WARN_CONSTANT_CONVERSION = YES;
319 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
321 | CLANG_WARN_EMPTY_BODY = YES;
322 | CLANG_WARN_ENUM_CONVERSION = YES;
323 | CLANG_WARN_INFINITE_RECURSION = YES;
324 | CLANG_WARN_INT_CONVERSION = YES;
325 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
326 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
327 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
328 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
329 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
330 | CLANG_WARN_STRICT_PROTOTYPES = YES;
331 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
332 | CLANG_WARN_UNREACHABLE_CODE = YES;
333 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
334 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
335 | COPY_PHASE_STRIP = NO;
336 | DEBUG_INFORMATION_FORMAT = dwarf;
337 | ENABLE_STRICT_OBJC_MSGSEND = YES;
338 | ENABLE_TESTABILITY = YES;
339 | GCC_C_LANGUAGE_STANDARD = gnu99;
340 | GCC_DYNAMIC_NO_PIC = NO;
341 | GCC_NO_COMMON_BLOCKS = YES;
342 | GCC_OPTIMIZATION_LEVEL = 0;
343 | GCC_PREPROCESSOR_DEFINITIONS = (
344 | "DEBUG=1",
345 | "$(inherited)",
346 | );
347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
349 | GCC_WARN_UNDECLARED_SELECTOR = YES;
350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
351 | GCC_WARN_UNUSED_FUNCTION = YES;
352 | GCC_WARN_UNUSED_VARIABLE = YES;
353 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
354 | MTL_ENABLE_DEBUG_INFO = YES;
355 | ONLY_ACTIVE_ARCH = YES;
356 | SDKROOT = iphoneos;
357 | TARGETED_DEVICE_FAMILY = "1,2";
358 | };
359 | name = Debug;
360 | };
361 | 97C147041CF9000F007C117D /* Release */ = {
362 | isa = XCBuildConfiguration;
363 | buildSettings = {
364 | ALWAYS_SEARCH_USER_PATHS = NO;
365 | CLANG_ANALYZER_NONNULL = YES;
366 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
367 | CLANG_CXX_LIBRARY = "libc++";
368 | CLANG_ENABLE_MODULES = YES;
369 | CLANG_ENABLE_OBJC_ARC = YES;
370 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
371 | CLANG_WARN_BOOL_CONVERSION = YES;
372 | CLANG_WARN_COMMA = YES;
373 | CLANG_WARN_CONSTANT_CONVERSION = YES;
374 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
375 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
376 | CLANG_WARN_EMPTY_BODY = YES;
377 | CLANG_WARN_ENUM_CONVERSION = YES;
378 | CLANG_WARN_INFINITE_RECURSION = YES;
379 | CLANG_WARN_INT_CONVERSION = YES;
380 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
381 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
382 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
383 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
384 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
385 | CLANG_WARN_STRICT_PROTOTYPES = YES;
386 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
387 | CLANG_WARN_UNREACHABLE_CODE = YES;
388 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
389 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
390 | COPY_PHASE_STRIP = NO;
391 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
392 | ENABLE_NS_ASSERTIONS = NO;
393 | ENABLE_STRICT_OBJC_MSGSEND = YES;
394 | GCC_C_LANGUAGE_STANDARD = gnu99;
395 | GCC_NO_COMMON_BLOCKS = YES;
396 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
397 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
398 | GCC_WARN_UNDECLARED_SELECTOR = YES;
399 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
400 | GCC_WARN_UNUSED_FUNCTION = YES;
401 | GCC_WARN_UNUSED_VARIABLE = YES;
402 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
403 | MTL_ENABLE_DEBUG_INFO = NO;
404 | SDKROOT = iphoneos;
405 | SUPPORTED_PLATFORMS = iphoneos;
406 | SWIFT_COMPILATION_MODE = wholemodule;
407 | SWIFT_OPTIMIZATION_LEVEL = "-O";
408 | TARGETED_DEVICE_FAMILY = "1,2";
409 | VALIDATE_PRODUCT = YES;
410 | };
411 | name = Release;
412 | };
413 | 97C147061CF9000F007C117D /* Debug */ = {
414 | isa = XCBuildConfiguration;
415 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
416 | buildSettings = {
417 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
418 | CLANG_ENABLE_MODULES = YES;
419 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
420 | DEVELOPMENT_TEAM = Z39Q2A6NB8;
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.gokberkyagci.flutterGenericApiResponse;
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 | DEVELOPMENT_TEAM = Z39Q2A6NB8;
444 | ENABLE_BITCODE = NO;
445 | INFOPLIST_FILE = Runner/Info.plist;
446 | LD_RUNPATH_SEARCH_PATHS = (
447 | "$(inherited)",
448 | "@executable_path/Frameworks",
449 | );
450 | PRODUCT_BUNDLE_IDENTIFIER = com.gokberkyagci.flutterGenericApiResponse;
451 | PRODUCT_NAME = "$(TARGET_NAME)";
452 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
453 | SWIFT_VERSION = 5.0;
454 | VERSIONING_SYSTEM = "apple-generic";
455 | };
456 | name = Release;
457 | };
458 | /* End XCBuildConfiguration section */
459 |
460 | /* Begin XCConfigurationList section */
461 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
462 | isa = XCConfigurationList;
463 | buildConfigurations = (
464 | 97C147031CF9000F007C117D /* Debug */,
465 | 97C147041CF9000F007C117D /* Release */,
466 | 249021D3217E4FDB00AE95B9 /* Profile */,
467 | );
468 | defaultConfigurationIsVisible = 0;
469 | defaultConfigurationName = Release;
470 | };
471 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
472 | isa = XCConfigurationList;
473 | buildConfigurations = (
474 | 97C147061CF9000F007C117D /* Debug */,
475 | 97C147071CF9000F007C117D /* Release */,
476 | 249021D4217E4FDB00AE95B9 /* Profile */,
477 | );
478 | defaultConfigurationIsVisible = 0;
479 | defaultConfigurationName = Release;
480 | };
481 | /* End XCConfigurationList section */
482 | };
483 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
484 | }
485 |
--------------------------------------------------------------------------------
/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gokberky/flutter_generic_api_response/82347951309c4f71e57e28b51fd2b07b80586c04/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 | Flutter Generic Api Response
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_generic_api_response
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 |
47 |
48 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/extensions/safe_call_extensions.dart:
--------------------------------------------------------------------------------
1 | extension GenericExtensions on Object? {
2 | T? asOrNull() {
3 | var self = this;
4 | return self is T ? self : null;
5 | }
6 | }
7 |
8 | T? cast(x) => x is T ? x : null;
9 |
10 | extension ListExtensions on List {
11 | T? firstOrNull() {
12 | return isEmpty ? null : first;
13 | }
14 | }
15 |
16 | extension StringExtensions on String? {
17 | String getOrEmpty() {
18 | var self = this;
19 | return self is String ? self : "";
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import 'package:flutter_generic_api_response/network/api_client.dart';
4 | import 'package:flutter_generic_api_response/ui/page/login/login_page.dart';
5 |
6 | void main() {
7 | runApp(const MyApp());
8 | }
9 |
10 | class MyApp extends StatelessWidget {
11 | const MyApp({Key? key}) : super(key: key);
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return RepositoryProvider(
16 | create: (context) => ApiClient(),
17 | child: MaterialApp(
18 | title: 'Flutter Demo',
19 | theme: ThemeData(
20 | primarySwatch: Colors.blue,
21 | ),
22 | home: const LoginPage(),
23 | ),
24 | );
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lib/model/user_entity.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:freezed_annotation/freezed_annotation.dart';
3 |
4 | part 'user_entity.freezed.dart';
5 |
6 | part 'user_entity.g.dart';
7 |
8 | @freezed
9 | class UserEntity with _$UserEntity {
10 | const factory UserEntity({
11 | required int id,
12 | required String name,
13 | }) = _UserEntity;
14 |
15 | factory UserEntity.fromJson(Map json) =>
16 | _$UserEntityFromJson(json);
17 | }
18 |
--------------------------------------------------------------------------------
/lib/model/user_entity.freezed.dart:
--------------------------------------------------------------------------------
1 | // coverage:ignore-file
2 | // GENERATED CODE - DO NOT MODIFY BY HAND
3 | // ignore_for_file: type=lint
4 | // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
5 |
6 | part of 'user_entity.dart';
7 |
8 | // **************************************************************************
9 | // FreezedGenerator
10 | // **************************************************************************
11 |
12 | T _$identity(T value) => value;
13 |
14 | final _privateConstructorUsedError = UnsupportedError(
15 | 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
16 |
17 | UserEntity _$UserEntityFromJson(Map json) {
18 | return _UserEntity.fromJson(json);
19 | }
20 |
21 | /// @nodoc
22 | mixin _$UserEntity {
23 | int get id => throw _privateConstructorUsedError;
24 | String get name => throw _privateConstructorUsedError;
25 |
26 | Map toJson() => throw _privateConstructorUsedError;
27 | @JsonKey(ignore: true)
28 | $UserEntityCopyWith get copyWith =>
29 | throw _privateConstructorUsedError;
30 | }
31 |
32 | /// @nodoc
33 | abstract class $UserEntityCopyWith<$Res> {
34 | factory $UserEntityCopyWith(
35 | UserEntity value, $Res Function(UserEntity) then) =
36 | _$UserEntityCopyWithImpl<$Res>;
37 | $Res call({int id, String name});
38 | }
39 |
40 | /// @nodoc
41 | class _$UserEntityCopyWithImpl<$Res> implements $UserEntityCopyWith<$Res> {
42 | _$UserEntityCopyWithImpl(this._value, this._then);
43 |
44 | final UserEntity _value;
45 | // ignore: unused_field
46 | final $Res Function(UserEntity) _then;
47 |
48 | @override
49 | $Res call({
50 | Object? id = freezed,
51 | Object? name = freezed,
52 | }) {
53 | return _then(_value.copyWith(
54 | id: id == freezed
55 | ? _value.id
56 | : id // ignore: cast_nullable_to_non_nullable
57 | as int,
58 | name: name == freezed
59 | ? _value.name
60 | : name // ignore: cast_nullable_to_non_nullable
61 | as String,
62 | ));
63 | }
64 | }
65 |
66 | /// @nodoc
67 | abstract class _$UserEntityCopyWith<$Res> implements $UserEntityCopyWith<$Res> {
68 | factory _$UserEntityCopyWith(
69 | _UserEntity value, $Res Function(_UserEntity) then) =
70 | __$UserEntityCopyWithImpl<$Res>;
71 | @override
72 | $Res call({int id, String name});
73 | }
74 |
75 | /// @nodoc
76 | class __$UserEntityCopyWithImpl<$Res> extends _$UserEntityCopyWithImpl<$Res>
77 | implements _$UserEntityCopyWith<$Res> {
78 | __$UserEntityCopyWithImpl(
79 | _UserEntity _value, $Res Function(_UserEntity) _then)
80 | : super(_value, (v) => _then(v as _UserEntity));
81 |
82 | @override
83 | _UserEntity get _value => super._value as _UserEntity;
84 |
85 | @override
86 | $Res call({
87 | Object? id = freezed,
88 | Object? name = freezed,
89 | }) {
90 | return _then(_UserEntity(
91 | id: id == freezed
92 | ? _value.id
93 | : id // ignore: cast_nullable_to_non_nullable
94 | as int,
95 | name: name == freezed
96 | ? _value.name
97 | : name // ignore: cast_nullable_to_non_nullable
98 | as String,
99 | ));
100 | }
101 | }
102 |
103 | /// @nodoc
104 | @JsonSerializable()
105 | class _$_UserEntity with DiagnosticableTreeMixin implements _UserEntity {
106 | const _$_UserEntity({required this.id, required this.name});
107 |
108 | factory _$_UserEntity.fromJson(Map json) =>
109 | _$$_UserEntityFromJson(json);
110 |
111 | @override
112 | final int id;
113 | @override
114 | final String name;
115 |
116 | @override
117 | String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
118 | return 'UserEntity(id: $id, name: $name)';
119 | }
120 |
121 | @override
122 | void debugFillProperties(DiagnosticPropertiesBuilder properties) {
123 | super.debugFillProperties(properties);
124 | properties
125 | ..add(DiagnosticsProperty('type', 'UserEntity'))
126 | ..add(DiagnosticsProperty('id', id))
127 | ..add(DiagnosticsProperty('name', name));
128 | }
129 |
130 | @override
131 | bool operator ==(dynamic other) {
132 | return identical(this, other) ||
133 | (other.runtimeType == runtimeType &&
134 | other is _UserEntity &&
135 | const DeepCollectionEquality().equals(other.id, id) &&
136 | const DeepCollectionEquality().equals(other.name, name));
137 | }
138 |
139 | @JsonKey(ignore: true)
140 | @override
141 | int get hashCode => Object.hash(
142 | runtimeType,
143 | const DeepCollectionEquality().hash(id),
144 | const DeepCollectionEquality().hash(name));
145 |
146 | @JsonKey(ignore: true)
147 | @override
148 | _$UserEntityCopyWith<_UserEntity> get copyWith =>
149 | __$UserEntityCopyWithImpl<_UserEntity>(this, _$identity);
150 |
151 | @override
152 | Map toJson() {
153 | return _$$_UserEntityToJson(this);
154 | }
155 | }
156 |
157 | abstract class _UserEntity implements UserEntity {
158 | const factory _UserEntity(
159 | {required final int id, required final String name}) = _$_UserEntity;
160 |
161 | factory _UserEntity.fromJson(Map json) =
162 | _$_UserEntity.fromJson;
163 |
164 | @override
165 | int get id => throw _privateConstructorUsedError;
166 | @override
167 | String get name => throw _privateConstructorUsedError;
168 | @override
169 | @JsonKey(ignore: true)
170 | _$UserEntityCopyWith<_UserEntity> get copyWith =>
171 | throw _privateConstructorUsedError;
172 | }
173 |
--------------------------------------------------------------------------------
/lib/model/user_entity.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'user_entity.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | _$_UserEntity _$$_UserEntityFromJson(Map json) =>
10 | _$_UserEntity(
11 | id: json['id'] as int,
12 | name: json['name'] as String,
13 | );
14 |
15 | Map _$$_UserEntityToJson(_$_UserEntity instance) =>
16 | {
17 | 'id': instance.id,
18 | 'name': instance.name,
19 | };
20 |
--------------------------------------------------------------------------------
/lib/network/api_client.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:flutter_generic_api_response/network/services/user_services/user_services.dart';
3 | import 'package:pretty_dio_logger/pretty_dio_logger.dart';
4 |
5 | class ApiClient {
6 | late final Dio _dio = Dio()..interceptors.add(PrettyDioLogger());
7 |
8 | late UserServices userServices = UserServices(_dio);
9 | }
10 |
--------------------------------------------------------------------------------
/lib/network/base/api_error.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:freezed_annotation/freezed_annotation.dart';
3 |
4 | part 'api_error.freezed.dart';
5 |
6 | part 'api_error.g.dart';
7 |
8 | @freezed
9 | class ApiError with _$ApiError {
10 | @JsonSerializable(fieldRename: FieldRename.snake, explicitToJson: true)
11 | const factory ApiError({required int? code, required String message}) =
12 | _ApiError;
13 |
14 | factory ApiError.fromJson(Map json) =>
15 | _$ApiErrorFromJson(json);
16 | }
17 |
--------------------------------------------------------------------------------
/lib/network/base/api_error.freezed.dart:
--------------------------------------------------------------------------------
1 | // coverage:ignore-file
2 | // GENERATED CODE - DO NOT MODIFY BY HAND
3 | // ignore_for_file: type=lint
4 | // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
5 |
6 | part of 'api_error.dart';
7 |
8 | // **************************************************************************
9 | // FreezedGenerator
10 | // **************************************************************************
11 |
12 | T _$identity(T value) => value;
13 |
14 | final _privateConstructorUsedError = UnsupportedError(
15 | 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
16 |
17 | ApiError _$ApiErrorFromJson(Map json) {
18 | return _ApiError.fromJson(json);
19 | }
20 |
21 | /// @nodoc
22 | mixin _$ApiError {
23 | int? get code => throw _privateConstructorUsedError;
24 | String get message => throw _privateConstructorUsedError;
25 |
26 | Map toJson() => throw _privateConstructorUsedError;
27 | @JsonKey(ignore: true)
28 | $ApiErrorCopyWith get copyWith =>
29 | throw _privateConstructorUsedError;
30 | }
31 |
32 | /// @nodoc
33 | abstract class $ApiErrorCopyWith<$Res> {
34 | factory $ApiErrorCopyWith(ApiError value, $Res Function(ApiError) then) =
35 | _$ApiErrorCopyWithImpl<$Res>;
36 | $Res call({int? code, String message});
37 | }
38 |
39 | /// @nodoc
40 | class _$ApiErrorCopyWithImpl<$Res> implements $ApiErrorCopyWith<$Res> {
41 | _$ApiErrorCopyWithImpl(this._value, this._then);
42 |
43 | final ApiError _value;
44 | // ignore: unused_field
45 | final $Res Function(ApiError) _then;
46 |
47 | @override
48 | $Res call({
49 | Object? code = freezed,
50 | Object? message = freezed,
51 | }) {
52 | return _then(_value.copyWith(
53 | code: code == freezed
54 | ? _value.code
55 | : code // ignore: cast_nullable_to_non_nullable
56 | as int?,
57 | message: message == freezed
58 | ? _value.message
59 | : message // ignore: cast_nullable_to_non_nullable
60 | as String,
61 | ));
62 | }
63 | }
64 |
65 | /// @nodoc
66 | abstract class _$ApiErrorCopyWith<$Res> implements $ApiErrorCopyWith<$Res> {
67 | factory _$ApiErrorCopyWith(_ApiError value, $Res Function(_ApiError) then) =
68 | __$ApiErrorCopyWithImpl<$Res>;
69 | @override
70 | $Res call({int? code, String message});
71 | }
72 |
73 | /// @nodoc
74 | class __$ApiErrorCopyWithImpl<$Res> extends _$ApiErrorCopyWithImpl<$Res>
75 | implements _$ApiErrorCopyWith<$Res> {
76 | __$ApiErrorCopyWithImpl(_ApiError _value, $Res Function(_ApiError) _then)
77 | : super(_value, (v) => _then(v as _ApiError));
78 |
79 | @override
80 | _ApiError get _value => super._value as _ApiError;
81 |
82 | @override
83 | $Res call({
84 | Object? code = freezed,
85 | Object? message = freezed,
86 | }) {
87 | return _then(_ApiError(
88 | code: code == freezed
89 | ? _value.code
90 | : code // ignore: cast_nullable_to_non_nullable
91 | as int?,
92 | message: message == freezed
93 | ? _value.message
94 | : message // ignore: cast_nullable_to_non_nullable
95 | as String,
96 | ));
97 | }
98 | }
99 |
100 | /// @nodoc
101 |
102 | @JsonSerializable(fieldRename: FieldRename.snake, explicitToJson: true)
103 | class _$_ApiError with DiagnosticableTreeMixin implements _ApiError {
104 | const _$_ApiError({required this.code, required this.message});
105 |
106 | factory _$_ApiError.fromJson(Map json) =>
107 | _$$_ApiErrorFromJson(json);
108 |
109 | @override
110 | final int? code;
111 | @override
112 | final String message;
113 |
114 | @override
115 | String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
116 | return 'ApiError(code: $code, message: $message)';
117 | }
118 |
119 | @override
120 | void debugFillProperties(DiagnosticPropertiesBuilder properties) {
121 | super.debugFillProperties(properties);
122 | properties
123 | ..add(DiagnosticsProperty('type', 'ApiError'))
124 | ..add(DiagnosticsProperty('code', code))
125 | ..add(DiagnosticsProperty('message', message));
126 | }
127 |
128 | @override
129 | bool operator ==(dynamic other) {
130 | return identical(this, other) ||
131 | (other.runtimeType == runtimeType &&
132 | other is _ApiError &&
133 | const DeepCollectionEquality().equals(other.code, code) &&
134 | const DeepCollectionEquality().equals(other.message, message));
135 | }
136 |
137 | @JsonKey(ignore: true)
138 | @override
139 | int get hashCode => Object.hash(
140 | runtimeType,
141 | const DeepCollectionEquality().hash(code),
142 | const DeepCollectionEquality().hash(message));
143 |
144 | @JsonKey(ignore: true)
145 | @override
146 | _$ApiErrorCopyWith<_ApiError> get copyWith =>
147 | __$ApiErrorCopyWithImpl<_ApiError>(this, _$identity);
148 |
149 | @override
150 | Map toJson() {
151 | return _$$_ApiErrorToJson(this);
152 | }
153 | }
154 |
155 | abstract class _ApiError implements ApiError {
156 | const factory _ApiError(
157 | {required final int? code, required final String message}) = _$_ApiError;
158 |
159 | factory _ApiError.fromJson(Map json) = _$_ApiError.fromJson;
160 |
161 | @override
162 | int? get code => throw _privateConstructorUsedError;
163 | @override
164 | String get message => throw _privateConstructorUsedError;
165 | @override
166 | @JsonKey(ignore: true)
167 | _$ApiErrorCopyWith<_ApiError> get copyWith =>
168 | throw _privateConstructorUsedError;
169 | }
170 |
--------------------------------------------------------------------------------
/lib/network/base/api_error.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'api_error.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | _$_ApiError _$$_ApiErrorFromJson(Map json) => _$_ApiError(
10 | code: json['code'] as int?,
11 | message: json['message'] as String,
12 | );
13 |
14 | Map _$$_ApiErrorToJson(_$_ApiError instance) =>
15 | {
16 | 'code': instance.code,
17 | 'message': instance.message,
18 | };
19 |
--------------------------------------------------------------------------------
/lib/network/base/api_result.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:flutter_generic_api_response/network/base/api_error.dart';
3 |
4 | abstract class ApiResult {
5 | static const String _jsonNodeData = "data";
6 | static const String _jsonNodeErrors = "errors";
7 |
8 | static ApiResult fromResponse(
9 | Response response, T Function(Map) mapper) {
10 | final responseData = response.data;
11 |
12 | if (responseData[_jsonNodeErrors] != null) {
13 | return ServerError.fromResponse(response);
14 | } else if (responseData[_jsonNodeData] != null) {
15 | return Success(mapper(response.data[_jsonNodeData]));
16 | } else {
17 | return InternalError();
18 | }
19 | }
20 | }
21 |
22 | class Success extends ApiResult {
23 | final T data;
24 |
25 | Success(this.data);
26 | }
27 |
28 | class Failed extends ApiResult {
29 | List errors;
30 |
31 | Failed(this.errors);
32 | }
33 |
34 | class ServerError extends Failed {
35 | static const String _jsonNodeErrors = "errors";
36 |
37 | ServerError(List errors) : super(errors);
38 |
39 | static ServerError fromResponse(Response response) {
40 | return ServerError((response.data[_jsonNodeErrors] as List)
41 | .map((e) => ApiError.fromJson(e))
42 | .toList());
43 | }
44 | }
45 |
46 | class NetworkError extends Failed {
47 | NetworkError(List errors) : super(errors);
48 | }
49 |
50 | class InternalError extends Failed {
51 | InternalError() : super(List.empty());
52 | }
53 |
--------------------------------------------------------------------------------
/lib/network/base/safe_call.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:flutter_generic_api_response/network/base/api_error.dart';
3 | import 'package:flutter_generic_api_response/network/base/api_result.dart';
4 |
5 | extension DioExtensions on Dio {
6 | Future> safePost(String path,
7 | T Function(Map) mapper,
8 | {data,
9 | Map? queryParameters,
10 | Options? options,
11 | CancelToken? cancelToken,
12 | ProgressCallback? onSendProgress,
13 | ProgressCallback? onReceiveProgress}) async {
14 | try {
15 | final response = await post(path,
16 | data: data,
17 | queryParameters: queryParameters,
18 | options: options,
19 | cancelToken: cancelToken,
20 | onSendProgress: onSendProgress,
21 | onReceiveProgress: onReceiveProgress);
22 |
23 | return ApiResult.fromResponse(response, mapper);
24 | } on DioError catch (exception) {
25 | return NetworkError(
26 | List.filled(1, ApiError(
27 | code: exception.response?.statusCode,
28 | message: exception.message
29 | ), growable: false)
30 | );
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/network/services/user_services/model/login_request.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:freezed_annotation/freezed_annotation.dart';
3 |
4 | part 'login_request.freezed.dart';
5 |
6 | part 'login_request.g.dart';
7 |
8 | @freezed
9 | class LoginRequest with _$LoginRequest {
10 | const factory LoginRequest({
11 | required String username,
12 | required String password,
13 | }) = _LoginRequest;
14 |
15 | factory LoginRequest.fromJson(Map json) =>
16 | _$LoginRequestFromJson(json);
17 | }
18 |
--------------------------------------------------------------------------------
/lib/network/services/user_services/model/login_request.freezed.dart:
--------------------------------------------------------------------------------
1 | // coverage:ignore-file
2 | // GENERATED CODE - DO NOT MODIFY BY HAND
3 | // ignore_for_file: type=lint
4 | // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
5 |
6 | part of 'login_request.dart';
7 |
8 | // **************************************************************************
9 | // FreezedGenerator
10 | // **************************************************************************
11 |
12 | T _$identity(T value) => value;
13 |
14 | final _privateConstructorUsedError = UnsupportedError(
15 | 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
16 |
17 | LoginRequest _$LoginRequestFromJson(Map json) {
18 | return _LoginRequest.fromJson(json);
19 | }
20 |
21 | /// @nodoc
22 | mixin _$LoginRequest {
23 | String get username => throw _privateConstructorUsedError;
24 | String get password => throw _privateConstructorUsedError;
25 |
26 | Map toJson() => throw _privateConstructorUsedError;
27 | @JsonKey(ignore: true)
28 | $LoginRequestCopyWith get copyWith =>
29 | throw _privateConstructorUsedError;
30 | }
31 |
32 | /// @nodoc
33 | abstract class $LoginRequestCopyWith<$Res> {
34 | factory $LoginRequestCopyWith(
35 | LoginRequest value, $Res Function(LoginRequest) then) =
36 | _$LoginRequestCopyWithImpl<$Res>;
37 | $Res call({String username, String password});
38 | }
39 |
40 | /// @nodoc
41 | class _$LoginRequestCopyWithImpl<$Res> implements $LoginRequestCopyWith<$Res> {
42 | _$LoginRequestCopyWithImpl(this._value, this._then);
43 |
44 | final LoginRequest _value;
45 | // ignore: unused_field
46 | final $Res Function(LoginRequest) _then;
47 |
48 | @override
49 | $Res call({
50 | Object? username = freezed,
51 | Object? password = freezed,
52 | }) {
53 | return _then(_value.copyWith(
54 | username: username == freezed
55 | ? _value.username
56 | : username // ignore: cast_nullable_to_non_nullable
57 | as String,
58 | password: password == freezed
59 | ? _value.password
60 | : password // ignore: cast_nullable_to_non_nullable
61 | as String,
62 | ));
63 | }
64 | }
65 |
66 | /// @nodoc
67 | abstract class _$LoginRequestCopyWith<$Res>
68 | implements $LoginRequestCopyWith<$Res> {
69 | factory _$LoginRequestCopyWith(
70 | _LoginRequest value, $Res Function(_LoginRequest) then) =
71 | __$LoginRequestCopyWithImpl<$Res>;
72 | @override
73 | $Res call({String username, String password});
74 | }
75 |
76 | /// @nodoc
77 | class __$LoginRequestCopyWithImpl<$Res> extends _$LoginRequestCopyWithImpl<$Res>
78 | implements _$LoginRequestCopyWith<$Res> {
79 | __$LoginRequestCopyWithImpl(
80 | _LoginRequest _value, $Res Function(_LoginRequest) _then)
81 | : super(_value, (v) => _then(v as _LoginRequest));
82 |
83 | @override
84 | _LoginRequest get _value => super._value as _LoginRequest;
85 |
86 | @override
87 | $Res call({
88 | Object? username = freezed,
89 | Object? password = freezed,
90 | }) {
91 | return _then(_LoginRequest(
92 | username: username == freezed
93 | ? _value.username
94 | : username // ignore: cast_nullable_to_non_nullable
95 | as String,
96 | password: password == freezed
97 | ? _value.password
98 | : password // ignore: cast_nullable_to_non_nullable
99 | as String,
100 | ));
101 | }
102 | }
103 |
104 | /// @nodoc
105 | @JsonSerializable()
106 | class _$_LoginRequest with DiagnosticableTreeMixin implements _LoginRequest {
107 | const _$_LoginRequest({required this.username, required this.password});
108 |
109 | factory _$_LoginRequest.fromJson(Map json) =>
110 | _$$_LoginRequestFromJson(json);
111 |
112 | @override
113 | final String username;
114 | @override
115 | final String password;
116 |
117 | @override
118 | String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
119 | return 'LoginRequest(username: $username, password: $password)';
120 | }
121 |
122 | @override
123 | void debugFillProperties(DiagnosticPropertiesBuilder properties) {
124 | super.debugFillProperties(properties);
125 | properties
126 | ..add(DiagnosticsProperty('type', 'LoginRequest'))
127 | ..add(DiagnosticsProperty('username', username))
128 | ..add(DiagnosticsProperty('password', password));
129 | }
130 |
131 | @override
132 | bool operator ==(dynamic other) {
133 | return identical(this, other) ||
134 | (other.runtimeType == runtimeType &&
135 | other is _LoginRequest &&
136 | const DeepCollectionEquality().equals(other.username, username) &&
137 | const DeepCollectionEquality().equals(other.password, password));
138 | }
139 |
140 | @JsonKey(ignore: true)
141 | @override
142 | int get hashCode => Object.hash(
143 | runtimeType,
144 | const DeepCollectionEquality().hash(username),
145 | const DeepCollectionEquality().hash(password));
146 |
147 | @JsonKey(ignore: true)
148 | @override
149 | _$LoginRequestCopyWith<_LoginRequest> get copyWith =>
150 | __$LoginRequestCopyWithImpl<_LoginRequest>(this, _$identity);
151 |
152 | @override
153 | Map toJson() {
154 | return _$$_LoginRequestToJson(this);
155 | }
156 | }
157 |
158 | abstract class _LoginRequest implements LoginRequest {
159 | const factory _LoginRequest(
160 | {required final String username,
161 | required final String password}) = _$_LoginRequest;
162 |
163 | factory _LoginRequest.fromJson(Map json) =
164 | _$_LoginRequest.fromJson;
165 |
166 | @override
167 | String get username => throw _privateConstructorUsedError;
168 | @override
169 | String get password => throw _privateConstructorUsedError;
170 | @override
171 | @JsonKey(ignore: true)
172 | _$LoginRequestCopyWith<_LoginRequest> get copyWith =>
173 | throw _privateConstructorUsedError;
174 | }
175 |
--------------------------------------------------------------------------------
/lib/network/services/user_services/model/login_request.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'login_request.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | _$_LoginRequest _$$_LoginRequestFromJson(Map json) =>
10 | _$_LoginRequest(
11 | username: json['username'] as String,
12 | password: json['password'] as String,
13 | );
14 |
15 | Map _$$_LoginRequestToJson(_$_LoginRequest instance) =>
16 | {
17 | 'username': instance.username,
18 | 'password': instance.password,
19 | };
20 |
--------------------------------------------------------------------------------
/lib/network/services/user_services/model/login_response.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter_generic_api_response/model/user_entity.dart';
3 | import 'package:freezed_annotation/freezed_annotation.dart';
4 |
5 | part 'login_response.freezed.dart';
6 |
7 | part 'login_response.g.dart';
8 |
9 | @freezed
10 | class LoginResponse with _$LoginResponse {
11 | const factory LoginResponse({
12 | required UserEntity user,
13 | required String accessToken,
14 | }) = _LoginResponse;
15 |
16 |
17 |
18 | factory LoginResponse.fromJson(Map json) =>
19 | _$LoginResponseFromJson(json);
20 | }
--------------------------------------------------------------------------------
/lib/network/services/user_services/model/login_response.freezed.dart:
--------------------------------------------------------------------------------
1 | // coverage:ignore-file
2 | // GENERATED CODE - DO NOT MODIFY BY HAND
3 | // ignore_for_file: type=lint
4 | // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
5 |
6 | part of 'login_response.dart';
7 |
8 | // **************************************************************************
9 | // FreezedGenerator
10 | // **************************************************************************
11 |
12 | T _$identity(T value) => value;
13 |
14 | final _privateConstructorUsedError = UnsupportedError(
15 | 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
16 |
17 | LoginResponse _$LoginResponseFromJson(Map json) {
18 | return _LoginResponse.fromJson(json);
19 | }
20 |
21 | /// @nodoc
22 | mixin _$LoginResponse {
23 | UserEntity get user => throw _privateConstructorUsedError;
24 | String get accessToken => throw _privateConstructorUsedError;
25 |
26 | Map toJson() => throw _privateConstructorUsedError;
27 | @JsonKey(ignore: true)
28 | $LoginResponseCopyWith get copyWith =>
29 | throw _privateConstructorUsedError;
30 | }
31 |
32 | /// @nodoc
33 | abstract class $LoginResponseCopyWith<$Res> {
34 | factory $LoginResponseCopyWith(
35 | LoginResponse value, $Res Function(LoginResponse) then) =
36 | _$LoginResponseCopyWithImpl<$Res>;
37 | $Res call({UserEntity user, String accessToken});
38 |
39 | $UserEntityCopyWith<$Res> get user;
40 | }
41 |
42 | /// @nodoc
43 | class _$LoginResponseCopyWithImpl<$Res>
44 | implements $LoginResponseCopyWith<$Res> {
45 | _$LoginResponseCopyWithImpl(this._value, this._then);
46 |
47 | final LoginResponse _value;
48 | // ignore: unused_field
49 | final $Res Function(LoginResponse) _then;
50 |
51 | @override
52 | $Res call({
53 | Object? user = freezed,
54 | Object? accessToken = freezed,
55 | }) {
56 | return _then(_value.copyWith(
57 | user: user == freezed
58 | ? _value.user
59 | : user // ignore: cast_nullable_to_non_nullable
60 | as UserEntity,
61 | accessToken: accessToken == freezed
62 | ? _value.accessToken
63 | : accessToken // ignore: cast_nullable_to_non_nullable
64 | as String,
65 | ));
66 | }
67 |
68 | @override
69 | $UserEntityCopyWith<$Res> get user {
70 | return $UserEntityCopyWith<$Res>(_value.user, (value) {
71 | return _then(_value.copyWith(user: value));
72 | });
73 | }
74 | }
75 |
76 | /// @nodoc
77 | abstract class _$LoginResponseCopyWith<$Res>
78 | implements $LoginResponseCopyWith<$Res> {
79 | factory _$LoginResponseCopyWith(
80 | _LoginResponse value, $Res Function(_LoginResponse) then) =
81 | __$LoginResponseCopyWithImpl<$Res>;
82 | @override
83 | $Res call({UserEntity user, String accessToken});
84 |
85 | @override
86 | $UserEntityCopyWith<$Res> get user;
87 | }
88 |
89 | /// @nodoc
90 | class __$LoginResponseCopyWithImpl<$Res>
91 | extends _$LoginResponseCopyWithImpl<$Res>
92 | implements _$LoginResponseCopyWith<$Res> {
93 | __$LoginResponseCopyWithImpl(
94 | _LoginResponse _value, $Res Function(_LoginResponse) _then)
95 | : super(_value, (v) => _then(v as _LoginResponse));
96 |
97 | @override
98 | _LoginResponse get _value => super._value as _LoginResponse;
99 |
100 | @override
101 | $Res call({
102 | Object? user = freezed,
103 | Object? accessToken = freezed,
104 | }) {
105 | return _then(_LoginResponse(
106 | user: user == freezed
107 | ? _value.user
108 | : user // ignore: cast_nullable_to_non_nullable
109 | as UserEntity,
110 | accessToken: accessToken == freezed
111 | ? _value.accessToken
112 | : accessToken // ignore: cast_nullable_to_non_nullable
113 | as String,
114 | ));
115 | }
116 | }
117 |
118 | /// @nodoc
119 | @JsonSerializable()
120 | class _$_LoginResponse with DiagnosticableTreeMixin implements _LoginResponse {
121 | const _$_LoginResponse({required this.user, required this.accessToken});
122 |
123 | factory _$_LoginResponse.fromJson(Map json) =>
124 | _$$_LoginResponseFromJson(json);
125 |
126 | @override
127 | final UserEntity user;
128 | @override
129 | final String accessToken;
130 |
131 | @override
132 | String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
133 | return 'LoginResponse(user: $user, accessToken: $accessToken)';
134 | }
135 |
136 | @override
137 | void debugFillProperties(DiagnosticPropertiesBuilder properties) {
138 | super.debugFillProperties(properties);
139 | properties
140 | ..add(DiagnosticsProperty('type', 'LoginResponse'))
141 | ..add(DiagnosticsProperty('user', user))
142 | ..add(DiagnosticsProperty('accessToken', accessToken));
143 | }
144 |
145 | @override
146 | bool operator ==(dynamic other) {
147 | return identical(this, other) ||
148 | (other.runtimeType == runtimeType &&
149 | other is _LoginResponse &&
150 | const DeepCollectionEquality().equals(other.user, user) &&
151 | const DeepCollectionEquality()
152 | .equals(other.accessToken, accessToken));
153 | }
154 |
155 | @JsonKey(ignore: true)
156 | @override
157 | int get hashCode => Object.hash(
158 | runtimeType,
159 | const DeepCollectionEquality().hash(user),
160 | const DeepCollectionEquality().hash(accessToken));
161 |
162 | @JsonKey(ignore: true)
163 | @override
164 | _$LoginResponseCopyWith<_LoginResponse> get copyWith =>
165 | __$LoginResponseCopyWithImpl<_LoginResponse>(this, _$identity);
166 |
167 | @override
168 | Map toJson() {
169 | return _$$_LoginResponseToJson(this);
170 | }
171 | }
172 |
173 | abstract class _LoginResponse implements LoginResponse {
174 | const factory _LoginResponse(
175 | {required final UserEntity user,
176 | required final String accessToken}) = _$_LoginResponse;
177 |
178 | factory _LoginResponse.fromJson(Map json) =
179 | _$_LoginResponse.fromJson;
180 |
181 | @override
182 | UserEntity get user => throw _privateConstructorUsedError;
183 | @override
184 | String get accessToken => throw _privateConstructorUsedError;
185 | @override
186 | @JsonKey(ignore: true)
187 | _$LoginResponseCopyWith<_LoginResponse> get copyWith =>
188 | throw _privateConstructorUsedError;
189 | }
190 |
--------------------------------------------------------------------------------
/lib/network/services/user_services/model/login_response.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'login_response.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | _$_LoginResponse _$$_LoginResponseFromJson(Map json) =>
10 | _$_LoginResponse(
11 | user: UserEntity.fromJson(json['user'] as Map),
12 | accessToken: json['accessToken'] as String,
13 | );
14 |
15 | Map _$$_LoginResponseToJson(_$_LoginResponse instance) =>
16 | {
17 | 'user': instance.user,
18 | 'accessToken': instance.accessToken,
19 | };
20 |
--------------------------------------------------------------------------------
/lib/network/services/user_services/user_services.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:flutter_generic_api_response/network/base/safe_call.dart';
3 | import 'package:flutter_generic_api_response/network/services/user_services/model/login_request.dart';
4 | import 'package:flutter_generic_api_response/network/services/user_services/model/login_response.dart';
5 |
6 | import '../../base/api_result.dart';
7 |
8 | class UserServices {
9 | final Dio _dio;
10 |
11 | UserServices(this._dio);
12 |
13 | Future> login(LoginRequest request) async {
14 | return await _dio.safePost(
15 | "https://gokberkyagci.com/flutterapp/api/login.php",
16 | LoginResponse.fromJson,
17 | data: request.toJson());
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/ui/page/login/login_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import 'package:flutter_generic_api_response/extensions/safe_call_extensions.dart';
4 | import 'package:flutter_generic_api_response/network/api_client.dart';
5 | import 'package:flutter_generic_api_response/ui/page/login/login_page_bloc.dart';
6 |
7 | class LoginPage extends StatefulWidget {
8 | const LoginPage({Key? key}) : super(key: key);
9 |
10 | @override
11 | State createState() => _LoginPageState();
12 | }
13 |
14 | class _LoginPageState extends State {
15 | late TextEditingController _userNameController;
16 | late TextEditingController _passwordController;
17 |
18 | @override
19 | void initState() {
20 | super.initState();
21 | _userNameController = TextEditingController();
22 | _passwordController = TextEditingController();
23 | }
24 |
25 | @override
26 | Widget build(BuildContext context) {
27 | final bloc = LoginPageBloc(context.read().userServices);
28 |
29 | const margin = 16.0;
30 |
31 | return BlocProvider(
32 | create: (_) => bloc,
33 | child: Scaffold(
34 | body: SafeArea(
35 | child: BlocBuilder(
36 | builder: (context, state) {
37 | return IgnorePointer(
38 | ignoring: state.isLoading,
39 | child: Padding(
40 | padding: const EdgeInsets.all(margin),
41 | child: Column(
42 | mainAxisSize: MainAxisSize.max,
43 | mainAxisAlignment: MainAxisAlignment.center,
44 | children: [
45 | TextField(
46 | controller: _userNameController,
47 | decoration: const InputDecoration(
48 | hintText: 'Username',
49 | ),
50 | ),
51 | const SizedBox(
52 | height: margin,
53 | ),
54 | TextField(
55 | controller: _passwordController,
56 | decoration: const InputDecoration(
57 | hintText: 'Password',
58 | ),
59 | obscureText: true,
60 | enableSuggestions: false,
61 | autocorrect: false,
62 | ),
63 | const SizedBox(
64 | height: margin,
65 | ),
66 | MaterialButton(
67 | color: Colors.blue,
68 | child: const Text("Login"),
69 | onPressed: () {
70 | bloc.add(LoginPageLoginAttempted(
71 | _userNameController.text,
72 | _passwordController.text));
73 | }),
74 | const SizedBox(
75 | height: margin,
76 | ),
77 | if (bloc.state.status != null)
78 | Text(
79 | "Status\n${bloc.state.status?.getOrEmpty()}",
80 | textAlign: TextAlign.center,
81 | ),
82 | ],
83 | ),
84 | ),
85 | );
86 | },
87 | ),
88 | ),
89 | ),
90 | );
91 | }
92 |
93 | @override
94 | void dispose() {
95 | super.dispose();
96 | _userNameController.dispose();
97 | _passwordController.dispose();
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/lib/ui/page/login/login_page_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import 'package:flutter_generic_api_response/extensions/safe_call_extensions.dart';
4 | import 'package:flutter_generic_api_response/network/base/api_result.dart';
5 | import 'package:flutter_generic_api_response/network/services/user_services/model/login_request.dart';
6 | import 'package:flutter_generic_api_response/network/services/user_services/model/login_response.dart';
7 | import 'package:flutter_generic_api_response/network/services/user_services/user_services.dart';
8 |
9 | abstract class LoginPageEvent {}
10 |
11 | class LoginPageState {
12 | final bool isLoading;
13 | final String? status;
14 |
15 | LoginPageState({this.isLoading = false, this.status});
16 | }
17 |
18 | class LoginPageLoginAttempted extends LoginPageEvent {
19 | final String username;
20 | final String password;
21 |
22 | LoginPageLoginAttempted(this.username, this.password);
23 | }
24 |
25 | class LoginPageBloc extends Bloc {
26 | final UserServices userServices;
27 |
28 | LoginPageBloc(this.userServices) : super(LoginPageState()) {
29 | on((event, emit) async {
30 | emit(LoginPageState(isLoading: true));
31 | final result = await userServices.login(
32 | LoginRequest(username: event.username, password: event.password));
33 |
34 | if (result is Success) {
35 | emit(LoginPageState(
36 | isLoading: false, status: "Welcome ${result.data.user.name}"));
37 | } else {
38 | final errorMessage =
39 | result.asOrNull()?.errors.firstOrNull()?.message ??
40 | "Something went wrong";
41 | emit(LoginPageState(isLoading: false, status: errorMessage));
42 | }
43 | });
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | _fe_analyzer_shared:
5 | dependency: transitive
6 | description:
7 | name: _fe_analyzer_shared
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "39.0.0"
11 | analyzer:
12 | dependency: transitive
13 | description:
14 | name: analyzer
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "4.0.0"
18 | args:
19 | dependency: transitive
20 | description:
21 | name: args
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.3.0"
25 | async:
26 | dependency: transitive
27 | description:
28 | name: async
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "2.8.2"
32 | bloc:
33 | dependency: transitive
34 | description:
35 | name: bloc
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "8.0.3"
39 | boolean_selector:
40 | dependency: transitive
41 | description:
42 | name: boolean_selector
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "2.1.0"
46 | build:
47 | dependency: transitive
48 | description:
49 | name: build
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "2.3.0"
53 | build_config:
54 | dependency: transitive
55 | description:
56 | name: build_config
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.0.0"
60 | build_daemon:
61 | dependency: transitive
62 | description:
63 | name: build_daemon
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "3.1.0"
67 | build_resolvers:
68 | dependency: transitive
69 | description:
70 | name: build_resolvers
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "2.0.8"
74 | build_runner:
75 | dependency: "direct dev"
76 | description:
77 | name: build_runner
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "2.1.10"
81 | build_runner_core:
82 | dependency: transitive
83 | description:
84 | name: build_runner_core
85 | url: "https://pub.dartlang.org"
86 | source: hosted
87 | version: "7.2.3"
88 | built_collection:
89 | dependency: transitive
90 | description:
91 | name: built_collection
92 | url: "https://pub.dartlang.org"
93 | source: hosted
94 | version: "5.1.1"
95 | built_value:
96 | dependency: transitive
97 | description:
98 | name: built_value
99 | url: "https://pub.dartlang.org"
100 | source: hosted
101 | version: "8.2.0"
102 | characters:
103 | dependency: transitive
104 | description:
105 | name: characters
106 | url: "https://pub.dartlang.org"
107 | source: hosted
108 | version: "1.2.0"
109 | charcode:
110 | dependency: transitive
111 | description:
112 | name: charcode
113 | url: "https://pub.dartlang.org"
114 | source: hosted
115 | version: "1.3.1"
116 | checked_yaml:
117 | dependency: transitive
118 | description:
119 | name: checked_yaml
120 | url: "https://pub.dartlang.org"
121 | source: hosted
122 | version: "2.0.1"
123 | clock:
124 | dependency: transitive
125 | description:
126 | name: clock
127 | url: "https://pub.dartlang.org"
128 | source: hosted
129 | version: "1.1.0"
130 | code_builder:
131 | dependency: transitive
132 | description:
133 | name: code_builder
134 | url: "https://pub.dartlang.org"
135 | source: hosted
136 | version: "4.1.0"
137 | collection:
138 | dependency: transitive
139 | description:
140 | name: collection
141 | url: "https://pub.dartlang.org"
142 | source: hosted
143 | version: "1.15.0"
144 | convert:
145 | dependency: transitive
146 | description:
147 | name: convert
148 | url: "https://pub.dartlang.org"
149 | source: hosted
150 | version: "3.0.1"
151 | crypto:
152 | dependency: transitive
153 | description:
154 | name: crypto
155 | url: "https://pub.dartlang.org"
156 | source: hosted
157 | version: "3.0.1"
158 | dart_style:
159 | dependency: transitive
160 | description:
161 | name: dart_style
162 | url: "https://pub.dartlang.org"
163 | source: hosted
164 | version: "2.2.3"
165 | dio:
166 | dependency: "direct main"
167 | description:
168 | name: dio
169 | url: "https://pub.dartlang.org"
170 | source: hosted
171 | version: "4.0.6"
172 | fake_async:
173 | dependency: transitive
174 | description:
175 | name: fake_async
176 | url: "https://pub.dartlang.org"
177 | source: hosted
178 | version: "1.2.0"
179 | file:
180 | dependency: transitive
181 | description:
182 | name: file
183 | url: "https://pub.dartlang.org"
184 | source: hosted
185 | version: "6.1.2"
186 | fixnum:
187 | dependency: transitive
188 | description:
189 | name: fixnum
190 | url: "https://pub.dartlang.org"
191 | source: hosted
192 | version: "1.0.0"
193 | flutter:
194 | dependency: "direct main"
195 | description: flutter
196 | source: sdk
197 | version: "0.0.0"
198 | flutter_bloc:
199 | dependency: "direct main"
200 | description:
201 | name: flutter_bloc
202 | url: "https://pub.dartlang.org"
203 | source: hosted
204 | version: "8.0.1"
205 | flutter_lints:
206 | dependency: "direct dev"
207 | description:
208 | name: flutter_lints
209 | url: "https://pub.dartlang.org"
210 | source: hosted
211 | version: "1.0.4"
212 | flutter_test:
213 | dependency: "direct dev"
214 | description: flutter
215 | source: sdk
216 | version: "0.0.0"
217 | freezed:
218 | dependency: "direct main"
219 | description:
220 | name: freezed
221 | url: "https://pub.dartlang.org"
222 | source: hosted
223 | version: "2.0.2"
224 | freezed_annotation:
225 | dependency: "direct main"
226 | description:
227 | name: freezed_annotation
228 | url: "https://pub.dartlang.org"
229 | source: hosted
230 | version: "2.0.1"
231 | frontend_server_client:
232 | dependency: transitive
233 | description:
234 | name: frontend_server_client
235 | url: "https://pub.dartlang.org"
236 | source: hosted
237 | version: "2.1.2"
238 | glob:
239 | dependency: transitive
240 | description:
241 | name: glob
242 | url: "https://pub.dartlang.org"
243 | source: hosted
244 | version: "2.0.2"
245 | graphs:
246 | dependency: transitive
247 | description:
248 | name: graphs
249 | url: "https://pub.dartlang.org"
250 | source: hosted
251 | version: "2.1.0"
252 | http_multi_server:
253 | dependency: transitive
254 | description:
255 | name: http_multi_server
256 | url: "https://pub.dartlang.org"
257 | source: hosted
258 | version: "3.2.0"
259 | http_parser:
260 | dependency: transitive
261 | description:
262 | name: http_parser
263 | url: "https://pub.dartlang.org"
264 | source: hosted
265 | version: "4.0.0"
266 | io:
267 | dependency: transitive
268 | description:
269 | name: io
270 | url: "https://pub.dartlang.org"
271 | source: hosted
272 | version: "1.0.3"
273 | js:
274 | dependency: transitive
275 | description:
276 | name: js
277 | url: "https://pub.dartlang.org"
278 | source: hosted
279 | version: "0.6.4"
280 | json_annotation:
281 | dependency: transitive
282 | description:
283 | name: json_annotation
284 | url: "https://pub.dartlang.org"
285 | source: hosted
286 | version: "4.4.0"
287 | json_serializable:
288 | dependency: "direct main"
289 | description:
290 | name: json_serializable
291 | url: "https://pub.dartlang.org"
292 | source: hosted
293 | version: "6.1.6"
294 | lints:
295 | dependency: transitive
296 | description:
297 | name: lints
298 | url: "https://pub.dartlang.org"
299 | source: hosted
300 | version: "1.0.1"
301 | logging:
302 | dependency: transitive
303 | description:
304 | name: logging
305 | url: "https://pub.dartlang.org"
306 | source: hosted
307 | version: "1.0.2"
308 | matcher:
309 | dependency: transitive
310 | description:
311 | name: matcher
312 | url: "https://pub.dartlang.org"
313 | source: hosted
314 | version: "0.12.11"
315 | material_color_utilities:
316 | dependency: transitive
317 | description:
318 | name: material_color_utilities
319 | url: "https://pub.dartlang.org"
320 | source: hosted
321 | version: "0.1.3"
322 | meta:
323 | dependency: transitive
324 | description:
325 | name: meta
326 | url: "https://pub.dartlang.org"
327 | source: hosted
328 | version: "1.7.0"
329 | mime:
330 | dependency: transitive
331 | description:
332 | name: mime
333 | url: "https://pub.dartlang.org"
334 | source: hosted
335 | version: "1.0.1"
336 | nested:
337 | dependency: transitive
338 | description:
339 | name: nested
340 | url: "https://pub.dartlang.org"
341 | source: hosted
342 | version: "1.0.0"
343 | package_config:
344 | dependency: transitive
345 | description:
346 | name: package_config
347 | url: "https://pub.dartlang.org"
348 | source: hosted
349 | version: "2.0.2"
350 | path:
351 | dependency: transitive
352 | description:
353 | name: path
354 | url: "https://pub.dartlang.org"
355 | source: hosted
356 | version: "1.8.0"
357 | pool:
358 | dependency: transitive
359 | description:
360 | name: pool
361 | url: "https://pub.dartlang.org"
362 | source: hosted
363 | version: "1.5.0"
364 | pretty_dio_logger:
365 | dependency: "direct main"
366 | description:
367 | name: pretty_dio_logger
368 | url: "https://pub.dartlang.org"
369 | source: hosted
370 | version: "1.2.0-beta-1"
371 | provider:
372 | dependency: transitive
373 | description:
374 | name: provider
375 | url: "https://pub.dartlang.org"
376 | source: hosted
377 | version: "6.0.2"
378 | pub_semver:
379 | dependency: transitive
380 | description:
381 | name: pub_semver
382 | url: "https://pub.dartlang.org"
383 | source: hosted
384 | version: "2.1.1"
385 | pubspec_parse:
386 | dependency: transitive
387 | description:
388 | name: pubspec_parse
389 | url: "https://pub.dartlang.org"
390 | source: hosted
391 | version: "1.2.0"
392 | shelf:
393 | dependency: transitive
394 | description:
395 | name: shelf
396 | url: "https://pub.dartlang.org"
397 | source: hosted
398 | version: "1.3.0"
399 | shelf_web_socket:
400 | dependency: transitive
401 | description:
402 | name: shelf_web_socket
403 | url: "https://pub.dartlang.org"
404 | source: hosted
405 | version: "1.0.1"
406 | sky_engine:
407 | dependency: transitive
408 | description: flutter
409 | source: sdk
410 | version: "0.0.99"
411 | source_gen:
412 | dependency: transitive
413 | description:
414 | name: source_gen
415 | url: "https://pub.dartlang.org"
416 | source: hosted
417 | version: "1.2.2"
418 | source_helper:
419 | dependency: transitive
420 | description:
421 | name: source_helper
422 | url: "https://pub.dartlang.org"
423 | source: hosted
424 | version: "1.3.2"
425 | source_span:
426 | dependency: transitive
427 | description:
428 | name: source_span
429 | url: "https://pub.dartlang.org"
430 | source: hosted
431 | version: "1.8.1"
432 | stack_trace:
433 | dependency: transitive
434 | description:
435 | name: stack_trace
436 | url: "https://pub.dartlang.org"
437 | source: hosted
438 | version: "1.10.0"
439 | stream_channel:
440 | dependency: transitive
441 | description:
442 | name: stream_channel
443 | url: "https://pub.dartlang.org"
444 | source: hosted
445 | version: "2.1.0"
446 | stream_transform:
447 | dependency: transitive
448 | description:
449 | name: stream_transform
450 | url: "https://pub.dartlang.org"
451 | source: hosted
452 | version: "2.0.0"
453 | string_scanner:
454 | dependency: transitive
455 | description:
456 | name: string_scanner
457 | url: "https://pub.dartlang.org"
458 | source: hosted
459 | version: "1.1.0"
460 | term_glyph:
461 | dependency: transitive
462 | description:
463 | name: term_glyph
464 | url: "https://pub.dartlang.org"
465 | source: hosted
466 | version: "1.2.0"
467 | test_api:
468 | dependency: transitive
469 | description:
470 | name: test_api
471 | url: "https://pub.dartlang.org"
472 | source: hosted
473 | version: "0.4.8"
474 | timing:
475 | dependency: transitive
476 | description:
477 | name: timing
478 | url: "https://pub.dartlang.org"
479 | source: hosted
480 | version: "1.0.0"
481 | typed_data:
482 | dependency: transitive
483 | description:
484 | name: typed_data
485 | url: "https://pub.dartlang.org"
486 | source: hosted
487 | version: "1.3.0"
488 | vector_math:
489 | dependency: transitive
490 | description:
491 | name: vector_math
492 | url: "https://pub.dartlang.org"
493 | source: hosted
494 | version: "2.1.1"
495 | watcher:
496 | dependency: transitive
497 | description:
498 | name: watcher
499 | url: "https://pub.dartlang.org"
500 | source: hosted
501 | version: "1.0.1"
502 | web_socket_channel:
503 | dependency: transitive
504 | description:
505 | name: web_socket_channel
506 | url: "https://pub.dartlang.org"
507 | source: hosted
508 | version: "2.1.0"
509 | yaml:
510 | dependency: transitive
511 | description:
512 | name: yaml
513 | url: "https://pub.dartlang.org"
514 | source: hosted
515 | version: "3.1.0"
516 | sdks:
517 | dart: ">=2.16.2 <3.0.0"
518 | flutter: ">=1.16.0"
519 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_generic_api_response
2 | description: This project has been built that has been proof of building Generic Api Response with freeze plugin.
3 |
4 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
5 |
6 | version: 1.0.0+1
7 |
8 | environment:
9 | sdk: ">=2.16.2 <3.0.0"
10 |
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 | flutter_bloc: ^8.0.1
16 | dio: ^4.0.6
17 | pretty_dio_logger: ^1.2.0-beta-1
18 | freezed_annotation: ^2.0.1
19 | json_serializable: ^6.1.6
20 | freezed: ^2.0.2
21 |
22 | dev_dependencies:
23 | flutter_test:
24 | sdk: flutter
25 |
26 | flutter_lints: ^1.0.0
27 | build_runner: ^2.1.10
28 |
29 | flutter:
30 | uses-material-design: true
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:flutter_generic_api_response/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 |
--------------------------------------------------------------------------------