├── .gitignore ├── .metadata ├── README.md ├── android ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── sadeemwss │ │ │ │ └── api_app │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── HD.jpg ├── Icons.png ├── image.png └── sadeem.png ├── howitworks.gif ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── 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 ├── CountryListView.dart ├── InspectionDetail.dart ├── InspectionListView.dart ├── Models.dart ├── NewCountry.dart ├── NewInspection.dart ├── NewPorject.dart ├── ProjectListView.dart ├── UpdateCountry.dart ├── UpdateInspection.dart ├── UpdateProject.dart ├── global.dart ├── location.dart └── main.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 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /.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: 8661d8aecd626f7f57ccbcb735553edc05a2e713 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Inspector 2 | 3 | A Flutter app. 4 | 5 | ## How it works 6 | 7 | ![](howitworks.gif) 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.sadeemwss.api_app" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 67 | } 68 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 15 | 17 | 24 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/sadeemwss/api_app/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.sadeemwss.api_app 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.0' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | classpath 'com.google.gms:google-services:4.2.0' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | #org.gradle.jvmargs=-Xmx1536M 2 | org.gradle.jvmargs=-Xmx1536M 3 | android.useAndroidX=true 4 | android.enableJetifier=true -------------------------------------------------------------------------------- /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-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /assets/HD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/assets/HD.jpg -------------------------------------------------------------------------------- /assets/Icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/assets/Icons.png -------------------------------------------------------------------------------- /assets/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/assets/image.png -------------------------------------------------------------------------------- /assets/sadeem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/assets/sadeem.png -------------------------------------------------------------------------------- /howitworks.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/howitworks.gif -------------------------------------------------------------------------------- /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 | 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 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 106 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146F21CF9000F007C117D /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 97C146ED1CF9000F007C117D /* Runner */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 132 | buildPhases = ( 133 | 9740EEB61CF901F6004384FC /* Run Script */, 134 | 97C146EA1CF9000F007C117D /* Sources */, 135 | 97C146EB1CF9000F007C117D /* Frameworks */, 136 | 97C146EC1CF9000F007C117D /* Resources */, 137 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = Runner; 145 | productName = Runner; 146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 97C146E61CF9000F007C117D /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastUpgradeCheck = 0910; 156 | ORGANIZATIONNAME = "The Chromium Authors"; 157 | TargetAttributes = { 158 | 97C146ED1CF9000F007C117D = { 159 | CreatedOnToolsVersion = 7.3.1; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Profile; 307 | }; 308 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 314 | DEVELOPMENT_TEAM = S8QB4VV633; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.sadeemwss.apiApp; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | }; 384 | name = Debug; 385 | }; 386 | 97C147041CF9000F007C117D /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | ENABLE_STRICT_OBJC_MSGSEND = YES; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | 97C147061CF9000F007C117D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 440 | ENABLE_BITCODE = NO; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(PROJECT_DIR)/Flutter", 444 | ); 445 | INFOPLIST_FILE = Runner/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | LIBRARY_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = com.sadeemwss.apiApp; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | VERSIONING_SYSTEM = "apple-generic"; 454 | }; 455 | name = Debug; 456 | }; 457 | 97C147071CF9000F007C117D /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 460 | buildSettings = { 461 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 462 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 463 | ENABLE_BITCODE = NO; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "$(PROJECT_DIR)/Flutter", 467 | ); 468 | INFOPLIST_FILE = Runner/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | LIBRARY_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.sadeemwss.apiApp; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | 249021D3217E4FDB00AE95B9 /* Profile */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 97C147061CF9000F007C117D /* Debug */, 497 | 97C147071CF9000F007C117D /* Release */, 498 | 249021D4217E4FDB00AE95B9 /* Profile */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | /* End XCConfigurationList section */ 504 | }; 505 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 506 | } 507 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsguru-git/Inspector/b6b0e3e967dc5a2161f6512c8b2ae806b819ad38/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 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | api_app 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/CountryListView.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'package:api_app/ProjectListView.dart'; 4 | import 'package:api_app/Models.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:api_app/global.dart'; 7 | import 'package:http/http.dart' as http; 8 | import 'package:api_app/NewCountry.dart'; 9 | import 'package:api_app/UpdateCountry.dart'; 10 | 11 | class CountryList extends StatefulWidget { 12 | @override 13 | _CountryListState createState() => _CountryListState(); 14 | } 15 | 16 | class _CountryListState extends State { 17 | 18 | List countryList = new List(); 19 | final GlobalKey scaffoldKey = new GlobalKey(); 20 | final GlobalKey _refreshIndicatorKey = 21 | new GlobalKey(); 22 | Map headers = {"Content-type": "application/json"}; 23 | TextEditingController controller = new TextEditingController(); 24 | List _search =[]; 25 | @override 26 | void initState() { 27 | // TODO: implement initState 28 | super.initState(); 29 | getCountryList(); 30 | } 31 | 32 | void getCountryList() { 33 | http.get(URL.URL_COUNTRY).then((response) { 34 | setState(() { 35 | Iterable list = json.decode(response.body); //Iterable a collection of values, or "elements", that can be accessed sequentially. 36 | countryList = list.map((model) => Country.fromJson(model)).toList(); 37 | }); 38 | }); 39 | } 40 | void DeleteCountry ( List item, int c_id){ 41 | http.delete(URL.URL_COUNTRY+ c_id.toString(), headers: headers).then((http.Response response){ 42 | print("Response status: ${response.statusCode}"); 43 | print("Response body: ${response.contentLength}"); 44 | print(response.reasonPhrase); 45 | print(response.request); 46 | 47 | }); 48 | } 49 | Future _refresh() { 50 | getCountryList(); 51 | setState(() { 52 | countryList; 53 | }); 54 | } 55 | Future _Refresh() { 56 | print('refreshed'); 57 | Completer completer = new Completer(); 58 | } 59 | 60 | OnSearch(String text) async{ 61 | _search.clear(); 62 | if (text.isEmpty) { 63 | setState(() {}); 64 | return countryList; 65 | } 66 | countryList.forEach((s){ 67 | if (s.name.contains(text) || s.name.contains(text))_search.add(s); 68 | }); 69 | setState(() { 70 | 71 | }); 72 | } 73 | @override 74 | Widget build(BuildContext context) { 75 | return Scaffold( 76 | key: scaffoldKey, 77 | appBar: AppBar( 78 | elevation: 10.0, 79 | title: new Padding(padding: EdgeInsets.only(left: 10.0), 80 | child: Text('Countries'), 81 | ), 82 | // actions: [ 83 | // IconButton( 84 | // icon: AddCountry(countryList), 85 | // ) 86 | // ], 87 | ), 88 | 89 | body:Container( 90 | 91 | child:Column( 92 | crossAxisAlignment: CrossAxisAlignment.start, 93 | mainAxisAlignment: MainAxisAlignment.start, 94 | children:[ 95 | TextField( 96 | controller: controller, 97 | onChanged: OnSearch, 98 | decoration: InputDecoration( 99 | hintText: 'Search', 100 | border: InputBorder.none, 101 | icon: IconButton( 102 | icon: Icon(Icons.search), 103 | onPressed: (){ 104 | controller.clear(); 105 | OnSearch(''); 106 | }) 107 | ), 108 | ), 109 | Expanded( 110 | child: _search !=0 || controller.text.isNotEmpty ? 111 | ListView.builder( 112 | itemCount: _search.length, 113 | itemBuilder:(context, i){ 114 | return Card( 115 | elevation: 5.0, 116 | shape: RoundedRectangleBorder( 117 | borderRadius: BorderRadius.circular(3.0), 118 | ), 119 | child: InkWell ( 120 | child: Container( 121 | padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 25.0), 122 | child: Row( 123 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 124 | crossAxisAlignment: CrossAxisAlignment.start, 125 | children: [ 126 | Row( 127 | crossAxisAlignment: CrossAxisAlignment.start, 128 | children: [ 129 | Container( 130 | width: 350.0, 131 | height: 50.0, 132 | child: ListTile( 133 | isThreeLine: true, 134 | leading: CircleAvatar(child: Image.asset('assets/sadeem.png'), 135 | ), 136 | title: Text(_search[i].name), 137 | subtitle: Text("test"), 138 | onTap: (){ 139 | Navigator.push(context, new MaterialPageRoute ( 140 | builder: (context) => ProjectListView(countryID: _search[i].id, countryName: _search[i].name)) 141 | ); 142 | }, 143 | trailing: Row( 144 | mainAxisSize: MainAxisSize.min, 145 | children: [ 146 | IconButton( icon: 147 | Icon(Icons.edit, size: 25, color: Color.fromARGB(255, 56, 96,170),), 148 | onPressed: (){ 149 | _refresh(); 150 | Navigator.push(context, 151 | MaterialPageRoute(builder: (BuildContext context) =>UpdateCountry(countryID: _search[i].id, countryName: _search[i].name))); 152 | 153 | }), 154 | // IconButton(icon: 155 | // Icon(Icons.delete, size: 25, color: Color.fromARGB(255, 243, 146, 00),), 156 | // onPressed: () { 157 | // DeleteCountry(_search,_search[i].id ); 158 | // _refresh(); 159 | // } 160 | // ), 161 | IconButton( 162 | icon: const Icon(Icons.refresh), 163 | tooltip: 'Refresh', 164 | onPressed: () { 165 | _refresh(); 166 | //_refreshIndicatorKey.currentState.dispose(); 167 | }), 168 | ], 169 | ), 170 | ), 171 | ) 172 | ], 173 | ) 174 | ] 175 | ) 176 | ) 177 | ) 178 | ); 179 | } 180 | ) 181 | : 182 | ListView.builder( 183 | itemCount: countryList.length, 184 | itemBuilder: (context,i){ 185 | return Card( 186 | elevation: 5.0, 187 | shape: RoundedRectangleBorder( 188 | borderRadius: BorderRadius.circular(3.0), 189 | ), 190 | child: InkWell( 191 | child: Container( 192 | padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 25.0), 193 | child: Row( 194 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 195 | crossAxisAlignment: CrossAxisAlignment.start, 196 | children: [ 197 | Row( 198 | crossAxisAlignment: CrossAxisAlignment.start, 199 | children: [ 200 | Container( 201 | width: 350, 202 | height: 50, 203 | child: ListTile( 204 | isThreeLine: true, 205 | leading: CircleAvatar(child: Image.asset('assets/sadeem.png'), 206 | ), 207 | title: Text(countryList[i].name), 208 | subtitle: Text("test"), 209 | onTap: (){ 210 | Navigator.push(context, new MaterialPageRoute ( 211 | builder: (context) => ProjectListView(countryID: countryList[i].id, countryName: countryList[i].name)) 212 | ); 213 | // Row() 214 | }, 215 | ), 216 | ) 217 | ], 218 | ) 219 | ], 220 | ), 221 | ), 222 | ), 223 | ); 224 | }) 225 | ) 226 | ] 227 | ) 228 | ), 229 | ); 230 | } 231 | 232 | } 233 | 234 | class AddCountry extends StatelessWidget { 235 | final List country; 236 | //final int countryID; 237 | AddCountry(this.country); 238 | 239 | @override 240 | Widget build(BuildContext context) { 241 | return IconButton( 242 | padding: EdgeInsets.only(right: 40), 243 | icon: Icon(Icons.add, size: 40, color: Colors.white,), 244 | onPressed: () async { 245 | Country c = await Navigator.push(context, 246 | MaterialPageRoute( 247 | builder: (BuildContext Context) => NewCountry(country ), 248 | ) 249 | ); 250 | if (c==null){ 251 | Scaffold.of(context).showSnackBar( 252 | SnackBar( 253 | content: Text("Failed"), 254 | backgroundColor: Colors.grey, 255 | duration: Duration(seconds: 3), 256 | ), 257 | ); 258 | } 259 | else{ 260 | country.add(c); 261 | Scaffold.of(context).showSnackBar(SnackBar( 262 | content: Text('Saved'), 263 | backgroundColor: Colors.green, 264 | duration: Duration(seconds: 3), 265 | ) 266 | ); 267 | } 268 | } 269 | ); 270 | } 271 | } 272 | -------------------------------------------------------------------------------- /lib/InspectionDetail.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | import 'dart:io'; 3 | import 'package:api_app/Models.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:http/http.dart' as http; 6 | import 'dart:convert'; 7 | import 'package:api_app/global.dart'; 8 | import 'package:image_picker/image_picker.dart'; 9 | 10 | class InspectionDetail extends StatelessWidget { 11 | final Inspection inspectionList; 12 | var pic; 13 | InspectionDetail(this.inspectionList); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: AppBar( 19 | title: Text(inspectionList.name), 20 | ), 21 | body: SingleChildScrollView( 22 | child: Column( 23 | children: [ 24 | Container( 25 | padding: EdgeInsets.all(5), 26 | margin:EdgeInsets.all(20), 27 | decoration: BoxDecoration( 28 | borderRadius: BorderRadius.all(Radius.circular(6)), 29 | color:Colors.grey[200], 30 | ), 31 | height: 170, 32 | child: Column(children: [ 33 | Padding(padding: EdgeInsets.only(bottom: 15)), 34 | Text('Lamp post', style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),), 35 | Padding(padding: EdgeInsets.only(bottom: 5)), 36 | Row(children: [ 37 | Padding(padding: EdgeInsets.only(left: 15)), 38 | Text('Lamp Width:', style: TextStyle(fontSize: 20)), 39 | Padding(padding: EdgeInsets.only(left: 180)), 40 | Text(inspectionList.LampWidth.toString(), style: TextStyle(fontSize: 20)), 41 | inspectionList.LampWidth.toString()==null? new Text('No data') 42 | : Padding(padding: EdgeInsets.only(bottom: 60)), 43 | ],), 44 | Row( 45 | children: [ 46 | 47 | Padding(padding: EdgeInsets.only(left: 15)), 48 | Text('Lamp circumfernce:', style: TextStyle(fontSize: 20)), 49 | Padding(padding: EdgeInsets.only(left: 120)), 50 | inspectionList.LampCircumference.toString() ==null ? new Text('No data') 51 | :Text(inspectionList.LampCircumference.toString(), style: TextStyle(fontSize: 20)), 52 | 53 | ], 54 | ) 55 | ],), 56 | ), 57 | 58 | Container( 59 | padding:EdgeInsets.all(5) , 60 | margin: EdgeInsets.all(20), 61 | decoration: BoxDecoration( 62 | borderRadius: BorderRadius.all(Radius.circular(6)), 63 | color: Colors.grey[200] 64 | ), 65 | height: 170, 66 | 67 | 68 | child: Column(children:[ 69 | Padding(padding: EdgeInsets.only(bottom: 15)), 70 | Text('Tunnel post', style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),), 71 | Padding(padding: EdgeInsets.only(bottom: 5)), 72 | Row( 73 | children:[ 74 | Padding(padding: EdgeInsets.only(left: 15)), 75 | Text('Tunnel Width:', style: TextStyle(fontSize: 20)), 76 | Padding(padding: EdgeInsets.only(left: 150)), 77 | inspectionList.TunnelWidht == null ? 78 | new Text('No data') :Padding(padding: EdgeInsets.only(bottom: 60)), 79 | Text(inspectionList.TunnelWidht.toString(), style: TextStyle(fontSize: 20)), 80 | 81 | 82 | ], 83 | ), 84 | Row( 85 | children: [ 86 | Padding(padding: EdgeInsets.only(left: 15)), 87 | Text('Tunnel height:', style: TextStyle(fontSize: 20)), 88 | Padding(padding: EdgeInsets.only(left: 150)), 89 | inspectionList.TunnelHeight == null ? 90 | new Text('No data') 91 | :Text(inspectionList.TunnelHeight.toString(), style: TextStyle(fontSize: 20)), 92 | ], 93 | ) 94 | ]), 95 | ), 96 | Container( 97 | margin: EdgeInsets.all(20), 98 | height: 200, 99 | child: inspectionList.ImageNearby==null? new Text('no image'): Image.file(new File(inspectionList.ImageNearby)), 100 | ), 101 | Container( 102 | margin: EdgeInsets.all(20), 103 | height: 200, 104 | child: inspectionList.ImageOverall==null? new Text('no image'): Image.file(new File(inspectionList.ImageOverall)), 105 | ), 106 | Container( 107 | margin: EdgeInsets.all(20), 108 | height: 200, 109 | child: inspectionList.SunPath==null? new Text('no image'): Image.file(new File(inspectionList.SunPath)), 110 | ), 111 | Container( 112 | padding: EdgeInsets.all(5), 113 | margin: EdgeInsets.all(20), 114 | decoration: BoxDecoration( 115 | color: Colors.grey[200], 116 | borderRadius: BorderRadius.all(Radius.circular(6)), 117 | ), 118 | height: 50, 119 | child: Row( 120 | children:[ 121 | Padding(padding: EdgeInsets.only(bottom: 15)), 122 | Text('Sensor' , style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), 123 | Row( 124 | children:[ 125 | Padding(padding: EdgeInsets.only(left: 200)), 126 | Text(inspectionList.Sensor, style: TextStyle(fontSize: 16),) 127 | ], 128 | ) 129 | ], 130 | ), 131 | ), 132 | Container( 133 | padding: EdgeInsets.all(5), 134 | margin: EdgeInsets.all(20), 135 | decoration: BoxDecoration( 136 | color: Colors.grey[200], 137 | borderRadius: BorderRadius.all(Radius.circular(6)), 138 | ), 139 | height: 50, 140 | child: Row( 141 | children:[ 142 | Padding(padding: EdgeInsets.only(bottom: 15)), 143 | Text('Status' , style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), 144 | Row( 145 | children:[ 146 | Padding(padding: EdgeInsets.only(left: 200)), 147 | Text(inspectionList.Status.toString(), style: TextStyle(fontSize: 16),) 148 | ], 149 | ) 150 | ], 151 | ), 152 | 153 | 154 | ), 155 | ], 156 | ), 157 | ) 158 | //Container( 159 | // margin: EdgeInsets.all(20), 160 | // height: 200, 161 | // child: 162 | // inspectionList.SunPath==null? new Text('no image'): 163 | // Image.file(new File(inspectionList.SunPath)), 164 | // ) 165 | ); 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /lib/InspectionListView.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | import 'package:api_app/Models.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:api_app/global.dart'; 6 | import 'package:http/http.dart' as http; 7 | import 'package:api_app/NewInspection.dart'; 8 | import 'package:api_app/UpdateInspection.dart'; 9 | import 'package:api_app/InspectionDetail.dart'; 10 | 11 | class InspectionListView extends StatefulWidget { 12 | 13 | final int projectID; 14 | final String country, city; 15 | 16 | InspectionListView({this.projectID, this.country, this.city}): super(); 17 | @override 18 | _InspectionListViewState createState() => _InspectionListViewState(projectID, country, city); 19 | } 20 | 21 | class _InspectionListViewState extends State { 22 | 23 | int projectID; 24 | String country, city; 25 | List inspectionList = List(); 26 | List _search =[]; 27 | _InspectionListViewState(this.projectID, this.country, this.city); 28 | 29 | final GlobalKey scaffoldKey = new GlobalKey(); 30 | Map headers = {"Content-type": "application/json"}; 31 | 32 | void getInspectionList(int pro_id) { 33 | http.get(URL.URL_INSPECTION + pro_id.toString()).then((response) { 34 | setState(() { 35 | Iterable list = json.decode(response.body); 36 | inspectionList = list.map((model) => Inspection.fromJson(model)).toList(); 37 | print(response.body); 38 | print(response.request); 39 | }); 40 | }); 41 | } 42 | void DeleteInspection ( List item, int pro_id ){ 43 | http.delete(URL.URL_INSPECTION+ pro_id.toString(), headers: headers).then((http.Response response){ 44 | print("Response status: ${response.statusCode}"); 45 | print("Response body: ${response.contentLength}"); 46 | print(response.reasonPhrase); 47 | print(response.request); 48 | }); 49 | } 50 | 51 | void _selfRefresh() { 52 | getInspectionList(this.projectID); 53 | } 54 | 55 | @override 56 | void initState() { 57 | super.initState(); 58 | getInspectionList(this.projectID); 59 | } 60 | @override 61 | Widget build(BuildContext context) { 62 | return Scaffold( 63 | key: scaffoldKey, 64 | appBar: AppBar( 65 | elevation: 10.0, 66 | title: new Padding(padding: EdgeInsets.only(left: 70.0), 67 | child: Text('Inspection List'), 68 | ), 69 | actions: [ 70 | IconButton( 71 | icon: AddInspection(inspectionList, projectID), 72 | ) 73 | ] 74 | ), 75 | body:Container( 76 | child: inspectionList.length ==0 ? 77 | Center( 78 | child: Column( 79 | children: [ 80 | Padding(padding: EdgeInsets.only(top: 200),), 81 | Text("No Inspections " , style: TextStyle(fontWeight: FontWeight.bold),), 82 | RaisedButton( 83 | child: Text('Add new inspection'), 84 | onPressed: ()async { 85 | Inspection i = await Navigator.push(context, 86 | MaterialPageRoute( 87 | builder: (BuildContext Context)=>NewInspection(inspectionList,projectID ) , 88 | )); 89 | if (i ==null){ 90 | Scaffold.of(context).showSnackBar( 91 | SnackBar( 92 | content: Text("Failed"), 93 | backgroundColor: Colors.grey, 94 | duration: Duration(seconds: 3), 95 | ), 96 | ); 97 | } 98 | else{ 99 | inspectionList.add(i); 100 | // Scaffold.of(context).showSnackBar(SnackBar( 101 | // content: Text('Saved'), 102 | // backgroundColor: Colors.green, 103 | // duration: Duration(seconds: 3), 104 | // ) 105 | // ); 106 | } 107 | } 108 | ) 109 | ]), 110 | ) 111 | : ListView.builder( 112 | itemCount: inspectionList.length, 113 | itemBuilder:(context, i){ 114 | return Card( 115 | elevation: 3.0, 116 | shape: RoundedRectangleBorder( 117 | borderRadius: BorderRadius.circular(0.0), 118 | ), 119 | child: InkWell( 120 | onTap: (){ 121 | // var pic = base64.decode(inspectionList[i].ImageNearby); 122 | Navigator.push(context, new MaterialPageRoute 123 | (builder: (context) => InspectionDetail(inspectionList[i]))); 124 | }, 125 | child:Container( 126 | padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 25.0), 127 | child: Row( 128 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 129 | crossAxisAlignment: CrossAxisAlignment.start, 130 | children: [ 131 | Row( 132 | crossAxisAlignment: CrossAxisAlignment.start, 133 | children: [ 134 | Container( 135 | width: 350.0, 136 | height: 50.0, 137 | child: ListTile( 138 | isThreeLine: true, 139 | leading: CircleAvatar( 140 | child: Image.asset('assets/sadeem.png'), 141 | ), 142 | title: Text(inspectionList[i].name), 143 | subtitle: Text(inspectionList[i].Sensor), 144 | //subtitle: Text(country + " " + city), 145 | onTap: () { 146 | }, 147 | trailing: Row( 148 | mainAxisSize: MainAxisSize.min, 149 | children: [ 150 | IconButton( icon: 151 | Icon(Icons.edit, size: 25, color: Color.fromARGB(255, 56, 96,170),), 152 | onPressed: (){ 153 | Navigator.push(context, 154 | MaterialPageRoute(builder: (BuildContext context) => 155 | UpdateInspectin(I_id:inspectionList[i].id, I_name:inspectionList[i].name, 156 | I_TunnelWidht: inspectionList[i].TunnelWidht, I_TunnelHeight: inspectionList[i].TunnelHeight, 157 | I_LampWidth: inspectionList[i].LampWidth, I_LampCircumference: inspectionList[i].LampCircumference, 158 | I_ImageNearby: inspectionList[i].ImageNearby, I_ImageOverall: inspectionList[i].ImageOverall, 159 | I_SunPath: inspectionList[i].SunPath, I_Latitude:inspectionList[i].Latitude, I_Longtitude: inspectionList[i].Longtitude, 160 | I_Status: inspectionList[i].Status , I_Sensor:inspectionList[i].Sensor,I_ProjectId: projectID, onUpdateInspectionList: _selfRefresh ) ) 161 | ); 162 | }), 163 | IconButton( 164 | icon: Icon(Icons.delete, size: 25, color: Color.fromARGB(255, 243, 146, 00),), 165 | onPressed: () { 166 | DeleteInspection(inspectionList,inspectionList[i].id ); 167 | setState(() { 168 | inspectionList.removeAt(i); 169 | }); 170 | }), 171 | ] 172 | ), 173 | 174 | ), 175 | ) 176 | ], 177 | ) 178 | ], 179 | ), ), 180 | ) 181 | ); 182 | }), 183 | ) 184 | ); 185 | } 186 | } 187 | 188 | class AddInspection extends StatelessWidget { 189 | final List inspection; 190 | final int ProjectId ; 191 | AddInspection(this.inspection, this.ProjectId); 192 | @override 193 | Widget build(BuildContext context) { 194 | return IconButton( 195 | padding: EdgeInsets.only(right: 40), 196 | icon: Icon(Icons.add, size: 40,color: Colors.white), 197 | onPressed: ()async { 198 | Inspection i = await Navigator.push(context, 199 | MaterialPageRoute( 200 | builder: (BuildContext Context)=>NewInspection(inspection,ProjectId ) , 201 | )); 202 | if (i ==null){ 203 | Scaffold.of(context).showSnackBar( 204 | SnackBar( 205 | content: Text("Failed"), 206 | backgroundColor: Colors.grey, 207 | duration: Duration(seconds: 3), 208 | ), 209 | ); 210 | } 211 | else{ 212 | inspection.add(i); 213 | Scaffold.of(context).showSnackBar(SnackBar( 214 | content: Text('Saved'), 215 | backgroundColor: Colors.green, 216 | duration: Duration(seconds: 3), 217 | ) 218 | ); 219 | } 220 | }, 221 | 222 | ); 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /lib/Models.dart: -------------------------------------------------------------------------------- 1 | 2 | class Country { 3 | int id; 4 | String name; 5 | 6 | Country( {this.id, this.name}); 7 | 8 | int get Id => id; 9 | String get Name=> name; 10 | factory Country.fromJson(Map json){ 11 | return Country( 12 | id: json["id"], 13 | name: json["name"], 14 | ); 15 | } 16 | Map toMap(int c_id){ 17 | final Map item = { 18 | "name": name, 19 | }; 20 | if ( c_id != null) 21 | item["id"]= id; 22 | return item; 23 | // var map = Map(); 24 | // map["name"]= name; 25 | // if (id != null){ 26 | // map["id"]= id; 27 | // } 28 | // return map; 29 | } 30 | Map toMapEdit(int c_id) { 31 | return { 32 | "id" : id, 33 | "name": name 34 | 35 | }; 36 | } 37 | } 38 | 39 | class Project { 40 | 41 | int id; 42 | String name; 43 | String city; 44 | String orgnazation; 45 | double latitude; 46 | double longtitude; 47 | int CountryId; 48 | 49 | Project ({this.id,this.name, this.city, this.orgnazation, this.latitude, this.longtitude, this.CountryId,}); 50 | 51 | int get ID =>id; 52 | String get Name => name; 53 | String get City=> city; 54 | String get Orgnazation => orgnazation; 55 | double get Latitude => latitude; 56 | double get Longtitude=> longtitude; 57 | int get countryid => CountryId; 58 | 59 | factory Project.fromJson(Map json){ 60 | return Project( 61 | id: json["id"], 62 | name: json["name"], 63 | city: json["city"], 64 | orgnazation: json["orgnazation"], 65 | latitude: json["latitude"], 66 | longtitude: json["longtitude"], 67 | CountryId: json["CountryId"] 68 | ); 69 | } 70 | Map toMap(int p_id){ 71 | final map = Map(); 72 | //final Map item = 73 | if (p_id != null) 74 | map ["id"] =id; 75 | map ["name"]= name; 76 | map["city"]= city; 77 | map["orgnazation"]=orgnazation; 78 | map["latitude"]= latitude; 79 | map["longtitude"]=longtitude; 80 | map["countryId"]=CountryId; 81 | 82 | // if (p_id != null) 83 | // item ["id"] =id; 84 | return map; 85 | } 86 | Map toMapEdit(int p_id){ 87 | final map = Map(); 88 | //final Map item = 89 | map ["id"] =id; 90 | map ["name"]= name; 91 | map["city"]= city; 92 | map["orgnazation"]=orgnazation; 93 | map["latitude"]= latitude; 94 | map["longtitude"]=longtitude; 95 | map["countryId"]=CountryId; 96 | 97 | // if (p_id != null) 98 | // item ["id"] =id; 99 | return map; 100 | } 101 | } 102 | 103 | 104 | class Inspection { 105 | 106 | int id; 107 | String name; 108 | double TunnelWidht; 109 | double TunnelHeight; 110 | double LampWidth; 111 | double LampCircumference; 112 | String ImageNearby; 113 | String ImageOverall; 114 | String SunPath; 115 | double Latitude; 116 | double Longtitude; 117 | bool Status; 118 | String Sensor; 119 | int ProjectId; 120 | 121 | 122 | Inspection({this.id, this.name, this.TunnelWidht, this.TunnelHeight, this.LampWidth, 123 | this.LampCircumference, this.ImageNearby, this.ImageOverall, this.SunPath, this.Latitude, 124 | this.Longtitude, this.Status, this.Sensor, this.ProjectId}); 125 | 126 | factory Inspection.fromJson(Map json){ 127 | return Inspection( 128 | id : json["id"], 129 | name :json["name"], 130 | TunnelWidht : json["tunnelWidth"], 131 | TunnelHeight :json["tunnelHeight"], 132 | LampWidth : json ["lampWidth"], 133 | LampCircumference : json["lampCircumference"], 134 | ImageNearby :json["imageNearby"], 135 | ImageOverall: json["imageOverall"], 136 | SunPath : json["sunPath"], 137 | Sensor : json["sensor"], 138 | Latitude : json["latitude"], 139 | Longtitude :json["longtitude"], 140 | Status :json["status"], 141 | ProjectId:json["projectId"] 142 | ); 143 | } 144 | Map toMap(int i_id){ 145 | final item= Map() ; 146 | if (i_id != null) 147 | item ["id"]= id; 148 | item["name"]= name; 149 | item["tunnelWidth"]= TunnelWidht; 150 | item["tunnelHeight"]= TunnelHeight; 151 | item["lampWidth"]= LampWidth; 152 | item["lampCircumference"]= LampCircumference; 153 | item["imageNearby"]= ImageNearby; 154 | item["imageOverall"]= ImageOverall; 155 | item["sunPath"] = SunPath; 156 | item["latitude"]=Latitude; 157 | item["longtitude"] = Longtitude; 158 | item["status"]= Status; 159 | item["sensor"]= Sensor; 160 | item["projectId"]= ProjectId; 161 | return item; 162 | } 163 | Map toMapEdit(){ 164 | return { 165 | "id": id, 166 | "name": name, 167 | "tunnelWidth": TunnelWidht, 168 | "tunnelHeight": TunnelHeight, 169 | "lampWidth": LampWidth, 170 | "lampCircumference": LampCircumference, 171 | "imageNearby": ImageNearby, 172 | "imageOverall": ImageOverall, 173 | "sunPath" : SunPath, 174 | "latitude": Latitude, 175 | "longtitude" : Longtitude, 176 | "status": Status, 177 | "sensor": Sensor, 178 | "projectId": ProjectId 179 | }; 180 | } 181 | } -------------------------------------------------------------------------------- /lib/NewCountry.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | import 'package:api_app/Models.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'dart:convert'; 6 | import 'package:api_app/global.dart'; 7 | import 'package:api_app/CountryListView.dart'; 8 | 9 | class NewCountry extends StatefulWidget { 10 | final List country; 11 | NewCountry(this.country); 12 | @override 13 | _NewCountryState createState() => _NewCountryState(country); 14 | } 15 | 16 | class _NewCountryState extends State { 17 | List country; 18 | int id; 19 | String name; 20 | _NewCountryState(this.country); 21 | final key = GlobalKey(); 22 | 23 | Map headers = {"Content-type": "application/json"}; 24 | 25 | // get _CountryListState =>_CountryListState; 26 | 27 | Future postCountryList( Country item) async{ 28 | http.post(URL.URL_COUNTRY,headers:headers, 29 | body: json.encode(item.toMap(id))).then((http.Response response){ 30 | print("Response status: ${response.statusCode}"); 31 | print("Response body: ${response.contentLength}"); 32 | print(response.reasonPhrase); 33 | print(response.request); 34 | print(item.toMap(id)); 35 | 36 | }); 37 | } 38 | @override 39 | Widget build(BuildContext context) { 40 | return Scaffold( 41 | appBar: AppBar( 42 | title: Text('Add new Project'), 43 | ), 44 | body: SingleChildScrollView( 45 | child:Form( 46 | key:key , 47 | child: Column( 48 | crossAxisAlignment: CrossAxisAlignment.start, 49 | children: [ 50 | 51 | ListTile( 52 | contentPadding: EdgeInsets.all(15.0), 53 | title:TextFormField( 54 | onSaved: (value)=> name= value, 55 | decoration: InputDecoration( 56 | labelText: 'Project Name', 57 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 58 | border: new OutlineInputBorder( 59 | borderRadius: new BorderRadius.circular(15.0) 60 | ) 61 | ), 62 | maxLines: 1, 63 | 64 | ) 65 | ), 66 | ListTile( 67 | title: RaisedButton( 68 | child: Text('Save'), 69 | onPressed: () { 70 | this.key.currentState.save(); 71 | Country country = new Country( id:id, name: name); 72 | postCountryList(country); 73 | Navigator.pop(context, country); 74 | setState(() { 75 | Country; 76 | }); 77 | } ), 78 | ) 79 | ], 80 | ) 81 | ) 82 | ) 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/NewInspection.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | import 'dart:io'; 3 | import 'dart:convert'; 4 | import 'package:api_app/Models.dart'; 5 | import 'package:api_app/location.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:http/http.dart' as http; 8 | import 'dart:convert'; 9 | import 'package:api_app/global.dart'; 10 | import 'package:image_picker/image_picker.dart'; 11 | import 'package:geolocator/geolocator.dart'; 12 | import 'package:google_maps_flutter/google_maps_flutter.dart'; 13 | 14 | class NewInspection extends StatefulWidget { 15 | final List inspection; 16 | final int projectId; 17 | NewInspection(this.inspection, this.projectId); 18 | @override 19 | _NewInspectionState createState() => _NewInspectionState(inspection, projectId); 20 | } 21 | 22 | class _NewInspectionState extends State { 23 | List inspection; final int projectId; 24 | _NewInspectionState(this.inspection, this.projectId); 25 | int id; String name; 26 | double TunnelWidht; double TunnelHeight; 27 | double LampWidth; double LampCircumference; 28 | String ImageNearby; String ImageOverall; 29 | String SunPath; double Latitude; 30 | double Longtitude; bool Status; 31 | String Sensor; 32 | final key = GlobalKey(); 33 | GoogleMapController mycontroller; 34 | bool _isEnabled = true; 35 | bool _isEnabledd = true; 36 | bool _autoValidate = false; 37 | void PickImageNearby() async { 38 | print('picker is called '); 39 | var image = await ImagePicker.pickImage(source: ImageSource.camera ); 40 | ImageNearby = image.path; 41 | print(ImageNearby); 42 | setState(() { 43 | ImageNearby; 44 | }); 45 | } 46 | void PickImageOverAll() async { 47 | print('picker is called '); 48 | var imageo = await ImagePicker.pickImage(source: ImageSource.camera ); 49 | ImageOverall = imageo.path; 50 | print(ImageOverall); 51 | setState(() { 52 | ImageOverall; 53 | }); 54 | } 55 | void PickImageSunpath() async { 56 | print('picker is called '); 57 | var image = await ImagePicker.pickImage(source: ImageSource.camera ); 58 | SunPath = image.path; 59 | print(SunPath); 60 | setState(() { 61 | SunPath; 62 | }); 63 | } 64 | void loc() async{ 65 | Position position =await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high); 66 | setState(() { 67 | Latitude = position.latitude; 68 | Longtitude = position.longitude; 69 | print (Latitude); print(Longtitude); 70 | }); 71 | Inspection inspectionData = new Inspection(id: id, name:name, TunnelWidht:TunnelWidht, TunnelHeight: TunnelHeight 72 | ,LampWidth: LampWidth, LampCircumference: LampCircumference, ImageNearby: ImageNearby.toString(), ImageOverall:ImageOverall.toString(), 73 | SunPath: SunPath.toString(), Latitude: Latitude, Longtitude: Longtitude, Status:Status,Sensor: Sensor, ProjectId: projectId); 74 | postInspectionList( inspectionData); 75 | print("show me inspectionData created"); 76 | print(inspectionData.toMapEdit()); 77 | } 78 | 79 | Map headers = {"Content-type": "application/json"}; 80 | 81 | Future postInspectionList( Inspection item) async{ 82 | http.post(URL.URL_INSPECTION ,headers:headers, 83 | body: json.encode(item.toMap(id))).then((http.Response response){ 84 | print("Response status: ${response.statusCode}"); 85 | print("Response body: ${response.contentLength}"); 86 | print(response.reasonPhrase); 87 | print(response.request); 88 | print(response.body); 89 | print(item.toMap(id)); 90 | print(json.decode(response.body)['id']); 91 | item.id = json.decode(response.body)['id']; 92 | Navigator.pop(context, item); 93 | }); 94 | } 95 | void _validateInputs() { 96 | if (key.currentState.validate()) { 97 | // If all data are correct then save data to out variables 98 | key.currentState.save(); 99 | } else { 100 | // If all data are not valid then start auto validation. 101 | setState(() { 102 | _autoValidate = true; 103 | }); 104 | } 105 | } 106 | @override 107 | Widget build(BuildContext context) { 108 | return Scaffold( 109 | appBar: AppBar( 110 | title: Text("Add new inspection"), 111 | ), 112 | body: SingleChildScrollView( 113 | child:Form( 114 | key:key , 115 | child: Column( 116 | crossAxisAlignment: CrossAxisAlignment.start, 117 | children: [ 118 | ListTile( 119 | contentPadding: EdgeInsets.all(15.0), 120 | title:TextFormField( 121 | onSaved: (value)=> name= value, 122 | decoration: InputDecoration( 123 | labelText: 'Inspection Name', 124 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 125 | ), 126 | autovalidate: _autoValidate, 127 | validator: (String val){ 128 | if (val.length ==0){ 129 | return "Please enter a name"; 130 | } 131 | else{return null;} 132 | }, 133 | maxLines: 1, 134 | 135 | ) 136 | ), 137 | ListTile( 138 | contentPadding: EdgeInsets.all(15.0), 139 | title:TextFormField( 140 | onSaved: (value)=> Sensor= value, 141 | decoration: InputDecoration( 142 | labelText: 'Sensor Name', 143 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 144 | ), 145 | autovalidate: _autoValidate, 146 | validator: (String val){ 147 | if (val.length ==0){ 148 | return "Please enter a name"; 149 | } 150 | else{return null;} 151 | }, 152 | maxLines: 1, 153 | 154 | ) 155 | ), 156 | 157 | ListTile( 158 | contentPadding: EdgeInsets.all(8.0), 159 | title:Container( 160 | height:250 , 161 | decoration: BoxDecoration( 162 | color:Color.fromARGB(10, 0, 0, 0), 163 | borderRadius:BorderRadius.circular(8.0) 164 | ), 165 | child: Column( 166 | children: [ 167 | Row( 168 | children: [ 169 | RaisedButton.icon( 170 | onPressed: () => setState(() => _isEnabledd = !_isEnabledd), 171 | label: Text(_isEnabledd ? "Enables" : "Disables"), 172 | icon: Icon(_isEnabledd? Icons.check_circle :Icons.clear), 173 | color: _isEnabledd ? Colors.green :Colors.grey, 174 | ), 175 | ], 176 | ), 177 | Padding( padding: EdgeInsets.only( top: 20),), 178 | Text("Tunnel post:",style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),), 179 | Padding( padding: EdgeInsets.only( bottom: 20),), 180 | Row( 181 | mainAxisAlignment:MainAxisAlignment.spaceBetween, 182 | children: [ 183 | Padding(padding:EdgeInsets.only(top:30, left: 10),), 184 | new Flexible(child: TextFormField( 185 | keyboardType: TextInputType.number, 186 | 187 | autovalidate: _autoValidate, 188 | onSaved: (value){ 189 | if(value.isEmpty){ 190 | value= 0.toString(); 191 | TunnelWidht = double.parse(value); 192 | } 193 | else{ 194 | TunnelWidht= double.parse(value);}}, 195 | decoration: InputDecoration( 196 | labelText: 'Tunnel Widht', 197 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 198 | ), 199 | maxLines: 1, 200 | enabled: _isEnabledd, 201 | )), 202 | SizedBox(width: 10.0,), 203 | Padding(padding:EdgeInsets.only(top: 30, left: 10),), 204 | new Flexible(child: TextFormField( 205 | keyboardType: TextInputType.number, 206 | autovalidate: _autoValidate, 207 | onSaved: (value){ 208 | if(value.isEmpty){ 209 | value= 0.toString(); 210 | TunnelHeight = double.parse(value); 211 | } 212 | else{ 213 | TunnelHeight= double.parse(value);}}, 214 | decoration: InputDecoration( 215 | labelText: 'TunnelHeight', 216 | labelStyle: TextStyle(fontWeight: FontWeight.bold) 217 | ), 218 | maxLines: 1, 219 | enabled: _isEnabledd, 220 | )) 221 | ], 222 | ) 223 | ], 224 | ), 225 | ) 226 | 227 | ), 228 | ListTile( 229 | contentPadding: EdgeInsets.all(8.0), 230 | title:Container( 231 | height:250 , 232 | decoration: BoxDecoration( 233 | color:Color.fromARGB(10, 0, 0, 0), 234 | borderRadius:BorderRadius.circular(8.0) 235 | ), 236 | child: Column( 237 | children: [ 238 | Row( 239 | children: [ 240 | Row( 241 | children: [ 242 | RaisedButton.icon( 243 | 244 | onPressed: () => setState(() => _isEnabled = !_isEnabled), 245 | label: Text(_isEnabled ? "Enables" : "Disables"), 246 | icon: Icon(_isEnabled? Icons.check_circle :Icons.clear), 247 | color: _isEnabled ? Colors.green :Colors.grey, 248 | ), 249 | ], 250 | ) 251 | ], 252 | ), 253 | Padding( padding: EdgeInsets.only( top: 20),), 254 | Text("Lamp post:",style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),), 255 | Padding( padding: EdgeInsets.only( bottom: 20),), 256 | Row( 257 | mainAxisAlignment:MainAxisAlignment.spaceBetween, 258 | children: [ 259 | Padding(padding:EdgeInsets.only(top:30, left: 10),), 260 | new Flexible(child: TextFormField( 261 | keyboardType: TextInputType.number, 262 | 263 | onSaved: (value){ 264 | if(value.isEmpty){ 265 | value= 0.toString(); 266 | LampWidth = double.parse(value); 267 | } 268 | else{ 269 | LampWidth= double.parse(value);}}, 270 | decoration: InputDecoration( 271 | labelText: "Lamp Width", 272 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 273 | ), 274 | maxLines: 1, 275 | enabled: _isEnabled, 276 | )), 277 | SizedBox(width: 10.0,), 278 | Padding(padding:EdgeInsets.only(top: 30, left: 10),), 279 | new Flexible(child: TextFormField( 280 | keyboardType: TextInputType.number, 281 | // validator: (String val){ 282 | // if(val.length ==0){ 283 | // return "Please enter a value"; 284 | // } 285 | // else{ return null;} 286 | // }, 287 | // autovalidate: _autoValidate, 288 | onSaved: (value) { 289 | if (value.isEmpty){ 290 | value = 0.toString(); 291 | LampCircumference = double.parse(value); 292 | } 293 | else{ 294 | LampCircumference = double.parse(value);} 295 | }, 296 | decoration: InputDecoration( 297 | labelText: 'Lamp Circumference', 298 | labelStyle: TextStyle(fontWeight: FontWeight.bold) 299 | ), 300 | maxLines: 1, 301 | enabled: _isEnabled, 302 | )) 303 | ], 304 | ), 305 | ], 306 | ), 307 | ) 308 | ), 309 | 310 | ListTile( 311 | title: Container( 312 | height: 470, 313 | decoration: BoxDecoration( 314 | color: Color.fromARGB(100, 254, 254, 254), 315 | borderRadius:BorderRadius.circular(8.0), 316 | boxShadow:[ 317 | BoxShadow( 318 | color:Colors.black12, 319 | offset:Offset(0.0, -2.0), 320 | blurRadius:1.0 321 | ) 322 | ] 323 | ), 324 | padding: EdgeInsets.all(20.0), 325 | child: Container( 326 | child: Column( 327 | children: [ 328 | Row(children: [ 329 | Text("Add image nearby: ", style: TextStyle(fontWeight: FontWeight.bold),), 330 | Padding(padding:(EdgeInsets.only(left: 70.0)),), 331 | Container( 332 | decoration: BoxDecoration( 333 | color:Color.fromARGB(150, 255, 255, 255), 334 | border: Border.all(color: Colors.black,width: 1), 335 | borderRadius: BorderRadius.circular(8.0), 336 | ), 337 | height: 90, width: 130, 338 | padding: EdgeInsets.all(2.0), 339 | child: ImageNearby == null? 340 | IconButton(icon: Icon(Icons.broken_image , size: 40,), 341 | onPressed: PickImageNearby, 342 | ) 343 | :Image.file(File(ImageNearby), fit: BoxFit.fill,) 344 | ) 345 | ], 346 | ), 347 | Row( 348 | children: [ 349 | Padding(padding: EdgeInsets.only(top: 170),), 350 | Text("Add image overall: ", style: TextStyle(fontWeight: FontWeight.bold),), 351 | Padding(padding: (EdgeInsets.only(left: 70.0)),), 352 | Container( 353 | decoration: BoxDecoration( 354 | color:Color.fromARGB(150, 255, 255, 255), 355 | border:Border.all(color: Colors.black,width: 1), 356 | borderRadius:BorderRadius.circular(8.0), 357 | ), 358 | height: 90, width: 130, 359 | padding: EdgeInsets.all(2.0), 360 | child: ImageOverall == null? 361 | IconButton(icon: Icon(Icons.broken_image, size: 40,), 362 | onPressed: PickImageOverAll,) 363 | : Image.file(File(ImageOverall), fit: BoxFit.fill,) 364 | ) 365 | ], 366 | ), 367 | Row( 368 | children: [ 369 | Padding(padding: EdgeInsets.only(top: 170),), 370 | Text("Add image sunpath:", style: TextStyle(fontWeight: FontWeight.bold),), 371 | Padding(padding: (EdgeInsets.only(left: 50.0)),), 372 | Container( 373 | decoration: BoxDecoration( 374 | color:Color.fromARGB(150, 255, 255, 255), 375 | border:Border.all(color: Colors.black,width: 1), 376 | borderRadius:BorderRadius.circular(8.0), 377 | ), 378 | height: 90, width: 130, 379 | padding: EdgeInsets.all(2.0), 380 | child: SunPath == null? 381 | IconButton(icon: Icon(Icons.broken_image, size: 40,), 382 | onPressed: PickImageSunpath,) 383 | : Image.file(File(SunPath), fit: BoxFit.fill,) 384 | ) 385 | ], 386 | ) 387 | ], 388 | ) 389 | ), 390 | ), 391 | ), 392 | 393 | ListTile( 394 | title: Container( 395 | child: CheckboxListTile( 396 | title: Text("The sensor has been installed"), 397 | value: Status!= false, 398 | onChanged: (bool val){ 399 | setState(() { 400 | Status = val ?true :false ; 401 | }); 402 | print(Status.toString()); 403 | }, 404 | ), 405 | ), 406 | ), 407 | 408 | 409 | 410 | ListTile( 411 | contentPadding: EdgeInsets.all(15.0), 412 | title: Container( 413 | height: 100, 414 | child: Stack( 415 | children :[ 416 | GoogleMap( 417 | initialCameraPosition: CameraPosition( 418 | target: LatLng(21.4858, 39.1925), 419 | zoom: 10.0, 420 | ), 421 | ), 422 | Positioned( 423 | top:30, 424 | right: 15, 425 | left: 15, 426 | child: Container( 427 | height: 50.0, 428 | width: double.infinity, 429 | child: IconButton( 430 | icon: Icon(Icons.location_on), 431 | onPressed: (){ 432 | Navigator.push( 433 | context, 434 | MaterialPageRoute(builder: (BuildContext context)=> Getlocation()), 435 | ); 436 | }, 437 | iconSize: 50.0) 438 | ), 439 | ) 440 | ] 441 | ), 442 | ), 443 | ), 444 | 445 | ListTile( 446 | title: RaisedButton( 447 | child: Text('Save'), 448 | onPressed: () { 449 | _validateInputs(); 450 | this.key.currentState.save(); 451 | loc(); 452 | // Inspection inspectionData = new Inspection(id: id, name:name, TunnelWidht:TunnelWidht, TunnelHeight: TunnelHeight 453 | // ,LampWidth: LampWidth, LampCircumference: LampCircumference, ImageNearby: ImageNearby.toString(), ImageOverall:ImageOverall.toString(), 454 | // SunPath: SunPath.toString(), Latitude: Latitude, Longtitude: Longtitude, Status:Status,Sensor: Sensor, ProjectId: projectId); 455 | // postInspectionList( inspectionData); 456 | print( "output"); 457 | // print(postProjectList(projectData)); 458 | // Navigator.pop(context, inspectionData); 459 | 460 | } ), 461 | ), 462 | ] 463 | ) 464 | ) 465 | ) 466 | ); 467 | } 468 | } 469 | -------------------------------------------------------------------------------- /lib/NewPorject.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | import 'package:api_app/Models.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:http/http.dart' as http; 6 | import 'dart:convert'; 7 | import 'package:api_app/global.dart'; 8 | 9 | class NewProject extends StatefulWidget { 10 | final List project; 11 | final int countryID; 12 | 13 | NewProject (this.project, this.countryID); 14 | @override 15 | _NewProjectState createState() => _NewProjectState(project, countryID); 16 | } 17 | 18 | class _NewProjectState extends State { 19 | List project; final int countryID; 20 | _NewProjectState(this.project,this.countryID); 21 | 22 | int id; String name; 23 | String city; String orgnazation; 24 | double latitude ; double longtitude; 25 | int CountryId; 26 | TextEditingController priceController = TextEditingController(); 27 | final key = GlobalKey(); 28 | Map headers = {"Content-type": "application/json"}; 29 | 30 | Future postProjectList( Project item) async{ 31 | http.post(URL.URL_PROJECT ,headers:headers, 32 | body: json.encode(item.toMap(id))).then((http.Response response){ 33 | print("Response status: ${response.statusCode}"); 34 | print("Response body: ${response.contentLength}"); 35 | print(response.reasonPhrase); 36 | print(response.request); 37 | // print(response.body); 38 | print(item.toMap(id)); 39 | print(json.decode(response.body)['id']); 40 | item.id = json.decode(response.body)['id']; 41 | Navigator.pop(context, item); 42 | }); 43 | } 44 | 45 | 46 | @override 47 | Widget build(BuildContext context) { 48 | return Scaffold( 49 | appBar: AppBar( 50 | title: Text("Add new project"), 51 | ), 52 | body: SingleChildScrollView( 53 | child:Form( 54 | key:key , 55 | child: Column( 56 | crossAxisAlignment: CrossAxisAlignment.start, 57 | children: [ 58 | ListTile( 59 | contentPadding: EdgeInsets.all(15.0), 60 | title:TextFormField( 61 | onSaved: (value)=> name= value, 62 | decoration: InputDecoration( 63 | labelText: 'Project Name', 64 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 65 | border: new OutlineInputBorder( 66 | borderRadius: new BorderRadius.circular(15.0) 67 | ) 68 | ), 69 | maxLines: 1, 70 | 71 | ) 72 | ), 73 | ListTile( 74 | contentPadding: EdgeInsets.all(15.0), 75 | title:TextFormField( 76 | onSaved: (value)=> city= value, 77 | decoration: InputDecoration( 78 | labelText: 'Enter city', 79 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 80 | border: new OutlineInputBorder( 81 | borderRadius: new BorderRadius.circular(15.0) 82 | ) 83 | ), 84 | maxLines: 1, 85 | 86 | ) 87 | ), 88 | ListTile( 89 | contentPadding: EdgeInsets.all(15.0), 90 | title:TextFormField( 91 | onSaved: (value)=> orgnazation= value, 92 | decoration: InputDecoration( 93 | labelText: 'orgnazation', 94 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 95 | border: new OutlineInputBorder( 96 | borderRadius: new BorderRadius.circular(15.0) 97 | ) 98 | ), 99 | maxLines: 1, 100 | 101 | ) 102 | ), 103 | ListTile( 104 | contentPadding: EdgeInsets.all(15.0), 105 | title:TextFormField( 106 | onSaved: (value)=> latitude = double.parse(value), 107 | keyboardType: TextInputType.number, 108 | decoration: InputDecoration( 109 | labelText: 'Latitude', 110 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 111 | border: new OutlineInputBorder( 112 | borderRadius: new BorderRadius.circular(15.0) 113 | ) 114 | ), 115 | maxLines: 1, 116 | 117 | ) 118 | ), 119 | ListTile( 120 | contentPadding: EdgeInsets.all(15.0), 121 | title:TextFormField( 122 | onSaved: (value)=> longtitude= double.parse(value), 123 | keyboardType: TextInputType.number, 124 | decoration: InputDecoration( 125 | labelText: 'Longtitude', 126 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 127 | border: new OutlineInputBorder( 128 | borderRadius: new BorderRadius.circular(15.0) 129 | ) 130 | ), 131 | maxLines: 1, 132 | 133 | ) 134 | ), 135 | ListTile( 136 | title: RaisedButton( 137 | child: Text('Save'), 138 | onPressed: () { 139 | // print(countryID); 140 | this.key.currentState.save(); 141 | Project projectData = new Project(id: id, name: name, city: city, orgnazation: orgnazation, 142 | latitude: latitude, longtitude: longtitude, CountryId: countryID); 143 | postProjectList( projectData); 144 | } ), 145 | ) 146 | ] 147 | ) 148 | ) 149 | ) 150 | ); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /lib/ProjectListView.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:api_app/InspectionListView.dart'; 3 | import 'package:api_app/Models.dart'; 4 | import 'package:api_app/NewPorject.dart'; 5 | import 'package:api_app/global.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:http/http.dart' as http; 8 | import 'package:api_app/UpdateProject.dart'; 9 | 10 | class ProjectListView extends StatefulWidget { 11 | 12 | final int countryID; 13 | final String countryName; 14 | ProjectListView({this.countryID, this.countryName}):super(); 15 | 16 | @override 17 | _ProjectListState createState()=> _ProjectListState(countryID, countryName); 18 | } 19 | 20 | class _ProjectListState extends State { 21 | 22 | final int countryID; 23 | final String countryName; 24 | List projectList = new List(); 25 | 26 | _ProjectListState(this.countryID, this.countryName); 27 | Map headers = {"Content-type": "application/json"}; 28 | void initState() { 29 | super.initState(); 30 | getProjectList(this.countryID); 31 | } 32 | 33 | void getProjectList(int c_id) { 34 | http.get(URL.URL_PROJECT + c_id.toString()).then((response) { 35 | setState(() { 36 | Iterable list = json.decode(response.body); 37 | projectList = list.map((model) => Project.fromJson(model)).toList(); 38 | print(response.request); 39 | print(response.body); 40 | }); 41 | }); 42 | } 43 | void DeleteProject ( List item, int p_id){ 44 | http.delete(URL.URL_PROJECT+ p_id.toString(), headers: headers).then((http.Response response){ 45 | print("Response status: ${response.statusCode}"); 46 | print("Response body: ${response.contentLength}"); 47 | print(response.reasonPhrase); 48 | print(response.request); 49 | 50 | }); 51 | } 52 | void _selfRefresh() { 53 | getProjectList(this.countryID); 54 | print("project list updated"); 55 | } 56 | 57 | @override 58 | Widget build(BuildContext context) { 59 | return Scaffold( 60 | body: CustomScrollView( 61 | slivers: [ 62 | SliverAppBar( 63 | expandedHeight: 160.0, 64 | floating: false, 65 | pinned: true, 66 | flexibleSpace: FlexibleSpaceBar( 67 | background: Image.asset('assets/HD.jpg',fit: BoxFit.cover,), 68 | title: Text(countryName, style: TextStyle(fontSize: 20.0,height:5.0,)), 69 | ), 70 | actions: [ 71 | IconButton( 72 | icon: AddProject(projectList, countryID), 73 | ) 74 | ], 75 | ), 76 | SliverFillRemaining( 77 | child: projectList.length ==0 ? 78 | Center(child: Column( 79 | children: [ 80 | Padding(padding: EdgeInsets.only(top: 200),), 81 | Text("No Projects " , style: TextStyle(fontWeight: FontWeight.bold),), 82 | RaisedButton( 83 | child: Text('Add new project'), 84 | onPressed: ()async { 85 | Project p = await Navigator.push(context, 86 | MaterialPageRoute( 87 | builder: (BuildContext Context)=> NewProject(projectList,countryID), 88 | )); 89 | if (p==null){ 90 | Scaffold.of(context).showSnackBar( 91 | SnackBar( 92 | content: Text("Failed"), 93 | backgroundColor: Colors.grey, 94 | duration: Duration(seconds: 3), 95 | ), 96 | ); 97 | } 98 | else{ 99 | projectList.add(p); 100 | // Scaffold.of(context).showSnackBar(SnackBar( 101 | // content: Text('Saved'), 102 | // backgroundColor: Colors.green, 103 | // duration: Duration(seconds: 3), 104 | // ) 105 | // ); 106 | } 107 | }, 108 | ) 109 | ], 110 | ),) 111 | :ListView.builder( 112 | itemCount: this.projectList.length, 113 | itemBuilder: (context, i){ 114 | return Card( 115 | elevation: 5.0, 116 | shape: RoundedRectangleBorder( 117 | borderRadius: BorderRadius.circular(3.0), 118 | ), 119 | child: InkWell ( 120 | onTap: (){ 121 | Navigator.push(context, new MaterialPageRoute ( 122 | builder: (context) => InspectionListView(projectID: projectList[i].id, country: countryName, city: projectList[i].city)), 123 | ); 124 | // print(projectList[i].CountryId); 125 | }, 126 | child: Container( 127 | padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 25.0), 128 | child: Row( 129 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 130 | crossAxisAlignment: CrossAxisAlignment.start, 131 | children: [ 132 | Row( 133 | crossAxisAlignment: CrossAxisAlignment.start, 134 | children: [ 135 | Container( 136 | width: 350.0, 137 | height: 50.0, 138 | child: ListTile( 139 | isThreeLine: true, 140 | leading: CircleAvatar( 141 | child: Image.asset('assets/sadeem.png'),), 142 | title: Text(projectList[i].name), 143 | subtitle: Text(projectList[i].city), 144 | trailing: Row( 145 | mainAxisSize: MainAxisSize.min, 146 | children: [ 147 | IconButton( icon: 148 | Icon(Icons.edit, size: 25, color: Color.fromARGB(255, 56, 96,170),), 149 | onPressed: (){ 150 | Navigator.push(context, 151 | MaterialPageRoute(builder: (BuildContext context) =>UpdateProject(P_id:projectList[i].id, p_name: projectList[i].name, 152 | p_city: projectList[i].city, p_orgnazation: projectList[i].orgnazation, 153 | p_latitude: projectList[i].latitude, p_longtitude: projectList[i].longtitude, Countryid: countryID, onUpdateProjectList: _selfRefresh) ) 154 | ); 155 | }), 156 | IconButton(icon: 157 | Icon(Icons.delete, size: 25, color: Color.fromARGB(255, 243, 146, 00),), 158 | onPressed: () { 159 | return showDialog( 160 | context: context, 161 | barrierDismissible: false, 162 | builder: (BuildContext context){ 163 | return AlertDialog( 164 | title: Text("Delete?"), 165 | content: Text("Are you sure you want to delete "+projectList[i].name), 166 | actions: [ 167 | FlatButton( 168 | child: const Text("CANCEL"), 169 | onPressed: (){ 170 | Navigator.of(context).pop(Confirmation.CANCEL); 171 | }, 172 | ), 173 | FlatButton( 174 | child: const Text("YES"), 175 | onPressed: (){ 176 | Navigator.of(context).pop(Confirmation.ACCEPT); 177 | DeleteProject(projectList, projectList[i].id); 178 | setState(() { 179 | projectList.removeAt(i); 180 | }); 181 | } 182 | ) 183 | ], 184 | ); 185 | });// DeleteProject(projectList,projectList[i].id ); 186 | }), 187 | ], 188 | ), 189 | ), 190 | ) 191 | ], 192 | ) 193 | ] 194 | ) 195 | ) 196 | ) 197 | ); 198 | }, 199 | ) 200 | ) 201 | ], 202 | ), 203 | ); 204 | } 205 | } 206 | 207 | class AddProject extends StatelessWidget { 208 | final List project; 209 | final int CountryId; 210 | AddProject (this.project, this.CountryId); 211 | @override 212 | Widget build(BuildContext context) { 213 | return IconButton( 214 | padding: EdgeInsets.only(right: 40), 215 | icon: Icon(Icons.add, size: 40,color: Colors.white), 216 | onPressed: ()async { 217 | print(CountryId); 218 | Project p = await Navigator.push(context, 219 | MaterialPageRoute( 220 | builder: (BuildContext Context)=> NewProject(project,CountryId), 221 | )); 222 | if (p==null){ 223 | Scaffold.of(context).showSnackBar( 224 | SnackBar( 225 | content: Text("Failed"), 226 | backgroundColor: Colors.grey, 227 | duration: Duration(seconds: 3), 228 | ), 229 | ); 230 | } 231 | else{ 232 | project.add(p); 233 | Scaffold.of(context).showSnackBar(SnackBar( 234 | content: Text('Saved'), 235 | backgroundColor: Colors.green, 236 | duration: Duration(seconds: 3), 237 | ) 238 | ); 239 | } 240 | }, 241 | 242 | ); 243 | } 244 | } 245 | enum Confirmation {CANCEL, ACCEPT } -------------------------------------------------------------------------------- /lib/UpdateCountry.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:api_app/Models.dart'; 3 | import 'package:api_app/global.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'dart:convert'; 6 | 7 | class UpdateCountry extends StatefulWidget { 8 | final int countryID; 9 | final String countryName; 10 | UpdateCountry({Key key, this.countryID, this.countryName}) : super(); 11 | @override 12 | _UpdateCountryState createState() => _UpdateCountryState(countryID, countryName); 13 | } 14 | 15 | class _UpdateCountryState extends State { 16 | final int countryID; 17 | final String countryName; 18 | 19 | _UpdateCountryState(this.countryID, this.countryName); 20 | final key = GlobalKey(); 21 | Country country; 22 | String name; 23 | final GlobalKey _refreshIndicatorKey = 24 | new GlobalKey(); 25 | Map headers = {"Content-type": "application/json"}; 26 | 27 | Future UpdateCountryitem ( Country item, int c_id) async{ 28 | http.put(URL.URL_COUNTRY + c_id.toString() ,headers:headers, 29 | body: json.encode(item.toMapEdit(c_id))).then((http.Response response){ 30 | print("Response status: ${response.statusCode}"); 31 | print("Response body: ${response.contentLength}"); 32 | print(response.reasonPhrase); 33 | print(response.request); 34 | print(item.toMapEdit(c_id)); 35 | 36 | }); 37 | } 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | appBar: AppBar( 43 | title: Text('Add new Project'), 44 | ), 45 | body: SingleChildScrollView( 46 | child:Form( 47 | key:key , 48 | child: Column( 49 | crossAxisAlignment: CrossAxisAlignment.start, 50 | children: [ 51 | ListTile( 52 | contentPadding: EdgeInsets.all(15.0), 53 | title:TextFormField( 54 | onSaved: (value)=> name= value, 55 | decoration: InputDecoration( 56 | labelText: 'Country Name', 57 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 58 | border: new OutlineInputBorder( 59 | borderRadius: new BorderRadius.circular(15.0) 60 | ) 61 | ), 62 | maxLines: 1, 63 | 64 | ) 65 | ), 66 | ListTile( 67 | title: RaisedButton( 68 | child: Text('Save'), 69 | onPressed: () { 70 | this.key.currentState.save(); 71 | Country country = new Country(id: countryID, name: name); 72 | UpdateCountryitem (country,countryID ); 73 | Navigator.pop(context, country); 74 | } ), 75 | ) 76 | ], 77 | ) 78 | ) 79 | ) 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/UpdateInspection.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | import 'dart:io'; 3 | import 'package:api_app/Models.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:http/http.dart' as http; 6 | import 'dart:convert'; 7 | import 'package:api_app/global.dart'; 8 | import 'package:image_picker/image_picker.dart'; 9 | 10 | class UpdateInspectin extends StatefulWidget { 11 | final int I_id; 12 | final String I_name; 13 | final double I_TunnelWidht; 14 | final double I_TunnelHeight; 15 | final double I_LampWidth; 16 | final double I_LampCircumference; 17 | final String I_ImageNearby; 18 | final String I_ImageOverall; 19 | final String I_SunPath; 20 | final double I_Latitude; 21 | final double I_Longtitude; 22 | final bool I_Status; 23 | final String I_Sensor; 24 | final int I_ProjectId; 25 | final VoidCallback onUpdateInspectionList; 26 | 27 | UpdateInspectin({this.I_id, this.I_name, this.I_TunnelWidht, this.I_TunnelHeight, this.I_LampWidth, this.I_LampCircumference, 28 | this.I_ImageNearby, this.I_ImageOverall,this.I_SunPath, this.I_Latitude , this.I_Longtitude , 29 | this.I_Status, this.I_Sensor, this.I_ProjectId, this.onUpdateInspectionList}) : super(); 30 | @override 31 | _UpdateInspectinState createState() => _UpdateInspectinState(I_id, I_name, I_TunnelWidht,I_TunnelHeight, I_LampWidth,I_LampCircumference, 32 | I_ImageNearby, I_ImageOverall ,I_SunPath, I_Latitude, I_Longtitude,I_Status, I_Sensor, I_ProjectId); 33 | } 34 | 35 | class _UpdateInspectinState extends State { 36 | final int I_id; 37 | final String I_name; 38 | final double I_TunnelWidht; 39 | final double I_TunnelHeight; 40 | final double I_LampWidth; 41 | final double I_LampCircumference; 42 | final String I_ImageNearby; 43 | final String I_ImageOverall; 44 | final String I_SunPath; 45 | final double I_Latitude; 46 | final double I_Longtitude; 47 | final bool I_Status; 48 | final String I_Sensor; 49 | final int I_ProjectId; 50 | 51 | _UpdateInspectinState(this.I_id, this.I_name, this.I_TunnelWidht,this.I_TunnelHeight,this.I_LampWidth, this.I_LampCircumference, 52 | this.I_ImageNearby, this.I_ImageOverall,this.I_SunPath, this.I_Latitude, this.I_Longtitude,this.I_Status,this.I_Sensor, this.I_ProjectId); 53 | final key = GlobalKey(); 54 | int id; 55 | String name; 56 | double TunnelWidht; 57 | double TunnelHeight; 58 | double LampWidth; 59 | double LampCircumference; 60 | String ImageNearby; 61 | String ImageOverall; 62 | String SunPath; 63 | double Latitude; 64 | double Longtitude; 65 | bool Status; 66 | String Sensor; 67 | int ProjectId; 68 | Map headers = {"Content-type": "application/json"}; 69 | bool _autoValidate = false; 70 | void PickImageNearby() async { 71 | print('picker is called '); 72 | var image = await ImagePicker.pickImage(source: ImageSource.camera ); 73 | ImageNearby = image.path; 74 | print(ImageNearby); 75 | setState(() { 76 | ImageNearby; 77 | }); 78 | } 79 | void PickImageOverAll() async { 80 | print('picker is called '); 81 | var imageo = await ImagePicker.pickImage(source: ImageSource.camera ); 82 | ImageOverall = imageo.path; 83 | print(ImageOverall); 84 | setState(() { 85 | ImageOverall; 86 | }); 87 | } 88 | void PickImageSunpath() async { 89 | print('picker is called '); 90 | var image = await ImagePicker.pickImage(source: ImageSource.camera ); 91 | SunPath = image.path; 92 | print(SunPath); 93 | setState(() { 94 | SunPath; 95 | }); 96 | } 97 | Future UpdateInspectionList(Inspection item, int i_id) async { 98 | http.put(URL.URL_INSPECTION + i_id.toString() , headers: headers, 99 | body: json.encode(item.toMapEdit())).then((http.Response response) { 100 | print("Response status: ${response.statusCode}"); 101 | print("Response body: ${response.contentLength}"); 102 | print(response.reasonPhrase); 103 | print(response.request); 104 | print(item.toMapEdit()); 105 | widget.onUpdateInspectionList(); 106 | }); 107 | } 108 | void _validateInputs() { 109 | if (key.currentState.validate()) { 110 | // If all data are correct then save data to out variables 111 | key.currentState.save(); 112 | } else { 113 | // If all data are not valid then start auto validation. 114 | setState(() { 115 | _autoValidate = true; 116 | }); 117 | } 118 | } 119 | @override 120 | Widget build(BuildContext context) { 121 | return Scaffold( 122 | appBar: AppBar( 123 | title: Text("Edit"), 124 | ), 125 | body: SingleChildScrollView( 126 | child:Form( 127 | key:key , 128 | child: Column( 129 | crossAxisAlignment: CrossAxisAlignment.start, 130 | children: [ 131 | ListTile( 132 | contentPadding: EdgeInsets.all(15.0), 133 | title:TextFormField( 134 | onSaved:( value){ 135 | if (value.isEmpty){ 136 | value = I_name; 137 | name= value; 138 | } 139 | else { 140 | name = value; 141 | } 142 | }, 143 | decoration: InputDecoration( 144 | labelText: "Inspection Name", 145 | hintText:I_name , 146 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 147 | border: new OutlineInputBorder( 148 | borderRadius: new BorderRadius.circular(15.0) 149 | ) 150 | ), 151 | maxLines: 1, 152 | 153 | ) 154 | ), 155 | ListTile( 156 | contentPadding: EdgeInsets.all(15.0), 157 | title:TextFormField( 158 | onSaved: (value){ 159 | if (value.isEmpty){ 160 | value = I_Sensor; 161 | Sensor= value; 162 | } 163 | else{ 164 | Sensor= value; 165 | } 166 | }, 167 | decoration: InputDecoration( 168 | labelText:"Sensor name", 169 | hintText: I_Sensor, 170 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 171 | border: new OutlineInputBorder( 172 | borderRadius: new BorderRadius.circular(15.0) 173 | ) 174 | ), 175 | maxLines: 1, 176 | 177 | ) 178 | ), 179 | ListTile( 180 | contentPadding: EdgeInsets.all(15.0), 181 | title: Container( 182 | height: 150, 183 | decoration: BoxDecoration( 184 | color:Color.fromARGB(10, 0, 0, 0), 185 | borderRadius:BorderRadius.circular(8.0) 186 | ), 187 | child: Column( children: [ 188 | Padding( padding: EdgeInsets.only( top: 20)), 189 | Text("Tunnel post",style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),), 190 | Padding( padding: EdgeInsets.only( bottom: 20),), 191 | Row( 192 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 193 | children: [Padding(padding:EdgeInsets.only(top:30, left: 10),), 194 | new Flexible(child: TextFormField( 195 | keyboardType: TextInputType.number, 196 | validator: (String val){ 197 | if (val.length==0){ 198 | return "Please enter a value"; 199 | } 200 | else{return null; } 201 | }, 202 | autovalidate: _autoValidate, 203 | onSaved:( value) { 204 | if (value.isEmpty){ 205 | value = I_TunnelWidht.toString(); 206 | TunnelWidht = double.parse(value); 207 | } 208 | else{ 209 | TunnelWidht = double.parse(value); 210 | } 211 | }, 212 | decoration: InputDecoration( 213 | labelText:"Tunnel width" , 214 | hintText:I_TunnelWidht.toString() , 215 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 216 | border: new OutlineInputBorder( 217 | borderRadius: new BorderRadius.circular(15.0) 218 | ) 219 | ), 220 | maxLines: 1, 221 | )), 222 | SizedBox(width: 10.0,), 223 | Padding(padding:EdgeInsets.only(top: 30, left: 10),), 224 | new Flexible(child: TextFormField( 225 | keyboardType: TextInputType.number, 226 | validator: (String val){ 227 | if(val.length ==0){ 228 | return "Please enter a value"; 229 | } 230 | else{ return null;} 231 | }, 232 | autovalidate: _autoValidate, 233 | onSaved: (value){ 234 | if (value.isEmpty){ 235 | value= I_TunnelHeight.toString(); 236 | TunnelHeight = double.parse(value); 237 | } 238 | else{ 239 | TunnelHeight = double.parse(value); 240 | } 241 | }, 242 | decoration: InputDecoration( 243 | labelText: "Tunnel Height", 244 | hintText:I_TunnelHeight.toString() , 245 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 246 | border: new OutlineInputBorder( 247 | borderRadius: new BorderRadius.circular(15.0) 248 | ) 249 | ), 250 | maxLines: 1, 251 | )) 252 | ], 253 | ) 254 | ],), 255 | ), 256 | 257 | ), 258 | 259 | ListTile( 260 | contentPadding: EdgeInsets.all(15.0), 261 | title: Container( 262 | height: 150, 263 | decoration: BoxDecoration( 264 | color:Color.fromARGB(10, 0, 0, 0), 265 | borderRadius:BorderRadius.circular(8.0) 266 | ), 267 | child: Column( children: [ 268 | Padding( padding: EdgeInsets.only( top: 20)), 269 | Text("Lamp Post",style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),), 270 | Padding( padding: EdgeInsets.only( bottom: 20),), 271 | Row( 272 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 273 | children: [Padding(padding:EdgeInsets.only(top:30, left: 10),), 274 | new Flexible(child: TextFormField( 275 | keyboardType: TextInputType.number, 276 | validator: (String val){ 277 | if (val.length==0){ 278 | return "Please enter a value"; 279 | } 280 | else{return null; } 281 | }, 282 | autovalidate: _autoValidate, 283 | onSaved: (value){ 284 | if (value.isEmpty){ 285 | value = I_LampWidth.toString(); 286 | LampWidth = double.parse(value); 287 | } 288 | else{ 289 | LampWidth = double.parse(value); 290 | } 291 | }, 292 | decoration: InputDecoration( 293 | labelText: "Lamp Width", 294 | hintText:I_LampWidth.toString(), 295 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 296 | border: new OutlineInputBorder( 297 | borderRadius: new BorderRadius.circular(15.0) 298 | ) 299 | ), 300 | maxLines: 1, 301 | )), 302 | SizedBox(width: 10.0,), 303 | Padding(padding:EdgeInsets.only(top: 30, left: 10),), 304 | new Flexible(child: TextFormField( 305 | keyboardType: TextInputType.number, 306 | validator: (String val){ 307 | if(val.length ==0){ 308 | return "Please enter a value"; 309 | } 310 | else{ return null;} 311 | }, 312 | autovalidate: _autoValidate, 313 | onSaved: (value) { 314 | if (value.isEmpty){ 315 | value = I_LampCircumference.toString(); 316 | LampCircumference = double.parse(value); 317 | } 318 | else{ 319 | LampCircumference = double.parse(value); 320 | } 321 | }, 322 | decoration: InputDecoration( 323 | labelText: "Lamp Circumference", 324 | hintText: I_LampCircumference.toString(), 325 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 326 | border: new OutlineInputBorder( 327 | borderRadius: new BorderRadius.circular(15.0) 328 | ) 329 | ), 330 | maxLines: 1, 331 | )) 332 | ], 333 | ) 334 | ],), 335 | ), 336 | 337 | ), 338 | 339 | ListTile( 340 | title: Container( 341 | height: 470, 342 | decoration: BoxDecoration( 343 | color: Color.fromARGB(100, 254, 254, 254), 344 | borderRadius:BorderRadius.circular(8.0), 345 | boxShadow:[ 346 | BoxShadow( 347 | color:Colors.black12, 348 | offset:Offset(0.0, -2.0), 349 | blurRadius:1.0 350 | ) 351 | ] 352 | ), 353 | padding: EdgeInsets.all(20.0), 354 | child: Container( 355 | child: Column( 356 | children: [ 357 | Row(children: [ 358 | Text("Add image nearby: ", style: TextStyle(fontWeight: FontWeight.bold),), 359 | Padding(padding:(EdgeInsets.only(left: 70.0)),), 360 | Container( 361 | decoration: BoxDecoration( 362 | color:Color.fromARGB(150, 255, 255, 255), 363 | border: Border.all(color: Colors.black,width: 1), 364 | borderRadius: BorderRadius.circular(8.0), 365 | ), 366 | height: 90, width: 130, 367 | padding: EdgeInsets.all(2.0), 368 | child: ImageNearby == null? 369 | IconButton(icon: Icon(Icons.broken_image , size: 40,), 370 | onPressed:PickImageNearby 371 | ) 372 | :Image.file(File(ImageNearby), fit: BoxFit.fill,) 373 | ) 374 | ], 375 | ), 376 | Row( 377 | children: [ 378 | Padding(padding: EdgeInsets.only(top: 170),), 379 | Text("Add image overall: ", style: TextStyle(fontWeight: FontWeight.bold),), 380 | Padding(padding: (EdgeInsets.only(left: 70.0)),), 381 | Container( 382 | decoration: BoxDecoration( 383 | color:Color.fromARGB(150, 255, 255, 255), 384 | border:Border.all(color: Colors.black,width: 1), 385 | borderRadius:BorderRadius.circular(8.0), 386 | ), 387 | height: 90, width: 130, 388 | padding: EdgeInsets.all(2.0), 389 | child: ImageOverall == null? 390 | IconButton(icon: Icon(Icons.broken_image, size: 40,), 391 | onPressed: PickImageOverAll,) 392 | : Image.file(File(ImageOverall), fit: BoxFit.fill,) 393 | ) 394 | ], 395 | ), 396 | Row( 397 | children: [ 398 | Padding(padding: EdgeInsets.only(top: 170),), 399 | Text("Add image sunpath:", style: TextStyle(fontWeight: FontWeight.bold),), 400 | Padding(padding: (EdgeInsets.only(left: 50.0)),), 401 | Container( 402 | decoration: BoxDecoration( 403 | color:Color.fromARGB(150, 255, 255, 255), 404 | border:Border.all(color: Colors.black,width: 1), 405 | borderRadius:BorderRadius.circular(8.0), 406 | ), 407 | height: 90, width: 130, 408 | padding: EdgeInsets.all(2.0), 409 | child: SunPath == null? 410 | IconButton(icon: Icon(Icons.broken_image, size: 40,), 411 | onPressed: PickImageSunpath,) 412 | : Image.file(File(SunPath), fit: BoxFit.fill,) 413 | ) 414 | ], 415 | ) 416 | ], 417 | ) 418 | ), 419 | ), 420 | ), 421 | ListTile( 422 | title: Container( 423 | child: CheckboxListTile( 424 | title: Text("The sensor has been installed"), 425 | value: Status!= false, 426 | onChanged: (bool val){ 427 | setState(() { 428 | Status = val ?true :false ; 429 | }); 430 | print(Status.toString()); 431 | }, 432 | ), 433 | ), 434 | ), 435 | 436 | ListTile( 437 | contentPadding: EdgeInsets.all(15.0), 438 | title:TextFormField( 439 | onSaved: (value)=> Latitude=I_Latitude, 440 | decoration: InputDecoration( 441 | labelText: I_Latitude.toString(), 442 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 443 | border: new OutlineInputBorder( 444 | borderRadius: new BorderRadius.circular(15.0) 445 | ) 446 | ), 447 | maxLines: 1, 448 | 449 | ) 450 | ), 451 | ListTile( 452 | contentPadding: EdgeInsets.all(15.0), 453 | title:TextFormField( 454 | onSaved: (value)=> Longtitude=I_Longtitude, 455 | decoration: InputDecoration( 456 | labelText: I_Longtitude.toString(), 457 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 458 | border: new OutlineInputBorder( 459 | borderRadius: new BorderRadius.circular(15.0) 460 | ) 461 | ), 462 | maxLines: 1, 463 | 464 | ) 465 | ), 466 | 467 | 468 | ListTile( 469 | title: RaisedButton( 470 | child: Text('Save'), 471 | onPressed: () { 472 | this.key.currentState.save(); 473 | print(I_id); 474 | Inspection inspectiondata = new Inspection(id: I_id, name:name, TunnelWidht:TunnelWidht, TunnelHeight: TunnelHeight, 475 | LampWidth: LampWidth, LampCircumference: LampCircumference,ImageNearby: I_ImageNearby,Latitude: Latitude,Longtitude: Longtitude, 476 | ImageOverall:I_ImageOverall,SunPath: I_SunPath, Status: I_Status, Sensor:Sensor ,ProjectId: I_ProjectId); 477 | 478 | UpdateInspectionList( inspectiondata, I_id); 479 | print( "output"); 480 | // print(postProjectList(projectData)); 481 | Navigator.pop(context, inspectiondata); 482 | 483 | } ), 484 | ) 485 | ] 486 | ) 487 | ) 488 | ) 489 | ); 490 | } 491 | } 492 | -------------------------------------------------------------------------------- /lib/UpdateProject.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | import 'package:api_app/Models.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'dart:convert'; 6 | import 'package:api_app/global.dart'; 7 | 8 | class UpdateProject extends StatefulWidget { 9 | final int P_id; 10 | final String p_name; 11 | final String p_city; 12 | final String p_orgnazation; 13 | final double p_latitude; 14 | final double p_longtitude; 15 | final int Countryid; 16 | final VoidCallback onUpdateProjectList; 17 | 18 | UpdateProject({Key key, this.P_id, this.p_name, this.p_city, this.p_orgnazation, this.p_latitude, this.p_longtitude, this.Countryid, this.onUpdateProjectList}) : super(); 19 | 20 | @override 21 | _UpdateProjectState createState() => _UpdateProjectState(P_id,p_name, p_city,p_orgnazation, p_latitude,p_longtitude, Countryid); 22 | } 23 | 24 | class _UpdateProjectState extends State { 25 | final int P_id; 26 | final String p_name; 27 | final String p_city; 28 | final String p_orgnazation; 29 | final double p_latitude; 30 | final double p_longtitude; 31 | final int Countryid; 32 | _UpdateProjectState(this.P_id, this.p_name, this.p_city, this.p_orgnazation, this.p_latitude, this.p_longtitude, this.Countryid); 33 | 34 | final key = GlobalKey(); 35 | int id; 36 | String name; 37 | String city; 38 | String orgnazation; 39 | double latitude; 40 | double longtitude; 41 | int CountryId; 42 | Map headers = {"Content-type": "application/json"}; 43 | 44 | Future UpdateProjectList(Project item, int p_id) async { 45 | http.put(URL.URL_PROJECT+p_id.toString() , headers: headers, 46 | body: json.encode(item.toMapEdit(id))).then((http.Response response) { 47 | print("Response status: ${response.statusCode}"); 48 | print("Response body: ${response.contentLength}"); 49 | print(response.reasonPhrase); 50 | print(response.request); 51 | print(item.toMap(id)); 52 | widget.onUpdateProjectList(); 53 | }); 54 | } 55 | 56 | @override 57 | Widget build(BuildContext context) { 58 | return Scaffold( 59 | appBar: AppBar( 60 | title: Text("Add new project"), 61 | ), 62 | body: SingleChildScrollView( 63 | child:Form( 64 | key:key , 65 | child: Column( 66 | crossAxisAlignment: CrossAxisAlignment.start, 67 | children: [ 68 | ListTile( 69 | contentPadding: EdgeInsets.all(15.0), 70 | title:TextFormField( 71 | onSaved:( value){ 72 | if (value.isEmpty){ 73 | value = p_name; 74 | name= value; 75 | } 76 | else { 77 | name = value; 78 | } 79 | }, 80 | decoration: InputDecoration( 81 | labelText: p_name, 82 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 83 | border: new OutlineInputBorder( 84 | borderRadius: new BorderRadius.circular(15.0) 85 | ) 86 | ), 87 | maxLines: 1, 88 | 89 | ) 90 | ), 91 | ListTile( 92 | contentPadding: EdgeInsets.all(15.0), 93 | title:TextFormField( 94 | onSaved:( value){ 95 | if (value.isEmpty){ 96 | value= p_city; 97 | city = value; 98 | } 99 | else{ 100 | city= value; 101 | } 102 | }, 103 | decoration: InputDecoration( 104 | labelText: p_city, 105 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 106 | border: new OutlineInputBorder( 107 | borderRadius: new BorderRadius.circular(15.0) 108 | ) 109 | ), 110 | maxLines: 1, 111 | 112 | ) 113 | ), 114 | ListTile( 115 | contentPadding: EdgeInsets.all(15.0), 116 | title:TextFormField( 117 | onSaved:( value){ 118 | if (value.isEmpty){ 119 | value = p_orgnazation; orgnazation= value; 120 | } 121 | else{ 122 | orgnazation= value; 123 | } 124 | }, 125 | decoration: InputDecoration( 126 | labelText: p_orgnazation, 127 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 128 | border: new OutlineInputBorder( 129 | borderRadius: new BorderRadius.circular(15.0) 130 | ) 131 | ), 132 | maxLines: 1, 133 | 134 | ) 135 | ), 136 | ListTile( 137 | contentPadding: EdgeInsets.all(15.0), 138 | title:TextFormField( 139 | keyboardType: TextInputType.number, 140 | onSaved:( value) { 141 | if (value.isEmpty){ 142 | value = p_latitude.toString(); 143 | latitude = double.parse(value); 144 | } 145 | else{ 146 | latitude = double.parse(value); 147 | } 148 | }, 149 | 150 | decoration: InputDecoration( 151 | labelText:p_latitude.toString(), 152 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 153 | border: new OutlineInputBorder( 154 | borderRadius: new BorderRadius.circular(15.0) 155 | ) 156 | ), 157 | maxLines: 1, 158 | 159 | ) 160 | ), 161 | ListTile( 162 | contentPadding: EdgeInsets.all(15.0), 163 | title:TextFormField( 164 | keyboardType: TextInputType.number, 165 | onSaved:( value) { 166 | if (value.isEmpty){ 167 | value = p_longtitude.toString(); 168 | longtitude = double.parse(value); 169 | } 170 | else{ 171 | longtitude = double.parse(value); 172 | } 173 | }, 174 | decoration: InputDecoration( 175 | labelText: p_longtitude.toString(), 176 | labelStyle: TextStyle(fontWeight: FontWeight.bold), 177 | border: new OutlineInputBorder( 178 | borderRadius: new BorderRadius.circular(15.0) 179 | ) 180 | ), 181 | maxLines: 1, 182 | 183 | ) 184 | ), 185 | ListTile( 186 | title: RaisedButton( 187 | child: Text('Save'), 188 | onPressed: () { 189 | print(P_id); 190 | this.key.currentState.save(); 191 | Project projectData = new Project(id: P_id, name: name, city: city, orgnazation: orgnazation, 192 | latitude: latitude, longtitude: longtitude, CountryId:Countryid ); 193 | UpdateProjectList( projectData, P_id); 194 | print( "output"); 195 | // print(postProjectList(projectData)); 196 | Navigator.pop(context, projectData); 197 | 198 | } ), 199 | ) 200 | ] 201 | ) 202 | ) 203 | ) 204 | ); 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /lib/global.dart: -------------------------------------------------------------------------------- 1 | const SERVER_NAME="10.0.2.2"; 2 | const URL_COUNTRY = "http://$SERVER_NAME:500/Country"; 3 | const URL_PROJECT = "http://$SERVER_NAME:500/Project"; 4 | const URL_PROJECT_FROM_COUNTRY ="http://$SERVER_NAME:500/Project/Countryid"; 5 | 6 | 7 | class URL { 8 | static const SERVER_NAME = "10.0.2.2"; 9 | static const SERVER_PORT = 5000; 10 | static const baseUri = "http://$SERVER_NAME:$SERVER_PORT/api"; 11 | static const URL_COUNTRY = "$baseUri/Country/"; 12 | static const URL_PROJECT = "$baseUri/Project/"; 13 | static const URL_INSPECTION = "$baseUri/Inspection/"; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /lib/location.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_maps_flutter/google_maps_flutter.dart'; 3 | import 'dart:async'; 4 | import 'package:geolocator/geolocator.dart'; 5 | class Getlocation extends StatefulWidget { 6 | @override 7 | _GetlocationState createState() => _GetlocationState(); 8 | } 9 | 10 | class _GetlocationState extends State { 11 | GoogleMapController mycontroller; 12 | String searchadress; 13 | double Latitude; 14 | double Longtitude; 15 | Iterable markers = []; 16 | @override 17 | Widget build(BuildContext context) { 18 | return new Scaffold( 19 | body: Stack( 20 | children: [ 21 | GoogleMap( 22 | markers: Set.from(markers,), 23 | onMapCreated: onMapCreated , 24 | initialCameraPosition: CameraPosition( 25 | target: LatLng(21.4858, 39.1925), 26 | zoom: 10.0, 27 | ), 28 | ), 29 | Positioned( 30 | top: 30.0, 31 | right: 15.0, 32 | left: 15.0, 33 | child: Container( 34 | height: 50.0, 35 | width: double.infinity, 36 | child: IconButton( 37 | icon: Icon(Icons.location_on), 38 | onPressed: searchNav, 39 | 40 | iconSize: 50.0) 41 | ), 42 | ), 43 | Row( 44 | children: [ 45 | RaisedButton( 46 | child: Text("Add location"), 47 | onPressed: (){ 48 | print(Longtitude); 49 | Navigator.pop(context, Longtitude); 50 | }) 51 | ], 52 | ) 53 | ] 54 | ) 55 | ); 56 | } 57 | @override 58 | void initState() { 59 | // TODO: implement initState 60 | super.initState(); 61 | checker(); 62 | } 63 | 64 | void checker() async { 65 | final GeolocationStatus result = await Geolocator() 66 | .checkGeolocationPermissionStatus(); 67 | if (result == GeolocationStatus.disabled) { 68 | print("faild"); 69 | } 70 | else { 71 | print("success"); 72 | } 73 | } 74 | 75 | void searchNav() async{ 76 | Position position =await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high); 77 | setState(() { 78 | mycontroller.animateCamera(CameraUpdate.newCameraPosition( 79 | CameraPosition(target: LatLng(position.latitude, position.longitude), 80 | zoom: 16.0) 81 | )); 82 | Latitude = position.latitude; 83 | Longtitude = position.longitude; 84 | Iterable _markers = Iterable.generate(1, (index) { 85 | return Marker(markerId: MarkerId("marker$index"), position: LatLng(Latitude, Longtitude)); 86 | }); 87 | markers = _markers; 88 | print("$Latitude \n $Longtitude"); 89 | }); 90 | } 91 | 92 | void onMapCreated (GoogleMapController controller){ 93 | setState(() { 94 | mycontroller = controller; 95 | }); 96 | } 97 | } 98 | 99 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:api_app/CountryListView.dart'; 3 | import 'package:api_app/location.dart'; 4 | 5 | void main() => runApp(MaterialApp( 6 | home: MyApp(), 7 | debugShowCheckedModeBanner: false, 8 | )); 9 | 10 | class MyApp extends StatefulWidget { 11 | 12 | @override 13 | _MyAppState createState() => _MyAppState(); 14 | } 15 | 16 | class _MyAppState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return MaterialApp( 20 | title:"Sadeem", 21 | theme: ThemeData( 22 | primarySwatch: Colors.deepOrange, accentColor: Color.fromARGB(255, 29, 29, 27) 23 | ), 24 | home: CountryList(), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /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.3.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.5" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | cupertino_icons: 33 | dependency: "direct main" 34 | description: 35 | name: cupertino_icons 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.1.2" 39 | flutter: 40 | dependency: "direct main" 41 | description: flutter 42 | source: sdk 43 | version: "0.0.0" 44 | flutter_test: 45 | dependency: "direct dev" 46 | description: flutter 47 | source: sdk 48 | version: "0.0.0" 49 | geolocator: 50 | dependency: "direct main" 51 | description: 52 | name: geolocator 53 | url: "https://pub.dartlang.org" 54 | source: hosted 55 | version: "3.0.1" 56 | google_api_availability: 57 | dependency: transitive 58 | description: 59 | name: google_api_availability 60 | url: "https://pub.dartlang.org" 61 | source: hosted 62 | version: "2.0.1" 63 | google_maps_flutter: 64 | dependency: "direct main" 65 | description: 66 | name: google_maps_flutter 67 | url: "https://pub.dartlang.org" 68 | source: hosted 69 | version: "0.5.15" 70 | http: 71 | dependency: "direct main" 72 | description: 73 | name: http 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "0.12.0+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.3" 84 | image_picker: 85 | dependency: "direct main" 86 | description: 87 | name: image_picker 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.6.0+8" 91 | matcher: 92 | dependency: transitive 93 | description: 94 | name: matcher 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.12.5" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.1.7" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.6.4" 112 | path_provider: 113 | dependency: "direct main" 114 | description: 115 | name: path_provider 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.2.0" 119 | pedantic: 120 | dependency: transitive 121 | description: 122 | name: pedantic 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "1.8.0+1" 126 | permission_handler: 127 | dependency: transitive 128 | description: 129 | name: permission_handler 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "3.2.2" 133 | quiver: 134 | dependency: transitive 135 | description: 136 | name: quiver 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "2.0.5" 140 | sky_engine: 141 | dependency: transitive 142 | description: flutter 143 | source: sdk 144 | version: "0.0.99" 145 | source_span: 146 | dependency: transitive 147 | description: 148 | name: source_span 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.5.5" 152 | sqflite: 153 | dependency: "direct main" 154 | description: 155 | name: sqflite 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.1.6+4" 159 | stack_trace: 160 | dependency: transitive 161 | description: 162 | name: stack_trace 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.9.3" 166 | stream_channel: 167 | dependency: transitive 168 | description: 169 | name: stream_channel 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "2.0.0" 173 | string_scanner: 174 | dependency: transitive 175 | description: 176 | name: string_scanner 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "1.0.5" 180 | synchronized: 181 | dependency: transitive 182 | description: 183 | name: synchronized 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "2.1.0+1" 187 | term_glyph: 188 | dependency: transitive 189 | description: 190 | name: term_glyph 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.1.0" 194 | test_api: 195 | dependency: transitive 196 | description: 197 | name: test_api 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.2.5" 201 | typed_data: 202 | dependency: transitive 203 | description: 204 | name: typed_data 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.1.6" 208 | vector_math: 209 | dependency: transitive 210 | description: 211 | name: vector_math 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "2.0.8" 215 | sdks: 216 | dart: ">=2.2.2 <3.0.0" 217 | flutter: ">=1.2.1 <2.0.0" 218 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: api_app 2 | description: A new Flutter application. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | sqflite: any 23 | path_provider: any 24 | google_maps_flutter: ^0.5.5 25 | geolocator: ^3.0.1 26 | 27 | # The following adds the Cupertino Icons font to your application. 28 | # Use with the CupertinoIcons class for iOS style icons. 29 | cupertino_icons: ^0.1.2 30 | http: 31 | image_picker: 32 | 33 | dev_dependencies: 34 | flutter_test: 35 | sdk: flutter 36 | 37 | 38 | # For information on the generic Dart part of this file, see the 39 | # following page: https://www.dartlang.org/tools/pub/pubspec 40 | 41 | # The following section is specific to Flutter. 42 | flutter: 43 | 44 | # The following line ensures that the Material Icons font is 45 | # included with your application, so that you can use the icons in 46 | # the material Icons class. 47 | uses-material-design: true 48 | 49 | # To add assets to your application, add an assets section, like this: 50 | assets: 51 | - assets/image.png 52 | - assets/sadeem.png 53 | - assets/HD.jpg 54 | - assets/Icons.png 55 | 56 | # An image asset can refer to one or more resolution-specific "variants", see 57 | # https://flutter.io/assets-and-images/#resolution-aware. 58 | 59 | # For details regarding adding assets from package dependencies, see 60 | # https://flutter.io/assets-and-images/#from-packages 61 | 62 | # To add custom fonts to your application, add a fonts section here, 63 | # in this "flutter" section. Each entry in this list should have a 64 | # "family" key with the font family name, and a "fonts" key with a 65 | # list giving the asset and other descriptors for the font. For 66 | # example: 67 | # fonts: 68 | # - family: Schyler 69 | # fonts: 70 | # - asset: fonts/Schyler-Regular.ttf 71 | # - asset: fonts/Schyler-Italic.ttf 72 | # style: italic 73 | # - family: Trajan Pro 74 | # fonts: 75 | # - asset: fonts/TrajanPro.ttf 76 | # - asset: fonts/TrajanPro_Bold.ttf 77 | # weight: 700 78 | # 79 | # For details regarding fonts from package dependencies, 80 | # see https://flutter.io/custom-fonts/#from-packages 81 | -------------------------------------------------------------------------------- /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:api_app/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(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 | --------------------------------------------------------------------------------