├── firebase.json ├── functions ├── .gitignore ├── package.json ├── flutter-app-product.json └── index.js ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── 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 │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── flutter_app │ │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── lib ├── models │ ├── auth.dart │ ├── user.dart │ └── product.dart ├── scoped_model │ ├── main.dart │ └── connected_product.dart ├── widgets │ ├── ui_elements │ │ └── title_default.dart │ ├── products │ │ ├── address_tag.dart │ │ ├── price_tag.dart │ │ ├── Products.dart │ │ └── product_card.dart │ ├── helper │ │ └── ensure_visible.dart │ └── form_input │ │ └── image.dart ├── pages │ ├── products_Admin.dart │ ├── commonWidget │ │ └── menu_Control.dart │ ├── products.dart │ ├── product.dart │ ├── product_list.dart │ ├── auth.dart │ └── product_edit.dart └── main.dart ├── .firebaserc ├── assets ├── food.jpg ├── Oswald-Bold.ttf └── Montserrat-Regular.ttf ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── AppDelegate.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── 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-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── main.m │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ └── project.pbxproj ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── WorkspaceSettings.xcsettings ├── Podfile.lock └── Podfile ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── analysis_options.yaml ├── .metadata ├── README.md ├── test └── widget_test.dart ├── .gitignore ├── pubspec.yaml └── pubspec.lock /firebase.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /functions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /lib/models/auth.dart: -------------------------------------------------------------------------------- 1 | enum AuthMode { Login, SignUp } 2 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "flutter-app-32074" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /assets/food.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/assets/food.jpg -------------------------------------------------------------------------------- /assets/Oswald-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/assets/Oswald-Bold.ttf -------------------------------------------------------------------------------- /assets/Montserrat-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/assets/Montserrat-Regular.ttf -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | 2 | # You can add one username per supported platform and one custom link 3 | custom: https://www.paypal.me/thealphamerc 4 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:pedantic/analysis_options.yaml 2 | 3 | analyzer: 4 | errors: 5 | mixin_inherits_from_not_object: ignore 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/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/TheAlphamerc/FlutterApp/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheAlphamerc/FlutterApp/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /lib/models/user.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class User{ 4 | final String id; 5 | final String email; 6 | final String token; 7 | User({@required this.id, @required this.email,@required this.token}); 8 | } -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/scoped_model/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_app/scoped_model/connected_product.dart'; 2 | import 'package:scoped_model/scoped_model.dart'; 3 | 4 | class MainModel extends Model 5 | with ConnectedProductsModel, ProductsModel, UserModel, UtilityModel {} 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /.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: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /lib/widgets/ui_elements/title_default.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TitleDefault extends StatelessWidget { 4 | final String title; 5 | 6 | TitleDefault(this.title); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Text( 11 | title, 12 | style: TextStyle( 13 | fontSize: 26, fontWeight: FontWeight.bold, fontFamily: 'Oswald'), 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/flutter_app/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.flutter_app; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/widgets/products/address_tag.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AddressTag extends StatelessWidget { 4 | final String address; 5 | 6 | const AddressTag( this.address) ; 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | padding: EdgeInsets.symmetric(vertical: 2.5, horizontal: 6), 12 | decoration: BoxDecoration( 13 | border: Border.all(width: 1.0), 14 | borderRadius: BorderRadius.circular(4)), 15 | child: Text(address)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_app 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /lib/widgets/products/price_tag.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class PriceTag extends StatelessWidget { 4 | final double price; 5 | 6 | const PriceTag( this.price) ; 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | padding: EdgeInsets.symmetric(horizontal: 6, vertical: 2.5), 12 | decoration: BoxDecoration( 13 | color: Theme.of(context).accentColor, 14 | borderRadius: BorderRadius.circular(5)), 15 | child: Text( 16 | '$price', 17 | style: TextStyle(color: Colors.white), 18 | )); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - shared_preferences (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `.symlinks/flutter/ios`) 8 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: ".symlinks/flutter/ios" 13 | shared_preferences: 14 | :path: ".symlinks/plugins/shared_preferences/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a 18 | shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523 19 | 20 | PODFILE CHECKSUM: aff02bfeed411c636180d6812254b2daeea14d09 21 | 22 | COCOAPODS: 1.6.1 23 | -------------------------------------------------------------------------------- /lib/models/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class Product { 4 | final String id; 5 | final String title; 6 | final String description; 7 | final double price; 8 | final String image; 9 | final String imagePath; 10 | final bool isFavourite; 11 | final String userId; 12 | final String userEmail; 13 | Product( 14 | {@required this.id, 15 | @required this.title, 16 | @required this.price, 17 | @required this.description, 18 | @required this.image, 19 | @required this.userEmail, 20 | @required this.userId, 21 | @required this.imagePath, 22 | this.isFavourite = false}); 23 | } 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Cloud Functions for Firebase", 4 | "scripts": { 5 | "serve": "firebase serve --only functions", 6 | "shell": "firebase functions:shell", 7 | "start": "npm run shell", 8 | "deploy": "firebase deploy --only functions", 9 | "logs": "firebase functions:log" 10 | }, 11 | "engines": { 12 | "node": "8" 13 | }, 14 | "dependencies": { 15 | "@google-cloud/storage": "^2.5.0", 16 | "busboy": "^0.3.1", 17 | "cors": "^2.8.5", 18 | "dicer": "^0.3.0", 19 | "firebase-admin": "^7.0.0", 20 | "firebase-functions": "^2.3.0", 21 | "uuid": "^3.3.2" 22 | }, 23 | "devDependencies": { 24 | "firebase-functions-test": "^0.1.6" 25 | }, 26 | "private": true 27 | } 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/widgets/products/Products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_app/models/product.dart'; 3 | import 'package:flutter_app/scoped_model/main.dart'; 4 | import 'package:flutter_app/widgets/products/product_card.dart'; 5 | import 'package:scoped_model/scoped_model.dart'; 6 | 7 | class ProductListView extends StatelessWidget { 8 | Widget _buildProductList(List product){ 9 | return product.length > 0 10 | ? ListView.builder( 11 | itemBuilder: (BuildContext context,int index)=> ProductCard(product[index],index), 12 | itemCount: product.length, 13 | ) 14 | : Center(child: Text('No Item Available')); 15 | } 16 | @override 17 | Widget build(BuildContext context) { 18 | return ScopedModelDescendant(builder: (BuildContext context,Widget widget,MainModel model){ 19 | return _buildProductList(model.displayedproducts); 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_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 | -------------------------------------------------------------------------------- /lib/pages/products_Admin.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_app/pages/product_edit.dart'; 3 | import 'package:flutter_app/pages/product_list.dart'; 4 | import 'package:flutter_app/scoped_model/main.dart'; 5 | import 'commonWidget/menu_Control.dart'; 6 | 7 | class ProductAdminPage extends StatelessWidget { 8 | final MainModel model; 9 | ProductAdminPage(this.model); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return DefaultTabController( 14 | child: Scaffold( 15 | drawer: MenuControlView(context), 16 | appBar: AppBar( 17 | title: Text("EasyList"), 18 | bottom: TabBar( 19 | tabs: [ 20 | Tab( 21 | text: "Create Product", 22 | icon: Icon(Icons.create), 23 | ), 24 | Tab(text: "View Product", icon: Icon(Icons.list)), 25 | ], 26 | indicatorColor: Colors.black, 27 | ), 28 | ), 29 | body: TabBarView( 30 | children: [ProductEditPage(), ProductListPage(model)], 31 | )), 32 | length: 2, 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/pages/commonWidget/menu_Control.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_app/scoped_model/main.dart'; 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | class MenuControlView extends StatelessWidget { 6 | BuildContext context; 7 | 8 | MenuControlView(this.context); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Drawer( 13 | child: Column( 14 | children: [ 15 | AppBar( 16 | title: Text('Choose'), 17 | automaticallyImplyLeading: false, 18 | ), 19 | ListTile( 20 | leading: Icon(Icons.edit), 21 | title: Text('Manage Product'), 22 | onTap: () { 23 | Navigator.pushReplacementNamed(context, '/admin'); 24 | }, 25 | ), 26 | ListTile( 27 | leading: Icon(Icons.shop), 28 | title: Text('Home page'), 29 | onTap: () { 30 | Navigator.pushReplacementNamed(context, '/'); 31 | }, 32 | ), 33 | Divider(), 34 | ScopedModelDescendant( 35 | builder: (BuildContext context, Widget widget, MainModel model) { 36 | return ListTile( 37 | leading: Icon(Icons.exit_to_app), 38 | title: Text('Logout'), 39 | onTap: () { 40 | model.logout(); 41 | Navigator.of(context).pushReplacementNamed('/login'); 42 | }, 43 | ); 44 | }) 45 | ], 46 | )); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /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 | flutter_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 | NSPhotoLibraryUsageDescription 30 | Image is used as a product image 31 | NSCameraUsageDescription 32 | Image is used as a product image 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /lib/pages/products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_app/pages/commonWidget/menu_Control.dart'; 3 | import 'package:flutter_app/scoped_model/main.dart'; 4 | import 'package:flutter_app/widgets/products/Products.dart'; 5 | import 'package:scoped_model/scoped_model.dart'; 6 | 7 | class ProductsPage extends StatefulWidget { 8 | final MainModel model; 9 | ProductsPage(this.model); 10 | 11 | @override 12 | State createState() { 13 | return _ProductsPageState(); 14 | } 15 | } 16 | 17 | class _ProductsPageState extends State { 18 | @override 19 | void initState() { 20 | print('[Debug] Home page'); 21 | widget.model.fetchProducts(); 22 | super.initState(); 23 | } 24 | 25 | Widget _buildProductList() { 26 | return ScopedModelDescendant( 27 | builder: (BuildContext context, Widget widget, MainModel model) { 28 | Widget content = Center( 29 | child: Text("No data available"), 30 | ); 31 | if (model.displayedproducts.length > 0 && !model.isLoading) { 32 | content = ProductListView(); 33 | } else if (model.isLoading) { 34 | content = Center(child: CircularProgressIndicator()); 35 | } 36 | return RefreshIndicator(onRefresh: model.fetchProducts, child: content); 37 | }); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | drawer: MenuControlView(context), 44 | appBar: AppBar( 45 | title: Text("EasyList"), 46 | actions: [ 47 | ScopedModelDescendant( 48 | builder: (BuildContext context, Widget widget, MainModel model) { 49 | return IconButton( 50 | icon: Icon(model.displayFavouriteOnly 51 | ? Icons.favorite 52 | : Icons.favorite_border), 53 | onPressed: () { 54 | model.toggleDisplayModel(); 55 | }, 56 | ); 57 | }) 58 | ], 59 | ), 60 | body: _buildProductList(), 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.flutter_app" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /functions/flutter-app-product.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "service_account", 3 | "project_id": "flutter-app-32074", 4 | "private_key_id": "0dd13b6dd385eb1169c372bd3e6cafafe1fe9a46", 5 | "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCgxHzOGTfmWOb6\n7ia0+2lqh1PUbIDLsYTKwhsY1v8AtuenfJyEfBXQIYtX8XdHhCOxx/x8Dy106SLR\nIHh+0HpAc4dkpvS9x4KuVkj5QgowR69EI/CFILnRaMPzesW3+/qMM6Nzg0mvRXuP\n4qiom6IWzewLlvqqwSAufBh6nJoLXaWffxU/r7tNSSiN7Vg2CTo1tNh/WQCzvyRY\nNwp0ZGf5we3n/14E9vzMuanpEA6puxTteOhE8ex3vEOtAPweK1IkEq5Rv/kf/sCW\nKjETtGsG8eM+SJXUSvPdzTdqK1HkyQQX9TduMCSOQRJLY0nPDs0FGJIRrmagTSqx\nudrkx7VBAgMBAAECggEAAtMW8AJNiw+TbdPUtGPxKQLsCjC2ldWWbB9LTXU8DVe5\nU9YOtC1vruyi84pploUj4SgOx6F24o2ky+Swl0ZLipG5Do+4H7Q3V5+qmC4Eyq68\nvaNNwtIFj8BB5peI7SPJRfCzkchMCW88pbVVUiKLX1ASgkzeljTOz2BE6BUTqAjP\n0UacXhOCe0KPYAFO4tqYNKBMIfdB4kKTdMzyGXqqhnkX5dG2pr0whOULpgtx1Zej\nHgWkv/eSpkRLbbGKTlEROxU2IjtTfhUs4WTGuVvQUiFHaF3wdUoBQVQgoisO0ouC\nZ+FF8EYeMyg6ipKOjzQv+ITEBHLFo4gzV5G7FbQwwQKBgQDgxMAYaCNBuEgp+rNB\nmb31V97fQ/mIXCOqwG3k/vsROL6ifKjyEqyNPCOPy+637gNmnyrrSrJHNuMc8c6a\njfu0cUxVC3GnlcOjv2u5o4hyB07ET8ljFxH0nIZ+Znfk3CWT/OHeA/qaHhTdiYMT\n2KPytIJJApU8Y/n2MFKb/E8MYQKBgQC3GyeP+78ZEnyJ5H1hpx9/kYGY2T0DsrPQ\nVFD1AdoBB0VT6kOEJj2J7xcgqphh0+Nu9jex1Tpvv7ppjuP0PG/qJZDfKH6nRMxx\nGcwnyTTzd3ql84T52uXrPZQL8pSfDJgqY1IytHgNIqMGivdRWTrxgKe6+EXZFjeU\nqL1Zy/5U4QKBgBX76HX6qYgiCBzjAmlmKig3AfuAYIWvzWVEEPuW3OOgUzT9UGDs\n5qehvDCyV5Tx2K9O3hnJYoqImcoY9IY1YOsTMc4XonQrt8jqThUII65TfKbCzwW8\nGet868KtLwjZZ2uEDmtypC4yxwOsEX/9bnusoBmYARS5CpfDvjC3itvBAoGAW1Yl\nRvJJ4cTR8KrUTEjkMmsvnUIH6HdUsL/OXljdGRQ6ZeB+a0Xz/oEQJVBTkMD0Ox6A\nq6l0a9fUseEAHo2jOcYhXN/DRcbQwD4hE1uPmT7pJCy0ETo65DwkRE1uC2Rp5wMC\nNp7FH7A+Z/4b3i1HdL47bM15cg9eDD6brVZPeKECgYEAnDviPjAlETcFl2BvHhTX\n2vDUskQElNJPFIXRM0/4E77pwQ5FgOGCNIUeiH+cRUeF//rAADJVhLfLlChfpT4a\nPacmRR9ok3jqJEyB77nwJyVF7TaVblIhmIgPlgL+K2Z3QtDo2eNGntvspMNsK0LL\navIOljAF3Jc83J+IB3NGN6o=\n-----END PRIVATE KEY-----\n", 6 | "client_email": "firebase-adminsdk-eucr8@flutter-app-32074.iam.gserviceaccount.com", 7 | "client_id": "117166064338050218934", 8 | "auth_uri": "https://accounts.google.com/o/oauth2/auth", 9 | "token_uri": "https://oauth2.googleapis.com/token", 10 | "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", 11 | "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-eucr8%40flutter-app-32074.iam.gserviceaccount.com" 12 | } -------------------------------------------------------------------------------- /lib/pages/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_app/models/product.dart'; 3 | import 'dart:async'; 4 | 5 | import 'package:flutter_app/widgets/ui_elements/title_default.dart'; 6 | 7 | class ProductPage extends StatelessWidget { 8 | final Product product; 9 | ProductPage(this.product); 10 | void _showDialague(BuildContext context) { 11 | showDialog( 12 | context: context, 13 | builder: (BuildContext context) { 14 | return AlertDialog( 15 | title: Text("Are you sure"), 16 | content: Text("This action cannot be undone"), 17 | actions: [ 18 | FlatButton( 19 | child: Text('Discard'), 20 | onPressed: () { 21 | Navigator.pop(context); 22 | }, 23 | ), 24 | FlatButton( 25 | child: Text('Continue'), 26 | onPressed: () { 27 | Navigator.pop(context); 28 | Navigator.pop(context, true); 29 | }, 30 | ) 31 | ], 32 | ); 33 | }); 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | return WillPopScope( 39 | onWillPop: () { 40 | print('[Product Page] Back button pressed'); 41 | Navigator.pop(context, false); 42 | return Future.value(false); 43 | }, 44 | child: Scaffold( 45 | appBar: AppBar( 46 | title: Text(product.title), 47 | ), 48 | body: Column( 49 | children: [ 50 | FadeInImage( 51 | image: NetworkImage(product.image), 52 | height: 300.0, 53 | fit: BoxFit.cover, 54 | placeholder: AssetImage('assets/food.jpg'), 55 | ), 56 | Container( 57 | padding: EdgeInsets.all(10), 58 | child: TitleDefault(product.title), 59 | ), 60 | Container( 61 | padding: EdgeInsets.all(10), 62 | child: RaisedButton( 63 | color: Theme.of(context).accentColor, 64 | child: Text('Delete'), 65 | onPressed: () => _showDialague(context), 66 | ), 67 | ), 68 | ], 69 | ), 70 | )); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | pods_ary = [] 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) { |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | pods_ary.push({:name => podname, :path => podpath}); 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | } 32 | return pods_ary 33 | end 34 | 35 | target 'Runner' do 36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 37 | # referring to absolute paths on developers' machines. 38 | system('rm -rf .symlinks') 39 | system('mkdir -p .symlinks/plugins') 40 | 41 | # Flutter Pods 42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 43 | if generated_xcode_build_settings.empty? 44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 45 | end 46 | generated_xcode_build_settings.map { |p| 47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 48 | symlink = File.join('.symlinks', 'flutter') 49 | File.symlink(File.dirname(p[:path]), symlink) 50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 51 | end 52 | } 53 | 54 | # Plugin Pods 55 | plugin_pods = parse_KV_file('../.flutter-plugins') 56 | plugin_pods.map { |p| 57 | symlink = File.join('.symlinks', 'plugins', p[:name]) 58 | File.symlink(p[:path], symlink) 59 | pod p[:name], :path => File.join(symlink, 'ios') 60 | } 61 | end 62 | 63 | post_install do |installer| 64 | installer.pods_project.targets.each do |target| 65 | target.build_configurations.each do |config| 66 | config.build_settings['ENABLE_BITCODE'] = 'NO' 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/widgets/products/product_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_app/models/product.dart'; 3 | import 'package:flutter_app/scoped_model/main.dart'; 4 | import 'package:flutter_app/widgets/products/price_tag.dart'; 5 | import 'package:flutter_app/widgets/ui_elements/title_default.dart'; 6 | import 'package:scoped_model/scoped_model.dart'; 7 | 8 | import 'address_tag.dart'; 9 | 10 | class ProductCard extends StatelessWidget { 11 | final Product product; 12 | final int productIndex; 13 | ProductCard(this.product, this.productIndex); 14 | Widget _buildPriceRow() { 15 | return Container( 16 | padding: EdgeInsets.all(10), 17 | child: Row( 18 | mainAxisAlignment: MainAxisAlignment.center, 19 | children: [ 20 | TitleDefault(product.title), 21 | SizedBox(width: 15), 22 | PriceTag(product.price), 23 | ], 24 | )); 25 | } 26 | 27 | Widget _buildActionButton(BuildContext context) { 28 | return ScopedModelDescendant( 29 | builder: (BuildContext context, Widget widget, MainModel model) { 30 | return ButtonBar( 31 | alignment: MainAxisAlignment.center, 32 | children: [ 33 | IconButton( 34 | icon: Icon(Icons.info), 35 | color: Theme.of(context).accentColor, 36 | onPressed: () { 37 | Navigator.pushNamed( 38 | context, '/products/' + model.allProducts[productIndex].id); 39 | }, 40 | ), 41 | IconButton( 42 | icon: Icon(model.allProducts[productIndex].isFavourite 43 | ? Icons.favorite 44 | : Icons.favorite_border), 45 | color: Colors.red, 46 | onPressed: () { 47 | model.selectProduct(model.allProducts[productIndex].id); 48 | model.toggleProductFavouriteToggle(); 49 | }, 50 | ), 51 | ], 52 | ); 53 | }); 54 | } 55 | 56 | @override 57 | Widget build(BuildContext context) { 58 | return Card( 59 | elevation: 5, 60 | child: Column( 61 | mainAxisSize: MainAxisSize.min, 62 | children: [ 63 | FadeInImage( 64 | image: NetworkImage(product.image), 65 | height: 300.0, 66 | fit: BoxFit.cover, 67 | placeholder: AssetImage('assets/food.jpg'), 68 | ), 69 | _buildPriceRow(), 70 | AddressTag("Union Square, San Fransisco"), 71 | Text(product.userEmail), 72 | _buildActionButton(context) 73 | ], 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/widgets/helper/ensure_visible.dart: -------------------------------------------------------------------------------- 1 | // import 'dart:async'; 2 | 3 | // import 'package:flutter/rendering.dart'; 4 | // import 'package:flutter/widgets.dart'; 5 | // import 'package:meta/meta.dart'; 6 | 7 | // class EnsureVisibleWhenFocused extends StatefulWidget { 8 | // const EnsureVisibleWhenFocused({ 9 | // Key key, 10 | // @required this.child, 11 | // @required this.focusNode, 12 | // this.curve: Curves.ease, 13 | // this.duration: const Duration(milliseconds: 100), 14 | // }) : super(key: key); 15 | 16 | // /// The node we will monitor to determine if the child is focused 17 | // final FocusNode focusNode; 18 | 19 | // /// The child widget that we are wrapping 20 | // final Widget child; 21 | 22 | // /// The curve we will use to scroll ourselves into view. 23 | // /// 24 | // /// Defaults to Curves.ease. 25 | // final Curve curve; 26 | 27 | // /// The duration we will use to scroll ourselves into view 28 | // /// 29 | // /// Defaults to 100 milliseconds. 30 | // final Duration duration; 31 | 32 | // EnsureVisibleWhenFocusedState createState() => new EnsureVisibleWhenFocusedState(); 33 | // } 34 | 35 | // class EnsureVisibleWhenFocusedState extends State { 36 | // @override 37 | // void initState() { 38 | // super.initState(); 39 | // widget.focusNode.addListener(_ensureVisible); 40 | // } 41 | 42 | // @override 43 | // void dispose() { 44 | // super.dispose(); 45 | // widget.focusNode.removeListener(_ensureVisible); 46 | // } 47 | 48 | // Future _ensureVisible() async { 49 | // // Wait for the keyboard to come into view 50 | // // TODO: position doesn't seem to notify listeners when metrics change, 51 | // // perhaps a NotificationListener around the scrollable could avoid 52 | // // the need insert a delay here. 53 | // await Future.delayed(const Duration(milliseconds: 300)); 54 | 55 | // if (!widget.focusNode.hasFocus) 56 | // return; 57 | 58 | // final RenderObject object = context.findRenderObject(); 59 | // final RenderAbstractViewport viewport = RenderAbstractViewport.of(object); 60 | // assert(viewport != null); 61 | 62 | // ScrollableState scrollableState = Scrollable.of(context); 63 | // assert(scrollableState != null); 64 | 65 | // ScrollPosition position = scrollableState.position; 66 | // double alignment; 67 | // if (position.pixels > viewport.getOffsetToReveal(object, 0.0)) { 68 | // // Move down to the top of the viewport 69 | // alignment = 0.0; 70 | // } else if (position.pixels < viewport.getOffsetToReveal(object, 1.0)) { 71 | // // Move up to the bottom of the viewport 72 | // alignment = 1.0; 73 | // } else { 74 | // // No scrolling is necessary to reveal the child 75 | // return; 76 | // } 77 | // position.ensureVisible( 78 | // object, 79 | // alignment: alignment, 80 | // duration: widget.duration, 81 | // curve: widget.curve, 82 | // ); 83 | // } 84 | 85 | // Widget build(BuildContext context) => widget.child; 86 | // } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_app 2 | description: A new Flutter project. 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 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | scoped_model: ^1.0.1 27 | http: ^0.12.0+2 28 | shared_preferences: ^0.5.3+1 29 | rxdart: ^0.22.0 30 | image_picker_modern: ^0.4.12+2 31 | mime: ^0.9.1 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/food.jpg 52 | # - images/a_dot_ham.jpeg 53 | 54 | # An image asset can refer to one or more resolution-specific "variants", see 55 | # https://flutter.dev/assets-and-images/#resolution-aware. 56 | 57 | # For details regarding adding assets from package dependencies, see 58 | # https://flutter.dev/assets-and-images/#from-packages 59 | 60 | # To add custom fonts to your application, add a fonts section here, 61 | # in this "flutter" section. Each entry in this list should have a 62 | # "family" key with the font family name, and a "fonts" key with a 63 | # list giving the asset and other descriptors for the font. For 64 | # example: 65 | fonts: 66 | - family: Oswald 67 | fonts: 68 | - asset: assets/Oswald-Bold.ttf 69 | weight: 700 70 | - family: Montserrat 71 | fonts: 72 | - asset: assets/Montserrat-Regular.ttf 73 | # - asset: fonts/Schyler-Italic.ttf 74 | # style: italic 75 | # - family: Trajan Pro 76 | # fonts: 77 | # - asset: fonts/TrajanPro.ttf 78 | # - asset: fonts/TrajanPro_Bold.ttf 79 | # weight: 700 80 | # 81 | # For details regarding fonts from package dependencies, 82 | # see https://flutter.dev/custom-fonts/#from-packages 83 | 84 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/rendering.dart'; 3 | import 'package:flutter_app/models/product.dart'; 4 | import 'package:flutter_app/pages/auth.dart'; 5 | import 'package:flutter_app/pages/product.dart'; 6 | import 'package:flutter_app/pages/products.dart'; 7 | import 'package:flutter_app/pages/products_Admin.dart'; 8 | import 'package:flutter_app/scoped_model/main.dart'; 9 | import 'package:scoped_model/scoped_model.dart'; 10 | 11 | void main() { 12 | debugPaintSizeEnabled = false; 13 | runApp(MyApp()); 14 | } 15 | 16 | class MyApp extends StatefulWidget { 17 | @override 18 | State createState() { 19 | return _MyAppState(); 20 | } 21 | } 22 | 23 | class _MyAppState extends State { 24 | bool _isAuthenticated = false; 25 | final MainModel _model = new MainModel(); 26 | @override 27 | void initState() { 28 | _model.autoAuthenticated(); 29 | _model.userSubject.listen((bool isAuthenticated) { 30 | _isAuthenticated = isAuthenticated; 31 | print( 32 | "[Debug] Main page initState. isAuthenticated = ${isAuthenticated}"); 33 | }); 34 | super.initState(); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | print("[Debug] Build main page"); 40 | return ScopedModel( 41 | model: _model, 42 | child: MaterialApp( 43 | theme: ThemeData( 44 | primaryColor: Colors.deepOrange, 45 | accentColor: Colors.deepPurple, 46 | brightness: Brightness.light, 47 | buttonColor: Colors.deepPurple, 48 | fontFamily: 'Montserrat'), 49 | 50 | // home: AuthPage(), 51 | routes: { 52 | // '/': (BuildContext context) => ProductsPage(_products), 53 | '/': (BuildContext context) => 54 | !_isAuthenticated ? AuthPage() : ProductsPage(_model), 55 | 56 | '/admin': (BuildContext context) => 57 | !_isAuthenticated ? AuthPage() : ProductAdminPage(_model), 58 | // '/home': (BuildContext context) => ProductsPage(_model), 59 | '/login': (BuildContext context) => AuthPage(), 60 | }, 61 | onGenerateRoute: (RouteSettings settings) { 62 | if (!_isAuthenticated) { 63 | return MaterialPageRoute( 64 | builder: (BuildContext context) => AuthPage()); 65 | } 66 | final List pathElements = settings.name.split('/'); 67 | if (pathElements[0] != '') { 68 | return null; 69 | } 70 | if (pathElements[1] == 'products') { 71 | final String productId = pathElements[2]; 72 | Product product = _model.allProducts.firstWhere((x) { 73 | return x.id == productId; 74 | }); 75 | return MaterialPageRoute( 76 | builder: (BuildContext context) => !_isAuthenticated ? AuthPage() : ProductPage(product)); 77 | } 78 | }, 79 | onUnknownRoute: (RouteSettings settings) { 80 | return MaterialPageRoute( 81 | builder: (BuildContext context) => !_isAuthenticated ? AuthPage() : ProductsPage(_model)); 82 | })); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/widgets/form_input/image.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_app/models/product.dart'; 5 | import 'package:image_picker_modern/image_picker_modern.dart'; 6 | 7 | class ImageInput extends StatefulWidget { 8 | final Function setImage; 9 | final Product product; 10 | ImageInput(this.setImage, this.product); 11 | @override 12 | State createState() { 13 | return _ImageInputState(); 14 | } 15 | } 16 | 17 | class _ImageInputState extends State { 18 | File _imageFile; 19 | void _getImage(BuildContext context, ImageSource source) { 20 | ImagePicker.pickImage(source: source, maxWidth: 400).then((File image) { 21 | setState(() { 22 | _imageFile = image; 23 | }); 24 | widget.setImage(image); 25 | Navigator.pop(context); 26 | }); 27 | } 28 | 29 | void _openImagePicker(BuildContext context) { 30 | showModalBottomSheet( 31 | context: context, 32 | builder: (BuildContext context) { 33 | return Container( 34 | height: 150, 35 | padding: EdgeInsets.all(10), 36 | child: Column( 37 | children: [ 38 | Text( 39 | 'Pick an image', 40 | style: TextStyle(fontWeight: FontWeight.bold), 41 | ), 42 | SizedBox(height: 10), 43 | FlatButton( 44 | color: Theme.of(context).primaryColor, 45 | child: Text('Use Camera'), 46 | onPressed: () { 47 | _getImage(context, ImageSource.camera); 48 | }, 49 | ), 50 | SizedBox( 51 | height: 5, 52 | ), 53 | FlatButton( 54 | color: Theme.of(context).primaryColor, 55 | child: Text('Use Gallery'), 56 | onPressed: () { 57 | _getImage(context, ImageSource.gallery); 58 | }, 59 | ) 60 | ], 61 | ), 62 | ); 63 | }); 64 | } 65 | 66 | @override 67 | Widget build(BuildContext context) { 68 | Widget previewImage = Text('Please select an image'); 69 | if (_imageFile != null) { 70 | previewImage = Image.file( 71 | _imageFile, 72 | fit: BoxFit.cover, 73 | height: 300, 74 | width: MediaQuery.of(context).size.width, 75 | alignment: Alignment.topCenter, 76 | ); 77 | } else if (widget.product != null) { 78 | previewImage = Image.network( 79 | widget.product.image, 80 | fit: BoxFit.cover, 81 | height: 300, 82 | width: MediaQuery.of(context).size.width, 83 | alignment: Alignment.topCenter, 84 | ); 85 | } 86 | final buttonColor = Theme.of(context).accentColor; 87 | return Column( 88 | children: [ 89 | OutlineButton( 90 | borderSide: BorderSide(color: buttonColor, width: 2.0), 91 | child: Row( 92 | mainAxisAlignment: MainAxisAlignment.center, 93 | children: [ 94 | Icon( 95 | Icons.camera_alt, 96 | color: buttonColor, 97 | ), 98 | Text( 99 | 'Add Image', 100 | style: TextStyle(color: buttonColor), 101 | ) 102 | ], 103 | ), 104 | onPressed: () { 105 | _openImagePicker(context); 106 | }, 107 | ), 108 | SizedBox( 109 | height: 10, 110 | ), 111 | previewImage 112 | ], 113 | ); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /functions/index.js: -------------------------------------------------------------------------------- 1 | const functions = require('firebase-functions'); 2 | const cors = require('cors')({ 3 | origin: true 4 | }) 5 | const BusBoy = require('busboy'); 6 | const os = require('os'); 7 | `` 8 | const path = require('path'); 9 | const fs = require('fs'); 10 | const fbAdmin = require('firebase-admin'); 11 | const uuid = require('uuid/v4'); 12 | // // Create and Deploy Your First Cloud Functions 13 | // // https://firebase.google.com/docs/functions/write-firebase-functions 14 | // 15 | // exports.helloWorld = functions.https.onRequest((request, response) => { 16 | // response.send("Hello from Firebase!"); 17 | // }); 18 | const gcconfig = { 19 | projectId: 'flutter-app-32074', 20 | keyFilename: 'flutter-app-product.json' 21 | }; 22 | // const gcs = require('@google-cloud/storage')(gcconfig); 23 | const { 24 | Storage 25 | } = require('@google-cloud/storage'); 26 | const gcs = new Storage({ 27 | 28 | projectId: 'flutter-app-32074', 29 | keyFilename: 'flutter-app-product.json' 30 | 31 | }); 32 | 33 | fbAdmin.initializeApp({ 34 | credential: fbAdmin.credential.cert(require('./flutter-app-product.json')) 35 | }); 36 | 37 | exports.storeImage = functions.https.onRequest((req, res) => { 38 | return cors(req, res, () => { 39 | if (req.method !== 'POST') { 40 | return res.status(500).json({ 41 | message: 'Not allowed.' 42 | }); 43 | } 44 | 45 | if ( 46 | !req.headers.authorization || 47 | !req.headers.authorization.startsWith('Bearer ') 48 | ) { 49 | return res.status(401).json({ 50 | error: 'Unauthorized.' 51 | }); 52 | } 53 | 54 | let idToken; 55 | idToken = req.headers.authorization.split('Bearer ')[1]; 56 | 57 | const busboy = new BusBoy({ 58 | headers: req.headers 59 | }); 60 | let uploadData; 61 | let oldImagePath; 62 | 63 | busboy.on('file', (fieldname, file, filename, encoding, mimetype) => { 64 | const filePath = path.join(os.tmpdir(), filename); 65 | uploadData = { 66 | filePath: filePath, 67 | type: mimetype, 68 | name: filename 69 | }; 70 | file.pipe(fs.createWriteStream(filePath)); 71 | }); 72 | 73 | busboy.on('field', (fieldname, value) => { 74 | oldImagePath = decodeURIComponent(value); 75 | }); 76 | 77 | busboy.on('finish', () => { 78 | const bucket = gcs.bucket('flutter-app-32074.appspot.com'); 79 | const id = uuid(); 80 | let imagePath = 'images/' + id + '-' + uploadData.name; 81 | if (oldImagePath) { 82 | imagePath = oldImagePath; 83 | } 84 | 85 | return fbAdmin 86 | .auth() 87 | .verifyIdToken(idToken) 88 | .then(decodedToken => { 89 | return bucket.upload(uploadData.filePath, { 90 | uploadType: 'media', 91 | destination: imagePath, 92 | metadata: { 93 | metadata: { 94 | contentType: uploadData.type, 95 | firebaseStorageDownloadTokens: id 96 | } 97 | } 98 | }); 99 | }) 100 | .then(() => { 101 | return res.status(201).json({ 102 | imageUrl: 'https://firebasestorage.googleapis.com/v0/b/' + 103 | bucket.name + 104 | '/o/' + 105 | encodeURIComponent(imagePath) + 106 | '?alt=media&token=' + 107 | id, 108 | imagePath: imagePath 109 | }); 110 | }) 111 | .catch(error => { 112 | return res.status(401).json({ 113 | error: 'Unauthorized!' 114 | }); 115 | }); 116 | }); 117 | return busboy.end(req.rawBody); 118 | }); 119 | }); 120 | 121 | exports.deleteImage = functions.database.ref('/products/{productId}').onDelete(snapshot => { 122 | const imageData = snapshot.val(); 123 | const imagePath = imageData.imagePath; 124 | 125 | const bucket = gcs.bucket('flutter-app-32074.appspot.com'); 126 | return bucket.file(imagePath).delete(); 127 | }); -------------------------------------------------------------------------------- /lib/pages/product_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | import 'package:flutter_app/models/product.dart'; 4 | import 'package:flutter_app/pages/product_edit.dart'; 5 | import 'package:flutter_app/scoped_model/connected_product.dart'; 6 | import 'package:flutter_app/scoped_model/main.dart'; 7 | import 'package:scoped_model/scoped_model.dart'; 8 | 9 | class ProductListPage extends StatefulWidget { 10 | final MainModel model; 11 | ProductListPage(this.model); 12 | @override 13 | State createState() { 14 | return _ProductListPageState(); 15 | } 16 | } 17 | 18 | class _ProductListPageState extends State { 19 | @override 20 | void initState() { 21 | widget.model.fetchProducts(onlyForUser : true); 22 | super.initState(); 23 | } 24 | 25 | Widget _iconButton(BuildContext context, Product product, 26 | Function updateProduct, int index, ProductsModel model) { 27 | return IconButton( 28 | icon: Icon(Icons.edit), 29 | onPressed: () { 30 | model.selectProduct(model.allProducts[index].id); 31 | Navigator.of(context) 32 | .push(MaterialPageRoute(builder: (BuildContext context) { 33 | return ProductEditPage(); 34 | })); 35 | }); 36 | } 37 | 38 | Widget _icon(IconData icon) { 39 | return Container( 40 | alignment: Alignment(1, 0), 41 | padding: EdgeInsets.symmetric(horizontal: 20), 42 | child: Icon( 43 | icon, 44 | color: Colors.white, 45 | ), 46 | color: Colors.red, 47 | ); 48 | } 49 | 50 | Widget _circleAvatar(String image) { 51 | return CircleAvatar( 52 | backgroundImage: NetworkImage(image), 53 | ); 54 | } 55 | 56 | @override 57 | Widget build(BuildContext context) { 58 | return ScopedModelDescendant( 59 | builder: (BuildContext context, Widget widget, MainModel model) { 60 | final List _products = model.allProducts; 61 | { 62 | return ListView.builder( 63 | itemCount: _products.length, 64 | itemBuilder: (BuildContext context, int index) { 65 | return Dismissible( 66 | key: Key(model.allProducts[index].title), 67 | background: Container( 68 | color: Colors.red, 69 | child: Row( 70 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 71 | mainAxisSize: MainAxisSize.max, 72 | children: [ 73 | _icon(Icons.edit), 74 | _icon(Icons.delete) 75 | ], 76 | )), 77 | onDismissed: (DismissDirection direction) { 78 | try { 79 | switch (direction) { 80 | case DismissDirection.endToStart: 81 | { 82 | model.selectProduct(model.allProducts[index].id); 83 | model.deleteProduct(); 84 | break; 85 | } 86 | case DismissDirection.startToEnd: 87 | { 88 | model.selectProduct(model.allProducts[index].id); 89 | Navigator.of(context).push(MaterialPageRoute( 90 | builder: (BuildContext context) { 91 | return ProductEditPage(); 92 | })); 93 | //updateProduct(index); 94 | break; 95 | } 96 | default: 97 | break; 98 | } 99 | } catch (error) { 100 | model.cPrint( 101 | '[Exception] on productListPage >> Buid widget .${error}'); 102 | } 103 | }, 104 | child: Column( 105 | children: [ 106 | ListTile( 107 | leading: _circleAvatar(_products[index].image), 108 | title: Text(_products[index].title), 109 | subtitle: Text('\$ ${_products[index].price.toString()}'), 110 | trailing: _iconButton(context, _products[index], 111 | model.updateProduct, index, model), 112 | ), 113 | Divider() 114 | ], 115 | )); 116 | }, 117 | ); 118 | } 119 | }); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/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.1.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.4" 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 | http: 50 | dependency: "direct main" 51 | description: 52 | name: http 53 | url: "https://pub.dartlang.org" 54 | source: hosted 55 | version: "0.12.0+2" 56 | http_parser: 57 | dependency: transitive 58 | description: 59 | name: http_parser 60 | url: "https://pub.dartlang.org" 61 | source: hosted 62 | version: "3.1.3" 63 | image_picker_modern: 64 | dependency: "direct main" 65 | description: 66 | name: image_picker_modern 67 | url: "https://pub.dartlang.org" 68 | source: hosted 69 | version: "0.4.12+2" 70 | matcher: 71 | dependency: transitive 72 | description: 73 | name: matcher 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "0.12.5" 77 | meta: 78 | dependency: transitive 79 | description: 80 | name: meta 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.1.6" 84 | mime: 85 | dependency: "direct main" 86 | description: 87 | name: mime 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.9.6+3" 91 | path: 92 | dependency: transitive 93 | description: 94 | name: path 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.6.2" 98 | pedantic: 99 | dependency: transitive 100 | description: 101 | name: pedantic 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.5.0" 105 | quiver: 106 | dependency: transitive 107 | description: 108 | name: quiver 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "2.0.2" 112 | rxdart: 113 | dependency: "direct main" 114 | description: 115 | name: rxdart 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "0.22.0" 119 | scoped_model: 120 | dependency: "direct main" 121 | description: 122 | name: scoped_model 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "1.0.1" 126 | shared_preferences: 127 | dependency: "direct main" 128 | description: 129 | name: shared_preferences 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "0.5.3+1" 133 | sky_engine: 134 | dependency: transitive 135 | description: flutter 136 | source: sdk 137 | version: "0.0.99" 138 | source_span: 139 | dependency: transitive 140 | description: 141 | name: source_span 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.5.5" 145 | stack_trace: 146 | dependency: transitive 147 | description: 148 | name: stack_trace 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.9.3" 152 | stream_channel: 153 | dependency: transitive 154 | description: 155 | name: stream_channel 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "2.0.0" 159 | string_scanner: 160 | dependency: transitive 161 | description: 162 | name: string_scanner 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.0.4" 166 | term_glyph: 167 | dependency: transitive 168 | description: 169 | name: term_glyph 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.1.0" 173 | test_api: 174 | dependency: transitive 175 | description: 176 | name: test_api 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.2.4" 180 | typed_data: 181 | dependency: transitive 182 | description: 183 | name: typed_data 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.1.6" 187 | vector_math: 188 | dependency: transitive 189 | description: 190 | name: vector_math 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "2.0.8" 194 | sdks: 195 | dart: ">=2.2.0 <3.0.0" 196 | flutter: ">=1.5.0 <2.0.0" 197 | -------------------------------------------------------------------------------- /lib/pages/auth.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_app/models/auth.dart'; 3 | import 'package:flutter_app/scoped_model/main.dart'; 4 | import 'package:scoped_model/scoped_model.dart'; 5 | 6 | class AuthPage extends StatefulWidget { 7 | @override 8 | State createState() { 9 | return _AuthPageState(); 10 | } 11 | } 12 | 13 | class _AuthPageState extends State { 14 | bool acceptTermsValue = true; 15 | AuthMode _authMode = AuthMode.Login; 16 | final GlobalKey _formKey = GlobalKey(); 17 | final TextEditingController _passwordTextController = 18 | new TextEditingController(); 19 | final Map _formData = {'email': null, 'password': null}; 20 | Widget _buildEmail() { 21 | return TextFormField( 22 | decoration: InputDecoration(labelText: 'Email', icon: Icon(Icons.email)), 23 | keyboardType: TextInputType.emailAddress, 24 | validator: (String value) { 25 | if (value.isEmpty || value.length < 5) { 26 | return "Email is required and +5 character long"; 27 | } 28 | }, 29 | onSaved: (value) { 30 | _formData['email'] = value; 31 | }, 32 | ); 33 | } 34 | 35 | Widget _buildPassword() { 36 | return TextFormField( 37 | decoration: InputDecoration( 38 | labelText: 'Password', icon: Icon(Icons.enhanced_encryption)), 39 | controller: _passwordTextController, 40 | obscureText: true, 41 | validator: (String value) { 42 | if (value.isEmpty || value.length < 5) { 43 | return "Password is should be alphanumeric"; 44 | } 45 | }, 46 | onSaved: (value) { 47 | _formData['password'] = value; 48 | }, 49 | ); 50 | } 51 | 52 | Widget _buildConfirmPassword() { 53 | return TextFormField( 54 | decoration: InputDecoration( 55 | labelText: 'Confirm password', icon: Icon(Icons.enhanced_encryption)), 56 | obscureText: true, 57 | validator: (String value) { 58 | if (_passwordTextController.text != value) { 59 | return "Password do not match"; 60 | } 61 | }, 62 | onSaved: (value) {}, 63 | ); 64 | } 65 | 66 | Widget _buildSwitch() { 67 | return SwitchListTile( 68 | onChanged: (value) { 69 | setState(() { 70 | acceptTermsValue = value; 71 | }); 72 | }, 73 | title: Text('Accept Terms'), 74 | value: acceptTermsValue, 75 | ); 76 | } 77 | 78 | Widget _buildSubmitButton(MainModel model) { 79 | return model.isLoading 80 | ? CircularProgressIndicator() 81 | : RaisedButton( 82 | textColor: Colors.white, 83 | child: Text("Login"), 84 | onPressed: () { 85 | _submitForm(model.authenticate); 86 | }, 87 | ); 88 | } 89 | 90 | void _submitForm(Function authenticate) async { 91 | try { 92 | if (!_formKey.currentState.validate()) { 93 | return; 94 | } 95 | _formKey.currentState.save(); 96 | 97 | final Map response = await authenticate( 98 | _formData['email'], _formData['password'], _authMode); 99 | if (response['success']) { 100 | Navigator.pushReplacementNamed(context, '/'); 101 | } else { 102 | showDialog( 103 | context: context, 104 | builder: (BuildContext context) { 105 | return AlertDialog( 106 | title: Text('Alert'), 107 | content: Text(response['message']), 108 | actions: [ 109 | FlatButton( 110 | child: Text('Okay'), 111 | onPressed: () { 112 | Navigator.of(context).pop(); 113 | }, 114 | ) 115 | ], 116 | ); 117 | }); 118 | } 119 | } catch (error) { 120 | print(error); 121 | } 122 | } 123 | 124 | @override 125 | Widget build(BuildContext context) { 126 | final double deviceWidth = MediaQuery.of(context).size.width; 127 | final double targetWidth = deviceWidth > 550 ? 400 : deviceWidth * .9; 128 | // final double devicePadding = deviceWidth - targetWidth; 129 | return Scaffold( 130 | appBar: AppBar( 131 | title: Text("Login"), 132 | ), 133 | body: Container( 134 | padding: EdgeInsets.symmetric(horizontal: 30), 135 | child: Center( 136 | child: SingleChildScrollView( 137 | child: Container( 138 | width: targetWidth, 139 | child: Form( 140 | key: _formKey, 141 | child: Column( 142 | children: [ 143 | _buildEmail(), 144 | _buildPassword(), 145 | _authMode == AuthMode.SignUp 146 | ? _buildConfirmPassword() 147 | : Container(), 148 | _buildSwitch(), 149 | SizedBox( 150 | height: 50, 151 | ), 152 | FlatButton( 153 | child: Text( 154 | '${_authMode == AuthMode.Login ? 'SignUp' : 'SignIn'}'), 155 | onPressed: () { 156 | setState(() { 157 | _authMode = _authMode == AuthMode.Login 158 | ? AuthMode.SignUp 159 | : AuthMode.Login; 160 | }); 161 | }, 162 | ), 163 | ScopedModelDescendant(builder: 164 | (BuildContext context, Widget widget, 165 | MainModel model) { 166 | return _buildSubmitButton(model); 167 | }) 168 | ], 169 | ))))))); 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /lib/pages/product_edit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_app/models/product.dart'; 5 | import 'package:flutter_app/scoped_model/main.dart'; 6 | import 'package:flutter_app/widgets/form_input/image.dart'; 7 | import 'package:scoped_model/scoped_model.dart'; 8 | 9 | class ProductEditPage extends StatefulWidget { 10 | @override 11 | State createState() { 12 | return ProductEditPageState(); 13 | } 14 | } 15 | 16 | class ProductEditPageState extends State { 17 | String titleValue = ''; 18 | String descriptionValue = ''; 19 | double priceValue; 20 | bool acceptTerms = true; 21 | final Map _formData = { 22 | 'title': null, 23 | 'description': null, 24 | 'price': null, 25 | 'image': null 26 | }; 27 | final _titleTextController = TextEditingController(); 28 | final _descriptionTextController = TextEditingController(); 29 | @override 30 | final GlobalKey _formKey = GlobalKey(); 31 | Widget _buildTitle(Product product) { 32 | if (product == null && _titleTextController.text.trim() == '') { 33 | _titleTextController.text = ''; 34 | } else if (product != null && _titleTextController.text.trim() == '') { 35 | _titleTextController.text = product.title; 36 | } 37 | return TextFormField( 38 | controller: _titleTextController, 39 | decoration: 40 | InputDecoration(labelText: 'Product Tile', icon: Icon(Icons.face)), 41 | validator: (String value) { 42 | if (value.isEmpty || value.length < 5) { 43 | return "Title is required and +5 character long"; 44 | } 45 | }, 46 | onSaved: (value) { 47 | _formData['title'] = value; 48 | titleValue = value; 49 | }, 50 | ); 51 | } 52 | 53 | Widget _buildDescription(Product product) { 54 | if (product == null && _descriptionTextController.text.trim() == '') { 55 | _descriptionTextController.text = ''; 56 | } else if (product != null && 57 | _descriptionTextController.text.trim() == '') { 58 | _descriptionTextController.text = product.description; 59 | } 60 | return TextFormField( 61 | maxLines: 2, 62 | controller: _descriptionTextController, 63 | decoration: InputDecoration( 64 | labelText: 'Product Description', icon: Icon(Icons.storage)), 65 | validator: (String value) { 66 | if (value.isEmpty || value.length < 5) { 67 | return "Desription is required and +5 character long"; 68 | } 69 | }, 70 | onSaved: (value) { 71 | _formData['description'] = value; 72 | descriptionValue = value; 73 | }, 74 | ); 75 | } 76 | 77 | Widget _buildPrice(Product product) { 78 | return TextFormField( 79 | initialValue: product != null ? product.price.toString() : "", 80 | decoration: InputDecoration( 81 | labelText: 'Product Price', icon: Icon(Icons.euro_symbol)), 82 | keyboardType: TextInputType.number, 83 | validator: (String value) { 84 | if (value.isEmpty || 85 | !RegExp(r'^(?:[1-9]\d*|0)?(?:\.\d+)?$').hasMatch(value)) { 86 | return "Price is required and should be a no."; 87 | } 88 | }, 89 | onSaved: (value) { 90 | _formData['price'] = double.parse(value); 91 | priceValue = double.parse(value); 92 | }, 93 | ); 94 | } 95 | 96 | Widget _buildSwitchTile() { 97 | return SwitchListTile( 98 | value: acceptTerms, 99 | onChanged: (value) { 100 | acceptTerms = value; 101 | }, 102 | title: Text('Accept terms'), 103 | ); 104 | } 105 | 106 | Widget _showAlert() { 107 | return AlertDialog( 108 | title: Text('Something went wrong'), 109 | content: Text('Please try after some time'), 110 | actions: [ 111 | FlatButton( 112 | child: Text('Okay'), 113 | onPressed: () { 114 | Navigator.of(context).pop(); 115 | }, 116 | ) 117 | ], 118 | ); 119 | } 120 | 121 | Widget _buildRaisedButton() { 122 | return ScopedModelDescendant( 123 | builder: (BuildContext context, Widget widget, MainModel model) { 124 | { 125 | return model.isLoading 126 | ? Center(child: CircularProgressIndicator()) 127 | : RaisedButton( 128 | textColor: Colors.white, 129 | child: Text('Save'), 130 | onPressed: () => _submitForm( 131 | model.addProduct, 132 | model.updateProduct, 133 | model.setSelectedProductId, 134 | model.slectedProductId)); 135 | } 136 | }); 137 | } 138 | 139 | void _setImage(File file) { 140 | _formData['image'] = file; 141 | } 142 | 143 | void _submitForm( 144 | Function addProduct, Function updateProduct, Function setSelectedProduct, 145 | [String selectedProductIndex]) { 146 | if (!_formKey.currentState.validate() || 147 | (_formData['image'] == null && selectedProductIndex == null)) { 148 | return; 149 | } 150 | _formKey.currentState.save(); 151 | if (selectedProductIndex == null) { 152 | print('[Debug] Form is ready in Add new form'); 153 | addProduct( 154 | _titleTextController.text, 155 | _descriptionTextController.text, 156 | _formData['image'], 157 | _formData['price'], 158 | ).then((bool isOk) { 159 | if (!isOk) { 160 | showDialog( 161 | context: context, 162 | builder: (BuildContext context) { 163 | return _showAlert(); 164 | }); 165 | return; 166 | } 167 | print('[Debug] Navigate to home page'); 168 | Navigator.pushReplacementNamed(context, '/home').then((_) { 169 | print('[Debug] Set selected product to null'); 170 | setSelectedProduct(null); 171 | }); 172 | }); 173 | } else { 174 | print('[Debug] Form is ready in Edit form'); 175 | updateProduct(_titleTextController.text, _descriptionTextController.text, 176 | _formData['image'], _formData['price']) 177 | .then((bool isOk) { 178 | if (!isOk) { 179 | showDialog( 180 | context: context, 181 | builder: (BuildContext context) { 182 | return _showAlert(); 183 | }); 184 | return; 185 | } 186 | print('[Debug] Navigate to home page'); 187 | Navigator.pushReplacementNamed(context, '/home').then((_) { 188 | print('[Debug] Set selected product to null'); 189 | setSelectedProduct(null); 190 | }); 191 | }); 192 | ; 193 | } 194 | } 195 | 196 | Widget _pagecontent(BuildContext context, Product product) { 197 | final double deviceWidth = MediaQuery.of(context).size.width; 198 | final double targetWidth = deviceWidth > 550 ? 400 : deviceWidth * .95; 199 | final double devicePadding = deviceWidth - targetWidth; 200 | return GestureDetector( 201 | onTap: () { 202 | print("Focus out"); 203 | FocusScope.of(context).autofocus(FocusNode()); 204 | }, 205 | child: Container( 206 | padding: EdgeInsets.all(30), 207 | child: Form( 208 | key: _formKey, 209 | child: ListView( 210 | padding: EdgeInsets.symmetric(horizontal: devicePadding / 2), 211 | children: [ 212 | _buildTitle(product), 213 | _buildDescription(product), 214 | _buildPrice(product), 215 | _buildSwitchTile(), 216 | SizedBox( 217 | height: 30, 218 | ), 219 | ImageInput(_setImage, product), 220 | _buildRaisedButton() 221 | ], 222 | )))); 223 | } 224 | 225 | @override 226 | Widget build(BuildContext context) { 227 | return ScopedModelDescendant( 228 | builder: (BuildContext context, Widget widget, MainModel model) { 229 | { 230 | final Widget pageContent = _pagecontent(context, model.selectedProduct); 231 | return (model.selectedProductIndex == -1) 232 | ? pageContent 233 | : Scaffold( 234 | appBar: AppBar( 235 | title: Text('Edit Item'), 236 | ), 237 | body: pageContent); 238 | } 239 | }); 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /lib/scoped_model/connected_product.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:flutter_app/models/auth.dart'; 6 | import 'package:flutter_app/models/product.dart'; 7 | import 'package:flutter_app/models/user.dart'; 8 | import 'package:http_parser/http_parser.dart'; 9 | import 'package:scoped_model/scoped_model.dart'; 10 | import 'package:http/http.dart' as http; 11 | import 'dart:convert'; 12 | import 'dart:async'; 13 | import 'package:shared_preferences/shared_preferences.dart'; 14 | import 'package:rxdart/rxdart.dart'; 15 | import 'package:mime/mime.dart'; 16 | 17 | class ConnectedProductsModel extends Model { 18 | bool _isLoading = false; 19 | List _products = []; 20 | String _selSelectedId; 21 | User _authenticatedUser; 22 | 23 | void cPrint(statement) { 24 | debugPrint('${DateTime.now()}[Debug] ${statement}'); 25 | } 26 | } 27 | 28 | class ProductsModel extends ConnectedProductsModel { 29 | bool _showFavourite = false; 30 | 31 | List get allProducts { 32 | return List.from(_products); 33 | } 34 | 35 | List get displayedproducts { 36 | if (_showFavourite) { 37 | return _products.where((x) => x.isFavourite == true).toList(); 38 | } 39 | return List.from(_products); 40 | } 41 | 42 | int get selectedProductIndex { 43 | return _products.indexWhere((x) { 44 | return x.id == _selSelectedId; 45 | }); 46 | } 47 | 48 | String get slectedProductId { 49 | return _selSelectedId; 50 | } 51 | 52 | Product get selectedProduct { 53 | if (_selSelectedId == null) { 54 | return null; 55 | } 56 | return _products.firstWhere((x) { 57 | return x.id == _selSelectedId; 58 | }); 59 | } 60 | 61 | bool get displayFavouriteOnly { 62 | return _showFavourite; 63 | } 64 | 65 | Future> uploadImage(File image, 66 | {String imagePath}) async { 67 | _isLoading = true; 68 | notifyListeners(); 69 | final mimeTypeData = lookupMimeType(image.path).split('/'); 70 | final imageUploadRequest = http.MultipartRequest( 71 | 'POST', 72 | Uri.parse( 73 | 'https://us-central1-flutter-app-32074.cloudfunctions.net/storeImage')); 74 | final file = await http.MultipartFile.fromPath('image', image.path, 75 | contentType: MediaType(mimeTypeData[0], mimeTypeData[1])); 76 | cPrint(file.filename); 77 | cPrint(file.contentType); 78 | cPrint("File Length ${file.length}"); 79 | imageUploadRequest.files.add(file); 80 | if (imagePath != null) { 81 | imageUploadRequest.fields['imagePath'] = Uri.encodeComponent(imagePath); 82 | cPrint("Image path ${imageUploadRequest.fields['imagePath']}"); 83 | } 84 | imageUploadRequest.headers['Authorization'] = 85 | 'Bearer ${_authenticatedUser.token}'; 86 | // cPrint(imageUploadRequest.headers['Authorization']); 87 | try { 88 | final stramedResponse = await imageUploadRequest.send(); 89 | cPrint("Initiate Upload ${stramedResponse.statusCode}"); 90 | final response = await http.Response.fromStream(stramedResponse); 91 | if (response.statusCode != 200 && response.statusCode != 201) { 92 | cPrint( 93 | '[Error] firebase image upload. response : ${json.decode(response.body)}'); 94 | _isLoading = false; 95 | notifyListeners(); 96 | return null; 97 | } 98 | final responseData = json.decode(response.body); 99 | cPrint("Response data ${responseData}"); 100 | _isLoading = false; 101 | notifyListeners(); 102 | return responseData; 103 | } catch (error) { 104 | cPrint("[Exception] ${error}"); 105 | _isLoading = false; 106 | notifyListeners(); 107 | return null; 108 | } 109 | } 110 | 111 | Future addProduct( 112 | String title, String description, File image, double price) async { 113 | try { 114 | _isLoading = true; 115 | 116 | var uploadData = await uploadImage(image); 117 | if (uploadData == null) { 118 | cPrint('Image upload failed'); 119 | _isLoading = false; 120 | return false; 121 | } 122 | 123 | notifyListeners(); 124 | final Map productData = { 125 | 'title': title, 126 | 'description': description, 127 | 'imagePath': uploadData['imagePath'], 128 | 'imageUrl': uploadData['imageUrl'], 129 | 'price': price, 130 | 'email': _authenticatedUser.email, 131 | 'userId': _authenticatedUser.id 132 | }; 133 | final http.Response response = await http.post( 134 | 'https://flutter-app-32074.firebaseio.com/products.json?auth=${_authenticatedUser.token}', 135 | body: jsonEncode(productData)); 136 | if (response.statusCode != 200 && response.statusCode != 201) { 137 | cPrint('[Error] add api response error'); 138 | _isLoading = false; 139 | notifyListeners(); 140 | return false; 141 | } 142 | final Map responseData = json.decode(response.body); 143 | cPrint('New product added'); 144 | final Product product = new Product( 145 | id: responseData['name'], 146 | description: description, 147 | title: title, 148 | image: uploadData['imageUrl'], 149 | imagePath: uploadData['imagePath'], 150 | price: price, 151 | userEmail: _authenticatedUser.email, 152 | userId: _authenticatedUser.id); 153 | _products.add(product); 154 | _isLoading = false; 155 | notifyListeners(); 156 | return true; 157 | } catch (error) { 158 | cPrint('[Exception] in add product. ${error}'); 159 | _isLoading = false; 160 | notifyListeners(); 161 | return false; 162 | } 163 | } 164 | 165 | Future updateProduct( 166 | String title, String description, File image, double price) async { 167 | try { 168 | _isLoading = true; 169 | notifyListeners(); 170 | String imageUrl = selectedProduct.image; 171 | String imagePath = selectedProduct.imagePath; 172 | if (image != null) { 173 | var uploadData = await uploadImage(image); 174 | if (uploadData == null) { 175 | cPrint('Image upload failed'); 176 | _isLoading = false; 177 | return false; 178 | } 179 | imageUrl = uploadData['imageUrl']; 180 | imagePath = uploadData['imagePath']; 181 | } 182 | final Map productData = { 183 | 'title': title, 184 | 'description': description, 185 | 'imagePath': imagePath, 186 | 'imageUrl': imageUrl, 187 | 'price': price, 188 | 'email': selectedProduct.userEmail, 189 | 'userId': selectedProduct.userId 190 | }; 191 | final http.Response response = await http.put( 192 | 'https://flutter-app-32074.firebaseio.com/products/${selectedProduct.id}.json?auth=${_authenticatedUser.token}', 193 | body: jsonEncode(productData)); 194 | 195 | if (response.statusCode != 200 && response.statusCode != 201) { 196 | cPrint('[Error] update api response error'); 197 | _isLoading = false; 198 | notifyListeners(); 199 | return false; 200 | } 201 | cPrint('Product updated'); 202 | final Product updatedProduct = new Product( 203 | id: selectedProduct.id, 204 | description: description, 205 | title: title, 206 | image: imageUrl, 207 | imagePath: imagePath, 208 | price: price, 209 | userEmail: selectedProduct.userEmail, 210 | userId: selectedProduct.userId); 211 | 212 | _products[selectedProductIndex] = updatedProduct; 213 | _isLoading = false; 214 | notifyListeners(); 215 | return true; 216 | } catch (error) { 217 | cPrint('[Exception] in update product. ${error}'); 218 | _isLoading = false; 219 | notifyListeners(); 220 | return false; 221 | } 222 | } 223 | 224 | void deleteProduct() async { 225 | try { 226 | _isLoading = true; 227 | final deletedProductId = selectedProduct.id; 228 | final int selectedProductIndex = _products.indexWhere((x) { 229 | return x.id == _selSelectedId; 230 | }); 231 | _products.removeAt(selectedProductIndex); 232 | _selSelectedId = null; 233 | notifyListeners(); 234 | final http.Response response = await http.delete( 235 | 'https://flutter-app-32074.firebaseio.com/products/${deletedProductId}.json?auth=${_authenticatedUser.token}', 236 | ); 237 | if (response.statusCode != 200 && response.statusCode != 201) { 238 | cPrint('[Error] Delete api response error'); 239 | _isLoading = false; 240 | notifyListeners(); 241 | return; 242 | } 243 | cPrint('Product deleted'); 244 | _isLoading = false; 245 | notifyListeners(); 246 | } catch (error) { 247 | _isLoading = false; 248 | notifyListeners(); 249 | return; 250 | } 251 | } 252 | 253 | void selectProduct(String productId) { 254 | _selSelectedId = productId; 255 | notifyListeners(); 256 | } 257 | 258 | void setSelectedProductId(String productId) { 259 | if (productId == null) { 260 | cPrint("setSelectedProductId is set null"); 261 | } 262 | _selSelectedId = productId; 263 | notifyListeners(); 264 | } 265 | 266 | Future fetchProducts({onlyForUser = false}) async { 267 | try { 268 | _isLoading = true; 269 | notifyListeners(); 270 | final http.Response response = await http.get( 271 | 'https://flutter-app-32074.firebaseio.com/products.json?auth=${_authenticatedUser.token}'); 272 | 273 | cPrint('Data fetched from api'); 274 | if (response.statusCode != 200 && response.statusCode != 201) { 275 | cPrint( 276 | 'Fetch api response error. Status code:${response.statusCode} response: ${response.body}'); 277 | _isLoading = false; 278 | notifyListeners(); 279 | return; 280 | } 281 | final List fetchedProductList = []; 282 | final Map productListData = json.decode(response.body); 283 | if (productListData == null) { 284 | _isLoading = false; 285 | notifyListeners(); 286 | return; 287 | } 288 | productListData.forEach((String productId, dynamic productData) { 289 | final Product product = new Product( 290 | id: productId, 291 | title: productData['title'], 292 | description: productData['description'], 293 | price: productData['price'], 294 | image: productData['imageUrl'], 295 | imagePath: productData['imagePath'], 296 | userEmail: productData['email'], 297 | userId: productData['userId'], 298 | isFavourite: productData['wishlistUsers'] == null 299 | ? false 300 | : (productData['wishlistUsers'] as Map) 301 | .containsKey(_authenticatedUser.id)); 302 | fetchedProductList.add(product); 303 | }); 304 | _products = fetchedProductList.where((Product x) { 305 | return x.userId == _authenticatedUser.id; 306 | }).toList(); 307 | cPrint("Product count ${_products.length}"); 308 | cPrint("fetchedProductList count ${_products.length}"); 309 | _isLoading = false; 310 | notifyListeners(); 311 | _selSelectedId = null; 312 | } catch (error) { 313 | cPrint('[Exception] in add product. ${error} ${_authenticatedUser.id}'); 314 | _isLoading = false; 315 | notifyListeners(); 316 | } 317 | } 318 | 319 | void toggleProductFavouriteToggle() async { 320 | final bool isCurrentlyFavourite = selectedProduct.isFavourite; 321 | final bool newFavouriteStatus = !isCurrentlyFavourite; 322 | final Product updatedProduct = Product( 323 | id: selectedProduct.id, 324 | description: selectedProduct.description, 325 | title: selectedProduct.title, 326 | image: selectedProduct.image, 327 | imagePath: selectedProduct.imagePath, 328 | price: selectedProduct.price, 329 | isFavourite: newFavouriteStatus, 330 | userEmail: selectedProduct.userEmail, 331 | userId: selectedProduct.userId); 332 | _products[selectedProductIndex] = updatedProduct; 333 | http.Response response; 334 | if (newFavouriteStatus) { 335 | response = await http.put( 336 | 'https://flutter-app-32074.firebaseio.com/products/${selectedProduct.id}/wishlistUsers/${_authenticatedUser.id}.json?auth=${_authenticatedUser.token}', 337 | body: json.encode(true)); 338 | if (response.statusCode != 200 && response.statusCode != 201) { 339 | final Product updatedProduct = Product( 340 | id: selectedProduct.id, 341 | description: selectedProduct.description, 342 | title: selectedProduct.title, 343 | image: selectedProduct.image, 344 | imagePath: selectedProduct.imagePath, 345 | price: selectedProduct.price, 346 | isFavourite: !newFavouriteStatus, 347 | userEmail: selectedProduct.userEmail, 348 | userId: selectedProduct.userId); 349 | _products[selectedProductIndex] = updatedProduct; 350 | 351 | cPrint( 352 | 'Fsvourite product add api response error. Status code:${response.statusCode} response: ${response.body}'); 353 | _isLoading = false; 354 | notifyListeners(); 355 | return; 356 | } else { 357 | cPrint('User id ${_authenticatedUser.id}'); 358 | cPrint( 359 | 'Fsvourite product add successfull. Status code:${response.statusCode} response: ${response.body}'); 360 | } 361 | } else { 362 | response = await http.delete( 363 | 'https://flutter-app-32074.firebaseio.com/products/${selectedProduct.id}/wishlistUsers/${_authenticatedUser.id}.json?auth=${_authenticatedUser.token}'); 364 | 365 | if (response.statusCode != 200 && response.statusCode != 201) { 366 | final Product updatedProduct = Product( 367 | id: selectedProduct.id, 368 | description: selectedProduct.description, 369 | title: selectedProduct.title, 370 | image: selectedProduct.image, 371 | price: selectedProduct.price, 372 | isFavourite: !newFavouriteStatus, 373 | userEmail: selectedProduct.userEmail, 374 | userId: selectedProduct.userId); 375 | _products[selectedProductIndex] = updatedProduct; 376 | cPrint( 377 | 'Fsvourite product remove updated api response error. Status code:${response.statusCode} response: ${response.body}'); 378 | _isLoading = false; 379 | notifyListeners(); 380 | return; 381 | } else { 382 | cPrint( 383 | 'Fsvourite product remove successfull. Status code:${response.statusCode} response: ${response.body}'); 384 | } 385 | } 386 | 387 | notifyListeners(); 388 | } 389 | 390 | void toggleDisplayModel() { 391 | _showFavourite = !_showFavourite; 392 | notifyListeners(); 393 | } 394 | } 395 | 396 | class UserModel extends ConnectedProductsModel { 397 | Timer _authTimer; 398 | PublishSubject _userSubject = PublishSubject(); 399 | User get user { 400 | return _authenticatedUser; 401 | } 402 | 403 | PublishSubject get userSubject { 404 | return _userSubject; 405 | } 406 | 407 | void autoAuthenticated() async { 408 | SharedPreferences prefs = await SharedPreferences.getInstance(); 409 | String expirtTimeString = prefs.getString('expiryTime'); 410 | final String token = prefs.getString('token'); 411 | if (token != null) { 412 | DateTime now = DateTime.now(); 413 | final parseExpiryTime = DateTime.parse(expirtTimeString); 414 | if (parseExpiryTime.isBefore(now)) { 415 | _authenticatedUser = null; 416 | cPrint("Session Expire"); 417 | notifyListeners(); 418 | return; 419 | } 420 | final String userEmail = prefs.getString('userEmail'); 421 | final String userId = prefs.getString('userId'); 422 | final tokenLifeSpan = parseExpiryTime.difference(now).inSeconds; 423 | setAuthTimeOut(tokenLifeSpan); 424 | _authenticatedUser = new User(email: userEmail, id: userId, token: token); 425 | cPrint("Auto login. UserId : ${userId}"); 426 | _userSubject.add(true); 427 | notifyListeners(); 428 | } 429 | } 430 | 431 | void logout() async { 432 | SharedPreferences prefs = await SharedPreferences.getInstance(); 433 | await prefs.remove("token"); 434 | await prefs.remove("userEmail"); 435 | await prefs.remove("userId"); 436 | print('Logout'); 437 | _authTimer.cancel(); 438 | _userSubject.add(false); 439 | } 440 | 441 | void setAuthTimeOut(int time) { 442 | cPrint("Time Remaining for auto logout ${time}"); 443 | _authTimer = Timer(Duration(seconds: time), logout); 444 | } 445 | 446 | Future> authenticate(String email, String password, 447 | [AuthMode authMode = AuthMode.Login]) async { 448 | try { 449 | final Map _authData = { 450 | 'email': email, 451 | 'password': password, 452 | 'returnSecureToken': true 453 | }; 454 | _isLoading = true; 455 | notifyListeners(); 456 | http.Response response; 457 | if (authMode == AuthMode.Login) { 458 | response = await http.post( 459 | 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyAjc3XJO1612qcK0XOfmB5DrWGA1fb_lh8', 460 | body: json.encode(_authData), 461 | headers: {'content-Type': 'appliation/json'}); 462 | } else { 463 | response = await http.post( 464 | 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyAjc3XJO1612qcK0XOfmB5DrWGA1fb_lh8', 465 | body: json.encode(_authData), 466 | headers: {'content-Type': 'appliation/json'}); 467 | } 468 | 469 | final Map responseData = json.decode(response.body); 470 | bool hasError = true; 471 | String message = 'Something went wrong'; 472 | if (responseData.containsKey('idToken')) { 473 | hasError = false; 474 | message = 'Authentication succeeded'; 475 | _authenticatedUser = User( 476 | id: responseData['localId'], 477 | email: email, 478 | token: responseData['idToken']); 479 | cPrint('UserId = ${_authenticatedUser.id}'); 480 | setAuthTimeOut(int.parse(responseData['expiresIn'])); 481 | _userSubject.add(true); 482 | final now = DateTime.now(); 483 | final expiryTime = 484 | now.add(Duration(seconds: int.parse(responseData['expiresIn']))); 485 | cPrint(message); 486 | SharedPreferences prefs = await SharedPreferences.getInstance(); 487 | await prefs.setString('token', _authenticatedUser.token); 488 | await prefs.setString('userEmail', _authenticatedUser.email); 489 | await prefs.setString('userId', _authenticatedUser.id); 490 | await prefs.setString('expiryTime', expiryTime.toIso8601String()); 491 | await autoAuthenticated(); 492 | } else if (responseData.containsKey('error')) { 493 | if (responseData['error']['message'] == "EMAIL_NOT_FOUND") { 494 | message = 'Email not found'; 495 | cPrint(message); 496 | } else if (responseData['error']['message'] == "INVALID_EMAIL") { 497 | message = 'Invalid email'; 498 | cPrint(message); 499 | } else if (responseData['error']['message'] == "EMAIL_EXISTS") { 500 | message = 'This email is already exists'; 501 | cPrint(message); 502 | } else if (responseData['error']['message'] == "INVALID_PASSWORD") { 503 | message = 'Invalid password'; 504 | cPrint(message); 505 | } else { 506 | cPrint(responseData); 507 | } 508 | } else { 509 | cPrint(responseData); 510 | } 511 | _isLoading = false; 512 | notifyListeners(); 513 | return {'success': !hasError, "message": message}; 514 | } catch (error) { 515 | cPrint('[Exception] in signup. ${error}'); 516 | _isLoading = false; 517 | notifyListeners(); 518 | return {'success': false, "message": "Authentication failed!"}; 519 | } 520 | } 521 | } 522 | 523 | class UtilityModel extends ConnectedProductsModel { 524 | bool get isLoading { 525 | return _isLoading; 526 | } 527 | } 528 | -------------------------------------------------------------------------------- /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 | 0802FD5D046324D0B3A0217F /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ABEC79223382F740DD76FE08 /* libPods-Runner.a */; }; 11 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 19 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXCopyFilesBuildPhase section */ 26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 27 | isa = PBXCopyFilesBuildPhase; 28 | buildActionMask = 2147483647; 29 | dstPath = ""; 30 | dstSubfolderSpec = 10; 31 | files = ( 32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 34 | ); 35 | name = "Embed Frameworks"; 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 43 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 44 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 45 | 5ED8C773DAD8AA232FB2C590 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 46 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 47 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 51 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 52 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 54 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 55 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 57 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | A831EF51B93747A6858022A8 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 59 | ABEC79223382F740DD76FE08 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | EF88EF2F284443F35E842AE4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 69 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 70 | 0802FD5D046324D0B3A0217F /* libPods-Runner.a in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 9740EEB11CF90186004384FC /* Flutter */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 3B80C3931E831B6300D905FE /* App.framework */, 81 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 82 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 83 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 84 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 85 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 86 | ); 87 | name = Flutter; 88 | sourceTree = ""; 89 | }; 90 | 97C146E51CF9000F007C117D = { 91 | isa = PBXGroup; 92 | children = ( 93 | 9740EEB11CF90186004384FC /* Flutter */, 94 | 97C146F01CF9000F007C117D /* Runner */, 95 | 97C146EF1CF9000F007C117D /* Products */, 96 | DC611928565C7AA2A86EE493 /* Pods */, 97 | DEE4C8AB70625D0E92FE7B93 /* Frameworks */, 98 | ); 99 | sourceTree = ""; 100 | }; 101 | 97C146EF1CF9000F007C117D /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 97C146EE1CF9000F007C117D /* Runner.app */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | 97C146F01CF9000F007C117D /* Runner */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 113 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 114 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 115 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 116 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 117 | 97C147021CF9000F007C117D /* Info.plist */, 118 | 97C146F11CF9000F007C117D /* Supporting Files */, 119 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 120 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 121 | ); 122 | path = Runner; 123 | sourceTree = ""; 124 | }; 125 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 97C146F21CF9000F007C117D /* main.m */, 129 | ); 130 | name = "Supporting Files"; 131 | sourceTree = ""; 132 | }; 133 | DC611928565C7AA2A86EE493 /* Pods */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | EF88EF2F284443F35E842AE4 /* Pods-Runner.debug.xcconfig */, 137 | 5ED8C773DAD8AA232FB2C590 /* Pods-Runner.release.xcconfig */, 138 | A831EF51B93747A6858022A8 /* Pods-Runner.profile.xcconfig */, 139 | ); 140 | name = Pods; 141 | path = Pods; 142 | sourceTree = ""; 143 | }; 144 | DEE4C8AB70625D0E92FE7B93 /* Frameworks */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | ABEC79223382F740DD76FE08 /* libPods-Runner.a */, 148 | ); 149 | name = Frameworks; 150 | sourceTree = ""; 151 | }; 152 | /* End PBXGroup section */ 153 | 154 | /* Begin PBXNativeTarget section */ 155 | 97C146ED1CF9000F007C117D /* Runner */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 158 | buildPhases = ( 159 | 0BC61A742A572412B333B9B9 /* [CP] Check Pods Manifest.lock */, 160 | 9740EEB61CF901F6004384FC /* Run Script */, 161 | 97C146EA1CF9000F007C117D /* Sources */, 162 | 97C146EB1CF9000F007C117D /* Frameworks */, 163 | 97C146EC1CF9000F007C117D /* Resources */, 164 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 165 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 166 | 993FDE32A726D699B10E37DE /* [CP] Embed Pods Frameworks */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | ); 172 | name = Runner; 173 | productName = Runner; 174 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 175 | productType = "com.apple.product-type.application"; 176 | }; 177 | /* End PBXNativeTarget section */ 178 | 179 | /* Begin PBXProject section */ 180 | 97C146E61CF9000F007C117D /* Project object */ = { 181 | isa = PBXProject; 182 | attributes = { 183 | LastUpgradeCheck = 0910; 184 | ORGANIZATIONNAME = "The Chromium Authors"; 185 | TargetAttributes = { 186 | 97C146ED1CF9000F007C117D = { 187 | CreatedOnToolsVersion = 7.3.1; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = English; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | en, 197 | Base, 198 | ); 199 | mainGroup = 97C146E51CF9000F007C117D; 200 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | 97C146ED1CF9000F007C117D /* Runner */, 205 | ); 206 | }; 207 | /* End PBXProject section */ 208 | 209 | /* Begin PBXResourcesBuildPhase section */ 210 | 97C146EC1CF9000F007C117D /* Resources */ = { 211 | isa = PBXResourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 215 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 216 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 217 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 218 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | /* End PBXResourcesBuildPhase section */ 223 | 224 | /* Begin PBXShellScriptBuildPhase section */ 225 | 0BC61A742A572412B333B9B9 /* [CP] Check Pods Manifest.lock */ = { 226 | isa = PBXShellScriptBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | ); 230 | inputFileListPaths = ( 231 | ); 232 | inputPaths = ( 233 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 234 | "${PODS_ROOT}/Manifest.lock", 235 | ); 236 | name = "[CP] Check Pods Manifest.lock"; 237 | outputFileListPaths = ( 238 | ); 239 | outputPaths = ( 240 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | shellPath = /bin/sh; 244 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 245 | showEnvVarsInLog = 0; 246 | }; 247 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 248 | isa = PBXShellScriptBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | ); 252 | inputPaths = ( 253 | ); 254 | name = "Thin Binary"; 255 | outputPaths = ( 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | shellPath = /bin/sh; 259 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 260 | }; 261 | 9740EEB61CF901F6004384FC /* Run Script */ = { 262 | isa = PBXShellScriptBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | ); 266 | inputPaths = ( 267 | ); 268 | name = "Run Script"; 269 | outputPaths = ( 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | shellPath = /bin/sh; 273 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 274 | }; 275 | 993FDE32A726D699B10E37DE /* [CP] Embed Pods Frameworks */ = { 276 | isa = PBXShellScriptBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | ); 280 | inputFileListPaths = ( 281 | ); 282 | inputPaths = ( 283 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 284 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", 285 | ); 286 | name = "[CP] Embed Pods Frameworks"; 287 | outputFileListPaths = ( 288 | ); 289 | outputPaths = ( 290 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 291 | ); 292 | runOnlyForDeploymentPostprocessing = 0; 293 | shellPath = /bin/sh; 294 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 295 | showEnvVarsInLog = 0; 296 | }; 297 | /* End PBXShellScriptBuildPhase section */ 298 | 299 | /* Begin PBXSourcesBuildPhase section */ 300 | 97C146EA1CF9000F007C117D /* Sources */ = { 301 | isa = PBXSourcesBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 305 | 97C146F31CF9000F007C117D /* main.m in Sources */, 306 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | /* End PBXSourcesBuildPhase section */ 311 | 312 | /* Begin PBXVariantGroup section */ 313 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 314 | isa = PBXVariantGroup; 315 | children = ( 316 | 97C146FB1CF9000F007C117D /* Base */, 317 | ); 318 | name = Main.storyboard; 319 | sourceTree = ""; 320 | }; 321 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 322 | isa = PBXVariantGroup; 323 | children = ( 324 | 97C147001CF9000F007C117D /* Base */, 325 | ); 326 | name = LaunchScreen.storyboard; 327 | sourceTree = ""; 328 | }; 329 | /* End PBXVariantGroup section */ 330 | 331 | /* Begin XCBuildConfiguration section */ 332 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.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-with-dsym"; 362 | ENABLE_NS_ASSERTIONS = NO; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_NO_COMMON_BLOCKS = YES; 366 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 367 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 368 | GCC_WARN_UNDECLARED_SELECTOR = YES; 369 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 370 | GCC_WARN_UNUSED_FUNCTION = YES; 371 | GCC_WARN_UNUSED_VARIABLE = YES; 372 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 373 | MTL_ENABLE_DEBUG_INFO = NO; 374 | SDKROOT = iphoneos; 375 | TARGETED_DEVICE_FAMILY = "1,2"; 376 | VALIDATE_PRODUCT = YES; 377 | }; 378 | name = Profile; 379 | }; 380 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 381 | isa = XCBuildConfiguration; 382 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 383 | buildSettings = { 384 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 385 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 386 | DEVELOPMENT_TEAM = S8QB4VV633; 387 | ENABLE_BITCODE = NO; 388 | FRAMEWORK_SEARCH_PATHS = ( 389 | "$(inherited)", 390 | "$(PROJECT_DIR)/Flutter", 391 | ); 392 | INFOPLIST_FILE = Runner/Info.plist; 393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 394 | LIBRARY_SEARCH_PATHS = ( 395 | "$(inherited)", 396 | "$(PROJECT_DIR)/Flutter", 397 | ); 398 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApp; 399 | PRODUCT_NAME = "$(TARGET_NAME)"; 400 | VERSIONING_SYSTEM = "apple-generic"; 401 | }; 402 | name = Profile; 403 | }; 404 | 97C147031CF9000F007C117D /* Debug */ = { 405 | isa = XCBuildConfiguration; 406 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 407 | buildSettings = { 408 | ALWAYS_SEARCH_USER_PATHS = NO; 409 | CLANG_ANALYZER_NONNULL = YES; 410 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 411 | CLANG_CXX_LIBRARY = "libc++"; 412 | CLANG_ENABLE_MODULES = YES; 413 | CLANG_ENABLE_OBJC_ARC = YES; 414 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 415 | CLANG_WARN_BOOL_CONVERSION = YES; 416 | CLANG_WARN_COMMA = YES; 417 | CLANG_WARN_CONSTANT_CONVERSION = YES; 418 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 419 | CLANG_WARN_EMPTY_BODY = YES; 420 | CLANG_WARN_ENUM_CONVERSION = YES; 421 | CLANG_WARN_INFINITE_RECURSION = YES; 422 | CLANG_WARN_INT_CONVERSION = YES; 423 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 424 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 425 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 426 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 427 | CLANG_WARN_STRICT_PROTOTYPES = YES; 428 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 429 | CLANG_WARN_UNREACHABLE_CODE = YES; 430 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 431 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 432 | COPY_PHASE_STRIP = NO; 433 | DEBUG_INFORMATION_FORMAT = dwarf; 434 | ENABLE_STRICT_OBJC_MSGSEND = YES; 435 | ENABLE_TESTABILITY = YES; 436 | GCC_C_LANGUAGE_STANDARD = gnu99; 437 | GCC_DYNAMIC_NO_PIC = NO; 438 | GCC_NO_COMMON_BLOCKS = YES; 439 | GCC_OPTIMIZATION_LEVEL = 0; 440 | GCC_PREPROCESSOR_DEFINITIONS = ( 441 | "DEBUG=1", 442 | "$(inherited)", 443 | ); 444 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 445 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 446 | GCC_WARN_UNDECLARED_SELECTOR = YES; 447 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 448 | GCC_WARN_UNUSED_FUNCTION = YES; 449 | GCC_WARN_UNUSED_VARIABLE = YES; 450 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 451 | MTL_ENABLE_DEBUG_INFO = YES; 452 | ONLY_ACTIVE_ARCH = YES; 453 | SDKROOT = iphoneos; 454 | TARGETED_DEVICE_FAMILY = "1,2"; 455 | }; 456 | name = Debug; 457 | }; 458 | 97C147041CF9000F007C117D /* Release */ = { 459 | isa = XCBuildConfiguration; 460 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 461 | buildSettings = { 462 | ALWAYS_SEARCH_USER_PATHS = NO; 463 | CLANG_ANALYZER_NONNULL = YES; 464 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 465 | CLANG_CXX_LIBRARY = "libc++"; 466 | CLANG_ENABLE_MODULES = YES; 467 | CLANG_ENABLE_OBJC_ARC = YES; 468 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 469 | CLANG_WARN_BOOL_CONVERSION = YES; 470 | CLANG_WARN_COMMA = YES; 471 | CLANG_WARN_CONSTANT_CONVERSION = YES; 472 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 473 | CLANG_WARN_EMPTY_BODY = YES; 474 | CLANG_WARN_ENUM_CONVERSION = YES; 475 | CLANG_WARN_INFINITE_RECURSION = YES; 476 | CLANG_WARN_INT_CONVERSION = YES; 477 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 478 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 479 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 480 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 481 | CLANG_WARN_STRICT_PROTOTYPES = YES; 482 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 483 | CLANG_WARN_UNREACHABLE_CODE = YES; 484 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 485 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 486 | COPY_PHASE_STRIP = NO; 487 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 488 | ENABLE_NS_ASSERTIONS = NO; 489 | ENABLE_STRICT_OBJC_MSGSEND = YES; 490 | GCC_C_LANGUAGE_STANDARD = gnu99; 491 | GCC_NO_COMMON_BLOCKS = YES; 492 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 493 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 494 | GCC_WARN_UNDECLARED_SELECTOR = YES; 495 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 496 | GCC_WARN_UNUSED_FUNCTION = YES; 497 | GCC_WARN_UNUSED_VARIABLE = YES; 498 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 499 | MTL_ENABLE_DEBUG_INFO = NO; 500 | SDKROOT = iphoneos; 501 | TARGETED_DEVICE_FAMILY = "1,2"; 502 | VALIDATE_PRODUCT = YES; 503 | }; 504 | name = Release; 505 | }; 506 | 97C147061CF9000F007C117D /* Debug */ = { 507 | isa = XCBuildConfiguration; 508 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 509 | buildSettings = { 510 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 511 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 512 | ENABLE_BITCODE = NO; 513 | FRAMEWORK_SEARCH_PATHS = ( 514 | "$(inherited)", 515 | "$(PROJECT_DIR)/Flutter", 516 | ); 517 | INFOPLIST_FILE = Runner/Info.plist; 518 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 519 | LIBRARY_SEARCH_PATHS = ( 520 | "$(inherited)", 521 | "$(PROJECT_DIR)/Flutter", 522 | ); 523 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApp; 524 | PRODUCT_NAME = "$(TARGET_NAME)"; 525 | VERSIONING_SYSTEM = "apple-generic"; 526 | }; 527 | name = Debug; 528 | }; 529 | 97C147071CF9000F007C117D /* Release */ = { 530 | isa = XCBuildConfiguration; 531 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 532 | buildSettings = { 533 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 534 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 535 | ENABLE_BITCODE = NO; 536 | FRAMEWORK_SEARCH_PATHS = ( 537 | "$(inherited)", 538 | "$(PROJECT_DIR)/Flutter", 539 | ); 540 | INFOPLIST_FILE = Runner/Info.plist; 541 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 542 | LIBRARY_SEARCH_PATHS = ( 543 | "$(inherited)", 544 | "$(PROJECT_DIR)/Flutter", 545 | ); 546 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApp; 547 | PRODUCT_NAME = "$(TARGET_NAME)"; 548 | VERSIONING_SYSTEM = "apple-generic"; 549 | }; 550 | name = Release; 551 | }; 552 | /* End XCBuildConfiguration section */ 553 | 554 | /* Begin XCConfigurationList section */ 555 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 556 | isa = XCConfigurationList; 557 | buildConfigurations = ( 558 | 97C147031CF9000F007C117D /* Debug */, 559 | 97C147041CF9000F007C117D /* Release */, 560 | 249021D3217E4FDB00AE95B9 /* Profile */, 561 | ); 562 | defaultConfigurationIsVisible = 0; 563 | defaultConfigurationName = Release; 564 | }; 565 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 566 | isa = XCConfigurationList; 567 | buildConfigurations = ( 568 | 97C147061CF9000F007C117D /* Debug */, 569 | 97C147071CF9000F007C117D /* Release */, 570 | 249021D4217E4FDB00AE95B9 /* Profile */, 571 | ); 572 | defaultConfigurationIsVisible = 0; 573 | defaultConfigurationName = Release; 574 | }; 575 | /* End XCConfigurationList section */ 576 | }; 577 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 578 | } 579 | --------------------------------------------------------------------------------