├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner
│ ├── Runner-Bridging-Header.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
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
├── Runner.xcworkspace
│ └── contents.xcworkspacedata
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── xcshareddata
│ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ └── project.pbxproj
└── .gitignore
├── images
├── logo.png
└── table.png
├── android
├── key.properties
├── gradle.properties
├── .gitignore
├── 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
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── dezeleven
│ │ │ │ │ └── food_course
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── google-services.json
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── settings.gradle
└── build.gradle
├── lib
├── scr
│ ├── screens
│ │ ├── search.dart
│ │ ├── splash.dart
│ │ ├── order.dart
│ │ ├── product_search.dart
│ │ ├── restaurants_search.dart
│ │ ├── category.dart
│ │ ├── details.dart
│ │ ├── login.dart
│ │ ├── registration.dart
│ │ ├── restaurant.dart
│ │ ├── home.dart
│ │ └── cart.dart
│ ├── helpers
│ │ ├── style.dart
│ │ ├── screen_navigation.dart
│ │ ├── category.dart
│ │ ├── user.dart
│ │ ├── order.dart
│ │ ├── restaurant.dart
│ │ └── product.dart
│ ├── widgets
│ │ ├── small_floating_button.dart
│ │ ├── loading.dart
│ │ ├── custom_text.dart
│ │ ├── bottom_navigation_icons.dart
│ │ ├── likeWidget.dart
│ │ ├── categories.dart
│ │ ├── restaurant.dart
│ │ ├── product.dart
│ │ └── featured_products.dart
│ ├── providers
│ │ ├── category.dart
│ │ ├── restaurant.dart
│ │ ├── app.dart
│ │ ├── product.dart
│ │ └── user.dart
│ └── models
│ │ ├── category.dart
│ │ ├── restaurant.dart
│ │ ├── order.dart
│ │ ├── cart_item.dart
│ │ ├── user.dart
│ │ └── products.dart
└── main.dart
├── .metadata
├── README.md
├── .gitignore
├── pubspec.yaml
└── pubspec.lock
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Santos-Enoque/food_app_course/HEAD/images/logo.png
--------------------------------------------------------------------------------
/images/table.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Santos-Enoque/food_app_course/HEAD/images/table.png
--------------------------------------------------------------------------------
/android/key.properties:
--------------------------------------------------------------------------------
1 | storePassword=android
2 | keyPassword=android
3 | keyAlias=key
4 | storeFile=c:/Users/Santos/key.jks
5 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Santos-Enoque/food_app_course/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Santos-Enoque/food_app_course/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Santos-Enoque/food_app_course/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Santos-Enoque/food_app_course/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/Santos-Enoque/food_app_course/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lib/scr/screens/search.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class SearchScreen extends StatelessWidget {
4 | @override
5 | Widget build(BuildContext context) {
6 | return Scaffold(
7 |
8 | );
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/lib/scr/helpers/style.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color primary = Colors.deepOrange;
4 | const red = Colors.red;
5 | const Color white = Colors.white;
6 | const Color black = Colors.black;
7 | const Color grey = Colors.grey;
8 | const Color green = Colors.green;
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.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: 27321ebbad34b0a3fafe99fac037102196d655ff
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.
--------------------------------------------------------------------------------
/lib/scr/helpers/screen_navigation.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void changeScreen(BuildContext context, Widget widget) {
4 | Navigator.push(context, MaterialPageRoute(builder: (context) => widget));
5 | }
6 |
7 | // request here
8 | void changeScreenReplacement(BuildContext context, Widget widget) {
9 | Navigator.push(context, MaterialPageRoute(builder: (context) => widget));
10 | }
11 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/scr/widgets/small_floating_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../helpers/style.dart';
4 |
5 |
6 | class SmallButton extends StatelessWidget {
7 | final IconData icon;
8 |
9 | SmallButton(this.icon);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Padding(
14 | padding: const EdgeInsets.all(8.0),
15 | child: Container(
16 | ),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/scr/widgets/loading.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_spinkit/flutter_spinkit.dart';
3 | import 'package:food_course/scr/helpers/style.dart';
4 |
5 | class Loading extends StatelessWidget {
6 | @override
7 | Widget build(BuildContext context) {
8 | return Container(
9 | color: white,
10 | child: SpinKitFadingCircle(
11 | color: black,
12 | size: 30,
13 | )
14 | );
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lib/scr/providers/category.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import '../helpers/category.dart';
3 | import '../models/category.dart';
4 |
5 | class CategoryProvider with ChangeNotifier{
6 | CategoryServices _categoryServices = CategoryServices();
7 | List categories = [];
8 |
9 | CategoryProvider.initialize(){
10 | loadCategories();
11 | }
12 |
13 | loadCategories()async{
14 | categories = await _categoryServices.getCategories();
15 | notifyListeners();
16 | }
17 | }
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/dezeleven/food_course/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.dezeleven.food_course
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity
5 | import io.flutter.embedding.engine.FlutterEngine
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10 | GeneratedPluginRegistrant.registerWith(flutterEngine);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/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/scr/models/category.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 |
3 | class CategoryModel {
4 | static const ID = "id";
5 | static const NAME = "name";
6 | static const IMAGE = "image";
7 |
8 | int _id;
9 | String _name;
10 | String _image;
11 |
12 | // getters
13 | int get id => _id;
14 |
15 | String get name => _name;
16 |
17 | String get image => _image;
18 |
19 | CategoryModel.fromSnapshot(DocumentSnapshot snapshot){
20 | _id = snapshot.data[ID];
21 | _name = snapshot.data[NAME];
22 | _image = snapshot.data[IMAGE];
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # food_course
2 |
3 | A new Flutter application.
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 |
--------------------------------------------------------------------------------
/lib/scr/helpers/category.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import '../models/category.dart';
3 |
4 | class CategoryServices {
5 | String collection = "categories";
6 | Firestore _firestore = Firestore.instance;
7 |
8 | Future> getCategories() async =>
9 | _firestore.collection(collection).getDocuments().then((result) {
10 | List categories = [];
11 | for(DocumentSnapshot category in result.documents){
12 | categories.add(CategoryModel.fromSnapshot(category));
13 | }
14 | return categories;
15 | });
16 | }
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/lib/scr/widgets/custom_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import '../helpers/style.dart';
3 |
4 | class CustomText extends StatelessWidget {
5 | final String text;
6 | final double size;
7 | final Color color;
8 | final FontWeight weight;
9 |
10 | // name constructor that has a positional parameters with the text required
11 | // and the other parameters optional
12 | CustomText({@required this.text, this.size,this.color,this.weight});
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Text(
17 | text,style: TextStyle(fontSize: size ?? 16, color: color ?? black, fontWeight: weight ?? FontWeight.normal),
18 | );
19 | }
20 | }
--------------------------------------------------------------------------------
/lib/scr/screens/splash.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:food_course/scr/helpers/style.dart';
3 | import 'package:food_course/scr/widgets/custom_text.dart';
4 | import 'package:food_course/scr/widgets/loading.dart';
5 |
6 | class Splash extends StatefulWidget {
7 | @override
8 | _SplashState createState() => _SplashState();
9 | }
10 |
11 | class _SplashState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Scaffold(
15 | backgroundColor: white,
16 | body:Column(
17 | mainAxisAlignment: MainAxisAlignment.center,
18 | children: [
19 | CustomText(text: "Loading"),
20 | Loading(),
21 | ],
22 | )
23 | );
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | classpath 'com.google.gms:google-services:4.3.3'
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | jcenter()
19 | }
20 | }
21 |
22 | rootProject.buildDir = '../build'
23 | subprojects {
24 | project.buildDir = "${rootProject.buildDir}/${project.name}"
25 | }
26 | subprojects {
27 | project.evaluationDependsOn(':app')
28 | }
29 |
30 | task clean(type: Delete) {
31 | delete rootProject.buildDir
32 | }
33 |
--------------------------------------------------------------------------------
/lib/scr/widgets/bottom_navigation_icons.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:food_course/scr/widgets/custom_text.dart';
3 |
4 | class BottomNavIcon extends StatelessWidget {
5 | final String image;
6 | final String name;
7 | final Function onTap;
8 |
9 | const BottomNavIcon({Key key, this.image, this.name, this.onTap}) : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Padding(
14 | padding: const EdgeInsets.all(8.0),
15 | child: GestureDetector(
16 | onTap: onTap ?? null,
17 | child: Column(
18 | children: [
19 | Image.asset("images/$image",width: 20,height: 20,),
20 | SizedBox(height: 2,),
21 | CustomText(text: name,)
22 | ],
23 | ),
24 | ),
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/lib/scr/widgets/likeWidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:food_course/scr/helpers/style.dart';
3 |
4 | class LikeWidget extends StatelessWidget {
5 | @override
6 | Widget build(BuildContext context) {
7 | return Padding(
8 | padding: EdgeInsets.all(8),
9 | child: Container(
10 | decoration: BoxDecoration(
11 | borderRadius:
12 | BorderRadius.circular(20),
13 | color: white,
14 | boxShadow: [
15 | BoxShadow(
16 | color: Colors.grey[300],
17 | offset: Offset(1, 1),
18 | blurRadius: 4),
19 | ]),
20 | child: Padding(
21 | padding: const EdgeInsets.all(4.0),
22 | child: Icon(
23 | Icons.favorite_border,
24 | color: red,
25 | size: 18,
26 | ),
27 | ),
28 | ),
29 | );
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/scr/providers/restaurant.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import '../helpers/restaurant.dart';
3 | import '../models/restaurant.dart';
4 |
5 | class RestaurantProvider with ChangeNotifier{
6 | RestaurantServices _restaurantServices = RestaurantServices();
7 | List restaurants = [];
8 | List searchedRestaurants = [];
9 |
10 | RestaurantModel restaurant;
11 |
12 | RestaurantProvider.initialize(){
13 | loadRestaurants();
14 | }
15 |
16 | loadRestaurants()async{
17 | restaurants = await _restaurantServices.getRestaurants();
18 | notifyListeners();
19 | }
20 |
21 | loadSingleRestaurant({String retaurantId}) async{
22 | restaurant = await _restaurantServices.getRestaurantById(id: retaurantId);
23 | notifyListeners();
24 | }
25 |
26 | Future search({String name})async{
27 | searchedRestaurants = await _restaurantServices.searchRestaurant(restaurantName: name);
28 | print("RESTOS ARE: ${searchedRestaurants.length}");
29 | notifyListeners();
30 | }
31 | }
--------------------------------------------------------------------------------
/android/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "752818674694",
4 | "firebase_url": "https://foodapp-ee4f1.firebaseio.com",
5 | "project_id": "foodapp-ee4f1",
6 | "storage_bucket": "foodapp-ee4f1.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:752818674694:android:112f5ce725096ae00bf787",
12 | "android_client_info": {
13 | "package_name": "com.dezeleven.food_course"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "752818674694-bhfd4m2ck3vfabqj08r0uholac3bpspj.apps.googleusercontent.com",
19 | "client_type": 3
20 | }
21 | ],
22 | "api_key": [
23 | {
24 | "current_key": "AIzaSyAm1hjOoZc8dJc8lIhXLzZalQLx4IWJJTw"
25 | }
26 | ],
27 | "services": {
28 | "appinvite_service": {
29 | "other_platform_oauth_client": [
30 | {
31 | "client_id": "752818674694-bhfd4m2ck3vfabqj08r0uholac3bpspj.apps.googleusercontent.com",
32 | "client_type": 3
33 | }
34 | ]
35 | }
36 | }
37 | }
38 | ],
39 | "configuration_version": "1"
40 | }
--------------------------------------------------------------------------------
/lib/scr/models/restaurant.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 |
3 | class RestaurantModel {
4 | static const ID = "id";
5 | static const NAME = "name";
6 | static const AVG_PRICE = "avgPrice";
7 | static const RATING = "rating";
8 | static const RATES = "rates";
9 | static const IMAGE = "image";
10 | static const POPULAR = "popular";
11 | static const USER_LIKES = "userLikes";
12 |
13 |
14 |
15 | String _id;
16 | String _name;
17 | String _image;
18 | List _userLikes;
19 | double _rating;
20 | double _avgPrice;
21 | bool _popular;
22 | int _rates;
23 |
24 | // getters
25 | String get id => _id;
26 |
27 | String get name => _name;
28 |
29 | String get image => _image;
30 |
31 | List get userLikes => _userLikes;
32 |
33 | double get avgPrice => _avgPrice;
34 |
35 | double get rating => _rating;
36 |
37 | bool get popular => _popular;
38 |
39 | int get rates => _rates;
40 |
41 | // public variable
42 | bool liked = false;
43 |
44 |
45 | RestaurantModel.fromSnapshot(DocumentSnapshot snapshot) {
46 | _id = snapshot.data[ID];
47 | _name = snapshot.data[NAME];
48 | _image = snapshot.data[IMAGE];
49 | _avgPrice = snapshot.data[AVG_PRICE];
50 | _rating = snapshot.data[RATING];
51 | _popular = snapshot.data[POPULAR];
52 | _rates = snapshot.data[RATES];
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/lib/scr/models/order.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 |
3 | class OrderModel{
4 | static const ID = "id";
5 | static const DESCRIPTION = "description";
6 | static const CART = "cart";
7 | static const USER_ID = "userId";
8 | static const TOTAL = "total";
9 | static const STATUS = "status";
10 | static const CREATED_AT = "createdAt";
11 | static const RESTAURANT_ID = "restaurantId";
12 |
13 |
14 | String _id;
15 | String _restaurantId;
16 | String _description;
17 | String _userId;
18 | String _status;
19 | int _createdAt;
20 | int _total;
21 |
22 | // getters
23 | String get id => _id;
24 | String get restaurantId => _restaurantId;
25 | String get description => _description;
26 | String get userId => _userId;
27 | String get status => _status;
28 | int get total => _total;
29 | int get createdAt => _createdAt;
30 |
31 | // public variable
32 | List cart;
33 |
34 |
35 | OrderModel.fromSnapshot(DocumentSnapshot snapshot){
36 | _id = snapshot.data[ID];
37 | _description = snapshot.data[DESCRIPTION];
38 | _total = snapshot.data[TOTAL];
39 | _status = snapshot.data[STATUS];
40 | _userId = snapshot.data[USER_ID];
41 | _createdAt = snapshot.data[CREATED_AT];
42 | _restaurantId = snapshot.data[RESTAURANT_ID];
43 | cart = snapshot.data[CART];
44 | }
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | }
--------------------------------------------------------------------------------
/lib/scr/helpers/user.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:food_course/scr/models/cart_item.dart';
3 | import 'package:food_course/scr/models/user.dart';
4 |
5 | class UserServices{
6 | String collection = "users";
7 | Firestore _firestore = Firestore.instance;
8 |
9 | void createUser(Map values) {
10 | String id = values["id"];
11 | _firestore.collection(collection).document(id).setData(values);
12 | }
13 |
14 | void updateUserData(Map values){
15 | _firestore.collection(collection).document(values['id']).updateData(values);
16 | }
17 |
18 |
19 | void addToCart({String userId, CartItemModel cartItem}){
20 | print("THE USER ID IS: $userId");
21 | print("cart items are: ${cartItem.toString()}");
22 | _firestore.collection(collection).document(userId).updateData({
23 | "cart": FieldValue.arrayUnion([cartItem.toMap()])
24 | });
25 | }
26 |
27 | void removeFromCart({String userId, CartItemModel cartItem}){
28 | print("THE USER ID IS: $userId");
29 | print("cart items are: ${cartItem.toString()}");
30 | _firestore.collection(collection).document(userId).updateData({
31 | "cart": FieldValue.arrayRemove([cartItem.toMap()])
32 | });
33 | }
34 |
35 |
36 | Future getUserById(String id) => _firestore.collection(collection).document(id).get().then((doc){
37 | return UserModel.fromSnapshot(doc);
38 | });
39 | }
--------------------------------------------------------------------------------
/lib/scr/helpers/order.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:food_course/scr/models/cart_item.dart';
3 | import 'package:food_course/scr/models/order.dart';
4 |
5 | class OrderServices{
6 | String collection = "orders";
7 | Firestore _firestore = Firestore.instance;
8 |
9 | void createOrder({String userId ,String id,String description,String status ,List cart, int totalPrice}) {
10 | List