├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── djamware
│ │ │ │ └── flutter_restapi
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── 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
│ └── main.m
├── lib
├── adddatawidget.dart
├── caseslist.dart
├── detailwidget.dart
├── editdatawidget.dart
├── main.dart
├── models
│ └── cases.dart
└── services
│ └── api_service.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 | # Exceptions to above rules.
44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
45 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 840c9205b344a59e48a5926ee2d791cc5640924c
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Didin Jamaludin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flutter Tutorial: Consume CRUD REST API Android and iOS Apps
2 |
3 | This source code is part of [Flutter Tutorial: Consume CRUD REST API Android and iOS Apps](https://www.djamware.com/post/5f308ef7185c336b811b362a/flutter-tutorial-consume-crud-rest-api-android-and-ios-apps).
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 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/android/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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 28
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | defaultConfig {
35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36 | applicationId "com.djamware.flutter_restapi"
37 | minSdkVersion 16
38 | targetSdkVersion 28
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | }
42 |
43 | buildTypes {
44 | release {
45 | // TODO: Add your own signing config for the release build.
46 | // Signing with the debug keys for now, so `flutter run --release` works.
47 | signingConfig signingConfigs.debug
48 | }
49 | }
50 | }
51 |
52 | flutter {
53 | source '../..'
54 | }
55 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/djamware/flutter_restapi/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.djamware.flutter_restapi;
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 |
5 | public class MainActivity extends FlutterActivity {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.5.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | 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 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
13 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXCopyFilesBuildPhase section */
20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
21 | isa = PBXCopyFilesBuildPhase;
22 | buildActionMask = 2147483647;
23 | dstPath = "";
24 | dstSubfolderSpec = 10;
25 | files = (
26 | );
27 | name = "Embed Frameworks";
28 | runOnlyForDeploymentPostprocessing = 0;
29 | };
30 | /* End PBXCopyFilesBuildPhase section */
31 |
32 | /* Begin PBXFileReference section */
33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
36 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
37 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
38 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
39 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
40 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
41 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
43 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
44 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
45 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
46 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
47 | /* End PBXFileReference section */
48 |
49 | /* Begin PBXFrameworksBuildPhase section */
50 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
51 | isa = PBXFrameworksBuildPhase;
52 | buildActionMask = 2147483647;
53 | files = (
54 | );
55 | runOnlyForDeploymentPostprocessing = 0;
56 | };
57 | /* End PBXFrameworksBuildPhase section */
58 |
59 | /* Begin PBXGroup section */
60 | 9740EEB11CF90186004384FC /* Flutter */ = {
61 | isa = PBXGroup;
62 | children = (
63 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
64 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
65 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
66 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
67 | );
68 | name = Flutter;
69 | sourceTree = "";
70 | };
71 | 97C146E51CF9000F007C117D = {
72 | isa = PBXGroup;
73 | children = (
74 | 9740EEB11CF90186004384FC /* Flutter */,
75 | 97C146F01CF9000F007C117D /* Runner */,
76 | 97C146EF1CF9000F007C117D /* Products */,
77 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
78 | );
79 | sourceTree = "";
80 | };
81 | 97C146EF1CF9000F007C117D /* Products */ = {
82 | isa = PBXGroup;
83 | children = (
84 | 97C146EE1CF9000F007C117D /* Runner.app */,
85 | );
86 | name = Products;
87 | sourceTree = "";
88 | };
89 | 97C146F01CF9000F007C117D /* Runner */ = {
90 | isa = PBXGroup;
91 | children = (
92 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
93 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
94 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
95 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
96 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97 | 97C147021CF9000F007C117D /* Info.plist */,
98 | 97C146F11CF9000F007C117D /* Supporting Files */,
99 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
100 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
101 | );
102 | path = Runner;
103 | sourceTree = "";
104 | };
105 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
106 | isa = PBXGroup;
107 | children = (
108 | 97C146F21CF9000F007C117D /* main.m */,
109 | );
110 | name = "Supporting Files";
111 | sourceTree = "";
112 | };
113 | /* End PBXGroup section */
114 |
115 | /* Begin PBXNativeTarget section */
116 | 97C146ED1CF9000F007C117D /* Runner */ = {
117 | isa = PBXNativeTarget;
118 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
119 | buildPhases = (
120 | 9740EEB61CF901F6004384FC /* Run Script */,
121 | 97C146EA1CF9000F007C117D /* Sources */,
122 | 97C146EB1CF9000F007C117D /* Frameworks */,
123 | 97C146EC1CF9000F007C117D /* Resources */,
124 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
125 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
126 | );
127 | buildRules = (
128 | );
129 | dependencies = (
130 | );
131 | name = Runner;
132 | productName = Runner;
133 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
134 | productType = "com.apple.product-type.application";
135 | };
136 | /* End PBXNativeTarget section */
137 |
138 | /* Begin PBXProject section */
139 | 97C146E61CF9000F007C117D /* Project object */ = {
140 | isa = PBXProject;
141 | attributes = {
142 | LastUpgradeCheck = 1020;
143 | ORGANIZATIONNAME = "";
144 | TargetAttributes = {
145 | 97C146ED1CF9000F007C117D = {
146 | CreatedOnToolsVersion = 7.3.1;
147 | };
148 | };
149 | };
150 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
151 | compatibilityVersion = "Xcode 9.3";
152 | developmentRegion = en;
153 | hasScannedForEncodings = 0;
154 | knownRegions = (
155 | en,
156 | Base,
157 | );
158 | mainGroup = 97C146E51CF9000F007C117D;
159 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
160 | projectDirPath = "";
161 | projectRoot = "";
162 | targets = (
163 | 97C146ED1CF9000F007C117D /* Runner */,
164 | );
165 | };
166 | /* End PBXProject section */
167 |
168 | /* Begin PBXResourcesBuildPhase section */
169 | 97C146EC1CF9000F007C117D /* Resources */ = {
170 | isa = PBXResourcesBuildPhase;
171 | buildActionMask = 2147483647;
172 | files = (
173 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
174 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
175 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
176 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
177 | );
178 | runOnlyForDeploymentPostprocessing = 0;
179 | };
180 | /* End PBXResourcesBuildPhase section */
181 |
182 | /* Begin PBXShellScriptBuildPhase section */
183 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
184 | isa = PBXShellScriptBuildPhase;
185 | buildActionMask = 2147483647;
186 | files = (
187 | );
188 | inputPaths = (
189 | );
190 | name = "Thin Binary";
191 | outputPaths = (
192 | );
193 | runOnlyForDeploymentPostprocessing = 0;
194 | shellPath = /bin/sh;
195 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
196 | };
197 | 9740EEB61CF901F6004384FC /* Run Script */ = {
198 | isa = PBXShellScriptBuildPhase;
199 | buildActionMask = 2147483647;
200 | files = (
201 | );
202 | inputPaths = (
203 | );
204 | name = "Run Script";
205 | outputPaths = (
206 | );
207 | runOnlyForDeploymentPostprocessing = 0;
208 | shellPath = /bin/sh;
209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
210 | };
211 | /* End PBXShellScriptBuildPhase section */
212 |
213 | /* Begin PBXSourcesBuildPhase section */
214 | 97C146EA1CF9000F007C117D /* Sources */ = {
215 | isa = PBXSourcesBuildPhase;
216 | buildActionMask = 2147483647;
217 | files = (
218 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
219 | 97C146F31CF9000F007C117D /* main.m in Sources */,
220 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
221 | );
222 | runOnlyForDeploymentPostprocessing = 0;
223 | };
224 | /* End PBXSourcesBuildPhase section */
225 |
226 | /* Begin PBXVariantGroup section */
227 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
228 | isa = PBXVariantGroup;
229 | children = (
230 | 97C146FB1CF9000F007C117D /* Base */,
231 | );
232 | name = Main.storyboard;
233 | sourceTree = "";
234 | };
235 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
236 | isa = PBXVariantGroup;
237 | children = (
238 | 97C147001CF9000F007C117D /* Base */,
239 | );
240 | name = LaunchScreen.storyboard;
241 | sourceTree = "";
242 | };
243 | /* End PBXVariantGroup section */
244 |
245 | /* Begin XCBuildConfiguration section */
246 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
247 | isa = XCBuildConfiguration;
248 | buildSettings = {
249 | ALWAYS_SEARCH_USER_PATHS = NO;
250 | CLANG_ANALYZER_NONNULL = YES;
251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
252 | CLANG_CXX_LIBRARY = "libc++";
253 | CLANG_ENABLE_MODULES = YES;
254 | CLANG_ENABLE_OBJC_ARC = YES;
255 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
256 | CLANG_WARN_BOOL_CONVERSION = YES;
257 | CLANG_WARN_COMMA = YES;
258 | CLANG_WARN_CONSTANT_CONVERSION = YES;
259 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
260 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
261 | CLANG_WARN_EMPTY_BODY = YES;
262 | CLANG_WARN_ENUM_CONVERSION = YES;
263 | CLANG_WARN_INFINITE_RECURSION = YES;
264 | CLANG_WARN_INT_CONVERSION = YES;
265 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
266 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
267 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
268 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
269 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
270 | CLANG_WARN_STRICT_PROTOTYPES = YES;
271 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
272 | CLANG_WARN_UNREACHABLE_CODE = YES;
273 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
274 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
275 | COPY_PHASE_STRIP = NO;
276 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
277 | ENABLE_NS_ASSERTIONS = NO;
278 | ENABLE_STRICT_OBJC_MSGSEND = YES;
279 | GCC_C_LANGUAGE_STANDARD = gnu99;
280 | GCC_NO_COMMON_BLOCKS = YES;
281 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
282 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
283 | GCC_WARN_UNDECLARED_SELECTOR = YES;
284 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
285 | GCC_WARN_UNUSED_FUNCTION = YES;
286 | GCC_WARN_UNUSED_VARIABLE = YES;
287 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
288 | MTL_ENABLE_DEBUG_INFO = NO;
289 | SDKROOT = iphoneos;
290 | SUPPORTED_PLATFORMS = iphoneos;
291 | TARGETED_DEVICE_FAMILY = "1,2";
292 | VALIDATE_PRODUCT = YES;
293 | };
294 | name = Profile;
295 | };
296 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
297 | isa = XCBuildConfiguration;
298 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
299 | buildSettings = {
300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
301 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
302 | ENABLE_BITCODE = NO;
303 | FRAMEWORK_SEARCH_PATHS = (
304 | "$(inherited)",
305 | "$(PROJECT_DIR)/Flutter",
306 | );
307 | INFOPLIST_FILE = Runner/Info.plist;
308 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
309 | LIBRARY_SEARCH_PATHS = (
310 | "$(inherited)",
311 | "$(PROJECT_DIR)/Flutter",
312 | );
313 | PRODUCT_BUNDLE_IDENTIFIER = com.djamware.flutterRestapi;
314 | PRODUCT_NAME = "$(TARGET_NAME)";
315 | VERSIONING_SYSTEM = "apple-generic";
316 | };
317 | name = Profile;
318 | };
319 | 97C147031CF9000F007C117D /* Debug */ = {
320 | isa = XCBuildConfiguration;
321 | buildSettings = {
322 | ALWAYS_SEARCH_USER_PATHS = NO;
323 | CLANG_ANALYZER_NONNULL = YES;
324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
325 | CLANG_CXX_LIBRARY = "libc++";
326 | CLANG_ENABLE_MODULES = YES;
327 | CLANG_ENABLE_OBJC_ARC = YES;
328 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
329 | CLANG_WARN_BOOL_CONVERSION = YES;
330 | CLANG_WARN_COMMA = YES;
331 | CLANG_WARN_CONSTANT_CONVERSION = YES;
332 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
334 | CLANG_WARN_EMPTY_BODY = YES;
335 | CLANG_WARN_ENUM_CONVERSION = YES;
336 | CLANG_WARN_INFINITE_RECURSION = YES;
337 | CLANG_WARN_INT_CONVERSION = YES;
338 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
339 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
343 | CLANG_WARN_STRICT_PROTOTYPES = YES;
344 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
345 | CLANG_WARN_UNREACHABLE_CODE = YES;
346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
348 | COPY_PHASE_STRIP = NO;
349 | DEBUG_INFORMATION_FORMAT = dwarf;
350 | ENABLE_STRICT_OBJC_MSGSEND = YES;
351 | ENABLE_TESTABILITY = YES;
352 | GCC_C_LANGUAGE_STANDARD = gnu99;
353 | GCC_DYNAMIC_NO_PIC = NO;
354 | GCC_NO_COMMON_BLOCKS = YES;
355 | GCC_OPTIMIZATION_LEVEL = 0;
356 | GCC_PREPROCESSOR_DEFINITIONS = (
357 | "DEBUG=1",
358 | "$(inherited)",
359 | );
360 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
361 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
362 | GCC_WARN_UNDECLARED_SELECTOR = YES;
363 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
364 | GCC_WARN_UNUSED_FUNCTION = YES;
365 | GCC_WARN_UNUSED_VARIABLE = YES;
366 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
367 | MTL_ENABLE_DEBUG_INFO = YES;
368 | ONLY_ACTIVE_ARCH = YES;
369 | SDKROOT = iphoneos;
370 | TARGETED_DEVICE_FAMILY = "1,2";
371 | };
372 | name = Debug;
373 | };
374 | 97C147041CF9000F007C117D /* Release */ = {
375 | isa = XCBuildConfiguration;
376 | buildSettings = {
377 | ALWAYS_SEARCH_USER_PATHS = NO;
378 | CLANG_ANALYZER_NONNULL = YES;
379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
380 | CLANG_CXX_LIBRARY = "libc++";
381 | CLANG_ENABLE_MODULES = YES;
382 | CLANG_ENABLE_OBJC_ARC = YES;
383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
384 | CLANG_WARN_BOOL_CONVERSION = YES;
385 | CLANG_WARN_COMMA = YES;
386 | CLANG_WARN_CONSTANT_CONVERSION = YES;
387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
389 | CLANG_WARN_EMPTY_BODY = YES;
390 | CLANG_WARN_ENUM_CONVERSION = YES;
391 | CLANG_WARN_INFINITE_RECURSION = YES;
392 | CLANG_WARN_INT_CONVERSION = YES;
393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
398 | CLANG_WARN_STRICT_PROTOTYPES = YES;
399 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
400 | CLANG_WARN_UNREACHABLE_CODE = YES;
401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
402 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
403 | COPY_PHASE_STRIP = NO;
404 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
405 | ENABLE_NS_ASSERTIONS = NO;
406 | ENABLE_STRICT_OBJC_MSGSEND = YES;
407 | GCC_C_LANGUAGE_STANDARD = gnu99;
408 | GCC_NO_COMMON_BLOCKS = YES;
409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
411 | GCC_WARN_UNDECLARED_SELECTOR = YES;
412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
413 | GCC_WARN_UNUSED_FUNCTION = YES;
414 | GCC_WARN_UNUSED_VARIABLE = YES;
415 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
416 | MTL_ENABLE_DEBUG_INFO = NO;
417 | SDKROOT = iphoneos;
418 | SUPPORTED_PLATFORMS = iphoneos;
419 | TARGETED_DEVICE_FAMILY = "1,2";
420 | VALIDATE_PRODUCT = YES;
421 | };
422 | name = Release;
423 | };
424 | 97C147061CF9000F007C117D /* Debug */ = {
425 | isa = XCBuildConfiguration;
426 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
427 | buildSettings = {
428 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
429 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
430 | ENABLE_BITCODE = NO;
431 | FRAMEWORK_SEARCH_PATHS = (
432 | "$(inherited)",
433 | "$(PROJECT_DIR)/Flutter",
434 | );
435 | INFOPLIST_FILE = Runner/Info.plist;
436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
437 | LIBRARY_SEARCH_PATHS = (
438 | "$(inherited)",
439 | "$(PROJECT_DIR)/Flutter",
440 | );
441 | PRODUCT_BUNDLE_IDENTIFIER = com.djamware.flutterRestapi;
442 | PRODUCT_NAME = "$(TARGET_NAME)";
443 | VERSIONING_SYSTEM = "apple-generic";
444 | };
445 | name = Debug;
446 | };
447 | 97C147071CF9000F007C117D /* Release */ = {
448 | isa = XCBuildConfiguration;
449 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
450 | buildSettings = {
451 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
452 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
453 | ENABLE_BITCODE = NO;
454 | FRAMEWORK_SEARCH_PATHS = (
455 | "$(inherited)",
456 | "$(PROJECT_DIR)/Flutter",
457 | );
458 | INFOPLIST_FILE = Runner/Info.plist;
459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
460 | LIBRARY_SEARCH_PATHS = (
461 | "$(inherited)",
462 | "$(PROJECT_DIR)/Flutter",
463 | );
464 | PRODUCT_BUNDLE_IDENTIFIER = com.djamware.flutterRestapi;
465 | PRODUCT_NAME = "$(TARGET_NAME)";
466 | VERSIONING_SYSTEM = "apple-generic";
467 | };
468 | name = Release;
469 | };
470 | /* End XCBuildConfiguration section */
471 |
472 | /* Begin XCConfigurationList section */
473 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
474 | isa = XCConfigurationList;
475 | buildConfigurations = (
476 | 97C147031CF9000F007C117D /* Debug */,
477 | 97C147041CF9000F007C117D /* Release */,
478 | 249021D3217E4FDB00AE95B9 /* Profile */,
479 | );
480 | defaultConfigurationIsVisible = 0;
481 | defaultConfigurationName = Release;
482 | };
483 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
484 | isa = XCConfigurationList;
485 | buildConfigurations = (
486 | 97C147061CF9000F007C117D /* Debug */,
487 | 97C147071CF9000F007C117D /* Release */,
488 | 249021D4217E4FDB00AE95B9 /* Profile */,
489 | );
490 | defaultConfigurationIsVisible = 0;
491 | defaultConfigurationName = Release;
492 | };
493 | /* End XCConfigurationList section */
494 | };
495 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
496 | }
497 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 | #import "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/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/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didinj/flutter-crud-restapi-example/7e734414eac44059f5e2166c99cfdff8c16701d8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_restapi
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/adddatawidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_restapi/services/api_service.dart';
3 | import 'models/cases.dart';
4 |
5 | enum Gender { male, female }
6 | enum Status { positive, dead, recovered }
7 |
8 | class AddDataWidget extends StatefulWidget {
9 | AddDataWidget();
10 |
11 | @override
12 | _AddDataWidgetState createState() => _AddDataWidgetState();
13 | }
14 |
15 | class _AddDataWidgetState extends State {
16 | _AddDataWidgetState();
17 |
18 | final ApiService api = ApiService();
19 | final _addFormKey = GlobalKey();
20 | final _nameController = TextEditingController();
21 | String gender = 'male';
22 | Gender _gender = Gender.male;
23 | final _ageController = TextEditingController();
24 | final _addressController = TextEditingController();
25 | final _cityController = TextEditingController();
26 | final _countryController = TextEditingController();
27 | String status = 'positive';
28 | Status _status = Status.positive;
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | return Scaffold(
33 | appBar: AppBar(
34 | title: Text('Add Cases'),
35 | ),
36 | body: Form(
37 | key: _addFormKey,
38 | child: SingleChildScrollView(
39 | child: Container(
40 | padding: EdgeInsets.all(20.0),
41 | child: Card(
42 | child: Container(
43 | padding: EdgeInsets.all(10.0),
44 | width: 440,
45 | child: Column(
46 | children: [
47 | Container(
48 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
49 | child: Column(
50 | children: [
51 | Text('Full Name'),
52 | TextFormField(
53 | controller: _nameController,
54 | decoration: const InputDecoration(
55 | hintText: 'Full Name',
56 | ),
57 | validator: (value) {
58 | if (value.isEmpty) {
59 | return 'Please enter full name';
60 | }
61 | return null;
62 | },
63 | onChanged: (value) {},
64 | ),
65 | ],
66 | ),
67 | ),
68 | Container(
69 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
70 | child: Column(
71 | children: [
72 | Text('Gender'),
73 | ListTile(
74 | title: const Text('Male'),
75 | leading: Radio(
76 | value: Gender.male,
77 | groupValue: _gender,
78 | onChanged: (Gender value) {
79 | setState(() {
80 | _gender = value;
81 | gender = 'male';
82 | });
83 | },
84 | ),
85 | ),
86 | ListTile(
87 | title: const Text('Female'),
88 | leading: Radio(
89 | value: Gender.female,
90 | groupValue: _gender,
91 | onChanged: (Gender value) {
92 | setState(() {
93 | _gender = value;
94 | gender = 'female';
95 | });
96 | },
97 | ),
98 | ),
99 | ],
100 | ),
101 | ),
102 | Container(
103 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
104 | child: Column(
105 | children: [
106 | Text('Age'),
107 | TextFormField(
108 | controller: _ageController,
109 | decoration: const InputDecoration(
110 | hintText: 'Age',
111 | ),
112 | keyboardType: TextInputType.number,
113 | validator: (value) {
114 | if (value.isEmpty) {
115 | return 'Please enter age';
116 | }
117 | return null;
118 | },
119 | onChanged: (value) {},
120 | ),
121 | ],
122 | ),
123 | ),
124 | Container(
125 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
126 | child: Column(
127 | children: [
128 | Text('Address'),
129 | TextFormField(
130 | controller: _addressController,
131 | decoration: const InputDecoration(
132 | hintText: 'Address',
133 | ),
134 | validator: (value) {
135 | if (value.isEmpty) {
136 | return 'Please enter address';
137 | }
138 | return null;
139 | },
140 | onChanged: (value) {},
141 | ),
142 | ],
143 | ),
144 | ),
145 | Container(
146 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
147 | child: Column(
148 | children: [
149 | Text('City'),
150 | TextFormField(
151 | controller: _cityController,
152 | decoration: const InputDecoration(
153 | hintText: 'City',
154 | ),
155 | validator: (value) {
156 | if (value.isEmpty) {
157 | return 'Please enter city';
158 | }
159 | return null;
160 | },
161 | onChanged: (value) {},
162 | ),
163 | ],
164 | ),
165 | ),
166 | Container(
167 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
168 | child: Column(
169 | children: [
170 | Text('Country'),
171 | TextFormField(
172 | controller: _countryController,
173 | decoration: const InputDecoration(
174 | hintText: 'Country',
175 | ),
176 | validator: (value) {
177 | if (value.isEmpty) {
178 | return 'Please enter country';
179 | }
180 | return null;
181 | },
182 | onChanged: (value) {},
183 | ),
184 | ],
185 | ),
186 | ),
187 | Container(
188 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
189 | child: Column(
190 | children: [
191 | Text('Status'),
192 | ListTile(
193 | title: const Text('Positive'),
194 | leading: Radio(
195 | value: Status.positive,
196 | groupValue: _status,
197 | onChanged: (Status value) {
198 | setState(() {
199 | _status = value;
200 | status = 'positive';
201 | });
202 | },
203 | ),
204 | ),
205 | ListTile(
206 | title: const Text('Dead'),
207 | leading: Radio(
208 | value: Status.dead,
209 | groupValue: _status,
210 | onChanged: (Status value) {
211 | setState(() {
212 | _status = value;
213 | status = 'dead';
214 | });
215 | },
216 | ),
217 | ),
218 | ListTile(
219 | title: const Text('Recovered'),
220 | leading: Radio(
221 | value: Status.recovered,
222 | groupValue: _status,
223 | onChanged: (Status value) {
224 | setState(() {
225 | _status = value;
226 | status = 'recovered';
227 | });
228 | },
229 | ),
230 | ),
231 | ],
232 | ),
233 | ),
234 | Container(
235 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
236 | child: Column(
237 | children: [
238 | RaisedButton(
239 | splashColor: Colors.red,
240 | onPressed: () {
241 | if (_addFormKey.currentState.validate()) {
242 | _addFormKey.currentState.save();
243 | api.createCase(Cases(name: _nameController.text, gender: gender, age: int.parse(_ageController.text), address: _addressController.text, city: _cityController.text, country: _countryController.text, status: status));
244 |
245 | Navigator.pop(context) ;
246 | }
247 | },
248 | child: Text('Save', style: TextStyle(color: Colors.white)),
249 | color: Colors.blue,
250 | )
251 | ],
252 | ),
253 | ),
254 | ],
255 | )
256 | )
257 | ),
258 | ),
259 | ),
260 | ),
261 | );
262 | }
263 | }
--------------------------------------------------------------------------------
/lib/caseslist.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_restapi/models/cases.dart';
3 | import 'detailwidget.dart';
4 |
5 | class CasesList extends StatelessWidget {
6 |
7 | final List cases;
8 | CasesList({Key key, this.cases}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return
13 | ListView.builder(
14 | itemCount: cases == null ? 0 : cases.length,
15 | itemBuilder: (BuildContext context, int index) {
16 | return
17 | Card(
18 | child: InkWell(
19 | onTap: () {
20 | Navigator.push(
21 | context,
22 | MaterialPageRoute(
23 | builder: (context) => DetailWidget(cases[index])),
24 | );
25 | },
26 | child: ListTile(
27 | leading: Icon(Icons.person),
28 | title: Text(cases[index].name),
29 | subtitle: Text(cases[index].age.toString()),
30 | ),
31 | )
32 | );
33 | });
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/lib/detailwidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'services/api_service.dart';
3 | import 'editdatawidget.dart';
4 | import 'models/cases.dart';
5 |
6 | class DetailWidget extends StatefulWidget {
7 | DetailWidget(this.cases);
8 |
9 | final Cases cases;
10 |
11 | @override
12 | _DetailWidgetState createState() => _DetailWidgetState();
13 | }
14 |
15 | class _DetailWidgetState extends State {
16 | _DetailWidgetState();
17 |
18 | final ApiService api = ApiService();
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return Scaffold(
23 | appBar: AppBar(
24 | title: Text('Details'),
25 | ),
26 | body: SingleChildScrollView(
27 | child: Container(
28 | padding: EdgeInsets.all(20.0),
29 | child: Card(
30 | child: Container(
31 | padding: EdgeInsets.all(10.0),
32 | width: 440,
33 | child: Column(
34 | children: [
35 | Container(
36 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
37 | child: Column(
38 | children: [
39 | Text('Name:', style: TextStyle(color: Colors.black.withOpacity(0.8))),
40 | Text(widget.cases.name, style: Theme.of(context).textTheme.title)
41 | ],
42 | ),
43 | ),
44 | Container(
45 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
46 | child: Column(
47 | children: [
48 | Text('Gender:', style: TextStyle(color: Colors.black.withOpacity(0.8))),
49 | Text(widget.cases.gender, style: Theme.of(context).textTheme.title)
50 | ],
51 | ),
52 | ),
53 | Container(
54 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
55 | child: Column(
56 | children: [
57 | Text('Age:', style: TextStyle(color: Colors.black.withOpacity(0.8))),
58 | Text(widget.cases.age.toString(), style: Theme.of(context).textTheme.title)
59 | ],
60 | ),
61 | ),
62 | Container(
63 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
64 | child: Column(
65 | children: [
66 | Text('Address:', style: TextStyle(color: Colors.black.withOpacity(0.8))),
67 | Text(widget.cases.address, style: Theme.of(context).textTheme.title)
68 | ],
69 | ),
70 | ),
71 | Container(
72 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
73 | child: Column(
74 | children: [
75 | Text('City:', style: TextStyle(color: Colors.black.withOpacity(0.8))),
76 | Text(widget.cases.city, style: Theme.of(context).textTheme.title)
77 | ],
78 | ),
79 | ),
80 | Container(
81 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
82 | child: Column(
83 | children: [
84 | Text('Country:', style: TextStyle(color: Colors.black.withOpacity(0.8))),
85 | Text(widget.cases.country, style: Theme.of(context).textTheme.title)
86 | ],
87 | ),
88 | ),
89 | Container(
90 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
91 | child: Column(
92 | children: [
93 | Text('Status:', style: TextStyle(color: Colors.black.withOpacity(0.8))),
94 | Text(widget.cases.status, style: Theme.of(context).textTheme.title)
95 | ],
96 | ),
97 | ),
98 | Container(
99 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
100 | child: Column(
101 | children: [
102 | Text('Update Date:', style: TextStyle(color: Colors.black.withOpacity(0.8))),
103 | Text(widget.cases.updated, style: Theme.of(context).textTheme.title)
104 | ],
105 | ),
106 | ),
107 | Container(
108 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
109 | child: Column(
110 | children: [
111 | RaisedButton(
112 | splashColor: Colors.red,
113 | onPressed: () {
114 | _navigateToEditScreen(context, widget.cases);
115 | },
116 | child: Text('Edit', style: TextStyle(color: Colors.white)),
117 | color: Colors.blue,
118 | ),
119 | RaisedButton(
120 | splashColor: Colors.red,
121 | onPressed: () {
122 | _confirmDialog();
123 | },
124 | child: Text('Delete', style: TextStyle(color: Colors.white)),
125 | color: Colors.blue,
126 | )
127 | ],
128 | ),
129 | ),
130 | ],
131 | )
132 | )
133 | ),
134 | ),
135 | ),
136 | );
137 | }
138 |
139 | _navigateToEditScreen (BuildContext context, Cases cases) async {
140 | final result = await Navigator.push(
141 | context,
142 | MaterialPageRoute(builder: (context) => EditDataWidget(cases)),
143 | );
144 | }
145 |
146 | Future _confirmDialog() async {
147 | return showDialog(
148 | context: context,
149 | barrierDismissible: false, // user must tap button!
150 | builder: (BuildContext context) {
151 | return AlertDialog(
152 | title: Text('Warning!'),
153 | content: SingleChildScrollView(
154 | child: ListBody(
155 | children: [
156 | Text('Are you sure want delete this item?'),
157 | ],
158 | ),
159 | ),
160 | actions: [
161 | FlatButton(
162 | child: Text('Yes'),
163 | onPressed: () {
164 | api.deleteCase(widget.cases.id);
165 | Navigator.popUntil(context, ModalRoute.withName(Navigator.defaultRouteName));
166 | },
167 | ),
168 | FlatButton(
169 | child: const Text('No'),
170 | onPressed: () {
171 | Navigator.of(context).pop();
172 | },
173 | ),
174 | ],
175 | );
176 | },
177 | );
178 | }
179 |
180 | }
--------------------------------------------------------------------------------
/lib/editdatawidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_restapi/services/api_service.dart';
3 | import 'models/cases.dart';
4 |
5 | enum Gender { male, female }
6 | enum Status { positive, dead, recovered }
7 |
8 | class EditDataWidget extends StatefulWidget {
9 | EditDataWidget(this.cases);
10 |
11 | final Cases cases;
12 |
13 | @override
14 | _EditDataWidgetState createState() => _EditDataWidgetState();
15 | }
16 |
17 | class _EditDataWidgetState extends State {
18 | _EditDataWidgetState();
19 |
20 | final ApiService api = ApiService();
21 | final _addFormKey = GlobalKey();
22 | String id = '';
23 | final _nameController = TextEditingController();
24 | String gender = 'male';
25 | Gender _gender = Gender.male;
26 | final _ageController = TextEditingController();
27 | final _addressController = TextEditingController();
28 | final _cityController = TextEditingController();
29 | final _countryController = TextEditingController();
30 | String status = 'positive';
31 | Status _status = Status.positive;
32 |
33 | @override
34 | void initState() {
35 | id = widget.cases.id;
36 | _nameController.text = widget.cases.name;
37 | gender = widget.cases.gender;
38 | if(widget.cases.gender == 'male') {
39 | _gender = Gender.male;
40 | } else {
41 | _gender = Gender.female;
42 | }
43 | _ageController.text = widget.cases.age.toString();
44 | _addressController.text = widget.cases.address;
45 | _cityController.text = widget.cases.city;
46 | _countryController.text = widget.cases.country;
47 | status = widget.cases.status;
48 | if(widget.cases.status == 'positive') {
49 | _status = Status.positive;
50 | } else if(widget.cases.status == 'dead') {
51 | _status = Status.dead;
52 | } else {
53 | _status = Status.recovered;
54 | }
55 | super.initState();
56 | }
57 |
58 | @override
59 | Widget build(BuildContext context) {
60 | return Scaffold(
61 | appBar: AppBar(
62 | title: Text('Edit Cases'),
63 | ),
64 | body: Form(
65 | key: _addFormKey,
66 | child: SingleChildScrollView(
67 | child: Container(
68 | padding: EdgeInsets.all(20.0),
69 | child: Card(
70 | child: Container(
71 | padding: EdgeInsets.all(10.0),
72 | width: 440,
73 | child: Column(
74 | children: [
75 | Container(
76 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
77 | child: Column(
78 | children: [
79 | Text('Full Name'),
80 | TextFormField(
81 | controller: _nameController,
82 | decoration: const InputDecoration(
83 | hintText: 'Full Name',
84 | ),
85 | validator: (value) {
86 | if (value.isEmpty) {
87 | return 'Please enter full name';
88 | }
89 | return null;
90 | },
91 | onChanged: (value) {},
92 | ),
93 | ],
94 | ),
95 | ),
96 | Container(
97 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
98 | child: Column(
99 | children: [
100 | Text('Gender'),
101 | ListTile(
102 | title: const Text('Male'),
103 | leading: Radio(
104 | value: Gender.male,
105 | groupValue: _gender,
106 | onChanged: (Gender value) {
107 | setState(() {
108 | _gender = value;
109 | gender = 'male';
110 | });
111 | },
112 | ),
113 | ),
114 | ListTile(
115 | title: const Text('Female'),
116 | leading: Radio(
117 | value: Gender.female,
118 | groupValue: _gender,
119 | onChanged: (Gender value) {
120 | setState(() {
121 | _gender = value;
122 | gender = 'female';
123 | });
124 | },
125 | ),
126 | ),
127 | ],
128 | ),
129 | ),
130 | Container(
131 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
132 | child: Column(
133 | children: [
134 | Text('Age'),
135 | TextFormField(
136 | controller: _ageController,
137 | decoration: const InputDecoration(
138 | hintText: 'Age',
139 | ),
140 | keyboardType: TextInputType.number,
141 | validator: (value) {
142 | if (value.isEmpty) {
143 | return 'Please enter age';
144 | }
145 | return null;
146 | },
147 | onChanged: (value) {},
148 | ),
149 | ],
150 | ),
151 | ),
152 | Container(
153 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
154 | child: Column(
155 | children: [
156 | Text('Address'),
157 | TextFormField(
158 | controller: _addressController,
159 | decoration: const InputDecoration(
160 | hintText: 'Address',
161 | ),
162 | validator: (value) {
163 | if (value.isEmpty) {
164 | return 'Please enter address';
165 | }
166 | return null;
167 | },
168 | onChanged: (value) {},
169 | ),
170 | ],
171 | ),
172 | ),
173 | Container(
174 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
175 | child: Column(
176 | children: [
177 | Text('City'),
178 | TextFormField(
179 | controller: _cityController,
180 | decoration: const InputDecoration(
181 | hintText: 'City',
182 | ),
183 | validator: (value) {
184 | if (value.isEmpty) {
185 | return 'Please enter city';
186 | }
187 | return null;
188 | },
189 | onChanged: (value) {},
190 | ),
191 | ],
192 | ),
193 | ),
194 | Container(
195 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
196 | child: Column(
197 | children: [
198 | Text('Country'),
199 | TextFormField(
200 | controller: _countryController,
201 | decoration: const InputDecoration(
202 | hintText: 'Country',
203 | ),
204 | validator: (value) {
205 | if (value.isEmpty) {
206 | return 'Please enter country';
207 | }
208 | return null;
209 | },
210 | onChanged: (value) {},
211 | ),
212 | ],
213 | ),
214 | ),
215 | Container(
216 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
217 | child: Column(
218 | children: [
219 | Text('Status'),
220 | ListTile(
221 | title: const Text('Positive'),
222 | leading: Radio(
223 | value: Status.positive,
224 | groupValue: _status,
225 | onChanged: (Status value) {
226 | setState(() {
227 | _status = value;
228 | status = 'positive';
229 | });
230 | },
231 | ),
232 | ),
233 | ListTile(
234 | title: const Text('Dead'),
235 | leading: Radio(
236 | value: Status.dead,
237 | groupValue: _status,
238 | onChanged: (Status value) {
239 | setState(() {
240 | _status = value;
241 | status = 'dead';
242 | });
243 | },
244 | ),
245 | ),
246 | ListTile(
247 | title: const Text('Recovered'),
248 | leading: Radio(
249 | value: Status.recovered,
250 | groupValue: _status,
251 | onChanged: (Status value) {
252 | setState(() {
253 | _status = value;
254 | status = 'recovered';
255 | });
256 | },
257 | ),
258 | ),
259 | ],
260 | ),
261 | ),
262 | Container(
263 | margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
264 | child: Column(
265 | children: [
266 | RaisedButton(
267 | splashColor: Colors.red,
268 | onPressed: () {
269 | if (_addFormKey.currentState.validate()) {
270 | _addFormKey.currentState.save();
271 | api.updateCases(id, Cases(name: _nameController.text, gender: gender, age: int.parse(_ageController.text), address: _addressController.text, city: _cityController.text, country: _countryController.text, status: status));
272 |
273 | Navigator.pop(context) ;
274 | }
275 | },
276 | child: Text('Save', style: TextStyle(color: Colors.white)),
277 | color: Colors.blue,
278 | )
279 | ],
280 | ),
281 | ),
282 | ],
283 | )
284 | )
285 | ),
286 | ),
287 | ),
288 | ),
289 | );
290 | }
291 |
292 | }
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_restapi/adddatawidget.dart';
3 | import 'dart:async';
4 | import 'package:flutter_restapi/models/cases.dart';
5 | import 'package:flutter_restapi/services/api_service.dart';
6 | import 'package:flutter_restapi/caseslist.dart';
7 |
8 | void main() {
9 | runApp(MyApp());
10 | }
11 |
12 | class MyApp extends StatelessWidget {
13 | // This widget is the root of your application.
14 | @override
15 | Widget build(BuildContext context) {
16 | return MaterialApp(
17 | title: 'Flutter Demo',
18 | theme: ThemeData(
19 | // This is the theme of your application.
20 | //
21 | // Try running your application with "flutter run". You'll see the
22 | // application has a blue toolbar. Then, without quitting the app, try
23 | // changing the primarySwatch below to Colors.green and then invoke
24 | // "hot reload" (press "r" in the console where you ran "flutter run",
25 | // or simply save your changes to "hot reload" in a Flutter IDE).
26 | // Notice that the counter didn't reset back to zero; the application
27 | // is not restarted.
28 | primarySwatch: Colors.blue,
29 | // This makes the visual density adapt to the platform that you run
30 | // the app on. For desktop platforms, the controls will be smaller and
31 | // closer together (more dense) than on mobile platforms.
32 | visualDensity: VisualDensity.adaptivePlatformDensity,
33 | ),
34 | home: MyHomePage(title: 'Flutter Demo Home Page'),
35 | );
36 | }
37 | }
38 |
39 | class MyHomePage extends StatefulWidget {
40 | MyHomePage({Key key, this.title}) : super(key: key);
41 |
42 | // This widget is the home page of your application. It is stateful, meaning
43 | // that it has a State object (defined below) that contains fields that affect
44 | // how it looks.
45 |
46 | // This class is the configuration for the state. It holds the values (in this
47 | // case the title) provided by the parent (in this case the App widget) and
48 | // used by the build method of the State. Fields in a Widget subclass are
49 | // always marked "final".
50 |
51 | final String title;
52 |
53 | @override
54 | _MyHomePageState createState() => _MyHomePageState();
55 | }
56 |
57 | class _MyHomePageState extends State {
58 | final ApiService api = ApiService();
59 | List casesList;
60 |
61 | @override
62 | Widget build(BuildContext context) {
63 | if(casesList == null) {
64 | casesList = List();
65 | }
66 | // This method is rerun every time setState is called, for instance as done
67 | // by the _incrementCounter method above.
68 | //
69 | // The Flutter framework has been optimized to make rerunning build methods
70 | // fast, so that you can just rebuild anything that needs updating rather
71 | // than having to individually change instances of widgets.
72 | return Scaffold(
73 | appBar: AppBar(
74 | // Here we take the value from the MyHomePage object that was created by
75 | // the App.build method, and use it to set our appbar title.
76 | title: Text(widget.title),
77 | ),
78 | body: new Container(
79 | child: new Center(
80 | child: new FutureBuilder(
81 | future: loadList(),
82 | builder: (context, snapshot) {
83 | return casesList.length > 0? new CasesList(cases: casesList):
84 | new Center(child:
85 | new Text('No data found, tap plus button to add!', style: Theme.of(context).textTheme.title));
86 | },
87 | )
88 | ),
89 | ),
90 | floatingActionButton: FloatingActionButton(
91 | onPressed: () {
92 | _navigateToAddScreen(context);
93 | },
94 | tooltip: 'Increment',
95 | child: Icon(Icons.add),
96 | ), // This trailing comma makes auto-formatting nicer for build methods.
97 | );
98 | }
99 |
100 | Future loadList() {
101 | Future> futureCases = api.getCases();
102 | futureCases.then((casesList) {
103 | setState(() {
104 | this.casesList = casesList;
105 | });
106 | });
107 | return futureCases;
108 | }
109 |
110 | _navigateToAddScreen (BuildContext context) async {
111 | final result = await Navigator.push(
112 | context,
113 | MaterialPageRoute(builder: (context) => AddDataWidget()),
114 | );
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/lib/models/cases.dart:
--------------------------------------------------------------------------------
1 | class Cases {
2 | final String id;
3 | final String name;
4 | final String gender;
5 | final int age;
6 | final String address;
7 | final String city;
8 | final String country;
9 | final String status;
10 | final String updated;
11 |
12 | Cases({ this.id, this.name, this.gender, this.age, this.address, this.city, this.country, this.status, this.updated });
13 |
14 | factory Cases.fromJson(Map json) {
15 | return Cases(
16 | id: json['_id'] as String,
17 | name: json['name'] as String,
18 | gender: json['gender'] as String,
19 | age: json['age'] as int,
20 | address: json['address'] as String,
21 | city: json['city'] as String,
22 | country: json['country'] as String,
23 | status: json['status'] as String,
24 | updated: json['updated'] as String,
25 | );
26 | }
27 |
28 | @override
29 | String toString() {
30 | return 'Trans{id: $id, name: $name, age: $age}';
31 | }
32 | }
--------------------------------------------------------------------------------
/lib/services/api_service.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_restapi/models/cases.dart';
4 | import 'package:http/http.dart';
5 |
6 | class ApiService {
7 | final String apiUrl = "http://192.168.0.7:3000/api";
8 |
9 | Future> getCases() async {
10 | Response res = await get(apiUrl);
11 |
12 | if (res.statusCode == 200) {
13 | List body = jsonDecode(res.body);
14 | List cases = body.map((dynamic item) => Cases.fromJson(item)).toList();
15 | return cases;
16 | } else {
17 | throw "Failed to load cases list";
18 | }
19 | }
20 |
21 | Future getCaseById(String id) async {
22 | final response = await get('$apiUrl/$id');
23 |
24 | if (response.statusCode == 200) {
25 | return Cases.fromJson(json.decode(response.body));
26 | } else {
27 | throw Exception('Failed to load a case');
28 | }
29 | }
30 |
31 | Future createCase(Cases cases) async {
32 | Map data = {
33 | 'name': cases.name,
34 | 'gender': cases.gender,
35 | 'age': cases.age,
36 | 'address': cases.address,
37 | 'city': cases.city,
38 | 'country': cases.country,
39 | 'status': cases.status
40 | };
41 |
42 | final Response response = await post(
43 | apiUrl,
44 | headers: {
45 | 'Content-Type': 'application/json; charset=UTF-8',
46 | },
47 | body: jsonEncode(data),
48 | );
49 | if (response.statusCode == 200) {
50 | return Cases.fromJson(json.decode(response.body));
51 | } else {
52 | throw Exception('Failed to post cases');
53 | }
54 | }
55 |
56 | Future updateCases(String id, Cases cases) async {
57 | Map data = {
58 | 'name': cases.name,
59 | 'gender': cases.gender,
60 | 'age': cases.age,
61 | 'address': cases.address,
62 | 'city': cases.city,
63 | 'country': cases.country,
64 | 'status': cases.status
65 | };
66 |
67 | final Response response = await put(
68 | '$apiUrl/$id',
69 | headers: {
70 | 'Content-Type': 'application/json; charset=UTF-8',
71 | },
72 | body: jsonEncode(data),
73 | );
74 | if (response.statusCode == 200) {
75 | return Cases.fromJson(json.decode(response.body));
76 | } else {
77 | throw Exception('Failed to update a case');
78 | }
79 | }
80 |
81 | Future deleteCase(String id) async {
82 | Response res = await delete('$apiUrl/$id');
83 |
84 | if (res.statusCode == 200) {
85 | print("Case deleted");
86 | } else {
87 | throw "Failed to delete a case.";
88 | }
89 | }
90 |
91 | }
92 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.4.2"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.0.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.0.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.1.3"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.0.1"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.14.13"
46 | cupertino_icons:
47 | dependency: "direct main"
48 | description:
49 | name: cupertino_icons
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "0.1.3"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.1.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | http:
71 | dependency: "direct main"
72 | description:
73 | name: http
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "0.12.2"
77 | http_parser:
78 | dependency: transitive
79 | description:
80 | name: http_parser
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "3.1.4"
84 | matcher:
85 | dependency: transitive
86 | description:
87 | name: matcher
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "0.12.8"
91 | meta:
92 | dependency: transitive
93 | description:
94 | name: meta
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "1.1.8"
98 | path:
99 | dependency: transitive
100 | description:
101 | name: path
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "1.7.0"
105 | pedantic:
106 | dependency: transitive
107 | description:
108 | name: pedantic
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "1.9.0"
112 | sky_engine:
113 | dependency: transitive
114 | description: flutter
115 | source: sdk
116 | version: "0.0.99"
117 | source_span:
118 | dependency: transitive
119 | description:
120 | name: source_span
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.7.0"
124 | stack_trace:
125 | dependency: transitive
126 | description:
127 | name: stack_trace
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "1.9.5"
131 | stream_channel:
132 | dependency: transitive
133 | description:
134 | name: stream_channel
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "2.0.0"
138 | string_scanner:
139 | dependency: transitive
140 | description:
141 | name: string_scanner
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "1.0.5"
145 | term_glyph:
146 | dependency: transitive
147 | description:
148 | name: term_glyph
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "1.1.0"
152 | test_api:
153 | dependency: transitive
154 | description:
155 | name: test_api
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "0.2.17"
159 | typed_data:
160 | dependency: transitive
161 | description:
162 | name: typed_data
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "1.2.0"
166 | vector_math:
167 | dependency: transitive
168 | description:
169 | name: vector_math
170 | url: "https://pub.dartlang.org"
171 | source: hosted
172 | version: "2.0.8"
173 | sdks:
174 | dart: ">=2.9.0-14.0.dev <3.0.0"
175 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_restapi
2 | description: A new Flutter application.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.7.0 <3.0.0"
22 |
23 | dependencies:
24 | flutter:
25 | sdk: flutter
26 |
27 |
28 | # The following adds the Cupertino Icons font to your application.
29 | # Use with the CupertinoIcons class for iOS style icons.
30 | cupertino_icons: ^0.1.3
31 | http: ^0.12.2
32 |
33 | dev_dependencies:
34 | flutter_test:
35 | sdk: flutter
36 |
37 | # For information on the generic Dart part of this file, see the
38 | # following page: https://dart.dev/tools/pub/pubspec
39 |
40 | # The following section is specific to Flutter.
41 | flutter:
42 |
43 | # The following line ensures that the Material Icons font is
44 | # included with your application, so that you can use the icons in
45 | # the material Icons class.
46 | uses-material-design: true
47 |
48 | # To add assets to your application, add an assets section, like this:
49 | # assets:
50 | # - images/a_dot_burr.jpeg
51 | # - images/a_dot_ham.jpeg
52 |
53 | # An image asset can refer to one or more resolution-specific "variants", see
54 | # https://flutter.dev/assets-and-images/#resolution-aware.
55 |
56 | # For details regarding adding assets from package dependencies, see
57 | # https://flutter.dev/assets-and-images/#from-packages
58 |
59 | # To add custom fonts to your application, add a fonts section here,
60 | # in this "flutter" section. Each entry in this list should have a
61 | # "family" key with the font family name, and a "fonts" key with a
62 | # list giving the asset and other descriptors for the font. For
63 | # example:
64 | # fonts:
65 | # - family: Schyler
66 | # fonts:
67 | # - asset: fonts/Schyler-Regular.ttf
68 | # - asset: fonts/Schyler-Italic.ttf
69 | # style: italic
70 | # - family: Trajan Pro
71 | # fonts:
72 | # - asset: fonts/TrajanPro.ttf
73 | # - asset: fonts/TrajanPro_Bold.ttf
74 | # weight: 700
75 | #
76 | # For details regarding fonts from package dependencies,
77 | # see https://flutter.dev/custom-fonts/#from-packages
78 |
--------------------------------------------------------------------------------
/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_restapi/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------