├── ios
├── 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
│ │ ├── LaunchBackground.imageset
│ │ │ ├── background.png
│ │ │ └── Contents.json
│ │ └── BrandingImage.imageset
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
├── .gitignore
├── Podfile.lock
└── Podfile
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── splash
│ ├── img
│ │ ├── dark-1x.png
│ │ ├── dark-2x.png
│ │ ├── dark-3x.png
│ │ ├── dark-4x.png
│ │ ├── light-1x.png
│ │ ├── light-2x.png
│ │ ├── light-3x.png
│ │ └── light-4x.png
│ ├── splash.js
│ └── style.css
├── manifest.json
└── index.html
├── screenshots
├── detail.png
├── drawer.png
├── home_01.png
├── home_02.png
└── welcome.png
├── assets
├── images
│ ├── user_avatar.png
│ ├── pepper_addon.png
│ ├── categories
│ │ ├── asian.png
│ │ ├── donat.png
│ │ ├── pizza.png
│ │ ├── burger.png
│ │ └── mexican.png
│ ├── restaurants
│ │ ├── pizza.png
│ │ ├── mc_donald.png
│ │ ├── noodles.png
│ │ └── starbucks.png
│ └── welcome_background.png
├── logo
│ └── splash_logo.png
├── fonts
│ ├── Sofia_Pro_Bold.otf
│ ├── Sofia_Pro_Medium.otf
│ ├── Sofia_Pro_Regular.otf
│ └── Sofia_Pro_Semi_Bold.otf
├── icons
│ ├── arrow_down.svg
│ ├── arrow_right.svg
│ ├── drawer_menu.svg
│ ├── star.svg
│ ├── search.svg
│ ├── facebook_circle.svg
│ ├── heart_circle.svg
│ ├── favourite_tab.svg
│ ├── mail.svg
│ ├── location.svg
│ ├── filter.svg
│ ├── location_tab.svg
│ ├── my_order.svg
│ ├── home_tab.svg
│ ├── person.svg
│ ├── wallet.svg
│ ├── google_circle.svg
│ ├── setting.svg
│ ├── faq.svg
│ ├── notification_tab.svg
│ ├── lock.svg
│ ├── cart_tab.svg
│ ├── power.svg
│ ├── timer.svg
│ └── delivery.svg
└── translations
│ ├── vi-VN.json
│ └── en-US.json
├── android
├── gradle.properties
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── splash.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── splash.png
│ │ │ │ ├── drawable
│ │ │ │ │ ├── background.png
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ ├── drawable-v21
│ │ │ │ │ ├── background.png
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable-xxxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ ├── 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-v31
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── values-night
│ │ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ │ └── styles.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── food_hub
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
└── build.gradle
├── lib
├── constants
│ ├── storage_key.dart
│ ├── spacing.dart
│ ├── radius.dart
│ ├── shadow.dart
│ └── colors.dart
├── presentation
│ ├── widgets
│ │ ├── material.dart
│ │ └── indicator.dart
│ └── screens
│ │ ├── welcome
│ │ └── welcome_page.dart
│ │ └── home_navigation
│ │ └── home_navigation.dart
├── routes
│ ├── links.dart
│ ├── guards.dart
│ └── routes.dart
├── models
│ ├── category_model.dart
│ ├── home_navigation_model.dart
│ ├── restaurant_model.dart
│ └── food_model.dart
├── bindings
│ ├── authen_binding.dart
│ ├── food_detail_binding.dart
│ ├── welcome_binding.dart
│ ├── home_binding.dart
│ └── home_navigation_binding.dart
├── services
│ ├── authorization_service.dart
│ └── auth_service.dart
├── repositories
│ └── count_repository.dart
├── controllers
│ ├── theme_controller.dart
│ ├── base_controller.dart
│ ├── welcome_controller.dart
│ ├── count_controller.dart
│ ├── home_navigation_controller.dart
│ ├── authen_controller.dart
│ ├── home_controller.dart
│ ├── food_detail_controller.dart
│ └── restaurant_controller.dart
└── main.dart
├── windows
├── runner
│ ├── resources
│ │ └── app_icon.ico
│ ├── resource.h
│ ├── CMakeLists.txt
│ ├── utils.h
│ ├── runner.exe.manifest
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── utils.cpp
│ ├── flutter_window.cpp
│ ├── Runner.rc
│ ├── win32_window.h
│ └── win32_window.cpp
├── flutter
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ ├── generated_plugins.cmake
│ └── CMakeLists.txt
├── .gitignore
└── CMakeLists.txt
├── .metadata
├── README.md
├── .gitignore
├── test
└── widget_test.dart
├── analysis_options.yaml
├── pubspec.yaml
└── pubspec.lock
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/favicon.png
--------------------------------------------------------------------------------
/screenshots/detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/screenshots/detail.png
--------------------------------------------------------------------------------
/screenshots/drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/screenshots/drawer.png
--------------------------------------------------------------------------------
/screenshots/home_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/screenshots/home_01.png
--------------------------------------------------------------------------------
/screenshots/home_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/screenshots/home_02.png
--------------------------------------------------------------------------------
/screenshots/welcome.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/screenshots/welcome.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/splash/img/dark-1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/splash/img/dark-1x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/splash/img/dark-2x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/splash/img/dark-3x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-4x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/splash/img/dark-4x.png
--------------------------------------------------------------------------------
/assets/images/user_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/user_avatar.png
--------------------------------------------------------------------------------
/assets/logo/splash_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/logo/splash_logo.png
--------------------------------------------------------------------------------
/web/splash/img/light-1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/splash/img/light-1x.png
--------------------------------------------------------------------------------
/web/splash/img/light-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/splash/img/light-2x.png
--------------------------------------------------------------------------------
/web/splash/img/light-3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/splash/img/light-3x.png
--------------------------------------------------------------------------------
/web/splash/img/light-4x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/splash/img/light-4x.png
--------------------------------------------------------------------------------
/assets/fonts/Sofia_Pro_Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/fonts/Sofia_Pro_Bold.otf
--------------------------------------------------------------------------------
/assets/images/pepper_addon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/pepper_addon.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/assets/fonts/Sofia_Pro_Medium.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/fonts/Sofia_Pro_Medium.otf
--------------------------------------------------------------------------------
/assets/fonts/Sofia_Pro_Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/fonts/Sofia_Pro_Regular.otf
--------------------------------------------------------------------------------
/assets/images/categories/asian.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/categories/asian.png
--------------------------------------------------------------------------------
/assets/images/categories/donat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/categories/donat.png
--------------------------------------------------------------------------------
/assets/images/categories/pizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/categories/pizza.png
--------------------------------------------------------------------------------
/assets/fonts/Sofia_Pro_Semi_Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/fonts/Sofia_Pro_Semi_Bold.otf
--------------------------------------------------------------------------------
/assets/images/categories/burger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/categories/burger.png
--------------------------------------------------------------------------------
/assets/images/categories/mexican.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/categories/mexican.png
--------------------------------------------------------------------------------
/assets/images/restaurants/pizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/restaurants/pizza.png
--------------------------------------------------------------------------------
/assets/images/welcome_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/welcome_background.png
--------------------------------------------------------------------------------
/assets/images/restaurants/mc_donald.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/restaurants/mc_donald.png
--------------------------------------------------------------------------------
/assets/images/restaurants/noodles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/restaurants/noodles.png
--------------------------------------------------------------------------------
/assets/images/restaurants/starbucks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/assets/images/restaurants/starbucks.png
--------------------------------------------------------------------------------
/lib/constants/storage_key.dart:
--------------------------------------------------------------------------------
1 | class AuthenStorageKey {
2 | // authen token
3 | static const String token = "TOKEN";
4 | }
5 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/android/app/src/main/res/drawable-hdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/android/app/src/main/res/drawable-mdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/android/app/src/main/res/drawable/background.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/android/app/src/main/res/drawable-xhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/android/app/src/main/res/drawable-xxhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/android/app/src/main/res/drawable-v21/background.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/android/app/src/main/res/drawable-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/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/phankietit/food_hub/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/HEAD/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phankietit/food_hub/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/phankietit/food_hub/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/lib/presentation/widgets/material.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | BorderRadiusGeometry circularRadius(double radius) {
4 | return BorderRadius.all(Radius.circular(radius));
5 | }
6 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/food_hub/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.food_hub
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/assets/icons/arrow_down.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/icons/arrow_right.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/web/splash/splash.js:
--------------------------------------------------------------------------------
1 | function removeSplashFromWeb() {
2 | const elem = document.getElementById("splash");
3 | if (elem) {
4 | elem.remove();
5 | }
6 | document.body.style.background = "transparent";
7 | }
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lib/routes/links.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: constant_identifier_names
2 |
3 | class AppLinks {
4 | static const WELCOME = "/welcome";
5 | static const HOME_NAVIGATION = "/home_navigation";
6 | static const FOOD_DETAIL = "/food_detail";
7 | }
8 |
--------------------------------------------------------------------------------
/lib/models/category_model.dart:
--------------------------------------------------------------------------------
1 | class CategoryModel {
2 | final String name;
3 | final String uri;
4 | final String id;
5 |
6 | CategoryModel({
7 | required this.name,
8 | required this.uri,
9 | required this.id,
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/lib/models/home_navigation_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class HomeNavigationModel {
4 | final Widget page;
5 | final String icon;
6 |
7 | HomeNavigationModel({
8 | required this.page,
9 | required this.icon,
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/assets/icons/drawer_menu.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/lib/bindings/authen_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/authen_controller.dart';
2 | import 'package:get/get.dart';
3 |
4 | class AuthenBinding implements Bindings {
5 | @override
6 | void dependencies() {
7 | Get.lazyPut(() => AuthenController());
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/assets/icons/star.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/bindings/food_detail_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/food_detail_controller.dart';
2 | import 'package:get/get.dart';
3 |
4 | class FoodDetailBinding implements Bindings {
5 | @override
6 | void dependencies() {
7 | Get.lazyPut(() => FoodDetailController());
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/services/authorization_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 |
3 | class AuthorizationService extends GetxService {
4 | late final bool isManager;
5 |
6 | @override
7 | void onInit() {
8 | isManager = true;
9 | super.onInit();
10 | }
11 |
12 | upgradeRole() {
13 | isManager = true;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/.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: 097d3313d8e2c7f901932d63e537c1acefb87800
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/lib/bindings/welcome_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/authen_controller.dart';
2 | import 'package:food_hub/controllers/welcome_controller.dart';
3 | import 'package:get/get.dart';
4 |
5 | class WelcomeBinding implements Bindings {
6 | @override
7 | void dependencies() {
8 | Get.lazyPut(() => WelcomeController());
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/assets/icons/search.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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/services/auth_service.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: prefer_typing_uninitialized_variables
2 |
3 | import 'package:get/get.dart';
4 |
5 | class AuthService extends GetxService {
6 | late final isAuthenticated;
7 |
8 | @override
9 | onInit() {
10 | isAuthenticated = false;
11 | return super.onInit();
12 | }
13 |
14 | updateAuth() {
15 | isAuthenticated = false;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/constants/spacing.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_screenutil/flutter_screenutil.dart';
2 |
3 | class AppSpacing {
4 | static double space4 = 4.w;
5 | static double space8 = 8.w;
6 | static double space12 = 12.w;
7 | static double space16 = 16.w;
8 | static double space20 = 20.w;
9 | static double space24 = 24.w;
10 | static double space28 = 28.w;
11 | static double space32 = 32.w;
12 | }
13 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/lib/constants/radius.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_screenutil/flutter_screenutil.dart';
2 |
3 | class AppRadius {
4 | static double border4 = 4.r;
5 | static double border8 = 8.r;
6 | static double border12 = 12.r;
7 | static double border16 = 16.r;
8 | static double border20 = 20.r;
9 | static double border24 = 24.r;
10 | static double border28 = 28.r;
11 | static double border32 = 32.r;
12 | }
13 |
--------------------------------------------------------------------------------
/lib/bindings/home_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/home_controller.dart';
2 | import 'package:food_hub/controllers/restaurant_controller.dart';
3 | import 'package:get/instance_manager.dart';
4 |
5 | class HomeBinding implements Bindings {
6 | @override
7 | void dependencies() {
8 | Get.lazyPut(() => HomeController());
9 | Get.lazyPut(() => RestaurantController());
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/lib/bindings/home_navigation_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/bindings/home_binding.dart';
2 | import 'package:food_hub/controllers/home_navigation_controller.dart';
3 | import 'package:get/instance_manager.dart';
4 |
5 | class HomeNavigationBinding implements Bindings {
6 | @override
7 | void dependencies() {
8 | Get.lazyPut(() => HomeNavigationController());
9 | HomeBinding().dependencies();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "background.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/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/repositories/count_repository.dart:
--------------------------------------------------------------------------------
1 | class CountRepository {
2 | Future getCount() async {
3 | await Future.delayed(const Duration(seconds: 2), () {});
4 | return 10;
5 | }
6 |
7 | Future increase(count) async {
8 | await Future.delayed(const Duration(milliseconds: 500), () {});
9 | return count + 1;
10 | }
11 |
12 | Future decrease(count) async {
13 | await Future.delayed(const Duration(milliseconds: 500), () {});
14 | return count - 1;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/assets/icons/facebook_circle.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "LaunchImage.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "LaunchImage@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "LaunchImage@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/BrandingImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "BrandingImage.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "BrandingImage@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "BrandingImage@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | set(PLUGIN_BUNDLED_LIBRARIES)
9 |
10 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
15 | endforeach(plugin)
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Food Delivery UI | Flutter
2 |
3 | - easy_localization
4 | - getX
5 | - get_storage
6 | - flutter_screenutil
7 | # Screenshot
8 |
9 | 
10 | 
11 | 
12 | 
13 | 
14 |
15 | # Video
16 |
17 | [](https://youtu.be/rMu6XOnE0UI)
18 |
19 | #### UI designed by Prelook Studio
--------------------------------------------------------------------------------
/lib/models/restaurant_model.dart:
--------------------------------------------------------------------------------
1 | class RestaurantModel {
2 | final String id;
3 | final String name;
4 | final double rating;
5 | final int totalRating;
6 | bool favourite;
7 | final int deliveryFee;
8 | final String timer;
9 | final List categoryIds;
10 | final String uri;
11 |
12 | RestaurantModel({
13 | required this.id,
14 | required this.name,
15 | required this.rating,
16 | required this.totalRating,
17 | required this.favourite,
18 | required this.deliveryFee,
19 | required this.timer,
20 | required this.categoryIds,
21 | required this.uri,
22 | });
23 | }
24 |
--------------------------------------------------------------------------------
/lib/controllers/theme_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get_storage/get_storage.dart';
3 | import 'package:get/get.dart';
4 |
5 | class ThemeController extends GetxController {
6 | final _box = GetStorage();
7 | final _key = 'isDarkMode';
8 |
9 | ThemeMode get theme => _loadTheme() ? ThemeMode.dark : ThemeMode.light;
10 | bool _loadTheme() => _box.read(_key) ?? false;
11 |
12 | void saveTheme(bool isDarkMode) => _box.write(_key, isDarkMode);
13 | void changeTheme(ThemeData theme) => Get.changeTheme(theme);
14 | void changeThemeMode(ThemeMode themeMode) => Get.changeThemeMode(themeMode);
15 | }
16 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | add_executable(${BINARY_NAME} WIN32
5 | "flutter_window.cpp"
6 | "main.cpp"
7 | "utils.cpp"
8 | "win32_window.cpp"
9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
10 | "Runner.rc"
11 | "runner.exe.manifest"
12 | )
13 | apply_standard_settings(${BINARY_NAME})
14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
17 | add_dependencies(${BINARY_NAME} flutter_assemble)
18 |
--------------------------------------------------------------------------------
/lib/controllers/base_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/state_manager.dart';
2 |
3 | abstract class BaseController extends GetxController {
4 | final RxBool _loading = true.obs;
5 | final RxString _error = ''.obs;
6 |
7 | bool get isLoading => _loading.value;
8 | bool get isError => !_loading.value && _error.value.isNotEmpty;
9 | String get error => _error.value;
10 |
11 | void onError(String error) {
12 | _error(error);
13 | _loading(false);
14 |
15 | update();
16 | }
17 |
18 | void updateLoading(bool _value) {
19 | _loading(_value);
20 | if (_value) {
21 | _error('');
22 | }
23 |
24 | update();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/assets/icons/heart_circle.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/translations/vi-VN.json:
--------------------------------------------------------------------------------
1 | {
2 | "skip": "Skip",
3 | "welcome1": "Welcome to",
4 | "welcome2": "FoodHub",
5 | "welcome3": "Your favourite foods delivered fast at your door.",
6 | "sign_in_with": " sign in with",
7 | "facebook": "Facebook",
8 | "google": "Google",
9 | "start_with_mail_phone": "Start with email or phone",
10 | "have_account": "Already have an account? ",
11 | "sign_in": "Sign in",
12 | "deliver_to": "Deliver to",
13 | "what_you_like": "What would you like\nto order",
14 | "find_food_restaurant": "Find for food or restaurant...",
15 | "featured_restaurant": "Featured Restaurants",
16 | "view_all": "View All"
17 | }
--------------------------------------------------------------------------------
/assets/icons/favourite_tab.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/lib/constants/shadow.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:food_hub/constants/colors.dart';
3 |
4 | class AppShadow {
5 | static const List button = [
6 | BoxShadow(
7 | color: Colors.white10,
8 | blurRadius: 10,
9 | offset: Offset(3, 6), // changes position of shadow
10 | ),
11 | ];
12 |
13 | static const List buttonWhite = [
14 | BoxShadow(
15 | color: AppColors.gray5,
16 | blurRadius: 15,
17 | offset: Offset(5, 10), // changes position of shadow
18 | ),
19 | ];
20 |
21 | static const List bottomTab = [
22 | BoxShadow(
23 | color: AppColors.gray5,
24 | blurRadius: 15,
25 | offset: Offset(0, -10), // changes position of shadow
26 | ),
27 | ];
28 | }
29 |
--------------------------------------------------------------------------------
/web/splash/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin:0;
3 | height:100%;
4 | background: #FE724C;
5 |
6 | background-size: 100% 100%;
7 | }
8 |
9 | .center {
10 | margin: 0;
11 | position: absolute;
12 | top: 50%;
13 | left: 50%;
14 | -ms-transform: translate(-50%, -50%);
15 | transform: translate(-50%, -50%);
16 | }
17 |
18 | .contain {
19 | display:block;
20 | width:100%; height:100%;
21 | object-fit: contain;
22 | }
23 |
24 | .stretch {
25 | display:block;
26 | width:100%; height:100%;
27 | }
28 |
29 | .cover {
30 | display:block;
31 | width:100%; height:100%;
32 | object-fit: cover;
33 | }
34 |
35 | @media (prefers-color-scheme: dark) {
36 | body {
37 | margin:0;
38 | height:100%;
39 | background: #FE724C;
40 |
41 | background-size: 100% 100%;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/assets/translations/en-US.json:
--------------------------------------------------------------------------------
1 | {
2 | "skip": "Skip",
3 | "welcome1": "Welcome to",
4 | "welcome2": "FoodHub",
5 | "welcome3": "Your favourite foods delivered fast at your door.",
6 | "sign_in_with": " sign in with",
7 | "facebook": "Facebook",
8 | "google": "Google",
9 | "start_with_mail_phone": "Start with email or phone",
10 | "have_account": "Already have an account? ",
11 | "sign_in": "Sign in",
12 | "deliver_to": "Deliver to",
13 | "what_you_like": "What would you like\nto order",
14 | "find_food_restaurant": "Find for food or restaurant...",
15 | "featured_restaurant": "Featured Restaurants",
16 | "view_all": "View All",
17 | "popular_item": "Popular Items",
18 | "log_out": "Log Out",
19 | "see_review": "See Review",
20 | "food_add_on": "Choice of Add On",
21 | "add_to_cart": "Add to cart"
22 | }
--------------------------------------------------------------------------------
/assets/icons/mail.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/assets/icons/location.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/lib/controllers/welcome_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/authen_controller.dart';
2 | import 'package:food_hub/routes/links.dart';
3 | import 'package:get/get.dart';
4 |
5 | class WelcomeController extends GetxController {
6 | final RxBool _loading = true.obs;
7 | final AuthenController authenController = Get.find();
8 |
9 | get loading => _loading.value;
10 |
11 | @override
12 | void onInit() async {
13 | await Future.delayed(const Duration(seconds: 2));
14 | _updateLoading(false);
15 | super.onInit();
16 | }
17 |
18 | void goToHome() async {
19 | _updateLoading(true);
20 | await Future.delayed(const Duration(seconds: 2));
21 | await authenController.doSetToken("FAKE_TOKEN");
22 | Get.toNamed(AppLinks.HOME_NAVIGATION);
23 | _updateLoading(false);
24 | }
25 |
26 | void _updateLoading(bool _value) {
27 | _loading(_value);
28 | update();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/assets/icons/filter.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "food_hub",
3 | "short_name": "food_hub",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values-v31/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/assets/icons/location_tab.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/icons/my_order.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/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:food_hub/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(const MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/assets/icons/home_tab.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
17 |
20 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - flutter_native_splash (0.0.1):
4 | - Flutter
5 | - path_provider_ios (0.0.1):
6 | - Flutter
7 | - shared_preferences_ios (0.0.1):
8 | - Flutter
9 |
10 | DEPENDENCIES:
11 | - Flutter (from `Flutter`)
12 | - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
13 | - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
14 | - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
15 |
16 | EXTERNAL SOURCES:
17 | Flutter:
18 | :path: Flutter
19 | flutter_native_splash:
20 | :path: ".symlinks/plugins/flutter_native_splash/ios"
21 | path_provider_ios:
22 | :path: ".symlinks/plugins/path_provider_ios/ios"
23 | shared_preferences_ios:
24 | :path: ".symlinks/plugins/shared_preferences_ios/ios"
25 |
26 | SPEC CHECKSUMS:
27 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
28 | flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
29 | path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
30 | shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
31 |
32 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
33 |
34 | COCOAPODS: 1.11.2
35 |
--------------------------------------------------------------------------------
/lib/controllers/count_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/repositories/count_repository.dart';
2 | import 'package:get/get.dart';
3 |
4 | class CountController extends GetxController with StateMixin {
5 | final repository = CountRepository();
6 | @override
7 | void onInit() {
8 | repository.getCount().then((resp) {
9 | change(resp, status: RxStatus.success());
10 | }, onError: (err) {
11 | change(
12 | null,
13 | status: RxStatus.error('Error get data'),
14 | );
15 | super.onInit();
16 | });
17 | }
18 |
19 | void increase() async {
20 | _loading();
21 | repository.increase(state).then((value) {
22 | change(value, status: RxStatus.success());
23 | }, onError: (err) {
24 | printError(info: err.toString());
25 | change(null, status: RxStatus.error());
26 | });
27 | }
28 |
29 | void decrease() async {
30 | _loading();
31 | repository.decrease(state).then((value) {
32 | change(value, status: RxStatus.success());
33 | }, onError: (err) {
34 | printError(info: err.toString());
35 | change(null, status: RxStatus.error());
36 | });
37 | }
38 |
39 | void _loading() {
40 | change(state, status: RxStatus.loading());
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/lib/routes/guards.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/authen_controller.dart';
2 | import 'package:food_hub/routes/links.dart';
3 | import 'package:food_hub/services/authorization_service.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:get/get.dart';
6 |
7 | class AuthGuard extends GetMiddleware {
8 | final authController = Get.find();
9 |
10 | @override
11 | int? get priority => 1;
12 |
13 | @override
14 | RouteSettings? redirect(String? route) {
15 | if (authController.isAuthenticated && route != AppLinks.HOME_NAVIGATION) {
16 | return const RouteSettings(name: AppLinks.HOME_NAVIGATION);
17 | } else if (!authController.isAuthenticated && route != AppLinks.WELCOME) {
18 | return const RouteSettings(name: AppLinks.WELCOME);
19 | }
20 | return super.redirect(route);
21 | }
22 | }
23 |
24 | class AuthorizationGuard extends GetMiddleware {
25 | final authzGuard = Get.find();
26 |
27 | @override
28 | int? get priority => 2;
29 |
30 | @override
31 | RouteSettings? redirect(String? route) {
32 | if (authzGuard.isManager) {
33 | return const RouteSettings(name: AppLinks.HOME_NAVIGATION);
34 | }
35 | return super.redirect(route);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/controllers/home_navigation_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:food_hub/models/home_navigation_model.dart';
3 | import 'package:food_hub/presentation/screens/home/home_page.dart';
4 | import 'package:get/get.dart';
5 |
6 | class HomeNavigationController extends GetxController {
7 | final RxList _pages = [
8 | HomeNavigationModel(
9 | icon: "assets/icons/home_tab.svg",
10 | page: HomePage(),
11 | ),
12 | HomeNavigationModel(
13 | icon: "assets/icons/location_tab.svg",
14 | page: Container(),
15 | ),
16 | HomeNavigationModel(
17 | icon: "assets/icons/cart_tab.svg",
18 | page: Container(),
19 | ),
20 | HomeNavigationModel(
21 | icon: "assets/icons/favourite_tab.svg",
22 | page: Container(),
23 | ),
24 | HomeNavigationModel(
25 | icon: "assets/icons/notification_tab.svg",
26 | page: Container(),
27 | ),
28 | ].obs;
29 | GlobalKey key = GlobalKey();
30 |
31 | final RxInt _selectedIndex = 0.obs;
32 |
33 | void onItemTapped(int index) {
34 | _selectedIndex(index);
35 | update();
36 | }
37 |
38 | RxList get pages => _pages;
39 | int get selectedIndex => _selectedIndex.value;
40 | }
41 |
--------------------------------------------------------------------------------
/assets/icons/person.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/assets/icons/wallet.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/assets/icons/google_circle.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/lib/models/food_model.dart:
--------------------------------------------------------------------------------
1 | class FoodModel {
2 | final String id;
3 | final String name;
4 | final String description;
5 | final double rating;
6 | final int totalRating;
7 | bool favourite;
8 | final String uri;
9 | final double price;
10 |
11 | FoodModel({
12 | required this.id,
13 | required this.name,
14 | required this.description,
15 | required this.rating,
16 | required this.totalRating,
17 | required this.favourite,
18 | required this.uri,
19 | required this.price,
20 | });
21 | }
22 |
23 | class FoodDetailModel {
24 | final String id;
25 | final String name;
26 | final String description;
27 | final double rating;
28 | final int totalRating;
29 | bool favourite;
30 | final String uri;
31 | final double price;
32 | final List addOns;
33 |
34 | FoodDetailModel({
35 | required this.id,
36 | required this.name,
37 | required this.description,
38 | required this.rating,
39 | required this.totalRating,
40 | required this.favourite,
41 | required this.uri,
42 | required this.price,
43 | required this.addOns,
44 | });
45 | }
46 |
47 | class FoodAddOnModel {
48 | final String id;
49 | final String name;
50 | final String uri;
51 | final double price;
52 |
53 | const FoodAddOnModel({
54 | required this.id,
55 | required this.name,
56 | required this.price,
57 | required this.uri,
58 | });
59 | }
60 |
--------------------------------------------------------------------------------
/lib/constants/colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class AppColors {
4 | static const List indicators = [
5 | Color(0xffFED2C7),
6 | Color(0xffFED2C7),
7 | Color(0xffFEA58D),
8 | Color(0xffFE8160),
9 | Color(0xffFE724C),
10 | ];
11 | // text
12 | static const Color white100 = Color(0xffffffff);
13 | static const Color white21 = Color(0x36ffffff);
14 | static const Color white10 = Color(0x1Affffff);
15 |
16 | static const Color orange100 = Color(0xffFE724C);
17 | static const Color orange80 = Color(0xffFE8160);
18 | static const Color orange50 = Color(0xffFEA58D);
19 | static const Color orange20 = Color(0xffFED2C7);
20 |
21 | static const Color dark100 = Color(0xff1A1D26);
22 | static const Color dark80 = Color(0xff2A2F3D);
23 | static const Color dark50 = Color(0xff4D5364);
24 | static const Color dark20 = Color(0xff6E7489);
25 | static const Color dark5 = Color(0xffE9EAEC);
26 |
27 | static const Color yellow100 = Color(0xffFFC529);
28 | static const Color yellow80 = Color(0xffFFD050);
29 | static const Color yellow50 = Color(0xffFFDF8B);
30 | static const Color yellow20 = Color(0xffFFEFC3);
31 |
32 | static const Color gray100 = Color(0xff9A9FAE);
33 | static const Color gray80 = Color(0xffA8ACB9);
34 | static const Color gray50 = Color(0xffC4C7D0);
35 | static const Color gray20 = Color(0xffEBEBEB);
36 | static const Color gray5 = Color(0xffF5F5F5);
37 | }
38 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.CreateAndShow(L"food_hub", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/lib/controllers/authen_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/constants/storage_key.dart';
2 | import 'package:food_hub/controllers/base_controller.dart';
3 | import 'package:food_hub/routes/links.dart';
4 | import 'package:get/get_navigation/get_navigation.dart';
5 | import 'package:get/state_manager.dart';
6 | import 'package:get_storage/get_storage.dart';
7 |
8 | class AuthenController extends BaseController {
9 | final RxString _token = "".obs;
10 | final RxBool _isAuthenticated = false.obs;
11 | final _box = GetStorage();
12 |
13 | String get token => _token.value;
14 | bool get isAuthenticated => _isAuthenticated.value;
15 |
16 | Future doSetToken(String token) async {
17 | updateLoading(true);
18 | await _box.write(AuthenStorageKey.token, token);
19 | _token(token);
20 | _isAuthenticated(true);
21 | updateLoading(false);
22 | }
23 |
24 | Future doRemoveToken() async {
25 | updateLoading(true);
26 | await _box.remove(AuthenStorageKey.token);
27 | _token("");
28 | _isAuthenticated(false);
29 | updateLoading(false);
30 | }
31 |
32 | void logOut() async {
33 | await doRemoveToken();
34 | Get.offAllNamed(AppLinks.WELCOME);
35 | }
36 |
37 | void doGetToken() async {
38 | final String token = await _box.read(AuthenStorageKey.token);
39 | if (token.isNotEmpty) {
40 | doSetToken(token);
41 | }
42 | }
43 |
44 | @override
45 | void onInit() {
46 | doGetToken();
47 | super.onInit();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/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 flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/controllers/home_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/base_controller.dart';
2 | import 'package:food_hub/models/category_model.dart';
3 | import 'package:food_hub/routes/links.dart';
4 | import 'package:get/get_navigation/get_navigation.dart';
5 | import 'package:get/state_manager.dart';
6 |
7 | class HomeController extends BaseController {
8 | final List _categories = [
9 | CategoryModel(
10 | id: "01",
11 | name: "Burger",
12 | uri: "assets/images/categories/burger.png",
13 | ),
14 | CategoryModel(
15 | id: "02",
16 | name: "Donat",
17 | uri: "assets/images/categories/donat.png",
18 | ),
19 | CategoryModel(
20 | id: "03",
21 | name: "Pizza",
22 | uri: "assets/images/categories/pizza.png",
23 | ),
24 | CategoryModel(
25 | id: "04",
26 | name: "Mexican",
27 | uri: "assets/images/categories/mexican.png",
28 | ),
29 | CategoryModel(
30 | id: "05",
31 | name: "Asian",
32 | uri: "assets/images/categories/asian.png",
33 | ),
34 | ];
35 |
36 | final RxString _currentCategoryId = ''.obs;
37 |
38 | String get currentCategoryId => _currentCategoryId.value;
39 | List get categories => _categories;
40 |
41 | void onSelectCategory(String id) async {
42 | updateLoading(true);
43 | _currentCategoryId(id);
44 | await Future.delayed(const Duration(milliseconds: 500));
45 | updateLoading(false);
46 | }
47 |
48 | void goToFoodDetail(String id) {
49 | Get.toNamed(AppLinks.FOOD_DETAIL);
50 | }
51 |
52 | @override
53 | void onInit() async {
54 | await Future.delayed(const Duration(seconds: 1));
55 | _currentCategoryId(_categories.first.id);
56 | updateLoading(false);
57 | super.onInit();
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr);
51 | if (target_length == 0) {
52 | return std::string();
53 | }
54 | std::string utf8_string;
55 | utf8_string.resize(target_length);
56 | int converted_length = ::WideCharToMultiByte(
57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
58 | -1, utf8_string.data(),
59 | target_length, nullptr, nullptr);
60 | if (converted_length == 0) {
61 | return std::string();
62 | }
63 | return utf8_string;
64 | }
65 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/bindings/authen_binding.dart';
2 | import 'package:food_hub/constants/colors.dart';
3 | import 'package:food_hub/routes/links.dart';
4 | import 'package:food_hub/routes/routes.dart';
5 | import 'package:easy_localization/easy_localization.dart';
6 | import 'package:flutter/material.dart';
7 | import 'package:flutter_screenutil/flutter_screenutil.dart';
8 | import 'package:get/route_manager.dart';
9 | import 'package:get_storage/get_storage.dart';
10 |
11 | void main() async {
12 | await GetStorage.init();
13 | AuthenBinding().dependencies();
14 | runApp(
15 | EasyLocalization(
16 | supportedLocales: const [Locale('en', 'US'), Locale('vi', 'VN')],
17 | path: 'assets/translations', //
18 | fallbackLocale: const Locale('en', 'US'),
19 | startLocale: const Locale('en', 'US'),
20 | child: const MyApp()),
21 | );
22 | }
23 |
24 | class MyApp extends StatelessWidget {
25 | const MyApp({Key? key}) : super(key: key);
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return ScreenUtilInit(
30 | designSize: const Size(375, 812),
31 | minTextAdapt: true,
32 | splitScreenMode: true,
33 | builder: () => GetMaterialApp(
34 | localizationsDelegates: context.localizationDelegates,
35 | supportedLocales: context.supportedLocales,
36 | locale: context.locale,
37 | theme: ThemeData(
38 | fontFamily: "SofiaPro",
39 | textTheme: const TextTheme(
40 | bodyText1: TextStyle(fontWeight: FontWeight.w500),
41 | bodyText2: TextStyle(fontWeight: FontWeight.w500),
42 | ).apply(
43 | bodyColor: AppColors.dark100,
44 | displayColor: AppColors.dark100,
45 | ),
46 | ),
47 | initialBinding: AuthenBinding(),
48 | initialRoute: AppLinks.WELCOME,
49 | getPages: AppRoutes.pages,
50 | ),
51 | );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/assets/icons/setting.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Food Hub
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | food_hub
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 | CFBundleLocalizations
47 |
48 | en
49 | vi
50 |
51 | UIStatusBarHidden
52 |
53 |
54 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 | return true;
30 | }
31 |
32 | void FlutterWindow::OnDestroy() {
33 | if (flutter_controller_) {
34 | flutter_controller_ = nullptr;
35 | }
36 |
37 | Win32Window::OnDestroy();
38 | }
39 |
40 | LRESULT
41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
42 | WPARAM const wparam,
43 | LPARAM const lparam) noexcept {
44 | // Give Flutter, including plugins, an opportunity to handle window messages.
45 | if (flutter_controller_) {
46 | std::optional result =
47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
48 | lparam);
49 | if (result) {
50 | return *result;
51 | }
52 | }
53 |
54 | switch (message) {
55 | case WM_FONTCHANGE:
56 | flutter_controller_->engine()->ReloadSystemFonts();
57 | break;
58 | }
59 |
60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
61 | }
62 |
--------------------------------------------------------------------------------
/assets/icons/faq.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/assets/icons/notification_tab.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/lib/routes/routes.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/bindings/food_detail_binding.dart';
2 | import 'package:food_hub/bindings/home_binding.dart';
3 | import 'package:food_hub/bindings/home_navigation_binding.dart';
4 | import 'package:food_hub/bindings/welcome_binding.dart';
5 | import 'package:food_hub/presentation/screens/food_detail/food_detail_page.dart';
6 | import 'package:food_hub/presentation/screens/home/home_page.dart';
7 | import 'package:food_hub/presentation/screens/home_navigation/home_navigation.dart';
8 | import 'package:food_hub/presentation/screens/welcome/welcome_page.dart';
9 | import 'package:food_hub/routes/guards.dart';
10 | import 'package:get/get.dart';
11 |
12 | import 'links.dart';
13 |
14 | class AppRoutes {
15 | static final pages = [
16 | GetPage(
17 | name: AppLinks.WELCOME,
18 | page: () => const WelcomePage(),
19 | binding: WelcomeBinding(),
20 | middlewares: [AuthGuard()],
21 | ),
22 | GetPage(
23 | name: AppLinks.HOME_NAVIGATION,
24 | page: () => HomeNavigationPage(),
25 | binding: HomeNavigationBinding(),
26 | middlewares: [AuthGuard()],
27 | ),
28 | GetPage(
29 | name: AppLinks.FOOD_DETAIL,
30 | page: () => FoodDetailPage(),
31 | binding: FoodDetailBinding(),
32 | )
33 | // GetPage(
34 | // name: AppLinks.DASHBOARD,
35 | // page: () => Dashboard(),
36 | // middlewares: [
37 | // AuthGuard(),
38 | // ],
39 | // children: [
40 | // GetPage(
41 | // name: AppLinks.PRODUCTS,
42 | // page: () => Products(),
43 | // ),
44 | // GetPage(
45 | // name: AppLinks.FAVORITES,
46 | // page: () => Favorites(),
47 | // ),
48 | // GetPage(
49 | // name: AppLinks.ORDERS,
50 | // page: () => Orders(),
51 | // ),
52 | // ],
53 | // ),
54 | // GetPage(
55 | // name: AppLinks.ADMIN,
56 | // page: () => AdminDashboard(),
57 | // middlewares: [
58 | // // Allow only admins to get through
59 | // AuthGuard(),
60 | // AuthorizationGuard()
61 | // ],
62 | // )
63 | ];
64 | }
65 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | kotlinOptions {
37 | jvmTarget = '1.8'
38 | }
39 |
40 | sourceSets {
41 | main.java.srcDirs += 'src/main/kotlin'
42 | }
43 |
44 | defaultConfig {
45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46 | applicationId "com.example.food_hub"
47 | minSdkVersion flutter.minSdkVersion
48 | targetSdkVersion flutter.targetSdkVersion
49 | versionCode flutterVersionCode.toInteger()
50 | versionName flutterVersionName
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68 | }
69 |
--------------------------------------------------------------------------------
/lib/controllers/food_detail_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/base_controller.dart';
2 | import 'package:food_hub/models/food_model.dart';
3 | import 'package:get/state_manager.dart';
4 |
5 | class FoodDetailController extends BaseController {
6 | final Rx _food = FoodDetailModel(
7 | id: "01",
8 | favourite: true,
9 | name: "Ground Beef Tacos",
10 | rating: 4.5,
11 | totalRating: 30,
12 | uri: "assets/images/restaurants/mc_donald.png",
13 | description:
14 | "Brown the beef better. Lean ground beef – I like to use 85% lean angus. Garlic – use fresh chopped. Spices – chili powder, cumin, onion powder.",
15 | price: 5.50,
16 | addOns: const [
17 | FoodAddOnModel(
18 | id: "01",
19 | name: "Pepper Julienned",
20 | price: 2.3,
21 | uri: "assets/images/pepper_addon.png",
22 | ),
23 | FoodAddOnModel(
24 | id: "02",
25 | name: "Pepper Julienned",
26 | price: 2.3,
27 | uri: "assets/images/pepper_addon.png",
28 | ),
29 | FoodAddOnModel(
30 | id: "03",
31 | name: "Pepper Julienned",
32 | price: 2.3,
33 | uri: "assets/images/pepper_addon.png",
34 | ),
35 | FoodAddOnModel(
36 | id: "011",
37 | name: "Pepper Julienned",
38 | price: 2.3,
39 | uri: "assets/images/pepper_addon.png",
40 | ),
41 | FoodAddOnModel(
42 | id: "022",
43 | name: "Pepper Julienned",
44 | price: 2.3,
45 | uri: "assets/images/pepper_addon.png",
46 | ),
47 | FoodAddOnModel(
48 | id: "033",
49 | name: "Pepper Julienned",
50 | price: 2.3,
51 | uri: "assets/images/pepper_addon.png",
52 | ),
53 | ],
54 | ).obs;
55 |
56 | final RxList _addOnIds = [].obs;
57 |
58 | final RxInt _quantity = 1.obs;
59 |
60 | List get addOnIds => _addOnIds;
61 | int get quantity => _quantity.value;
62 | FoodDetailModel get food => _food.value;
63 |
64 | void doMakeFavourite() {
65 | _food.value.favourite = !_food.value.favourite;
66 | _food.refresh();
67 | }
68 |
69 | void doIncrease() {
70 | _quantity(_quantity.value + 1);
71 | }
72 |
73 | void doDecrease() {
74 | if (_quantity.value - 1 > 0) {
75 | _quantity(_quantity.value - 1);
76 | }
77 | }
78 |
79 | void doCheckAddOn(String id) {
80 | if (_addOnIds.contains(id)) {
81 | _addOnIds.removeWhere((element) => element == id);
82 | } else {
83 | _addOnIds.add(id);
84 | }
85 | _addOnIds.refresh();
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/lib/controllers/restaurant_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/controllers/base_controller.dart';
2 | import 'package:food_hub/models/food_model.dart';
3 | import 'package:food_hub/models/restaurant_model.dart';
4 | import 'package:get/get.dart';
5 |
6 | class RestaurantController extends BaseController {
7 | final RxList _restaurants = [
8 | RestaurantModel(
9 | id: "01",
10 | categoryIds: ["01", "02"],
11 | deliveryFee: 0,
12 | favourite: true,
13 | name: "McDonald’s",
14 | rating: 4.5,
15 | timer: "10-15 mins",
16 | totalRating: 30,
17 | uri: "assets/images/restaurants/mc_donald.png",
18 | ),
19 | RestaurantModel(
20 | id: "02",
21 | categoryIds: ["03", "05", "01"],
22 | deliveryFee: 0,
23 | favourite: false,
24 | name: "Starbucks",
25 | rating: 4.5,
26 | timer: "10-15 mins",
27 | totalRating: 30,
28 | uri: "assets/images/restaurants/starbucks.png",
29 | ),
30 | ].obs;
31 |
32 | final RxList _popularFoods = [
33 | FoodModel(
34 | id: "01",
35 | favourite: true,
36 | name: "Salmon Salad",
37 | rating: 4.5,
38 | totalRating: 30,
39 | uri: "assets/images/restaurants/noodles.png",
40 | description: "Baked salmon fish",
41 | price: 5.50,
42 | ),
43 | FoodModel(
44 | id: "02",
45 | favourite: true,
46 | name: "Salmon Salad",
47 | rating: 4.5,
48 | totalRating: 30,
49 | uri: "assets/images/restaurants/pizza.png",
50 | description: "Baked salmon fish",
51 | price: 5.50,
52 | ),
53 | FoodModel(
54 | id: "03",
55 | favourite: true,
56 | name: "Salmon Salad",
57 | rating: 4.5,
58 | totalRating: 30,
59 | uri: "assets/images/restaurants/noodles.png",
60 | description: "Baked salmon fish",
61 | price: 5.50,
62 | ),
63 | FoodModel(
64 | id: "04",
65 | favourite: true,
66 | name: "Salmon Salad",
67 | rating: 4.5,
68 | totalRating: 30,
69 | uri: "assets/images/restaurants/mc_donald.png",
70 | description: "Baked salmon fish",
71 | price: 5.50,
72 | ),
73 | ].obs;
74 |
75 | List get restaurants => _restaurants;
76 | List get popularFoods => _popularFoods;
77 |
78 | void doMakeFavouriteRestaurant(String id) {
79 | final item = _restaurants.firstWhere((element) => element.id == id);
80 | item.favourite = !item.favourite;
81 | _restaurants.refresh();
82 | }
83 |
84 | void doMakeFavouriteFood(String id) {
85 | final item = _popularFoods.firstWhere((element) => element.id == id);
86 | item.favourite = !item.favourite;
87 | _restaurants.refresh();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/assets/icons/lock.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/icons/cart_tab.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/icons/power.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/assets/icons/timer.svg:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/indicator.dart:
--------------------------------------------------------------------------------
1 | import 'package:food_hub/constants/colors.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:loading_indicator/loading_indicator.dart';
5 |
6 | class AppIndicator extends StatelessWidget {
7 | const AppIndicator({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return SizedBox(
12 | height: 50.r,
13 | width: 50.r,
14 | child: const LoadingIndicator(
15 | indicatorType: Indicator.ballRotateChase,
16 | colors: AppColors.indicators,
17 | strokeWidth: 3,
18 | backgroundColor: Colors.transparent,
19 | pathBackgroundColor: Colors.black,
20 | ),
21 | );
22 | }
23 | }
24 |
25 | class ContainerIndicator extends StatelessWidget {
26 | const ContainerIndicator({Key? key}) : super(key: key);
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Container(
31 | width: double.infinity,
32 | height: double.infinity,
33 | alignment: Alignment.center,
34 | child: const AppIndicator(),
35 | );
36 | }
37 | }
38 |
39 | class WrapperIndicator extends StatefulWidget {
40 | final bool loading;
41 | final Widget child;
42 | const WrapperIndicator({
43 | Key? key,
44 | this.loading = false,
45 | required this.child,
46 | }) : super(key: key);
47 |
48 | @override
49 | State createState() => _WrapperIndicatorState();
50 | }
51 |
52 | class _WrapperIndicatorState extends State {
53 | bool loading = false;
54 |
55 | @override
56 | void didUpdateWidget(WrapperIndicator oldWidget) {
57 | if (oldWidget.loading != widget.loading) {
58 | setState(() {
59 | loading = widget.loading;
60 | });
61 | }
62 | super.didUpdateWidget(oldWidget);
63 | }
64 |
65 | @override
66 | Widget build(BuildContext context) {
67 | // return Stack(
68 | // key: ValueKey(widget.loading),
69 | // children: [
70 | // widget.child,
71 | // widget.loading
72 | // ? const Positioned(
73 | // top: 0,
74 | // left: 0,
75 | // right: 0,
76 | // bottom: 0,
77 | // child: ContainerIndicator(),
78 | // )
79 | // : const SizedBox(),
80 | // ],
81 | // );
82 |
83 | return AnimatedSwitcher(
84 | duration: const Duration(milliseconds: 300),
85 | transitionBuilder: (Widget child, Animation animation) {
86 | return FadeTransition(
87 | opacity: Tween(begin: 0.7, end: 1.0).animate(animation),
88 | child: child,
89 | );
90 | },
91 | child: Stack(
92 | key: ValueKey(widget.loading),
93 | children: [
94 | widget.child,
95 | widget.loading
96 | ? const Positioned(
97 | top: 0,
98 | left: 0,
99 | right: 0,
100 | bottom: 0,
101 | child: ContainerIndicator(),
102 | )
103 | : const SizedBox(),
104 | ],
105 | ));
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #ifdef FLUTTER_BUILD_NUMBER
64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0
67 | #endif
68 |
69 | #ifdef FLUTTER_BUILD_NAME
70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.example" "\0"
93 | VALUE "FileDescription", "food_hub" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "food_hub" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "food_hub.exe" "\0"
98 | VALUE "ProductName", "food_hub" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner/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 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates and shows a win32 window with |title| and position and size using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size to will treat the width height passed in to this function
35 | // as logical pixels and scale to appropriate for the default monitor. Returns
36 | // true if the window was created successfully.
37 | bool CreateAndShow(const std::wstring& title,
38 | const Point& origin,
39 | const Size& size);
40 |
41 | // Release OS resources associated with window.
42 | void Destroy();
43 |
44 | // Inserts |content| into the window tree.
45 | void SetChildContent(HWND content);
46 |
47 | // Returns the backing Window handle to enable clients to set icon and other
48 | // window properties. Returns nullptr if the window has been destroyed.
49 | HWND GetHandle();
50 |
51 | // If true, closing this window will quit the application.
52 | void SetQuitOnClose(bool quit_on_close);
53 |
54 | // Return a RECT representing the bounds of the current client area.
55 | RECT GetClientArea();
56 |
57 | protected:
58 | // Processes and route salient window messages for mouse handling,
59 | // size change and DPI. Delegates handling of these to member overloads that
60 | // inheriting classes can handle.
61 | virtual LRESULT MessageHandler(HWND window,
62 | UINT const message,
63 | WPARAM const wparam,
64 | LPARAM const lparam) noexcept;
65 |
66 | // Called when CreateAndShow is called, allowing subclass window-related
67 | // setup. Subclasses should return false if setup fails.
68 | virtual bool OnCreate();
69 |
70 | // Called when Destroy is called.
71 | virtual void OnDestroy();
72 |
73 | private:
74 | friend class WindowClassRegistrar;
75 |
76 | // OS callback called by message pump. Handles the WM_NCCREATE message which
77 | // is passed when the non-client area is being created and enables automatic
78 | // non-client DPI scaling so that the non-client area automatically
79 | // responsponds to changes in DPI. All other messages are handled by
80 | // MessageHandler.
81 | static LRESULT CALLBACK WndProc(HWND const window,
82 | UINT const message,
83 | WPARAM const wparam,
84 | LPARAM const lparam) noexcept;
85 |
86 | // Retrieves a class instance pointer for |window|
87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
88 |
89 | bool quit_on_close_ = false;
90 |
91 | // window handle for top level window.
92 | HWND window_handle_ = nullptr;
93 |
94 | // window handle for hosted content.
95 | HWND child_content_ = nullptr;
96 | };
97 |
98 | #endif // RUNNER_WIN32_WINDOW_H_
99 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(food_hub LANGUAGES CXX)
3 |
4 | set(BINARY_NAME "food_hub")
5 |
6 | cmake_policy(SET CMP0063 NEW)
7 |
8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
9 |
10 | # Configure build options.
11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
12 | if(IS_MULTICONFIG)
13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
14 | CACHE STRING "" FORCE)
15 | else()
16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
17 | set(CMAKE_BUILD_TYPE "Debug" CACHE
18 | STRING "Flutter build mode" FORCE)
19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
20 | "Debug" "Profile" "Release")
21 | endif()
22 | endif()
23 |
24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
28 |
29 | # Use Unicode for all projects.
30 | add_definitions(-DUNICODE -D_UNICODE)
31 |
32 | # Compilation settings that should be applied to most targets.
33 | function(APPLY_STANDARD_SETTINGS TARGET)
34 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
36 | target_compile_options(${TARGET} PRIVATE /EHsc)
37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
39 | endfunction()
40 |
41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
42 |
43 | # Flutter library and tool build rules.
44 | add_subdirectory(${FLUTTER_MANAGED_DIR})
45 |
46 | # Application build
47 | add_subdirectory("runner")
48 |
49 | # Generated plugin build rules, which manage building the plugins and adding
50 | # them to the application.
51 | include(flutter/generated_plugins.cmake)
52 |
53 |
54 | # === Installation ===
55 | # Support files are copied into place next to the executable, so that it can
56 | # run in place. This is done instead of making a separate bundle (as on Linux)
57 | # so that building and running from within Visual Studio will work.
58 | set(BUILD_BUNDLE_DIR "$")
59 | # Make the "install" step default, as it's required to run.
60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
63 | endif()
64 |
65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
67 |
68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
69 | COMPONENT Runtime)
70 |
71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
72 | COMPONENT Runtime)
73 |
74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
75 | COMPONENT Runtime)
76 |
77 | if(PLUGIN_BUNDLED_LIBRARIES)
78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
80 | COMPONENT Runtime)
81 | endif()
82 |
83 | # Fully re-copy the assets directory on each build to avoid having stale files
84 | # from a previous install.
85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
86 | install(CODE "
87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
88 | " COMPONENT Runtime)
89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
91 |
92 | # Install the AOT library on non-Debug builds only.
93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
94 | CONFIGURATIONS Profile;Release
95 | COMPONENT Runtime)
96 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 |
3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
4 |
5 | # Configuration provided via flutter tool.
6 | include(${EPHEMERAL_DIR}/generated_config.cmake)
7 |
8 | # TODO: Move the rest of this into files in ephemeral. See
9 | # https://github.com/flutter/flutter/issues/57146.
10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
11 |
12 | # === Flutter Library ===
13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
14 |
15 | # Published to parent scope for install step.
16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
20 |
21 | list(APPEND FLUTTER_LIBRARY_HEADERS
22 | "flutter_export.h"
23 | "flutter_windows.h"
24 | "flutter_messenger.h"
25 | "flutter_plugin_registrar.h"
26 | "flutter_texture_registrar.h"
27 | )
28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
29 | add_library(flutter INTERFACE)
30 | target_include_directories(flutter INTERFACE
31 | "${EPHEMERAL_DIR}"
32 | )
33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
34 | add_dependencies(flutter flutter_assemble)
35 |
36 | # === Wrapper ===
37 | list(APPEND CPP_WRAPPER_SOURCES_CORE
38 | "core_implementations.cc"
39 | "standard_codec.cc"
40 | )
41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
43 | "plugin_registrar.cc"
44 | )
45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
46 | list(APPEND CPP_WRAPPER_SOURCES_APP
47 | "flutter_engine.cc"
48 | "flutter_view_controller.cc"
49 | )
50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
51 |
52 | # Wrapper sources needed for a plugin.
53 | add_library(flutter_wrapper_plugin STATIC
54 | ${CPP_WRAPPER_SOURCES_CORE}
55 | ${CPP_WRAPPER_SOURCES_PLUGIN}
56 | )
57 | apply_standard_settings(flutter_wrapper_plugin)
58 | set_target_properties(flutter_wrapper_plugin PROPERTIES
59 | POSITION_INDEPENDENT_CODE ON)
60 | set_target_properties(flutter_wrapper_plugin PROPERTIES
61 | CXX_VISIBILITY_PRESET hidden)
62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
63 | target_include_directories(flutter_wrapper_plugin PUBLIC
64 | "${WRAPPER_ROOT}/include"
65 | )
66 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
67 |
68 | # Wrapper sources needed for the runner.
69 | add_library(flutter_wrapper_app STATIC
70 | ${CPP_WRAPPER_SOURCES_CORE}
71 | ${CPP_WRAPPER_SOURCES_APP}
72 | )
73 | apply_standard_settings(flutter_wrapper_app)
74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
75 | target_include_directories(flutter_wrapper_app PUBLIC
76 | "${WRAPPER_ROOT}/include"
77 | )
78 | add_dependencies(flutter_wrapper_app flutter_assemble)
79 |
80 | # === Flutter tool backend ===
81 | # _phony_ is a non-existent file to force this command to run every time,
82 | # since currently there's no way to get a full input/output list from the
83 | # flutter tool.
84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
86 | add_custom_command(
87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
89 | ${CPP_WRAPPER_SOURCES_APP}
90 | ${PHONY_OUTPUT}
91 | COMMAND ${CMAKE_COMMAND} -E env
92 | ${FLUTTER_TOOL_ENVIRONMENT}
93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
94 | windows-x64 $
95 | VERBATIM
96 | )
97 | add_custom_target(flutter_assemble DEPENDS
98 | "${FLUTTER_LIBRARY}"
99 | ${FLUTTER_LIBRARY_HEADERS}
100 | ${CPP_WRAPPER_SOURCES_CORE}
101 | ${CPP_WRAPPER_SOURCES_PLUGIN}
102 | ${CPP_WRAPPER_SOURCES_APP}
103 | )
104 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: food_hub
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.16.1 <3.0.0"
22 |
23 | # Dependencies specify other packages that your package needs in order to work.
24 | # To automatically upgrade your package dependencies to the latest versions
25 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
26 | # dependencies can be manually updated by changing the version numbers below to
27 | # the latest version available on pub.dev. To see which dependencies have newer
28 | # versions available, run `flutter pub outdated`.
29 | dependencies:
30 | flutter:
31 | sdk: flutter
32 |
33 |
34 | # The following adds the Cupertino Icons font to your application.
35 | # Use with the CupertinoIcons class for iOS style icons.
36 | cupertino_icons: ^1.0.2
37 | easy_localization: ^3.0.0
38 | flutter_screenutil: ^5.3.1
39 | get: ^4.6.1
40 | get_storage: ^2.0.3
41 | loading_indicator: ^3.0.3
42 | flutter_native_splash: ^2.1.1
43 | flutter_svg: ^1.0.3
44 |
45 | dev_dependencies:
46 | flutter_test:
47 | sdk: flutter
48 |
49 | # The "flutter_lints" package below contains a set of recommended lints to
50 | # encourage good coding practices. The lint set provided by the package is
51 | # activated in the `analysis_options.yaml` file located at the root of your
52 | # package. See that file for information about deactivating specific lint
53 | # rules and activating additional ones.
54 | flutter_lints: ^1.0.0
55 |
56 | # For information on the generic Dart part of this file, see the
57 | # following page: https://dart.dev/tools/pub/pubspec
58 |
59 | flutter_native_splash:
60 | color: "#FE724C"
61 | image: assets/logo/splash_logo.png
62 |
63 | # The following section is specific to Flutter.
64 | flutter:
65 |
66 | # The following line ensures that the Material Icons font is
67 | # included with your application, so that you can use the icons in
68 | # the material Icons class.
69 | uses-material-design: true
70 |
71 | assets:
72 | - assets/translations/
73 | - assets/images/
74 | - assets/images/categories/
75 | - assets/images/restaurants/
76 | - assets/fonts/
77 | - assets/icons/
78 | - assets/logo/
79 | fonts:
80 | - family: SofiaPro
81 | fonts:
82 | - asset: assets/fonts/Sofia_Pro_Medium.otf
83 | weight: 500
84 | - asset: assets/fonts/Sofia_Pro_Regular.otf
85 | weight: 300
86 | - asset: assets/fonts/Sofia_Pro_Semi_Bold.otf
87 | weight: 700
88 | - asset: assets/fonts/Sofia_Pro_Bold.otf
89 | weight: 900
90 |
91 | # An image asset can refer to one or more resolution-specific "variants", see
92 | # https://flutter.dev/assets-and-images/#resolution-aware.
93 |
94 | # For details regarding adding assets from package dependencies, see
95 | # https://flutter.dev/assets-and-images/#from-packages
96 |
97 | # To add custom fonts to your application, add a fonts section here,
98 | # in this "flutter" section. Each entry in this list should have a
99 | # "family" key with the font family name, and a "fonts" key with a
100 | # list giving the asset and other descriptors for the font. For
101 | # example:
102 | # fonts:
103 | # - family: Schyler
104 | # fonts:
105 | # - asset: fonts/Schyler-Regular.ttf
106 | # - asset: fonts/Schyler-Italic.ttf
107 | # style: italic
108 | # - family: Trajan Pro
109 | # fonts:
110 | # - asset: fonts/TrajanPro.ttf
111 | # - asset: fonts/TrajanPro_Bold.ttf
112 | # weight: 700
113 | #
114 | # For details regarding fonts from package dependencies,
115 | # see https://flutter.dev/custom-fonts/#from-packages
116 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | food_hub
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
47 |
111 |
112 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.cpp:
--------------------------------------------------------------------------------
1 | #include "win32_window.h"
2 |
3 | #include
4 |
5 | #include "resource.h"
6 |
7 | namespace {
8 |
9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
10 |
11 | // The number of Win32Window objects that currently exist.
12 | static int g_active_window_count = 0;
13 |
14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);
15 |
16 | // Scale helper to convert logical scaler values to physical using passed in
17 | // scale factor
18 | int Scale(int source, double scale_factor) {
19 | return static_cast(source * scale_factor);
20 | }
21 |
22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.
23 | // This API is only needed for PerMonitor V1 awareness mode.
24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) {
25 | HMODULE user32_module = LoadLibraryA("User32.dll");
26 | if (!user32_module) {
27 | return;
28 | }
29 | auto enable_non_client_dpi_scaling =
30 | reinterpret_cast(
31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
32 | if (enable_non_client_dpi_scaling != nullptr) {
33 | enable_non_client_dpi_scaling(hwnd);
34 | FreeLibrary(user32_module);
35 | }
36 | }
37 |
38 | } // namespace
39 |
40 | // Manages the Win32Window's window class registration.
41 | class WindowClassRegistrar {
42 | public:
43 | ~WindowClassRegistrar() = default;
44 |
45 | // Returns the singleton registar instance.
46 | static WindowClassRegistrar* GetInstance() {
47 | if (!instance_) {
48 | instance_ = new WindowClassRegistrar();
49 | }
50 | return instance_;
51 | }
52 |
53 | // Returns the name of the window class, registering the class if it hasn't
54 | // previously been registered.
55 | const wchar_t* GetWindowClass();
56 |
57 | // Unregisters the window class. Should only be called if there are no
58 | // instances of the window.
59 | void UnregisterWindowClass();
60 |
61 | private:
62 | WindowClassRegistrar() = default;
63 |
64 | static WindowClassRegistrar* instance_;
65 |
66 | bool class_registered_ = false;
67 | };
68 |
69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;
70 |
71 | const wchar_t* WindowClassRegistrar::GetWindowClass() {
72 | if (!class_registered_) {
73 | WNDCLASS window_class{};
74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);
75 | window_class.lpszClassName = kWindowClassName;
76 | window_class.style = CS_HREDRAW | CS_VREDRAW;
77 | window_class.cbClsExtra = 0;
78 | window_class.cbWndExtra = 0;
79 | window_class.hInstance = GetModuleHandle(nullptr);
80 | window_class.hIcon =
81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));
82 | window_class.hbrBackground = 0;
83 | window_class.lpszMenuName = nullptr;
84 | window_class.lpfnWndProc = Win32Window::WndProc;
85 | RegisterClass(&window_class);
86 | class_registered_ = true;
87 | }
88 | return kWindowClassName;
89 | }
90 |
91 | void WindowClassRegistrar::UnregisterWindowClass() {
92 | UnregisterClass(kWindowClassName, nullptr);
93 | class_registered_ = false;
94 | }
95 |
96 | Win32Window::Win32Window() {
97 | ++g_active_window_count;
98 | }
99 |
100 | Win32Window::~Win32Window() {
101 | --g_active_window_count;
102 | Destroy();
103 | }
104 |
105 | bool Win32Window::CreateAndShow(const std::wstring& title,
106 | const Point& origin,
107 | const Size& size) {
108 | Destroy();
109 |
110 | const wchar_t* window_class =
111 | WindowClassRegistrar::GetInstance()->GetWindowClass();
112 |
113 | const POINT target_point = {static_cast(origin.x),
114 | static_cast(origin.y)};
115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);
116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
117 | double scale_factor = dpi / 96.0;
118 |
119 | HWND window = CreateWindow(
120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor),
123 | nullptr, nullptr, GetModuleHandle(nullptr), this);
124 |
125 | if (!window) {
126 | return false;
127 | }
128 |
129 | return OnCreate();
130 | }
131 |
132 | // static
133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window,
134 | UINT const message,
135 | WPARAM const wparam,
136 | LPARAM const lparam) noexcept {
137 | if (message == WM_NCCREATE) {
138 | auto window_struct = reinterpret_cast(lparam);
139 | SetWindowLongPtr(window, GWLP_USERDATA,
140 | reinterpret_cast(window_struct->lpCreateParams));
141 |
142 | auto that = static_cast(window_struct->lpCreateParams);
143 | EnableFullDpiSupportIfAvailable(window);
144 | that->window_handle_ = window;
145 | } else if (Win32Window* that = GetThisFromHandle(window)) {
146 | return that->MessageHandler(window, message, wparam, lparam);
147 | }
148 |
149 | return DefWindowProc(window, message, wparam, lparam);
150 | }
151 |
152 | LRESULT
153 | Win32Window::MessageHandler(HWND hwnd,
154 | UINT const message,
155 | WPARAM const wparam,
156 | LPARAM const lparam) noexcept {
157 | switch (message) {
158 | case WM_DESTROY:
159 | window_handle_ = nullptr;
160 | Destroy();
161 | if (quit_on_close_) {
162 | PostQuitMessage(0);
163 | }
164 | return 0;
165 |
166 | case WM_DPICHANGED: {
167 | auto newRectSize = reinterpret_cast(lparam);
168 | LONG newWidth = newRectSize->right - newRectSize->left;
169 | LONG newHeight = newRectSize->bottom - newRectSize->top;
170 |
171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,
172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
173 |
174 | return 0;
175 | }
176 | case WM_SIZE: {
177 | RECT rect = GetClientArea();
178 | if (child_content_ != nullptr) {
179 | // Size and position the child window.
180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
181 | rect.bottom - rect.top, TRUE);
182 | }
183 | return 0;
184 | }
185 |
186 | case WM_ACTIVATE:
187 | if (child_content_ != nullptr) {
188 | SetFocus(child_content_);
189 | }
190 | return 0;
191 | }
192 |
193 | return DefWindowProc(window_handle_, message, wparam, lparam);
194 | }
195 |
196 | void Win32Window::Destroy() {
197 | OnDestroy();
198 |
199 | if (window_handle_) {
200 | DestroyWindow(window_handle_);
201 | window_handle_ = nullptr;
202 | }
203 | if (g_active_window_count == 0) {
204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass();
205 | }
206 | }
207 |
208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
209 | return reinterpret_cast(
210 | GetWindowLongPtr(window, GWLP_USERDATA));
211 | }
212 |
213 | void Win32Window::SetChildContent(HWND content) {
214 | child_content_ = content;
215 | SetParent(content, window_handle_);
216 | RECT frame = GetClientArea();
217 |
218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
219 | frame.bottom - frame.top, true);
220 |
221 | SetFocus(child_content_);
222 | }
223 |
224 | RECT Win32Window::GetClientArea() {
225 | RECT frame;
226 | GetClientRect(window_handle_, &frame);
227 | return frame;
228 | }
229 |
230 | HWND Win32Window::GetHandle() {
231 | return window_handle_;
232 | }
233 |
234 | void Win32Window::SetQuitOnClose(bool quit_on_close) {
235 | quit_on_close_ = quit_on_close;
236 | }
237 |
238 | bool Win32Window::OnCreate() {
239 | // No-op; provided for subclasses.
240 | return true;
241 | }
242 |
243 | void Win32Window::OnDestroy() {
244 | // No-op; provided for subclasses.
245 | }
246 |
--------------------------------------------------------------------------------
/lib/presentation/screens/welcome/welcome_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:flutter/gestures.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_screenutil/flutter_screenutil.dart';
5 | import 'package:flutter_svg/flutter_svg.dart';
6 | import 'package:food_hub/constants/colors.dart';
7 | import 'package:food_hub/constants/radius.dart';
8 | import 'package:food_hub/constants/shadow.dart';
9 | import 'package:food_hub/constants/spacing.dart';
10 | import 'package:food_hub/controllers/welcome_controller.dart';
11 | import 'package:food_hub/presentation/widgets/indicator.dart';
12 | import 'package:get/get.dart';
13 |
14 | class WelcomePage extends GetView {
15 | const WelcomePage({Key? key}) : super(key: key);
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(body: _buildBackground());
20 | }
21 |
22 | Widget _buildBackground() {
23 | return Obx(() => WrapperIndicator(
24 | loading: controller.loading,
25 | child: Container(
26 | decoration: const BoxDecoration(
27 | image: DecorationImage(
28 | image: AssetImage("assets/images/welcome_background.png"),
29 | fit: BoxFit.cover,
30 | alignment: Alignment.bottomLeft,
31 | ),
32 | ),
33 | child: SafeArea(
34 | child: _buildContent(),
35 | ),
36 | ),
37 | ));
38 | }
39 |
40 | Widget _buildContent() {
41 | return Padding(
42 | padding: EdgeInsets.symmetric(
43 | horizontal: AppSpacing.space28,
44 | ),
45 | child: Column(
46 | mainAxisAlignment: MainAxisAlignment.start,
47 | crossAxisAlignment: CrossAxisAlignment.start,
48 | children: [
49 | _buildSkip(),
50 | _buildMessage(),
51 | SizedBox(
52 | height: 110.h,
53 | ),
54 | _buildSigninMethod(),
55 | ],
56 | ),
57 | );
58 | }
59 |
60 | Widget _buildSigninMethod() {
61 | return Column(
62 | children: [
63 | Row(
64 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
65 | children: [
66 | SizedBox(
67 | width: 84.w,
68 | child: const Divider(
69 | color: AppColors.white100,
70 | thickness: 1,
71 | ),
72 | ),
73 | Text(
74 | tr("sign_in_with"),
75 | style: TextStyle(
76 | fontSize: 16.sp,
77 | fontWeight: FontWeight.w500,
78 | color: AppColors.white100,
79 | ),
80 | ),
81 | SizedBox(
82 | width: 84.w,
83 | child: const Divider(
84 | color: AppColors.white100,
85 | thickness: 1,
86 | ),
87 | )
88 | ],
89 | ),
90 | SizedBox(
91 | height: 18.h,
92 | ),
93 | Row(
94 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
95 | children: [
96 | GestureDetector(
97 | onTap: controller.goToHome,
98 | child: Container(
99 | width: 140.w,
100 | height: 54.w,
101 | padding: EdgeInsets.only(
102 | left: AppSpacing.space12,
103 | right: AppSpacing.space16,
104 | ),
105 | decoration: BoxDecoration(
106 | color: AppColors.white100,
107 | borderRadius: BorderRadius.all(
108 | Radius.circular(AppRadius.border28),
109 | ),
110 | boxShadow: AppShadow.button,
111 | ),
112 | child: Row(
113 | crossAxisAlignment: CrossAxisAlignment.center,
114 | children: [
115 | SvgPicture.asset(
116 | "assets/icons/facebook_circle.svg",
117 | width: 30.w,
118 | height: 30.w,
119 | ),
120 | Expanded(
121 | child: Center(child: Text(tr("facebook").toUpperCase())),
122 | ),
123 | ],
124 | ),
125 | ),
126 | ),
127 | GestureDetector(
128 | onTap: controller.goToHome,
129 | child: Container(
130 | width: 140.w,
131 | height: 54.w,
132 | padding: EdgeInsets.only(
133 | left: AppSpacing.space12,
134 | right: AppSpacing.space16,
135 | ),
136 | decoration: BoxDecoration(
137 | color: AppColors.white100,
138 | borderRadius: BorderRadius.all(
139 | Radius.circular(AppRadius.border28),
140 | ),
141 | boxShadow: AppShadow.button,
142 | ),
143 | child: Row(
144 | crossAxisAlignment: CrossAxisAlignment.center,
145 | children: [
146 | SvgPicture.asset(
147 | "assets/icons/google_circle.svg",
148 | width: 30.w,
149 | height: 30.w,
150 | ),
151 | Expanded(
152 | child: Center(
153 | child: Text(tr("google").toUpperCase()),
154 | ),
155 | )
156 | ],
157 | ),
158 | ),
159 | ),
160 | ],
161 | ),
162 | SizedBox(
163 | height: 24.h,
164 | ),
165 | GestureDetector(
166 | onTap: controller.goToHome,
167 | child: Container(
168 | width: double.infinity,
169 | alignment: Alignment.center,
170 | height: 54.w,
171 | decoration: BoxDecoration(
172 | borderRadius:
173 | BorderRadius.all(Radius.circular(AppRadius.border28)),
174 | border: Border.all(
175 | color: AppColors.white100,
176 | width: 2,
177 | ),
178 | boxShadow: AppShadow.button,
179 | color: AppColors.white21,
180 | ),
181 | child: Text(
182 | tr("start_with_mail_phone"),
183 | style: TextStyle(
184 | color: AppColors.white100,
185 | fontWeight: FontWeight.w500,
186 | fontSize: 17.sp,
187 | ),
188 | ),
189 | ),
190 | ),
191 | SizedBox(
192 | height: 24.h,
193 | ),
194 | RichText(
195 | text: TextSpan(
196 | text: tr("have_account"),
197 | style: TextStyle(
198 | fontWeight: FontWeight.w300,
199 | fontSize: 16.sp,
200 | ),
201 | children: [
202 | TextSpan(
203 | recognizer: TapGestureRecognizer()
204 | ..onTap = controller.goToHome,
205 | text: tr("sign_in"),
206 | style: const TextStyle(
207 | fontWeight: FontWeight.w500,
208 | decoration: TextDecoration.underline,
209 | )),
210 | ],
211 | ),
212 | ),
213 | ],
214 | );
215 | }
216 |
217 | Widget _buildMessage() {
218 | return Expanded(
219 | flex: 1,
220 | child: Column(
221 | crossAxisAlignment: CrossAxisAlignment.start,
222 | mainAxisAlignment: MainAxisAlignment.center,
223 | children: [
224 | Text(
225 | tr("welcome1"),
226 | style: TextStyle(
227 | fontSize: 48.sp,
228 | fontWeight: FontWeight.w900,
229 | ),
230 | ),
231 | Text(
232 | tr("welcome2"),
233 | style: TextStyle(
234 | fontSize: 48.sp,
235 | fontWeight: FontWeight.w900,
236 | color: AppColors.orange100,
237 | ),
238 | ),
239 | SizedBox(
240 | height: 20.h,
241 | ),
242 | Padding(
243 | padding: EdgeInsets.only(right: 52.w),
244 | child: Text(
245 | tr("welcome3"),
246 | style: TextStyle(
247 | fontSize: 18.sp,
248 | color: AppColors.dark50,
249 | ),
250 | ),
251 | ),
252 | ],
253 | ),
254 | );
255 | }
256 |
257 | Widget _buildSkip() {
258 | return Row(
259 | mainAxisAlignment: MainAxisAlignment.end,
260 | children: [
261 | GestureDetector(
262 | onTap: controller.goToHome,
263 | child: Container(
264 | padding: EdgeInsets.symmetric(
265 | horizontal: AppSpacing.space16,
266 | vertical: AppSpacing.space8,
267 | ),
268 | decoration: BoxDecoration(
269 | borderRadius: BorderRadius.all(
270 | Radius.circular(AppRadius.border28),
271 | ),
272 | color: AppColors.white100,
273 | boxShadow: AppShadow.button,
274 | ),
275 | child: Text(
276 | tr("skip"),
277 | style: TextStyle(
278 | color: AppColors.orange100,
279 | fontWeight: FontWeight.w300,
280 | fontSize: 14.sp,
281 | ),
282 | ),
283 | ),
284 | )
285 | ],
286 | );
287 | }
288 | }
289 |
--------------------------------------------------------------------------------
/assets/icons/delivery.svg:
--------------------------------------------------------------------------------
1 |
45 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | archive:
5 | dependency: transitive
6 | description:
7 | name: archive
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "3.2.2"
11 | args:
12 | dependency: transitive
13 | description:
14 | name: args
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.3.0"
18 | async:
19 | dependency: transitive
20 | description:
21 | name: async
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.8.2"
25 | boolean_selector:
26 | dependency: transitive
27 | description:
28 | name: boolean_selector
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "2.1.0"
32 | characters:
33 | dependency: transitive
34 | description:
35 | name: characters
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.2.0"
39 | charcode:
40 | dependency: transitive
41 | description:
42 | name: charcode
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.3.1"
46 | clock:
47 | dependency: transitive
48 | description:
49 | name: clock
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.1.0"
53 | collection:
54 | dependency: transitive
55 | description:
56 | name: collection
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.15.0"
60 | crypto:
61 | dependency: transitive
62 | description:
63 | name: crypto
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "3.0.1"
67 | cupertino_icons:
68 | dependency: "direct main"
69 | description:
70 | name: cupertino_icons
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "1.0.4"
74 | easy_localization:
75 | dependency: "direct main"
76 | description:
77 | name: easy_localization
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "3.0.0"
81 | easy_logger:
82 | dependency: transitive
83 | description:
84 | name: easy_logger
85 | url: "https://pub.dartlang.org"
86 | source: hosted
87 | version: "0.0.2"
88 | fake_async:
89 | dependency: transitive
90 | description:
91 | name: fake_async
92 | url: "https://pub.dartlang.org"
93 | source: hosted
94 | version: "1.2.0"
95 | ffi:
96 | dependency: transitive
97 | description:
98 | name: ffi
99 | url: "https://pub.dartlang.org"
100 | source: hosted
101 | version: "1.1.2"
102 | file:
103 | dependency: transitive
104 | description:
105 | name: file
106 | url: "https://pub.dartlang.org"
107 | source: hosted
108 | version: "6.1.2"
109 | flutter:
110 | dependency: "direct main"
111 | description: flutter
112 | source: sdk
113 | version: "0.0.0"
114 | flutter_lints:
115 | dependency: "direct dev"
116 | description:
117 | name: flutter_lints
118 | url: "https://pub.dartlang.org"
119 | source: hosted
120 | version: "1.0.4"
121 | flutter_localizations:
122 | dependency: transitive
123 | description: flutter
124 | source: sdk
125 | version: "0.0.0"
126 | flutter_native_splash:
127 | dependency: "direct main"
128 | description:
129 | name: flutter_native_splash
130 | url: "https://pub.dartlang.org"
131 | source: hosted
132 | version: "2.1.1"
133 | flutter_screenutil:
134 | dependency: "direct main"
135 | description:
136 | name: flutter_screenutil
137 | url: "https://pub.dartlang.org"
138 | source: hosted
139 | version: "5.3.1"
140 | flutter_svg:
141 | dependency: "direct main"
142 | description:
143 | name: flutter_svg
144 | url: "https://pub.dartlang.org"
145 | source: hosted
146 | version: "1.0.3"
147 | flutter_test:
148 | dependency: "direct dev"
149 | description: flutter
150 | source: sdk
151 | version: "0.0.0"
152 | flutter_web_plugins:
153 | dependency: transitive
154 | description: flutter
155 | source: sdk
156 | version: "0.0.0"
157 | get:
158 | dependency: "direct main"
159 | description:
160 | name: get
161 | url: "https://pub.dartlang.org"
162 | source: hosted
163 | version: "4.6.1"
164 | get_storage:
165 | dependency: "direct main"
166 | description:
167 | name: get_storage
168 | url: "https://pub.dartlang.org"
169 | source: hosted
170 | version: "2.0.3"
171 | image:
172 | dependency: transitive
173 | description:
174 | name: image
175 | url: "https://pub.dartlang.org"
176 | source: hosted
177 | version: "3.1.3"
178 | intl:
179 | dependency: transitive
180 | description:
181 | name: intl
182 | url: "https://pub.dartlang.org"
183 | source: hosted
184 | version: "0.17.0"
185 | js:
186 | dependency: transitive
187 | description:
188 | name: js
189 | url: "https://pub.dartlang.org"
190 | source: hosted
191 | version: "0.6.3"
192 | lints:
193 | dependency: transitive
194 | description:
195 | name: lints
196 | url: "https://pub.dartlang.org"
197 | source: hosted
198 | version: "1.0.1"
199 | loading_indicator:
200 | dependency: "direct main"
201 | description:
202 | name: loading_indicator
203 | url: "https://pub.dartlang.org"
204 | source: hosted
205 | version: "3.0.3"
206 | matcher:
207 | dependency: transitive
208 | description:
209 | name: matcher
210 | url: "https://pub.dartlang.org"
211 | source: hosted
212 | version: "0.12.11"
213 | material_color_utilities:
214 | dependency: transitive
215 | description:
216 | name: material_color_utilities
217 | url: "https://pub.dartlang.org"
218 | source: hosted
219 | version: "0.1.3"
220 | meta:
221 | dependency: transitive
222 | description:
223 | name: meta
224 | url: "https://pub.dartlang.org"
225 | source: hosted
226 | version: "1.7.0"
227 | path:
228 | dependency: transitive
229 | description:
230 | name: path
231 | url: "https://pub.dartlang.org"
232 | source: hosted
233 | version: "1.8.0"
234 | path_drawing:
235 | dependency: transitive
236 | description:
237 | name: path_drawing
238 | url: "https://pub.dartlang.org"
239 | source: hosted
240 | version: "1.0.0"
241 | path_parsing:
242 | dependency: transitive
243 | description:
244 | name: path_parsing
245 | url: "https://pub.dartlang.org"
246 | source: hosted
247 | version: "1.0.0"
248 | path_provider:
249 | dependency: transitive
250 | description:
251 | name: path_provider
252 | url: "https://pub.dartlang.org"
253 | source: hosted
254 | version: "2.0.9"
255 | path_provider_android:
256 | dependency: transitive
257 | description:
258 | name: path_provider_android
259 | url: "https://pub.dartlang.org"
260 | source: hosted
261 | version: "2.0.12"
262 | path_provider_ios:
263 | dependency: transitive
264 | description:
265 | name: path_provider_ios
266 | url: "https://pub.dartlang.org"
267 | source: hosted
268 | version: "2.0.8"
269 | path_provider_linux:
270 | dependency: transitive
271 | description:
272 | name: path_provider_linux
273 | url: "https://pub.dartlang.org"
274 | source: hosted
275 | version: "2.1.5"
276 | path_provider_macos:
277 | dependency: transitive
278 | description:
279 | name: path_provider_macos
280 | url: "https://pub.dartlang.org"
281 | source: hosted
282 | version: "2.0.5"
283 | path_provider_platform_interface:
284 | dependency: transitive
285 | description:
286 | name: path_provider_platform_interface
287 | url: "https://pub.dartlang.org"
288 | source: hosted
289 | version: "2.0.3"
290 | path_provider_windows:
291 | dependency: transitive
292 | description:
293 | name: path_provider_windows
294 | url: "https://pub.dartlang.org"
295 | source: hosted
296 | version: "2.0.5"
297 | petitparser:
298 | dependency: transitive
299 | description:
300 | name: petitparser
301 | url: "https://pub.dartlang.org"
302 | source: hosted
303 | version: "4.4.0"
304 | platform:
305 | dependency: transitive
306 | description:
307 | name: platform
308 | url: "https://pub.dartlang.org"
309 | source: hosted
310 | version: "3.1.0"
311 | plugin_platform_interface:
312 | dependency: transitive
313 | description:
314 | name: plugin_platform_interface
315 | url: "https://pub.dartlang.org"
316 | source: hosted
317 | version: "2.1.2"
318 | process:
319 | dependency: transitive
320 | description:
321 | name: process
322 | url: "https://pub.dartlang.org"
323 | source: hosted
324 | version: "4.2.4"
325 | shared_preferences:
326 | dependency: transitive
327 | description:
328 | name: shared_preferences
329 | url: "https://pub.dartlang.org"
330 | source: hosted
331 | version: "2.0.13"
332 | shared_preferences_android:
333 | dependency: transitive
334 | description:
335 | name: shared_preferences_android
336 | url: "https://pub.dartlang.org"
337 | source: hosted
338 | version: "2.0.11"
339 | shared_preferences_ios:
340 | dependency: transitive
341 | description:
342 | name: shared_preferences_ios
343 | url: "https://pub.dartlang.org"
344 | source: hosted
345 | version: "2.1.0"
346 | shared_preferences_linux:
347 | dependency: transitive
348 | description:
349 | name: shared_preferences_linux
350 | url: "https://pub.dartlang.org"
351 | source: hosted
352 | version: "2.1.0"
353 | shared_preferences_macos:
354 | dependency: transitive
355 | description:
356 | name: shared_preferences_macos
357 | url: "https://pub.dartlang.org"
358 | source: hosted
359 | version: "2.0.3"
360 | shared_preferences_platform_interface:
361 | dependency: transitive
362 | description:
363 | name: shared_preferences_platform_interface
364 | url: "https://pub.dartlang.org"
365 | source: hosted
366 | version: "2.0.0"
367 | shared_preferences_web:
368 | dependency: transitive
369 | description:
370 | name: shared_preferences_web
371 | url: "https://pub.dartlang.org"
372 | source: hosted
373 | version: "2.0.3"
374 | shared_preferences_windows:
375 | dependency: transitive
376 | description:
377 | name: shared_preferences_windows
378 | url: "https://pub.dartlang.org"
379 | source: hosted
380 | version: "2.1.0"
381 | sky_engine:
382 | dependency: transitive
383 | description: flutter
384 | source: sdk
385 | version: "0.0.99"
386 | source_span:
387 | dependency: transitive
388 | description:
389 | name: source_span
390 | url: "https://pub.dartlang.org"
391 | source: hosted
392 | version: "1.8.1"
393 | stack_trace:
394 | dependency: transitive
395 | description:
396 | name: stack_trace
397 | url: "https://pub.dartlang.org"
398 | source: hosted
399 | version: "1.10.0"
400 | stream_channel:
401 | dependency: transitive
402 | description:
403 | name: stream_channel
404 | url: "https://pub.dartlang.org"
405 | source: hosted
406 | version: "2.1.0"
407 | string_scanner:
408 | dependency: transitive
409 | description:
410 | name: string_scanner
411 | url: "https://pub.dartlang.org"
412 | source: hosted
413 | version: "1.1.0"
414 | term_glyph:
415 | dependency: transitive
416 | description:
417 | name: term_glyph
418 | url: "https://pub.dartlang.org"
419 | source: hosted
420 | version: "1.2.0"
421 | test_api:
422 | dependency: transitive
423 | description:
424 | name: test_api
425 | url: "https://pub.dartlang.org"
426 | source: hosted
427 | version: "0.4.8"
428 | typed_data:
429 | dependency: transitive
430 | description:
431 | name: typed_data
432 | url: "https://pub.dartlang.org"
433 | source: hosted
434 | version: "1.3.0"
435 | universal_io:
436 | dependency: transitive
437 | description:
438 | name: universal_io
439 | url: "https://pub.dartlang.org"
440 | source: hosted
441 | version: "2.0.4"
442 | vector_math:
443 | dependency: transitive
444 | description:
445 | name: vector_math
446 | url: "https://pub.dartlang.org"
447 | source: hosted
448 | version: "2.1.1"
449 | win32:
450 | dependency: transitive
451 | description:
452 | name: win32
453 | url: "https://pub.dartlang.org"
454 | source: hosted
455 | version: "2.4.2"
456 | xdg_directories:
457 | dependency: transitive
458 | description:
459 | name: xdg_directories
460 | url: "https://pub.dartlang.org"
461 | source: hosted
462 | version: "0.2.0+1"
463 | xml:
464 | dependency: transitive
465 | description:
466 | name: xml
467 | url: "https://pub.dartlang.org"
468 | source: hosted
469 | version: "5.3.1"
470 | yaml:
471 | dependency: transitive
472 | description:
473 | name: yaml
474 | url: "https://pub.dartlang.org"
475 | source: hosted
476 | version: "3.1.0"
477 | sdks:
478 | dart: ">=2.16.1 <3.0.0"
479 | flutter: ">=2.8.0"
480 |
--------------------------------------------------------------------------------
/lib/presentation/screens/home_navigation/home_navigation.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:flutter_svg/flutter_svg.dart';
5 | import 'package:food_hub/controllers/authen_controller.dart';
6 | import 'package:food_hub/routes/links.dart';
7 | import 'package:get/get.dart';
8 |
9 | import 'package:food_hub/constants/colors.dart';
10 | import 'package:food_hub/constants/radius.dart';
11 | import 'package:food_hub/constants/shadow.dart';
12 | import 'package:food_hub/constants/spacing.dart';
13 | import 'package:food_hub/controllers/home_navigation_controller.dart';
14 | import 'package:food_hub/models/home_navigation_model.dart';
15 | import 'package:food_hub/presentation/widgets/material.dart';
16 |
17 | class HomeNavigationPage extends GetView {
18 | HomeNavigationPage({Key? key}) : super(key: key);
19 |
20 | final AuthenController _authenController = Get.find();
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Obx(() {
25 | return Scaffold(
26 | key: controller.key,
27 | appBar: _buildAppBar(),
28 | drawer: _buildDrawer(),
29 | bottomNavigationBar: BottomTabBar(
30 | pages: controller.pages,
31 | onItemTapped: controller.onItemTapped,
32 | selectedIndex: controller.selectedIndex,
33 | ),
34 | backgroundColor: AppColors.white100,
35 | body: controller.pages[controller.selectedIndex].page,
36 | );
37 | });
38 | }
39 |
40 | Widget _buildDrawer() {
41 | return Drawer(
42 | child: SafeArea(
43 | child: Container(
44 | height: double.infinity,
45 | padding: EdgeInsets.symmetric(
46 | horizontal: AppSpacing.space24,
47 | vertical: AppSpacing.space32,
48 | ),
49 | child: Column(
50 | crossAxisAlignment: CrossAxisAlignment.start,
51 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
52 | children: [
53 | Padding(
54 | padding: EdgeInsets.only(left: AppSpacing.space4),
55 | child: Column(
56 | crossAxisAlignment: CrossAxisAlignment.start,
57 | children: [
58 | Container(
59 | clipBehavior: Clip.antiAlias,
60 | decoration: BoxDecoration(
61 | borderRadius: circularRadius(90.w / 2),
62 | boxShadow: AppShadow.button,
63 | color: AppColors.white100,
64 | ),
65 | child: Image.asset(
66 | "assets/images/user_avatar.png",
67 | width: 90.w,
68 | height: 90.w,
69 | fit: BoxFit.cover,
70 | ),
71 | ),
72 | SizedBox(
73 | height: 20.h,
74 | ),
75 | Text(
76 | "Farion Wick",
77 | style: TextStyle(
78 | fontSize: 20.sp,
79 | fontWeight: FontWeight.w700,
80 | color: AppColors.dark80,
81 | ),
82 | ),
83 | SizedBox(
84 | height: 8.h,
85 | ),
86 | Text(
87 | "farionwick@gmail.com",
88 | style: TextStyle(
89 | fontSize: 14.sp,
90 | fontWeight: FontWeight.w300,
91 | color: AppColors.gray100,
92 | ),
93 | ),
94 | SizedBox(height: 4.h),
95 | ],
96 | ),
97 | ),
98 | Expanded(
99 | child: SingleChildScrollView(
100 | child: Column(
101 | children: [
102 | SizedBox(height: 40.h),
103 | const DrawerItem(
104 | icon: "assets/icons/my_order.svg",
105 | label: "My Orders",
106 | ),
107 | const DrawerItem(
108 | icon: "assets/icons/person.svg",
109 | label: "My Profile",
110 | ),
111 | const DrawerItem(
112 | icon: "assets/icons/location.svg",
113 | label: "Delivery Address",
114 | ),
115 | const DrawerItem(
116 | icon: "assets/icons/wallet.svg",
117 | label: "Payment Methods",
118 | ),
119 | const DrawerItem(
120 | icon: "assets/icons/mail.svg",
121 | label: "Contact Us",
122 | ),
123 | const DrawerItem(
124 | icon: "assets/icons/setting.svg",
125 | label: "Settings",
126 | ),
127 | const DrawerItem(
128 | icon: "assets/icons/faq.svg",
129 | label: "Helps & FAQs",
130 | ),
131 | ],
132 | ),
133 | ),
134 | ),
135 | SizedBox(height: 4.h),
136 | GestureDetector(
137 | onTap: _authenController.logOut,
138 | child: Container(
139 | margin: EdgeInsets.only(top: AppSpacing.space4),
140 | padding: EdgeInsets.fromLTRB(
141 | AppSpacing.space12,
142 | AppSpacing.space12,
143 | AppSpacing.space16,
144 | AppSpacing.space12,
145 | ),
146 | decoration: BoxDecoration(
147 | borderRadius: circularRadius(AppRadius.border32),
148 | boxShadow: AppShadow.buttonWhite,
149 | color: AppColors.orange100,
150 | ),
151 | child: Row(
152 | mainAxisSize: MainAxisSize.min,
153 | children: [
154 | SvgPicture.asset(
155 | "assets/icons/power.svg",
156 | width: 26.w,
157 | height: 26.w,
158 | ),
159 | SizedBox(width: 12.w),
160 | Text(
161 | tr("log_out"),
162 | style: TextStyle(
163 | fontSize: 16.sp,
164 | fontWeight: FontWeight.w300,
165 | color: AppColors.white100,
166 | ),
167 | ),
168 | ],
169 | ),
170 | ),
171 | ),
172 | ],
173 | ),
174 | ),
175 | ),
176 | );
177 | }
178 |
179 | PreferredSizeWidget _buildAppBar() {
180 | return PreferredSize(
181 | preferredSize: Size.fromHeight(50.h), // Set this height
182 | child: SafeArea(
183 | child: Container(
184 | height: double.infinity,
185 | color: Colors.transparent,
186 | padding: EdgeInsets.only(bottom: 8.h),
187 | child: Row(
188 | children: [
189 | GestureDetector(
190 | onTap: () => controller.key.currentState?.openDrawer(),
191 | child: Padding(
192 | padding: EdgeInsets.symmetric(
193 | horizontal: AppSpacing.space28,
194 | ),
195 | child: Container(
196 | width: 38.w,
197 | height: 38.w,
198 | alignment: Alignment.center,
199 | child: SvgPicture.asset(
200 | "assets/icons/drawer_menu.svg",
201 | width: 12.w,
202 | height: 6.w,
203 | ),
204 | decoration: BoxDecoration(
205 | boxShadow: AppShadow.buttonWhite,
206 | color: AppColors.white100,
207 | borderRadius: circularRadius(AppRadius.border12),
208 | ),
209 | ),
210 | ),
211 | ),
212 | Expanded(
213 | flex: 1,
214 | child: Column(
215 | mainAxisAlignment: MainAxisAlignment.center,
216 | crossAxisAlignment: CrossAxisAlignment.center,
217 | children: [
218 | Row(
219 | mainAxisAlignment: MainAxisAlignment.center,
220 | children: [
221 | Text(
222 | tr("deliver_to"),
223 | style: TextStyle(
224 | color: AppColors.gray100,
225 | fontSize: 14.sp,
226 | fontWeight: FontWeight.w500,
227 | ),
228 | ),
229 | SizedBox(
230 | width: 5.w,
231 | ),
232 | SvgPicture.asset("assets/icons/arrow_down.svg"),
233 | ],
234 | ),
235 | Text(
236 | "4102 Pretty View Lane",
237 | style: TextStyle(
238 | fontSize: 15.sp,
239 | fontWeight: FontWeight.w500,
240 | color: AppColors.orange100,
241 | ),
242 | )
243 | ],
244 | ),
245 | ),
246 | Padding(
247 | padding: EdgeInsets.symmetric(
248 | horizontal: AppSpacing.space28,
249 | ),
250 | child: ClipRRect(
251 | borderRadius: BorderRadius.all(
252 | Radius.circular(AppRadius.border12),
253 | ),
254 | child: Image.asset(
255 | "assets/images/user_avatar.png",
256 | width: 38.w,
257 | height: 38.w,
258 | fit: BoxFit.cover,
259 | ),
260 | ),
261 | ),
262 | ],
263 | ),
264 | ),
265 | ),
266 | );
267 | }
268 | }
269 |
270 | class BottomTabBar extends GetView {
271 | final List pages;
272 | final int selectedIndex;
273 | final Function(int index) onItemTapped;
274 |
275 | const BottomTabBar({
276 | Key? key,
277 | required this.pages,
278 | required this.selectedIndex,
279 | required this.onItemTapped,
280 | }) : super(key: key);
281 |
282 | @override
283 | Widget build(BuildContext context) {
284 | return Container(
285 | padding: EdgeInsets.only(top: AppSpacing.space12),
286 | decoration: const BoxDecoration(
287 | boxShadow: AppShadow.bottomTab,
288 | color: AppColors.white100,
289 | ),
290 | // padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
291 | child: BottomNavigationBar(
292 | currentIndex: selectedIndex, //New
293 | onTap: onItemTapped,
294 | showSelectedLabels: false,
295 | showUnselectedLabels: false,
296 | backgroundColor: Colors.transparent,
297 | elevation: 0,
298 | type: BottomNavigationBarType.fixed,
299 | items: pages
300 | .asMap()
301 | .entries
302 | .map(
303 | (entries) => BottomNavigationBarItem(
304 | icon: TabBarIcon(
305 | entries.value.icon,
306 | active: entries.key == selectedIndex,
307 | ),
308 | label: '',
309 | ),
310 | )
311 | .toList(),
312 | ),
313 | );
314 | }
315 | }
316 |
317 | class TabBarIcon extends StatelessWidget {
318 | final String path;
319 | final bool active;
320 | final Color activeColor;
321 | final Color inactiveColor;
322 | const TabBarIcon(
323 | this.path, {
324 | Key? key,
325 | required this.active,
326 | this.activeColor = AppColors.orange100,
327 | this.inactiveColor = AppColors.gray50,
328 | }) : super(key: key);
329 |
330 | @override
331 | Widget build(BuildContext context) {
332 | return SizedBox(
333 | width: 24.w,
334 | height: 24.w,
335 | child: SvgPicture.asset(
336 | path,
337 | width: 24.w,
338 | height: 24.w,
339 | color: active ? activeColor : inactiveColor,
340 | ),
341 | );
342 | }
343 | }
344 |
345 | class DrawerItem extends StatelessWidget {
346 | final void Function()? onTap;
347 | final String icon;
348 | final String label;
349 | const DrawerItem({
350 | Key? key,
351 | this.onTap,
352 | required this.icon,
353 | required this.label,
354 | }) : super(key: key);
355 |
356 | @override
357 | Widget build(BuildContext context) {
358 | return Container(
359 | margin: EdgeInsets.only(bottom: AppSpacing.space32),
360 | child: GestureDetector(
361 | onTap: onTap,
362 | child: Row(
363 | children: [
364 | SvgPicture.asset(
365 | icon,
366 | width: 20.w,
367 | height: 20.w,
368 | ),
369 | SizedBox(width: 12.w),
370 | Text(
371 | label,
372 | style: TextStyle(
373 | fontSize: 16.sp,
374 | fontWeight: FontWeight.w300,
375 | color: AppColors.dark80,
376 | ),
377 | ),
378 | ],
379 | ),
380 | ),
381 | );
382 | }
383 | }
384 |
--------------------------------------------------------------------------------