├── linux
├── .gitignore
├── main.cc
├── flutter
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ ├── generated_plugins.cmake
│ └── CMakeLists.txt
├── my_application.h
└── my_application.cc
├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner
│ ├── Runner-Bridging-Header.h
│ ├── Assets.xcassets
│ │ ├── LaunchImage.imageset
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ ├── README.md
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-50x50@1x.png
│ │ │ ├── Icon-App-50x50@2x.png
│ │ │ ├── Icon-App-57x57@1x.png
│ │ │ ├── Icon-App-57x57@2x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-72x72@1x.png
│ │ │ ├── Icon-App-72x72@2x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
└── .gitignore
├── .gitattributes
├── assets
├── logo.png
├── ph_meal.png
├── ph_category.png
├── fonts
│ ├── Roboto-Bold.ttf
│ ├── Roboto-Light.ttf
│ ├── Roboto-Medium.ttf
│ └── Roboto-Regular.ttf
├── ph_category_slider.png
├── coffee_nostra_inside.png
├── translations
│ ├── ru-RU.json
│ ├── ru.json
│ ├── en-US.json
│ └── en.json
├── globe.svg
├── warning.svg
├── logo.svg
├── imo.svg
├── ca
│ └── lets-encrypt-r3.pem
├── instagram.svg
├── table.svg
├── success.json
├── logo_name.svg
└── table_logo.svg
├── macos
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Runner
│ ├── Configs
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ ├── Warnings.xcconfig
│ │ └── AppInfo.xcconfig
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_64.png
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_512.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Release.entitlements
│ ├── DebugProfile.entitlements
│ ├── MainFlutterWindow.swift
│ ├── Info.plist
│ └── GoogleService-Info.plist
├── .gitignore
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── firebase_app_id_file.json
└── Runner.xcodeproj
│ ├── project.xcworkspace
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ └── xcschemes
│ └── Runner.xcscheme
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── manifest.json
└── index.html
├── screenshots
├── phone_1.jpg
├── phone_2.jpg
├── phone_3.jpg
├── phone_4.jpg
├── phone_5.jpg
├── phone_6.jpg
├── tablet_1.jpg
├── tablet_2.jpg
├── tablet_3.jpg
├── tablet_4.jpg
├── tablet_5.jpg
└── tablet_6.jpg
├── android
├── gradle.properties
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable-v21
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── values-night
│ │ │ │ │ └── styles.xml
│ │ │ ├── kotlin
│ │ │ │ └── tm
│ │ │ │ │ └── com
│ │ │ │ │ └── yummify
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
└── build.gradle
├── lib
├── services
│ ├── services.dart
│ ├── api_root_service.dart
│ └── api_service.dart
├── ui
│ ├── cart
│ │ ├── cart.dart
│ │ ├── success_view.dart
│ │ └── cart_view_model.dart
│ ├── home
│ │ ├── meal
│ │ │ ├── meal_view.dart
│ │ │ └── meal_view_model.dart
│ │ ├── category
│ │ │ ├── category_view_model.dart
│ │ │ └── category_view.dart
│ │ └── home_view_model.dart
│ ├── badge
│ │ ├── badge_view_model.dart
│ │ └── badge_view.dart
│ ├── startup_animated_text_hook.dart
│ ├── tables
│ │ ├── tables_view_model.dart
│ │ └── tables_view.dart
│ ├── startup_view.dart
│ └── startup_viewmodel.dart
├── shared
│ ├── shared.dart
│ ├── app_colors.dart
│ ├── http_override.dart
│ ├── constants.dart
│ ├── utils.dart
│ └── styles.dart
├── widgets
│ ├── my_scroll_behavior.dart
│ ├── widgets.dart
│ ├── loading_widget.dart
│ ├── custom_modal_bottom_sheet.dart
│ ├── custom_text_child_button.dart
│ └── yummify_image.dart
├── models
│ ├── models.dart
│ ├── hive_models
│ │ ├── hive_table.dart
│ │ ├── hive_meal.dart
│ │ ├── hive_table.g.dart
│ │ └── hive_meal.g.dart
│ ├── cart_meal_dialog_data.dart
│ ├── table_model.dart
│ ├── create_order_item.dart
│ ├── create_order.dart
│ ├── table_model.g.dart
│ ├── meal_model.dart
│ ├── create_order_item.g.dart
│ ├── category_model.dart
│ ├── meal_model.g.dart
│ ├── create_order.g.dart
│ └── category_model.g.dart
├── generated
│ └── locale_keys.g.dart
├── app
│ ├── app.dart
│ └── app.locator.dart
├── main.dart
└── yummify_app.dart
├── windows
├── runner
│ ├── resources
│ │ └── app_icon.ico
│ ├── resource.h
│ ├── utils.h
│ ├── runner.exe.manifest
│ ├── flutter_window.h
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── utils.cpp
│ ├── flutter_window.cpp
│ ├── Runner.rc
│ └── win32_window.h
├── .gitignore
├── flutter
│ ├── generated_plugin_registrant.h
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugins.cmake
│ └── CMakeLists.txt
└── CMakeLists.txt
├── .gitignore
├── LICENSE
├── test
└── widget_test.dart
├── analysis_options.yaml
└── .metadata
/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/logo.png
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/web/favicon.png
--------------------------------------------------------------------------------
/assets/ph_meal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/ph_meal.png
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/assets/ph_category.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/ph_category.png
--------------------------------------------------------------------------------
/screenshots/phone_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/phone_1.jpg
--------------------------------------------------------------------------------
/screenshots/phone_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/phone_2.jpg
--------------------------------------------------------------------------------
/screenshots/phone_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/phone_3.jpg
--------------------------------------------------------------------------------
/screenshots/phone_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/phone_4.jpg
--------------------------------------------------------------------------------
/screenshots/phone_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/phone_5.jpg
--------------------------------------------------------------------------------
/screenshots/phone_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/phone_6.jpg
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/screenshots/tablet_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/tablet_1.jpg
--------------------------------------------------------------------------------
/screenshots/tablet_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/tablet_2.jpg
--------------------------------------------------------------------------------
/screenshots/tablet_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/tablet_3.jpg
--------------------------------------------------------------------------------
/screenshots/tablet_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/tablet_4.jpg
--------------------------------------------------------------------------------
/screenshots/tablet_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/tablet_5.jpg
--------------------------------------------------------------------------------
/screenshots/tablet_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/screenshots/tablet_6.jpg
--------------------------------------------------------------------------------
/assets/fonts/Roboto-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/fonts/Roboto-Bold.ttf
--------------------------------------------------------------------------------
/assets/fonts/Roboto-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/fonts/Roboto-Light.ttf
--------------------------------------------------------------------------------
/assets/fonts/Roboto-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/fonts/Roboto-Medium.ttf
--------------------------------------------------------------------------------
/assets/ph_category_slider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/ph_category_slider.png
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/assets/coffee_nostra_inside.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/coffee_nostra_inside.png
--------------------------------------------------------------------------------
/assets/fonts/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/assets/fonts/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/lib/services/services.dart:
--------------------------------------------------------------------------------
1 | export 'api_root_service.dart';
2 | export 'api_service.dart';
3 | export 'hv_db_service.dart';
4 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/lib/ui/cart/cart.dart:
--------------------------------------------------------------------------------
1 | export 'cart_view.dart';
2 | export 'cart_view_model.dart';
3 | export 'cart_meal_widget.dart';
4 | export 'success_view.dart';
5 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/lib/shared/shared.dart:
--------------------------------------------------------------------------------
1 | export 'app_colors.dart';
2 | export 'styles.dart';
3 | export 'constants.dart';
4 | export 'http_override.dart';
5 | export 'utils.dart';
6 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/tm/com/yummify/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package tm.com.yummify
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ruslanbek0809/Yummify/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/Ruslanbek0809/Yummify/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/linux/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 fl_register_plugins(FlPluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/lib/widgets/my_scroll_behavior.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class MyBehavior extends ScrollBehavior {
4 | @override
5 | Widget buildViewportChrome(
6 | BuildContext context, Widget child, AxisDirection axisDirection) {
7 | return child;
8 | }
9 | }
--------------------------------------------------------------------------------
/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
7 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/models/models.dart:
--------------------------------------------------------------------------------
1 | export 'table_model.dart';
2 | export 'hive_models/hive_meal.dart';
3 | export 'hive_models/hive_table.dart';
4 | export 'category_model.dart';
5 | export 'meal_model.dart';
6 | export 'cart_meal_dialog_data.dart';
7 | export 'create_order.dart';
8 | export 'create_order_item.dart';
9 |
--------------------------------------------------------------------------------
/lib/widgets/widgets.dart:
--------------------------------------------------------------------------------
1 | // export 'custom_bar_bottom_sheet.dart';
2 | // export 'custom_text_child_button.dart';
3 | export 'loading_widget.dart';
4 | export 'my_scroll_behavior.dart';
5 | export 'yummify_image.dart';
6 | export 'custom_text_child_button.dart';
7 | export 'custom_modal_bottom_sheet.dart';
8 |
--------------------------------------------------------------------------------
/macos/firebase_app_id_file.json:
--------------------------------------------------------------------------------
1 | {
2 | "file_generated_by": "FlutterFire CLI",
3 | "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
4 | "GOOGLE_APP_ID": "1:897078125338:ios:ea58b47c3367b365c042a3",
5 | "FIREBASE_PROJECT_ID": "yummify",
6 | "GCM_SENDER_ID": "897078125338"
7 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/models/hive_models/hive_table.dart:
--------------------------------------------------------------------------------
1 | import 'package:hive/hive.dart';
2 |
3 | part 'hive_table.g.dart';
4 |
5 | @HiveType(typeId: 1)
6 | class HiveTable {
7 | HiveTable({
8 | this.id,
9 | this.name,
10 | });
11 |
12 | @HiveField(0)
13 | final int? id;
14 |
15 | @HiveField(1)
16 | final String? name;
17 | }
18 |
--------------------------------------------------------------------------------
/lib/shared/app_colors.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color kcBackgroundColor = Color(0xFF000000);
4 | const Color kcWhiteColor = Color(0xFFFFFFFF);
5 | const Color kcSecondaryLightColor = Color(0xFFE4E4E4);
6 | const Color kcSecondaryDarkColor = Color(0xFF303030);
7 | const Color kcFontColor = Color(0xFFE3C086);
8 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/models/cart_meal_dialog_data.dart:
--------------------------------------------------------------------------------
1 | import '../ui/cart/cart_view_model.dart';
2 | import 'hive_models/hive_meal.dart';
3 |
4 | class CartMealDialogData {
5 | CartMealDialogData({
6 | required this.cartViewModel,
7 | required this.cartMeal,
8 | });
9 | final CartViewModel cartViewModel;
10 | final HiveMeal cartMeal;
11 | }
12 |
--------------------------------------------------------------------------------
/lib/shared/http_override.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | class MyHttpOverrides extends HttpOverrides {
4 | @override
5 | HttpClient createHttpClient(SecurityContext? context) {
6 | return super.createHttpClient(context)
7 | ..badCertificateCallback =
8 | (X509Certificate cert, String host, int port) => true;
9 | }
10 | }
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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/linux/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 fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/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 | #include
10 |
11 | void RegisterPlugins(flutter::PluginRegistry* registry) {
12 | ConnectivityPlusWindowsPluginRegisterWithRegistrar(
13 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
14 | }
15 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController.init()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/lib/models/table_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:json_annotation/json_annotation.dart';
2 |
3 | part 'table_model.g.dart';
4 |
5 | @JsonSerializable()
6 | class TableModel {
7 | TableModel({
8 | this.id,
9 | this.name,
10 | });
11 |
12 | @JsonKey(name: 'id')
13 | final int? id;
14 |
15 | @JsonKey(name: 'name')
16 | final String? name;
17 |
18 | factory TableModel.fromJson(Map json) =>
19 | _$TableModelFromJson(json);
20 |
21 | Map toJson() => _$TableModelToJson(this);
22 | }
23 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/assets/translations/ru-RU.json:
--------------------------------------------------------------------------------
1 | {
2 | "lang_en": "English",
3 | "lang_ru": "Русский",
4 | "tables": "Столы",
5 | "orders": "Заказы",
6 | "orderNow": "Заказать",
7 | "total": "Всего: ",
8 | "wannaClearCart": "Очистить корзину?",
9 | "letsClearCart": "Очистить",
10 | "no": "Отмена",
11 | "wannaRemoveMeal": "Хотите убрать?",
12 | "remove": "Убрать",
13 | "add": "Добавить",
14 | "errorOccured": "Ошибка подключения",
15 | "orderSuccess": "Ваш заказ успешно принят!",
16 | "homeScreen": "Главная страница"
17 | }
--------------------------------------------------------------------------------
/assets/translations/ru.json:
--------------------------------------------------------------------------------
1 | {
2 | "lang_en": "English",
3 | "lang_ru": "Русский",
4 | "tables": "Столы",
5 | "orders": "Заказы",
6 | "orderNow": "Заказать",
7 | "total": "Всего: ",
8 | "wannaClearCart": "Очистить корзину?",
9 | "letsClearCart": "Очистить",
10 | "no": "Отмена",
11 | "wannaRemoveMeal": "Хотите убрать?",
12 | "remove": "Убрать",
13 | "add": "Добавить",
14 | "errorOccured": "Ошибка подключения",
15 | "orderSuccess": "Ваш заказ успешно принят!",
16 | "homeScreen": "Главная страница"
17 | }
--------------------------------------------------------------------------------
/lib/models/hive_models/hive_meal.dart:
--------------------------------------------------------------------------------
1 | import 'package:hive/hive.dart';
2 | part 'hive_meal.g.dart';
3 |
4 | /// Added quantity
5 | @HiveType(typeId: 0)
6 | class HiveMeal {
7 | HiveMeal({
8 | this.id,
9 | this.name,
10 | this.image,
11 | this.price,
12 | this.quantity,
13 | });
14 |
15 | @HiveField(0)
16 | final int? id;
17 |
18 | @HiveField(1)
19 | final String? name;
20 |
21 | @HiveField(2)
22 | final String? image;
23 |
24 | @HiveField(3)
25 | final num? price;
26 |
27 | @HiveField(4)
28 | int? quantity;
29 | }
30 |
--------------------------------------------------------------------------------
/assets/translations/en-US.json:
--------------------------------------------------------------------------------
1 | {
2 | "lang_en": "English",
3 | "lang_ru": "Русский",
4 | "tables": "Tables",
5 | "orders": "Orders",
6 | "orderNow": "Order",
7 | "total": "Total: ",
8 | "wannaClearCart": "Do you want to clear cart?",
9 | "letsClearCart": "Clear",
10 | "no": "Cancel",
11 | "wannaRemoveMeal": "Do you want to remove a meal?",
12 | "remove": "Remove",
13 | "add": "Add",
14 | "errorOccured": "Error occured",
15 | "orderSuccess": "Your order has been proceeded successfully!",
16 | "homeScreen": "Home"
17 | }
--------------------------------------------------------------------------------
/assets/translations/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "lang_en": "English",
3 | "lang_ru": "Русский",
4 | "tables": "Tables",
5 | "orders": "Orders",
6 | "orderNow": "Order",
7 | "total": "Total: ",
8 | "wannaClearCart": "Do you want to clear cart?",
9 | "letsClearCart": "Clear",
10 | "no": "Cancel",
11 | "wannaRemoveMeal": "Do you want to remove a meal?",
12 | "remove": "Remove",
13 | "add": "Add",
14 | "errorOccured": "Error occured",
15 | "orderSuccess": "Your order has been proceeded successfully!",
16 | "homeScreen": "Home"
17 | }
--------------------------------------------------------------------------------
/lib/models/create_order_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:json_annotation/json_annotation.dart';
2 |
3 | part 'create_order_item.g.dart';
4 |
5 | @JsonSerializable(explicitToJson: true)
6 | class CreateOrderItem {
7 | CreateOrderItem({
8 | this.mealId,
9 | this.quantity,
10 | });
11 |
12 | @JsonKey(name: 'meal_id')
13 | final int? mealId;
14 |
15 | @JsonKey(name: 'quantity')
16 | final int? quantity;
17 |
18 | factory CreateOrderItem.fromJson(Map json) =>
19 | _$CreateOrderItemFromJson(json);
20 |
21 | Map toJson() => _$CreateOrderItemToJson(this);
22 | }
23 |
--------------------------------------------------------------------------------
/lib/widgets/loading_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:flutter_spinkit/flutter_spinkit.dart';
4 | import '../../shared/shared.dart';
5 |
6 | class LoadingWidget extends StatelessWidget {
7 | final double? width;
8 | const LoadingWidget({Key? key, this.width}) : super(key: key);
9 | @override
10 | Widget build(BuildContext context) {
11 | return SpinKitSpinningLines(
12 | size: width ?? 0.15.sw,
13 | lineWidth: 4.0,
14 | itemCount: 5,
15 | color: kcFontColor,
16 | );
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/models/create_order.dart:
--------------------------------------------------------------------------------
1 | import 'package:json_annotation/json_annotation.dart';
2 |
3 | import 'create_order_item.dart';
4 |
5 | part 'create_order.g.dart';
6 |
7 | @JsonSerializable(explicitToJson: true)
8 | class CreateOrder {
9 | CreateOrder({
10 | this.tableId,
11 | this.orderMeals,
12 | });
13 |
14 | @JsonKey(name: 'stol_id')
15 | final int? tableId;
16 |
17 | @JsonKey(name: 'meals')
18 | final List? orderMeals;
19 |
20 | factory CreateOrder.fromJson(Map json) =>
21 | _$CreateOrderFromJson(json);
22 |
23 | Map toJson() => _$CreateOrderToJson(this);
24 | }
25 |
--------------------------------------------------------------------------------
/lib/models/table_model.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'table_model.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | TableModel _$TableModelFromJson(Map json) => TableModel(
10 | id: json['id'] as int?,
11 | name: json['name'] as String?,
12 | );
13 |
14 | Map _$TableModelToJson(TableModel instance) =>
15 | {
16 | 'id': instance.id,
17 | 'name': instance.name,
18 | };
19 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = yummify
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = tm.com.yummify
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2022 tm.com. All rights reserved.
15 |
--------------------------------------------------------------------------------
/lib/models/meal_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:json_annotation/json_annotation.dart';
2 | part 'meal_model.g.dart';
3 |
4 | @JsonSerializable()
5 | class MealModel {
6 | MealModel({
7 | this.id,
8 | this.name,
9 | this.image,
10 | this.price,
11 | });
12 |
13 | @JsonKey(name: 'id')
14 | final int? id;
15 |
16 | @JsonKey(name: 'name')
17 | final String? name;
18 |
19 | @JsonKey(name: 'photo')
20 | final String? image;
21 |
22 | @JsonKey(name: 'price')
23 | final num? price;
24 |
25 | factory MealModel.fromJson(Map json) =>
26 | _$MealModelFromJson(json);
27 |
28 | Map toJson() => _$MealModelToJson(this);
29 | }
30 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import connectivity_plus
9 | import path_provider_macos
10 | import shared_preferences_macos
11 | import sqflite
12 |
13 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
14 | ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
15 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
16 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
17 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
18 | }
19 |
--------------------------------------------------------------------------------
/lib/models/create_order_item.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'create_order_item.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | CreateOrderItem _$CreateOrderItemFromJson(Map json) =>
10 | CreateOrderItem(
11 | mealId: json['meal_id'] as int?,
12 | quantity: json['quantity'] as int?,
13 | );
14 |
15 | Map _$CreateOrderItemToJson(CreateOrderItem instance) =>
16 | {
17 | 'meal_id': instance.mealId,
18 | 'quantity': instance.quantity,
19 | };
20 |
--------------------------------------------------------------------------------
/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:7.1.2'
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 |
--------------------------------------------------------------------------------
/lib/models/category_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:json_annotation/json_annotation.dart';
2 | part 'category_model.g.dart';
3 |
4 | @JsonSerializable()
5 | class CategoryModel {
6 | CategoryModel({
7 | this.id,
8 | this.name,
9 | this.image,
10 | this.categoryImage,
11 | });
12 |
13 | @JsonKey(name: 'id')
14 | final int? id;
15 |
16 | @JsonKey(name: 'name')
17 | final String? name;
18 |
19 | @JsonKey(name: 'photo')
20 | final String? image;
21 |
22 | @JsonKey(name: 'category_slider')
23 | final String? categoryImage;
24 |
25 | factory CategoryModel.fromJson(Map json) =>
26 | _$CategoryModelFromJson(json);
27 |
28 | Map toJson() => _$CategoryModelToJson(this);
29 | }
30 |
--------------------------------------------------------------------------------
/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/models/meal_model.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'meal_model.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | MealModel _$MealModelFromJson(Map json) => MealModel(
10 | id: json['id'] as int?,
11 | name: json['name'] as String?,
12 | image: json['photo'] as String?,
13 | price: json['price'] as num?,
14 | );
15 |
16 | Map _$MealModelToJson(MealModel instance) => {
17 | 'id': instance.id,
18 | 'name': instance.name,
19 | 'photo': instance.image,
20 | 'price': instance.price,
21 | };
22 |
--------------------------------------------------------------------------------
/lib/generated/locale_keys.g.dart:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
2 |
3 | abstract class LocaleKeys {
4 | static const lang_en = 'lang_en';
5 | static const lang_ru = 'lang_ru';
6 | static const tables = 'tables';
7 | static const orders = 'orders';
8 | static const orderNow = 'orderNow';
9 | static const total = 'total';
10 | static const wannaClearCart = 'wannaClearCart';
11 | static const letsClearCart = 'letsClearCart';
12 | static const no = 'no';
13 | static const wannaRemoveMeal = 'wannaRemoveMeal';
14 | static const remove = 'remove';
15 | static const add = 'add';
16 | static const errorOccured = 'errorOccured';
17 | static const orderSuccess = 'orderSuccess';
18 | static const homeScreen = 'homeScreen';
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/lib/ui/home/meal/meal_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import '../../../models/models.dart';
3 | import 'meal_hook.dart';
4 | import 'meal_view_model.dart';
5 | import 'package:stacked/stacked.dart';
6 |
7 | /// The reason to use this StatelessWidget instead of directly using MealHook structure is to create MealViewModel first using ViewModelBuilder
8 | class MealView extends StatelessWidget {
9 | final MealModel meal;
10 | const MealView({
11 | Key? key,
12 | required this.meal,
13 | }) : super(key: key);
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return ViewModelBuilder.reactive(
18 | builder: (context, model, child) => MealHook(meal: meal),
19 | viewModelBuilder: () => MealViewModel(meal),
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/models/create_order.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'create_order.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | CreateOrder _$CreateOrderFromJson(Map json) => CreateOrder(
10 | tableId: json['stol_id'] as int?,
11 | orderMeals: (json['meals'] as List?)
12 | ?.map((e) => CreateOrderItem.fromJson(e as Map))
13 | .toList(),
14 | );
15 |
16 | Map _$CreateOrderToJson(CreateOrder instance) =>
17 | {
18 | 'stol_id': instance.tableId,
19 | 'meals': instance.orderMeals?.map((e) => e.toJson()).toList(),
20 | };
21 |
--------------------------------------------------------------------------------
/assets/globe.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/lib/models/category_model.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'category_model.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | CategoryModel _$CategoryModelFromJson(Map json) =>
10 | CategoryModel(
11 | id: json['id'] as int?,
12 | name: json['name'] as String?,
13 | image: json['photo'] as String?,
14 | categoryImage: json['category_slider'] as String?,
15 | );
16 |
17 | Map _$CategoryModelToJson(CategoryModel instance) =>
18 | {
19 | 'id': instance.id,
20 | 'name': instance.name,
21 | 'photo': instance.image,
22 | 'category_slider': instance.categoryImage,
23 | };
24 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | connectivity_plus
7 | )
8 |
9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/ui/badge/badge_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:stacked/stacked.dart';
2 | import 'package:stacked_services/stacked_services.dart';
3 | import '../../app/app.locator.dart';
4 | import '../../app/app.logger.dart';
5 | import '../../app/app.router.dart';
6 | import '../../models/hive_models/hive_meal.dart';
7 | import '../../services/services.dart';
8 |
9 | class BadgeViewModel extends ReactiveViewModel {
10 | final log = getLogger('BadgeViewModel');
11 |
12 | final _navService = locator();
13 | final _hiveDbService = locator();
14 |
15 | List get cartMeals => _hiveDbService.cartMeals;
16 |
17 | //------------------------ NAVIGATIONS ----------------------------//
18 |
19 | Future navToCartView() async =>
20 | await _navService.navigateTo(Routes.cartView);
21 |
22 | @override
23 | List get reactiveServices => [_hiveDbService];
24 | }
25 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Web related
36 | lib/generated_plugin_registrant.dart
37 |
38 | # Symbolication related
39 | app.*.symbols
40 |
41 | # Obfuscation related
42 | app.*.map.json
43 |
44 | # Android Studio will place build artifacts here
45 | /android/app/debug
46 | /android/app/profile
47 | /android/app/release
48 |
--------------------------------------------------------------------------------
/lib/shared/constants.dart:
--------------------------------------------------------------------------------
1 | class Constants {
2 | static const appName = 'Yummify';
3 |
4 | static const baseUrl = 'http://185.223.93.215/api/';
5 |
6 | // Hive
7 | static const cartBox = 'cartBox';
8 | static const tableBox = 'tableBox';
9 | static const selectedHiveTable = 'selectedHiveTable';
10 |
11 | /// SharedPreferences
12 | static const accessToken = 'accessToken';
13 |
14 | /// Saved locale
15 | static const savedLocale = 'savedLocale';
16 |
17 | /// Device Types
18 | static const tablet = "tablet";
19 | static const phone = "phone";
20 |
21 | /// Border Radius Constants
22 | // ignore: constant_identifier_names
23 | static const BORDER_RADIUS_20 = 20.0;
24 | // ignore: constant_identifier_names
25 | static const BORDER_RADIUS_10 = 10.0;
26 | // ignore: constant_identifier_names
27 | static const BORDER_RADIUS_15 = 15.0;
28 | // ignore: constant_identifier_names
29 | static const BORDER_RADIUS_BUTTON_12 = 12.0;
30 | }
31 |
--------------------------------------------------------------------------------
/assets/warning.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "yummify",
3 | "short_name": "yummify",
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 |
--------------------------------------------------------------------------------
/lib/ui/home/category/category_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:stacked/stacked.dart';
2 | import '../../../app/app.locator.dart';
3 | import '../../../app/app.logger.dart';
4 | import '../../../models/models.dart';
5 | import '../../../services/api_service.dart';
6 |
7 | class CategoryViewModel extends FutureViewModel {
8 | final log = getLogger('CategoryViewModel');
9 |
10 | final CategoryModel categoryModel;
11 | CategoryViewModel(this.categoryModel);
12 |
13 | final _api = locator();
14 |
15 | List _categoryMeals = [];
16 | List get categoryMeals => _categoryMeals;
17 |
18 | /// GET METHOD 2 for FUTUREVIEWMODEL
19 | @override
20 | Future futureToRun() async => await getCatMeals();
21 |
22 | /// GETS Category meals
23 | Future getCatMeals() async {
24 | log.i('');
25 | await _api.getCategoryMeals(
26 | categoryId: categoryModel.id!,
27 | onSuccess: (result) => _categoryMeals = result,
28 | onFail: () {},
29 | );
30 |
31 | log.i('_categoryMeals.length: ${_categoryMeals.length}');
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Ruslan Hasanov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/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 in the flutter_test package. 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 | import 'package:yummify/yummify_app.dart';
11 |
12 | void main() {
13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | await tester.pumpWidget(const YummifyApp());
16 |
17 | // Verify that our counter starts at 0.
18 | expect(find.text('0'), findsOneWidget);
19 | expect(find.text('1'), findsNothing);
20 |
21 | // Tap the '+' icon and trigger a frame.
22 | await tester.tap(find.byIcon(Icons.add));
23 | await tester.pump();
24 |
25 | // Verify that our counter has incremented.
26 | expect(find.text('0'), findsNothing);
27 | expect(find.text('1'), findsOneWidget);
28 | });
29 | }
30 |
--------------------------------------------------------------------------------
/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/lib/app/app.dart:
--------------------------------------------------------------------------------
1 | import 'package:stacked/stacked_annotations.dart';
2 | import 'package:stacked_services/stacked_services.dart';
3 | import 'package:yummify/ui/tables/tables_view.dart';
4 | import '../services/services.dart';
5 | import '../ui/cart/cart.dart';
6 | import '../ui/home/category/category_view.dart';
7 | import '../ui/home/home_view.dart';
8 | import '../ui/startup_view.dart';
9 |
10 | @StackedApp(
11 | routes: [
12 | MaterialRoute(page: StartUpView, initial: true),
13 | MaterialRoute(page: TablesView),
14 | MaterialRoute(page: HomeView),
15 | MaterialRoute(page: CategoryView),
16 | MaterialRoute(page: CartView),
17 | MaterialRoute(page: SuccessView),
18 | ],
19 | dependencies: [
20 | LazySingleton(classType: ApiRootService),
21 | LazySingleton(classType: ApiService),
22 | LazySingleton(classType: HiveDbService),
23 | LazySingleton(classType: NavigationService),
24 | LazySingleton(classType: BottomSheetService),
25 | LazySingleton(classType: DialogService),
26 | LazySingleton(classType: SnackbarService),
27 | ],
28 | logger: StackedLogger(),
29 | )
30 | class AppSetup {
31 | /** Serves no purpose besides having an annotation attached to it */
32 | }
33 |
--------------------------------------------------------------------------------
/lib/ui/startup_animated_text_hook.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_hooks/flutter_hooks.dart';
5 | import 'package:stacked_hooks/stacked_hooks.dart';
6 |
7 | import 'startup_viewmodel.dart';
8 |
9 | class StartUpAnimatedTextHook extends HookViewModelWidget {
10 | final Widget child;
11 | final int? delay;
12 | const StartUpAnimatedTextHook(
13 | {required this.child, required this.delay, Key? key})
14 | : super(key: key);
15 |
16 | @override
17 | Widget buildViewModelWidget(BuildContext context, StartUpViewModel model) {
18 | final _animController =
19 | useAnimationController(duration: Duration(seconds: 1));
20 | Animation _fadeInFadeOut;
21 | _fadeInFadeOut = Tween(begin: 0.0, end: 1).animate(_animController);
22 |
23 | /// Animation will be PLAYED only for the first time
24 | if (model.startAnimation == true)
25 | Timer(Duration(milliseconds: delay!), () {
26 | model.log.v('_animController CALLED');
27 | _animController.forward();
28 | });
29 |
30 | return FadeTransition(
31 | child: child,
32 | opacity: _fadeInFadeOut,
33 | );
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/assets/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/macos/Runner/GoogleService-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CLIENT_ID
6 | 897078125338-71rdcpdr9kih8lufdlhlk6jf1casbm89.apps.googleusercontent.com
7 | REVERSED_CLIENT_ID
8 | com.googleusercontent.apps.897078125338-71rdcpdr9kih8lufdlhlk6jf1casbm89
9 | API_KEY
10 | AIzaSyB_wlkjqJtdjl2OpKIyJllgd3jud7tZUJk
11 | GCM_SENDER_ID
12 | 897078125338
13 | PLIST_VERSION
14 | 1
15 | BUNDLE_ID
16 | tm.com.yummify
17 | PROJECT_ID
18 | yummify
19 | STORAGE_BUCKET
20 | yummify.appspot.com
21 | IS_ADS_ENABLED
22 |
23 | IS_ANALYTICS_ENABLED
24 |
25 | IS_APPINVITE_ENABLED
26 |
27 | IS_GCM_ENABLED
28 |
29 | IS_SIGNIN_ENABLED
30 |
31 | GOOGLE_APP_ID
32 | 1:897078125338:ios:ea58b47c3367b365c042a3
33 |
34 |
--------------------------------------------------------------------------------
/lib/widgets/custom_modal_bottom_sheet.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import '../../shared/shared.dart';
5 |
6 | class CustomModalBottomSheet extends StatelessWidget {
7 | final Widget child;
8 | const CustomModalBottomSheet({
9 | Key? key,
10 | required this.child,
11 | }) : super(key: key);
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return AnnotatedRegion(
16 | value: SystemUiOverlayStyle.light,
17 | child: Stack(
18 | alignment: Alignment.center,
19 | children: [
20 | child,
21 | // --------------- CUSTOM BOTTOM SHEET MODAL WIDGET -------------- //
22 | Positioned(
23 | top: 0.h,
24 | child: Container(
25 | height: 5,
26 | width: 48,
27 | transform: Matrix4.translationValues(0.0, -10.h, 0.0),
28 | decoration: BoxDecoration(
29 | color: kcWhiteColor,
30 | borderRadius: BorderRadius.circular(6),
31 | ),
32 | ),
33 | ),
34 | ],
35 | ),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/widgets/custom_text_child_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import '../../shared/shared.dart';
3 |
4 | class CustomTextChildButton extends StatelessWidget {
5 | final Widget child;
6 | final Color color;
7 | final EdgeInsetsGeometry? padding;
8 | final BorderRadiusGeometry? borderRadius;
9 | final Function onPressed;
10 | const CustomTextChildButton({
11 | Key? key,
12 | required this.child,
13 | this.color = kcFontColor,
14 | this.padding,
15 | this.borderRadius,
16 | required this.onPressed,
17 | }) : super(key: key);
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return TextButton(
22 | style: TextButton.styleFrom(
23 | backgroundColor: color,
24 | primary: kcSecondaryLightColor, // ripple effect color
25 | elevation: 0,
26 | shape: RoundedRectangleBorder(
27 | borderRadius: borderRadius ?? radius15,
28 | ),
29 | padding: padding ?? const EdgeInsets.all(0.0),
30 | // primary: color,
31 | // onSurface: color,
32 | // shadowColor: color,
33 | // minimumSize: Size(width!, height!),
34 | ),
35 | onPressed: onPressed as void Function(),
36 | child: child,
37 | );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/lib/models/hive_models/hive_table.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'hive_table.dart';
4 |
5 | // **************************************************************************
6 | // TypeAdapterGenerator
7 | // **************************************************************************
8 |
9 | class HiveTableAdapter extends TypeAdapter {
10 | @override
11 | final int typeId = 1;
12 |
13 | @override
14 | HiveTable read(BinaryReader reader) {
15 | final numOfFields = reader.readByte();
16 | final fields = {
17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
18 | };
19 | return HiveTable(
20 | id: fields[0] as int?,
21 | name: fields[1] as String?,
22 | );
23 | }
24 |
25 | @override
26 | void write(BinaryWriter writer, HiveTable obj) {
27 | writer
28 | ..writeByte(2)
29 | ..writeByte(0)
30 | ..write(obj.id)
31 | ..writeByte(1)
32 | ..write(obj.name);
33 | }
34 |
35 | @override
36 | int get hashCode => typeId.hashCode;
37 |
38 | @override
39 | bool operator ==(Object other) =>
40 | identical(this, other) ||
41 | other is HiveTableAdapter &&
42 | runtimeType == other.runtimeType &&
43 | typeId == other.typeId;
44 | }
45 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Disable Windows macros that collide with C++ standard library functions.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
25 |
26 | # Add dependency libraries and include directories. Add any application-specific
27 | # dependencies here.
28 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
29 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
30 |
31 | # Run the Flutter tool portions of the build. This must not be removed.
32 | add_dependencies(${BINARY_NAME} flutter_assemble)
33 |
--------------------------------------------------------------------------------
/lib/app/app.locator.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | // **************************************************************************
4 | // StackedLocatorGenerator
5 | // **************************************************************************
6 |
7 | // ignore_for_file: public_member_api_docs
8 |
9 | import 'package:stacked_core/stacked_core.dart';
10 | import 'package:stacked_services/stacked_services.dart';
11 |
12 | import '../services/api_root_service.dart';
13 | import '../services/api_service.dart';
14 | import '../services/hv_db_service.dart';
15 |
16 | final locator = StackedLocator.instance;
17 |
18 | Future setupLocator(
19 | {String? environment, EnvironmentFilter? environmentFilter}) async {
20 | // Register environments
21 | locator.registerEnvironment(
22 | environment: environment, environmentFilter: environmentFilter);
23 |
24 | // Register dependencies
25 | locator.registerLazySingleton(() => ApiRootService());
26 | locator.registerLazySingleton(() => ApiService());
27 | locator.registerLazySingleton(() => HiveDbService());
28 | locator.registerLazySingleton(() => NavigationService());
29 | locator.registerLazySingleton(() => BottomSheetService());
30 | locator.registerLazySingleton(() => DialogService());
31 | locator.registerLazySingleton(() => SnackbarService());
32 | }
33 |
--------------------------------------------------------------------------------
/lib/ui/tables/tables_view_model.dart:
--------------------------------------------------------------------------------
1 | import '../../models/hive_models/hive_table.dart';
2 | import '../../models/table_model.dart';
3 | import 'package:stacked/stacked.dart';
4 | import 'package:stacked_services/stacked_services.dart';
5 | import '../../app/app.locator.dart';
6 | import '../../app/app.logger.dart';
7 | import '../../app/app.router.dart';
8 | import '../../services/services.dart';
9 |
10 | class TablesViewModel extends FutureViewModel {
11 | final log = getLogger('TablesViewModel');
12 |
13 | final apiService = locator();
14 | final _hiveDbService = locator();
15 | final _navService = locator();
16 |
17 | HiveTable get selectedHiveTable => _hiveDbService.selectedHiveTable;
18 |
19 | List _tables = [];
20 | List get tables => _tables;
21 |
22 | @override
23 | Future futureToRun() async {
24 | _tables = await apiService.getTables();
25 | log.i('_tables.length: ${_tables.length}');
26 | }
27 |
28 | /// ADDS selected table to HIVE and NAVIGATES to HomeView
29 | Future addTableToHive(TableModel tableModel) async {
30 | await _hiveDbService.updateTableInHive(tableModel);
31 | await _navService.pushNamedAndRemoveUntil(Routes.homeView);
32 | }
33 |
34 | @override
35 | List get reactiveServices => [_hiveDbService];
36 | }
37 |
--------------------------------------------------------------------------------
/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"yummify", 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 |
--------------------------------------------------------------------------------
/assets/imo.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:easy_localization/easy_localization.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:hive_flutter/hive_flutter.dart';
5 | import 'package:yummify/yummify_app.dart';
6 | import 'app/app.locator.dart';
7 | import 'models/models.dart';
8 | import 'setup_dialog.dart';
9 | import 'shared/shared.dart';
10 |
11 | void main() async {
12 | WidgetsFlutterBinding.ensureInitialized();
13 |
14 | /// METHOD 1. To solve HandshakeException: Handshake error in client CERTIFICATE_VERIFY_FAILED issue
15 | HttpOverrides.global = MyHttpOverrides();
16 |
17 | // /// METHOD 2. To solve HandshakeException: Handshake error in client CERTIFICATE_VERIFY_FAILED issue
18 | // ByteData data =
19 | // await PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem');
20 | // SecurityContext.defaultContext
21 | // .setTrustedCertificatesBytes(data.buffer.asUint8List());
22 |
23 | await EasyLocalization.ensureInitialized();
24 | await Hive.initFlutter();
25 | Hive.registerAdapter(HiveMealAdapter());
26 | Hive.registerAdapter(HiveTableAdapter());
27 | setupLocator(); // STACKED init setup for locators
28 | setupDialog();
29 | runApp(
30 | EasyLocalization(
31 | path: 'assets/translations',
32 | startLocale: const Locale('en', 'US'), // Overrides device locale.
33 | supportedLocales: const [Locale('en', 'US'), Locale('ru', 'RU')],
34 | fallbackLocale: const Locale('en', 'US'),
35 | child: const YummifyApp(),
36 | ),
37 | );
38 | }
39 |
--------------------------------------------------------------------------------
/lib/ui/startup_view.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:stacked/stacked.dart';
5 | import '../widgets/widgets.dart';
6 | import 'startup_animated_text_hook.dart';
7 | import 'startup_viewmodel.dart';
8 |
9 | class StartUpView extends StatelessWidget {
10 | const StartUpView({Key? key}) : super(key: key);
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return ViewModelBuilder.reactive(
15 | // Fires once when the ViewModel is created or set for the first time
16 | onModelReady: (model) => WidgetsBinding.instance
17 | .addPostFrameCallback((_) => model.runStartupLogic()),
18 |
19 | /// A builder function that returns the ViewModel for this widget
20 | viewModelBuilder: () => StartUpViewModel(),
21 | builder: (context, model, child) {
22 | /// CALLED when user has INTERNET CONNECTION
23 | if (model.startAnimation == false) {
24 | model.navToHomeWithConnection(context.locale);
25 | }
26 |
27 | return Scaffold(
28 | body: Center(
29 | child: StartUpAnimatedTextHook(
30 | delay: 500,
31 | child: YummifyImage(
32 | image: 'assets/logo.png',
33 | width: 0.4.sw,
34 | ), // YummifyImage is a custom image widget
35 | ),
36 | ),
37 | );
38 | },
39 | );
40 | }
41 | }
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 |
--------------------------------------------------------------------------------
/lib/ui/badge/badge_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:badges/badges.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:stacked/stacked.dart';
4 | import '../../shared/shared.dart';
5 | import 'badge_view_model.dart';
6 | import 'package:flutter_screenutil/flutter_screenutil.dart';
7 |
8 | class BadgeView extends StatelessWidget {
9 | const BadgeView({Key? key}) : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return ViewModelBuilder.reactive(
14 | builder: (context, model, child) {
15 | return Padding(
16 | padding: EdgeInsets.only(bottom: 5.h, right: 5.w),
17 | child: Badge(
18 | showBadge: model.cartMeals.isNotEmpty,
19 | badgeColor: kcFontColor,
20 | shape: BadgeShape.circle,
21 | badgeContent: Padding(
22 | padding: const EdgeInsets.all(5.0),
23 | child: Text(
24 | model.cartMeals.length.toString(),
25 | style: const TextStyle(color: kcSecondaryDarkColor),
26 | ),
27 | ),
28 | child: FloatingActionButton(
29 | backgroundColor: kcFontColor,
30 | onPressed: model.navToCartView,
31 | tooltip: 'cart',
32 | child: const Icon(
33 | Icons.shopping_basket,
34 | color: kcSecondaryDarkColor,
35 | ),
36 | ),
37 | ),
38 | );
39 | },
40 | viewModelBuilder: () => BadgeViewModel(),
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/models/hive_models/hive_meal.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'hive_meal.dart';
4 |
5 | // **************************************************************************
6 | // TypeAdapterGenerator
7 | // **************************************************************************
8 |
9 | class HiveMealAdapter extends TypeAdapter {
10 | @override
11 | final int typeId = 0;
12 |
13 | @override
14 | HiveMeal read(BinaryReader reader) {
15 | final numOfFields = reader.readByte();
16 | final fields = {
17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
18 | };
19 | return HiveMeal(
20 | id: fields[0] as int?,
21 | name: fields[1] as String?,
22 | image: fields[2] as String?,
23 | price: fields[3] as num?,
24 | quantity: fields[4] as int?,
25 | );
26 | }
27 |
28 | @override
29 | void write(BinaryWriter writer, HiveMeal obj) {
30 | writer
31 | ..writeByte(5)
32 | ..writeByte(0)
33 | ..write(obj.id)
34 | ..writeByte(1)
35 | ..write(obj.name)
36 | ..writeByte(2)
37 | ..write(obj.image)
38 | ..writeByte(3)
39 | ..write(obj.price)
40 | ..writeByte(4)
41 | ..write(obj.quantity);
42 | }
43 |
44 | @override
45 | int get hashCode => typeId.hashCode;
46 |
47 | @override
48 | bool operator ==(Object other) =>
49 | identical(this, other) ||
50 | other is HiveMealAdapter &&
51 | runtimeType == other.runtimeType &&
52 | typeId == other.typeId;
53 | }
54 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/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/widgets/yummify_image.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:cached_network_image/cached_network_image.dart';
3 |
4 | class YummifyImage extends StatelessWidget {
5 | final String image;
6 | final String phImage;
7 | final double? width;
8 | final double? height;
9 | final BoxFit fit;
10 | final double borderRadius;
11 | final AlignmentGeometry alignment;
12 |
13 | const YummifyImage({
14 | Key? key,
15 | required this.image,
16 | this.phImage = 'assets/logo.png',
17 | this.width,
18 | this.height,
19 | this.fit = BoxFit.cover,
20 | this.borderRadius = 0.0,
21 | this.alignment = Alignment.center,
22 | }) : super(key: key);
23 |
24 | @override
25 | Widget build(BuildContext context) {
26 | if (!(image.contains('http'))) {
27 | return ClipRRect(
28 | borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
29 | child: Image.asset(
30 | image,
31 | width: width,
32 | height: height,
33 | fit: fit,
34 | alignment: alignment,
35 | ),
36 | );
37 | }
38 |
39 | return ClipRRect(
40 | borderRadius: BorderRadius.circular(borderRadius),
41 | child: CachedNetworkImage(
42 | imageUrl: image,
43 | fit: fit,
44 | width: width,
45 | height: height,
46 | placeholder: (context, url) => Image.asset(
47 | phImage,
48 | fit: fit,
49 | width: width,
50 | height: height,
51 | alignment: alignment,
52 | ),
53 | errorWidget: (context, url, error) => Image.asset(
54 | phImage,
55 | fit: fit,
56 | width: width,
57 | height: height,
58 | alignment: alignment,
59 | ),
60 | ),
61 | );
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/.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.
5 |
6 | version:
7 | revision: cd41fdd495f6944ecd3506c21e94c6567b073278
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
17 | base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
18 | - platform: android
19 | create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
20 | base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
21 | - platform: ios
22 | create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
23 | base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
24 | - platform: linux
25 | create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
26 | base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
27 | - platform: macos
28 | create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
29 | base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
30 | - platform: web
31 | create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
32 | base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
33 | - platform: windows
34 | create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
35 | base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
36 |
37 | # User provided section
38 |
39 | # List of Local paths (relative to this file) that should be
40 | # ignored by the migrate tool.
41 | #
42 | # Files that are not part of the templates will be ignored by default.
43 | unmanaged_files:
44 | - 'lib/main.dart'
45 | - 'ios/Runner.xcodeproj/project.pbxproj'
46 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Yummify
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | Yummify
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 | CADisableMinimumFrameDurationOnPhone
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
16 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
31 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/assets/ca/lets-encrypt-r3.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
3 | TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
4 | cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw
5 | WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
6 | RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
7 | AoIBAQC7AhUozPaglNMPEuyNVZLD+ILxmaZ6QoinXSaqtSu5xUyxr45r+XXIo9cP
8 | R5QUVTVXjJ6oojkZ9YI8QqlObvU7wy7bjcCwXPNZOOftz2nwWgsbvsCUJCWH+jdx
9 | sxPnHKzhm+/b5DtFUkWWqcFTzjTIUu61ru2P3mBw4qVUq7ZtDpelQDRrK9O8Zutm
10 | NHz6a4uPVymZ+DAXXbpyb/uBxa3Shlg9F8fnCbvxK/eG3MHacV3URuPMrSXBiLxg
11 | Z3Vms/EY96Jc5lP/Ooi2R6X/ExjqmAl3P51T+c8B5fWmcBcUr2Ok/5mzk53cU6cG
12 | /kiFHaFpriV1uxPMUgP17VGhi9sVAgMBAAGjggEIMIIBBDAOBgNVHQ8BAf8EBAMC
13 | AYYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMBIGA1UdEwEB/wQIMAYB
14 | Af8CAQAwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYfr52LFMLGMB8GA1UdIwQYMBaA
15 | FHm0WeZ7tuXkAXOACIjIGlj26ZtuMDIGCCsGAQUFBwEBBCYwJDAiBggrBgEFBQcw
16 | AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw
17 | Oi8veDEuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYGZ4EMAQIBMA0GCysGAQQB
18 | gt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCFyk5HPqP3hUSFvNVneLKYY611TR6W
19 | PTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl
20 | ikfmZW4/RvTZ8M6UK+5UzhK8jCdLuMGYL6KvzXGRSgi3yLgjewQtCPkIVz6D2QQz
21 | CkcheAmCJ8MqyJu5zlzyZMjAvnnAT45tRAxekrsu94sQ4egdRCnbWSDtY7kh+BIm
22 | lJNXoB1lBMEKIq4QDUOXoRgffuDghje1WrG9ML+Hbisq/yFOGwXD9RiX8F6sw6W4
23 | avAuvDszue5L3sz85K+EC4Y/wFVDNvZo4TYXao6Z0f+lQKc0t8DQYzk1OXVu8rp2
24 | yJMC6alLbBfODALZvYH7n7do1AZls4I9d1P4jnkDrQoxB3UqQ9hVl3LEKQ73xF1O
25 | yK5GhDDX8oVfGKF5u+decIsH4YaTw7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids
26 | hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+
27 | HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv
28 | MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX
29 | nLRbwHOoq7hHwg==
30 | -----END CERTIFICATE-----
31 |
--------------------------------------------------------------------------------
/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 | std::string utf8_string;
52 | if (target_length == 0 || target_length > utf8_string.max_size()) {
53 | return utf8_string;
54 | }
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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | yummify
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/lib/ui/cart/success_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:easy_localization/easy_localization.dart';
4 | import 'package:lottie/lottie.dart';
5 | import 'cart_view_model.dart';
6 | import 'package:stacked/stacked.dart';
7 |
8 | import '../../generated/locale_keys.g.dart';
9 | import '../../shared/shared.dart';
10 | import '../../widgets/widgets.dart';
11 |
12 | class SuccessView extends StatelessWidget {
13 | const SuccessView({Key? key}) : super(key: key);
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return ViewModelBuilder.reactive(
18 | builder: (context, model, child) => WillPopScope(
19 | onWillPop: () async {
20 | model.navToHomeByRemovingAll(); // Workaround
21 | return false;
22 | },
23 | child: Scaffold(
24 | body: Center(
25 | child: Column(
26 | mainAxisAlignment: MainAxisAlignment.center,
27 | children: [
28 | Lottie.asset(
29 | 'assets/success.json',
30 | height: 0.3.sh,
31 | ),
32 | SizedBox(height: 0.1.sh),
33 | Padding(
34 | padding: EdgeInsets.symmetric(horizontal: 16.w),
35 | child: Text(
36 | LocaleKeys.orderSuccess,
37 | textAlign: TextAlign.center,
38 | style: getDeviceType() == Constants.phone
39 | ? ktsCartMealPricePhoneText
40 | : ktsCartMealPriceText,
41 | ).tr(),
42 | ),
43 | SizedBox(height: 0.1.sh),
44 | CustomTextChildButton(
45 | color: kcFontColor,
46 | borderRadius: kbr15,
47 | padding:
48 | EdgeInsets.symmetric(vertical: 12.h, horizontal: 25.w),
49 | onPressed: model.navToHomeByRemovingAll,
50 | child: Text(
51 | LocaleKeys.homeScreen,
52 | style: getDeviceType() == Constants.phone
53 | ? ktsMealButtonPhoneText
54 | : ktsMealButtonText,
55 | ).tr(),
56 | ),
57 | ],
58 | ),
59 | ),
60 | ),
61 | ),
62 | viewModelBuilder: () => CartViewModel(),
63 | );
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/lib/ui/startup_viewmodel.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: deprecated_member_use
2 | import 'dart:ui';
3 |
4 | import 'package:shared_preferences/shared_preferences.dart';
5 | import 'package:stacked/stacked.dart';
6 | import 'package:stacked_services/stacked_services.dart';
7 | import '../app/app.locator.dart';
8 | import '../app/app.logger.dart';
9 | import '../app/app.router.dart';
10 | import '../models/hive_models/hive_table.dart';
11 | import '../services/services.dart';
12 | import '../shared/shared.dart';
13 |
14 | class StartUpViewModel extends ReactiveViewModel {
15 | final log = getLogger('StartUpViewModel');
16 |
17 | final _navService = locator();
18 | final _apiRootService = locator();
19 | final _hiveDbService = locator();
20 |
21 | bool _startAnimation = true;
22 | bool get startAnimation => _startAnimation;
23 |
24 | HiveTable get selectedHiveTable => _hiveDbService.selectedHiveTable;
25 |
26 | /// FIRES startup view animation
27 | Future runStartupLogic() async {
28 | log.i('===== runStartupLogic() STARTED =====');
29 |
30 | await Future.delayed(const Duration(milliseconds: 2500)).then((value) {
31 | _startAnimation = false;
32 | notifyListeners();
33 | });
34 |
35 | log.i('===== runStartupLogic() ENDED =====');
36 | }
37 |
38 | /// AFTER startup view animation is finished, navigation to next view is implemented
39 | Future navToHomeWithConnection(Locale initLocale) async {
40 | log.i('===== navToHomeWithConnection() STARTED =====');
41 |
42 | /// So this below condition is to change lang of API initialization to ru lang when app is opened for the first time. Workaround for an issue of easy_localization package.
43 | if (initLocale.toString() == 'ru_RU') {
44 | SharedPreferences prefs = await SharedPreferences.getInstance();
45 | final savedLocale = prefs.getString(Constants.savedLocale) ??
46 | 'en_US'; // GETS saved locale.
47 |
48 | if (savedLocale != 'ru_RU') {
49 | await prefs.setString(Constants.savedLocale, initLocale.toString());
50 | }
51 | }
52 |
53 | await _apiRootService.initializeDio();
54 | await _hiveDbService.initializeHiveBoxes();
55 | _hiveDbService.getHiveTable();
56 | _hiveDbService.getCartMeals();
57 |
58 | if (selectedHiveTable.id != -1) {
59 | await _navService.replaceWith(Routes.homeView);
60 | } else {
61 | await _navService.replaceWith(Routes.tablesView);
62 | }
63 | }
64 |
65 | @override
66 | List get reactiveServices => [_hiveDbService];
67 | }
68 |
--------------------------------------------------------------------------------
/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 localProperties.getProperty('flutter.compileSdkVersion').toInteger()
30 | ndkVersion flutter.ndkVersion
31 |
32 | compileOptions {
33 | sourceCompatibility JavaVersion.VERSION_1_8
34 | targetCompatibility JavaVersion.VERSION_1_8
35 | }
36 |
37 | kotlinOptions {
38 | jvmTarget = '1.8'
39 | }
40 |
41 | sourceSets {
42 | main.java.srcDirs += 'src/main/kotlin'
43 | }
44 |
45 | defaultConfig {
46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 | applicationId "tm.com.yummify"
48 | // You can update the following values to match your application needs.
49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50 | minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
51 | targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()
52 | versionCode flutterVersionCode.toInteger()
53 | versionName flutterVersionName
54 | multiDexEnabled true
55 | }
56 |
57 | buildTypes {
58 | release {
59 | // TODO: Add your own signing config for the release build.
60 | // Signing with the debug keys for now, so `flutter run --release` works.
61 | signingConfig signingConfigs.debug
62 | }
63 | }
64 | }
65 |
66 | flutter {
67 | source '../..'
68 | }
69 |
70 | dependencies {
71 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72 | }
73 |
--------------------------------------------------------------------------------
/lib/ui/home/home_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:shared_preferences/shared_preferences.dart';
4 | import 'package:stacked/stacked.dart';
5 | import 'package:stacked_services/stacked_services.dart';
6 | import '../../app/app.locator.dart';
7 | import '../../app/app.logger.dart';
8 | import '../../app/app.router.dart';
9 | import '../../generated/locale_keys.g.dart';
10 | import '../../models/models.dart';
11 | import '../../services/services.dart';
12 | import '../../shared/shared.dart';
13 |
14 | class HomeViewModel extends FutureViewModel {
15 | final log = getLogger('HomeViewModel');
16 |
17 | final _apiRootService = locator();
18 | final _api = locator();
19 | final _navService = locator();
20 | final _hiveDbService = locator();
21 |
22 | String? _selectedLang;
23 | String? get selectedLang => _selectedLang;
24 |
25 | List _categories = [];
26 | List get categories => _categories;
27 |
28 | HiveTable get selectedHiveTable => _hiveDbService.selectedHiveTable;
29 |
30 | /// GET METHOD 1 for FUTUREVIEWMODEL
31 | @override
32 | Future futureToRun() async {
33 | _categories = await _api.getCategories();
34 | log.v('_categories.length: ${_categories.length}');
35 | }
36 |
37 | /// SETS initial lang
38 | setInitialLang(BuildContext context) =>
39 | _selectedLang = context.locale == context.supportedLocales[0]
40 | ? LocaleKeys.lang_en
41 | : LocaleKeys.lang_ru;
42 |
43 | /// SETS LOCALE of an app's baseUrl
44 | Future setLocale(String locale) async {
45 | SharedPreferences prefs = await SharedPreferences.getInstance();
46 | await prefs.setString(Constants.savedLocale, locale);
47 | }
48 |
49 | /// REINITIALIZES app api url
50 | Future reinitializeDio() async => await _apiRootService
51 | .initializeDio(); // MUST REINITIALIZE whole app dio config
52 |
53 | //------------------ NAVIGATION ---------------------//
54 |
55 | /// NAVIGATES to Home by removing all previous routes
56 | Future navToHomeByRemovingAll() async =>
57 | await _navService.pushNamedAndRemoveUntil(Routes.homeView);
58 |
59 | /// NAVIGATES to Category View
60 | Future navToCategoryMealsView(CategoryModel categoryModel) async =>
61 | await _navService.navigateTo(
62 | Routes.categoryView,
63 | arguments: CategoryViewArguments(categoryModel: categoryModel),
64 | );
65 |
66 | /// NAVIGATES to Tables View
67 | Future navToTablesView() async =>
68 | await _navService.navigateTo(Routes.tablesView);
69 |
70 | @override
71 | List get reactiveServices => [_hiveDbService];
72 | }
73 |
--------------------------------------------------------------------------------
/lib/shared/utils.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:flash/flash.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_svg/flutter_svg.dart';
5 | import 'shared.dart';
6 | import 'package:flutter_screenutil/flutter_screenutil.dart';
7 | import '../generated/locale_keys.g.dart';
8 |
9 | /// Enum for connectivity
10 | enum ConnectivityStatus { Idle, WiFi, Cellular, Offline }
11 |
12 | /// Method to round trailing zero based on its type.
13 |
14 | // toStringAsFixed guarantees the specified number of fractional
15 | // digits, so the regular expression is simpler than it would need to
16 | // be for more general cases.
17 | String formatNum(num value) =>
18 | value.toStringAsFixed(2).replaceFirst(RegExp(r'\.?0*$'), '');
19 |
20 | /// Enum for dialog types
21 | enum DialogType {
22 | removeCartMeal,
23 | clearCart,
24 | }
25 |
26 | List appLangs = [
27 | LocaleKeys.lang_en,
28 | LocaleKeys.lang_ru,
29 | ];
30 |
31 | Future showErrorFlashBar({
32 | required BuildContext context,
33 | String msg = LocaleKeys.errorOccured,
34 | }) async {
35 | await showFlash(
36 | context: context,
37 | duration: const Duration(milliseconds: 2000),
38 | builder: (context, controller) {
39 | return Flash(
40 | backgroundColor: kcSecondaryDarkColor,
41 | controller: controller,
42 | borderRadius: kbr15,
43 | boxShadows: kElevationToShadow[0],
44 | position: FlashPosition.bottom,
45 | barrierDismissible: true,
46 | behavior: FlashBehavior.floating,
47 | margin: EdgeInsets.only(
48 | left: 16.w,
49 | right: 16.w,
50 | bottom: 0.1.sh,
51 | ),
52 | child: FlashBar(
53 | icon: Padding(
54 | padding: EdgeInsets.only(left: 24.w, right: 12.w),
55 | child: SvgPicture.asset(
56 | 'assets/warning.svg',
57 | width: 20.w,
58 | height: 20.h,
59 | color: kcFontColor,
60 | ),
61 | ),
62 | content: Text(msg, style: ktsInfoText).tr(),
63 | ),
64 | );
65 | },
66 | );
67 | }
68 |
69 | String getDeviceType() {
70 | final data = MediaQueryData.fromWindow(WidgetsBinding.instance.window);
71 | // printLog('getDeviceType(): ${data.size.shortestSide}');
72 | return data.size.shortestSide < 600 ? Constants.phone : Constants.tablet;
73 | }
74 |
75 | /// Radiuses
76 | BorderRadius get radius20 => BorderRadius.circular(20.0);
77 | BorderRadius get radius15 => BorderRadius.circular(15.0);
78 | BorderRadius get radius16 => BorderRadius.circular(16.0);
79 | BorderRadius get radius12 => BorderRadius.circular(12.0);
80 | BorderRadius get radius10 => BorderRadius.circular(10.0);
81 | BorderRadius get radius5 => BorderRadius.circular(5.0);
82 |
--------------------------------------------------------------------------------
/lib/services/api_root_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import '../app/app.logger.dart';
3 | import '../shared/shared.dart';
4 | import 'package:shared_preferences/shared_preferences.dart';
5 |
6 | /// ApiRootService is used to initialize dio http client in ApiService
7 | class ApiRootService {
8 | final log = getLogger('ApiRootService');
9 |
10 | /// A powerful Http client for Dart,
11 | /// which supports Interceptors, Global configuration, FormData, Request Cancellation, File downloading, Timeout etc.
12 | Dio dio = Dio();
13 |
14 | /// INITIALIZES dio http client when the application is started
15 | Future initializeDio() async {
16 | log.v('====== DIO STARTED initialising ======');
17 |
18 | /// GETS saved locale.
19 | SharedPreferences prefs = await SharedPreferences.getInstance();
20 | final savedLocale = prefs.getString(Constants.savedLocale) ?? 'en_US';
21 | log.v('ApiRootService _savedLocale: $savedLocale');
22 |
23 | /// Method 1. Adds headers to each REST API that is requested
24 | Map headers = {
25 | 'Accept': 'application/json',
26 | 'Content-Type': 'application/json',
27 | 'Accept-Language': savedLocale == 'en_US' ? 'en' : 'ru',
28 | };
29 |
30 | /// Method 2. Adds headers to each REST API that is requested
31 | dio.options.baseUrl = Constants.baseUrl;
32 | dio.options.headers = headers;
33 |
34 | /// Adds dio interceptors headers to each REST API that is requested.
35 | /// For each dio instance, We can add one or more interceptors,
36 | /// by which we can intercept requests 、responses and errors before they are handled by `then` or `catchError`.
37 | dio.interceptors.add(InterceptorsWrapper(onRequest: (options, handler) {
38 | // Do something before request is sent
39 | log.v(
40 | 'REQUEST[${options.method}] => PATH: ${Constants.baseUrl}${options.path}');
41 | return handler.next(options); //continue
42 | // If you want to resolve the request with some custom data,
43 | // you can resolve a `Response` object eg: `handler.resolve(response)`.
44 | // If you want to reject the request with a error message,
45 | // you can reject a `DioError` object eg: `handler.reject(dioError)`
46 | }, onResponse: (response, handler) {
47 | // Do something with response data
48 | return handler.next(response); // continue
49 | // If you want to reject the request with a error message,
50 | // you can reject a `DioError` object eg: `handler.reject(dioError)`
51 | }, onError: (DioError e, handler) {
52 | // Do something with response error
53 | return handler.next(e); //continue
54 | // If you want to resolve the request with some custom data,
55 | // you can resolve a `Response` object eg: `handler.resolve(response)`.
56 | }));
57 |
58 | log.v('====== DIO ENDED initialising ======');
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/lib/yummify_app.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter/services.dart';
4 | import 'package:flutter_screenutil/flutter_screenutil.dart';
5 | import 'package:stacked_services/stacked_services.dart';
6 |
7 | import 'app/app.router.dart';
8 | import 'shared/shared.dart';
9 | import 'widgets/widgets.dart';
10 |
11 | class YummifyApp extends StatelessWidget {
12 | const YummifyApp({Key? key}) : super(key: key);
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | // Orientation: PORTRAIT Only
17 | SystemChrome.setPreferredOrientations([
18 | DeviceOrientation.portraitUp,
19 | DeviceOrientation.portraitDown,
20 | ]);
21 | return ScreenUtilInit(
22 | // designSize: const Size(428, 926),
23 | splitScreenMode: true,
24 | minTextAdapt:
25 | true, // Whether to adapt the text according to the minimum of width and height
26 | useInheritedMediaQuery: true,
27 | builder: (context, widget) => MaterialApp(
28 | useInheritedMediaQuery: true,
29 | title: Constants.appName,
30 | navigatorObservers: [StackedService.routeObserver],
31 | navigatorKey: StackedService.navigatorKey, // For stacked_services
32 | onGenerateRoute: StackedRouter()
33 | .onGenerateRoute, // Auto generates all routes using stacked package
34 | localizationsDelegates: context.localizationDelegates,
35 | supportedLocales: context.supportedLocales,
36 | locale: context.locale,
37 | debugShowCheckedModeBanner: false,
38 | themeMode: ThemeMode.light,
39 | theme: ThemeData(
40 | brightness: Brightness.light,
41 | primaryColor: kcFontColor,
42 | scaffoldBackgroundColor: kcBackgroundColor,
43 | splashColor: kcBackgroundColor,
44 | fontFamily: 'Roboto',
45 | appBarTheme: const AppBarTheme(elevation: 0),
46 | visualDensity: VisualDensity.adaptivePlatformDensity,
47 | ),
48 | darkTheme: ThemeData(
49 | brightness: Brightness.dark,
50 | primaryColor: kcFontColor,
51 | scaffoldBackgroundColor: kcBackgroundColor,
52 | splashColor: kcBackgroundColor,
53 | fontFamily: 'Roboto',
54 | appBarTheme: const AppBarTheme(elevation: 0),
55 | visualDensity: VisualDensity.adaptivePlatformDensity,
56 | ),
57 | builder: (context, child) {
58 | return ScrollConfiguration(
59 | behavior: MyBehavior(), // To remove the glow effect entirely
60 | child: MediaQuery(
61 | //Setting font does not change with system font size
62 | data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
63 | child: child!,
64 | ),
65 | );
66 | },
67 | ),
68 | );
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/assets/instagram.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | ]>
13 |
44 |
--------------------------------------------------------------------------------
/linux/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.10)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 |
12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...),
13 | # which isn't available in 3.10.
14 | function(list_prepend LIST_NAME PREFIX)
15 | set(NEW_LIST "")
16 | foreach(element ${${LIST_NAME}})
17 | list(APPEND NEW_LIST "${PREFIX}${element}")
18 | endforeach(element)
19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
20 | endfunction()
21 |
22 | # === Flutter Library ===
23 | # System-level dependencies.
24 | find_package(PkgConfig REQUIRED)
25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
28 |
29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
30 |
31 | # Published to parent scope for install step.
32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
36 |
37 | list(APPEND FLUTTER_LIBRARY_HEADERS
38 | "fl_basic_message_channel.h"
39 | "fl_binary_codec.h"
40 | "fl_binary_messenger.h"
41 | "fl_dart_project.h"
42 | "fl_engine.h"
43 | "fl_json_message_codec.h"
44 | "fl_json_method_codec.h"
45 | "fl_message_codec.h"
46 | "fl_method_call.h"
47 | "fl_method_channel.h"
48 | "fl_method_codec.h"
49 | "fl_method_response.h"
50 | "fl_plugin_registrar.h"
51 | "fl_plugin_registry.h"
52 | "fl_standard_message_codec.h"
53 | "fl_standard_method_codec.h"
54 | "fl_string_codec.h"
55 | "fl_value.h"
56 | "fl_view.h"
57 | "flutter_linux.h"
58 | )
59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
60 | add_library(flutter INTERFACE)
61 | target_include_directories(flutter INTERFACE
62 | "${EPHEMERAL_DIR}"
63 | )
64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
65 | target_link_libraries(flutter INTERFACE
66 | PkgConfig::GTK
67 | PkgConfig::GLIB
68 | PkgConfig::GIO
69 | )
70 | add_dependencies(flutter flutter_assemble)
71 |
72 | # === Flutter tool backend ===
73 | # _phony_ is a non-existent file to force this command to run every time,
74 | # since currently there's no way to get a full input/output list from the
75 | # flutter tool.
76 | add_custom_command(
77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_
79 | COMMAND ${CMAKE_COMMAND} -E env
80 | ${FLUTTER_TOOL_ENVIRONMENT}
81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
83 | VERBATIM
84 | )
85 | add_custom_target(flutter_assemble DEPENDS
86 | "${FLUTTER_LIBRARY}"
87 | ${FLUTTER_LIBRARY_HEADERS}
88 | )
89 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/assets/table.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | ]>
13 |
44 |
--------------------------------------------------------------------------------
/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", "tm.com" "\0"
93 | VALUE "FileDescription", "yummify" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "yummify" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2022 tm.com. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "yummify.exe" "\0"
98 | VALUE "ProductName", "yummify" "\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 |
--------------------------------------------------------------------------------
/macos/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/ui/home/meal/meal_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:stacked/stacked.dart';
2 | import '../../../app/app.locator.dart';
3 | import '../../../app/app.logger.dart';
4 | import '../../../models/models.dart';
5 | import '../../../services/services.dart';
6 |
7 | /// ReactiveViewModel is used to "react"
8 | class MealViewModel extends ReactiveViewModel {
9 | final log = getLogger('MealViewModel');
10 | final MealModel meal;
11 | MealViewModel(this.meal);
12 |
13 | final _hiveDbService = locator();
14 |
15 | //----------- MEAL HOOK PART ------------//
16 |
17 | /// This mealQuantity is used in UI part instead of quantity var so that UI to be updated without any Workarounds
18 | int get mealQuantity => _hiveDbService.getMealQuantity(meal.id!);
19 |
20 | /// ADDS a meal to CART or INCREASES meal's quantity in CART
21 | Future addOrIncreaseMealInCart() async {
22 | await _hiveDbService.addOrIncreaseMealInCart(meal);
23 | notifyListeners();
24 | }
25 |
26 | /// SUBTRACTS quantity of a meal or REMOVES a meal from CART
27 | Future subtractOrRemoveMealInCart() async {
28 | await _hiveDbService.subtractOrRemoveMealInCart(meal.id);
29 | notifyListeners();
30 | }
31 |
32 | //----------- MEAL BOTTOM SHEET PART ------------//
33 |
34 | /// CREATES INITIAL state when MEAL BOTTOM SHEET is pressed
35 | /// These below 2 lines are implemented for rare issue cases: when user dismisses mealBottomSheet without action it preserves meal's quantity. It solves this issue.
36 | int _quantityInBottomSheet = 1;
37 | int get quantityInBottomSheet => _quantityInBottomSheet;
38 |
39 | num _totalMealSumInBottomSheet = 0;
40 | num get totalMealSumInBottomSheet => _totalMealSumInBottomSheet;
41 |
42 | /// CREATES INITIAL state when MEAL BOTTOM SHEET is pressed
43 | void setOnModelReadyForMealBottomSheet() {
44 | log.i('setOnModelReadyVolsCustoms()');
45 |
46 | /// if this meal already ADDED then give its quantity value to initial _quantityDraft
47 | if (mealQuantity != 0) _quantityInBottomSheet = mealQuantity;
48 |
49 | /// GET meals totalSum
50 | _totalMealSumInBottomSheet = meal.price!;
51 | _totalMealSumInBottomSheet *= _quantityInBottomSheet;
52 | }
53 |
54 | /// ADDS to _quantityInBottomSheet in MEAL BOTTOM SHEET
55 | void addQuantityInBottomSheet() {
56 | log.i(
57 | 'addQuantityInBottomSheet() _quantityInBottomSheet: $_quantityInBottomSheet');
58 |
59 | _quantityInBottomSheet += 1;
60 |
61 | /// ADDS a meal's price to _totalMealSumInBottomSheet
62 | _totalMealSumInBottomSheet += meal.price!;
63 |
64 | log.i(
65 | 'AFTER addQuantityInBottomSheet() _quantityInBottomSheet: $_quantityInBottomSheet');
66 | notifyListeners();
67 | }
68 |
69 | /// SUBTRACTS from _quantityInBottomSheet in MEAL BOTTOM SHEET
70 | void subtractQuantityInBottomSheet() {
71 | log.i(
72 | 'subtractQuantityInBottomSheet() _quantityInBottomSheet: $_quantityInBottomSheet');
73 |
74 | /// IF _quantityInBottomSheet is already 1, then just RETURN without any action
75 | if (_quantityInBottomSheet <= 1) return;
76 | _quantityInBottomSheet -= 1;
77 |
78 | /// SUBTRACTS a meal's price from _totalMealSumInBottomSheet
79 | _totalMealSumInBottomSheet -= meal.price!;
80 |
81 | log.i(
82 | 'AFTER subtractQuantityInBottomSheet() _quantityInBottomSheet: $_quantityInBottomSheet');
83 | notifyListeners();
84 | }
85 |
86 | /// ADDS a meal to CART from MEAL BOTTOM SHEET or INCREASES quantity of a meal in CART from MEAL BOTTOM SHEET
87 | Future addOrIncreaseMealInCartFromMealBottomSheet() async {
88 | await _hiveDbService.addOrIncreaseMealInCart(meal,
89 | quantity: _quantityInBottomSheet);
90 | notifyListeners();
91 | }
92 |
93 | @override
94 | List get reactiveServices => [_hiveDbService];
95 | }
96 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.14)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
12 |
13 | # === Flutter Library ===
14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
15 |
16 | # Published to parent scope for install step.
17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
21 |
22 | list(APPEND FLUTTER_LIBRARY_HEADERS
23 | "flutter_export.h"
24 | "flutter_windows.h"
25 | "flutter_messenger.h"
26 | "flutter_plugin_registrar.h"
27 | "flutter_texture_registrar.h"
28 | )
29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
30 | add_library(flutter INTERFACE)
31 | target_include_directories(flutter INTERFACE
32 | "${EPHEMERAL_DIR}"
33 | )
34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
35 | add_dependencies(flutter flutter_assemble)
36 |
37 | # === Wrapper ===
38 | list(APPEND CPP_WRAPPER_SOURCES_CORE
39 | "core_implementations.cc"
40 | "standard_codec.cc"
41 | )
42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
44 | "plugin_registrar.cc"
45 | )
46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
47 | list(APPEND CPP_WRAPPER_SOURCES_APP
48 | "flutter_engine.cc"
49 | "flutter_view_controller.cc"
50 | )
51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
52 |
53 | # Wrapper sources needed for a plugin.
54 | add_library(flutter_wrapper_plugin STATIC
55 | ${CPP_WRAPPER_SOURCES_CORE}
56 | ${CPP_WRAPPER_SOURCES_PLUGIN}
57 | )
58 | apply_standard_settings(flutter_wrapper_plugin)
59 | set_target_properties(flutter_wrapper_plugin PROPERTIES
60 | POSITION_INDEPENDENT_CODE ON)
61 | set_target_properties(flutter_wrapper_plugin PROPERTIES
62 | CXX_VISIBILITY_PRESET hidden)
63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
64 | target_include_directories(flutter_wrapper_plugin PUBLIC
65 | "${WRAPPER_ROOT}/include"
66 | )
67 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
68 |
69 | # Wrapper sources needed for the runner.
70 | add_library(flutter_wrapper_app STATIC
71 | ${CPP_WRAPPER_SOURCES_CORE}
72 | ${CPP_WRAPPER_SOURCES_APP}
73 | )
74 | apply_standard_settings(flutter_wrapper_app)
75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
76 | target_include_directories(flutter_wrapper_app PUBLIC
77 | "${WRAPPER_ROOT}/include"
78 | )
79 | add_dependencies(flutter_wrapper_app flutter_assemble)
80 |
81 | # === Flutter tool backend ===
82 | # _phony_ is a non-existent file to force this command to run every time,
83 | # since currently there's no way to get a full input/output list from the
84 | # flutter tool.
85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
87 | add_custom_command(
88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
90 | ${CPP_WRAPPER_SOURCES_APP}
91 | ${PHONY_OUTPUT}
92 | COMMAND ${CMAKE_COMMAND} -E env
93 | ${FLUTTER_TOOL_ENVIRONMENT}
94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
95 | windows-x64 $
96 | VERBATIM
97 | )
98 | add_custom_target(flutter_assemble DEPENDS
99 | "${FLUTTER_LIBRARY}"
100 | ${FLUTTER_LIBRARY_HEADERS}
101 | ${CPP_WRAPPER_SOURCES_CORE}
102 | ${CPP_WRAPPER_SOURCES_PLUGIN}
103 | ${CPP_WRAPPER_SOURCES_APP}
104 | )
105 |
--------------------------------------------------------------------------------
/lib/shared/styles.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'shared.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 |
5 | // =========== Text Styles ============ //
6 |
7 | TextStyle ktsLogoText = TextStyle(
8 | fontSize: 8.sp,
9 | color: kcFontColor,
10 | );
11 |
12 | TextStyle ktsInfoText = TextStyle(
13 | fontSize: 10.sp,
14 | color: kcFontColor,
15 | );
16 |
17 | TextStyle ktsCatText = TextStyle(
18 | fontSize: 12.sp,
19 | color: kcFontColor,
20 | );
21 |
22 | TextStyle ktsCatPhoneText = TextStyle(
23 | fontSize: 14.sp,
24 | color: kcFontColor,
25 | );
26 |
27 | TextStyle ktsMealText = TextStyle(
28 | fontSize: 8.sp,
29 | color: kcFontColor,
30 | );
31 |
32 | TextStyle ktsMealPhoneText = TextStyle(
33 | fontSize: 12.sp,
34 | color: kcFontColor,
35 | );
36 |
37 | TextStyle ktsMealPriceText = TextStyle(
38 | fontSize: 10.sp,
39 | color: kcFontColor,
40 | );
41 |
42 | TextStyle ktsMealPricePhoneText = TextStyle(
43 | fontSize: 14.sp,
44 | color: kcFontColor,
45 | );
46 |
47 | TextStyle ktsMealButtonText = TextStyle(
48 | fontSize: 10.sp,
49 | fontWeight: FontWeight.w600,
50 | color: kcSecondaryDarkColor,
51 | );
52 |
53 | TextStyle ktsMealButtonPhoneText = TextStyle(
54 | fontSize: 12.sp,
55 | fontWeight: FontWeight.w600,
56 | color: kcSecondaryDarkColor,
57 | );
58 |
59 | TextStyle ktsQuantityText = TextStyle(
60 | fontSize: 12.sp,
61 | fontWeight: FontWeight.w600,
62 | color: kcFontColor,
63 | );
64 |
65 | TextStyle ktsQuantityPhoneText = TextStyle(
66 | fontSize: 14.sp,
67 | fontWeight: FontWeight.w600,
68 | color: kcFontColor,
69 | );
70 |
71 | TextStyle ktsCatNameText = TextStyle(
72 | fontSize: 22.sp,
73 | fontWeight: FontWeight.w600,
74 | color: kcFontColor,
75 | );
76 |
77 | TextStyle ktsCartTitleText = TextStyle(
78 | fontSize: 12.sp,
79 | color: kcFontColor,
80 | );
81 |
82 | TextStyle ktsCartTitlePhoneText = TextStyle(
83 | fontSize: 14.sp,
84 | color: kcFontColor,
85 | );
86 |
87 | TextStyle ktsCartMealText = TextStyle(
88 | fontSize: 10.sp,
89 | color: kcFontColor,
90 | );
91 |
92 | TextStyle ktsCartMealPhoneText = TextStyle(
93 | fontSize: 12.sp,
94 | color: kcFontColor,
95 | );
96 |
97 | TextStyle ktsCartMealPriceText = TextStyle(
98 | fontSize: 12.sp,
99 | fontWeight: FontWeight.w600,
100 | color: kcFontColor,
101 | );
102 |
103 | TextStyle ktsCartMealPricePhoneText = TextStyle(
104 | fontSize: 14.sp,
105 | fontWeight: FontWeight.w600,
106 | color: kcFontColor,
107 | );
108 |
109 | // =========== Horizontal/Vertical Space Styles ============ //
110 |
111 | // Horizontal Spacing: Use const when there is not flutter_screenutil package
112 | Widget horizontalSpaceTiny = SizedBox(width: 5.w);
113 | Widget horizontalSpaceSmall = SizedBox(width: 10.w);
114 | Widget horizontalSpaceRegular = SizedBox(width: 18.w);
115 | Widget horizontalSpaceMedium = SizedBox(width: 25.w);
116 | Widget horizontalSpaceLarge = SizedBox(width: 50.w);
117 |
118 | // Vertical Spacing
119 | Widget verticalSpaceTiny = SizedBox(height: 5.h);
120 | Widget verticalSpaceSmall = SizedBox(height: 10.h);
121 | Widget verticalSpaceRegular = SizedBox(height: 18.h);
122 | Widget verticalSpaceMedium = SizedBox(height: 25.h);
123 | Widget verticalSpaceLarge = SizedBox(height: 50.h);
124 |
125 | // =========== Screen Size Helpers ============ //
126 |
127 | double screenWidth(BuildContext context) => MediaQuery.of(context).size.width;
128 | double screenHeight(BuildContext context) => MediaQuery.of(context).size.height;
129 |
130 | double screenHeightPercentage(BuildContext context, {double percentage = 1}) =>
131 | screenHeight(context) * percentage;
132 |
133 | double screenWidthPercentage(BuildContext context, {double percentage = 1}) =>
134 | screenWidth(context) * percentage;
135 |
136 | // =========== Radiuses ============ //
137 |
138 | final kbr5 = BorderRadius.circular(5.0);
139 | final kbr10 = BorderRadius.circular(10.0);
140 | final kbr12 = BorderRadius.circular(12.0);
141 | final kbr15 = BorderRadius.circular(15.0);
142 | final kbr20 = BorderRadius.circular(20.0);
143 | final kbr50 = BorderRadius.circular(50.0);
144 |
--------------------------------------------------------------------------------
/linux/my_application.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | #include
4 | #ifdef GDK_WINDOWING_X11
5 | #include
6 | #endif
7 |
8 | #include "flutter/generated_plugin_registrant.h"
9 |
10 | struct _MyApplication {
11 | GtkApplication parent_instance;
12 | char** dart_entrypoint_arguments;
13 | };
14 |
15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
16 |
17 | // Implements GApplication::activate.
18 | static void my_application_activate(GApplication* application) {
19 | MyApplication* self = MY_APPLICATION(application);
20 | GtkWindow* window =
21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
22 |
23 | // Use a header bar when running in GNOME as this is the common style used
24 | // by applications and is the setup most users will be using (e.g. Ubuntu
25 | // desktop).
26 | // If running on X and not using GNOME then just use a traditional title bar
27 | // in case the window manager does more exotic layout, e.g. tiling.
28 | // If running on Wayland assume the header bar will work (may need changing
29 | // if future cases occur).
30 | gboolean use_header_bar = TRUE;
31 | #ifdef GDK_WINDOWING_X11
32 | GdkScreen* screen = gtk_window_get_screen(window);
33 | if (GDK_IS_X11_SCREEN(screen)) {
34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
36 | use_header_bar = FALSE;
37 | }
38 | }
39 | #endif
40 | if (use_header_bar) {
41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
42 | gtk_widget_show(GTK_WIDGET(header_bar));
43 | gtk_header_bar_set_title(header_bar, "yummify");
44 | gtk_header_bar_set_show_close_button(header_bar, TRUE);
45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
46 | } else {
47 | gtk_window_set_title(window, "yummify");
48 | }
49 |
50 | gtk_window_set_default_size(window, 1280, 720);
51 | gtk_widget_show(GTK_WIDGET(window));
52 |
53 | g_autoptr(FlDartProject) project = fl_dart_project_new();
54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
55 |
56 | FlView* view = fl_view_new(project);
57 | gtk_widget_show(GTK_WIDGET(view));
58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
59 |
60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view));
61 |
62 | gtk_widget_grab_focus(GTK_WIDGET(view));
63 | }
64 |
65 | // Implements GApplication::local_command_line.
66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
67 | MyApplication* self = MY_APPLICATION(application);
68 | // Strip out the first argument as it is the binary name.
69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
70 |
71 | g_autoptr(GError) error = nullptr;
72 | if (!g_application_register(application, nullptr, &error)) {
73 | g_warning("Failed to register: %s", error->message);
74 | *exit_status = 1;
75 | return TRUE;
76 | }
77 |
78 | g_application_activate(application);
79 | *exit_status = 0;
80 |
81 | return TRUE;
82 | }
83 |
84 | // Implements GObject::dispose.
85 | static void my_application_dispose(GObject* object) {
86 | MyApplication* self = MY_APPLICATION(object);
87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
89 | }
90 |
91 | static void my_application_class_init(MyApplicationClass* klass) {
92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate;
93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
95 | }
96 |
97 | static void my_application_init(MyApplication* self) {}
98 |
99 | MyApplication* my_application_new() {
100 | return MY_APPLICATION(g_object_new(my_application_get_type(),
101 | "application-id", APPLICATION_ID,
102 | "flags", G_APPLICATION_NON_UNIQUE,
103 | nullptr));
104 | }
105 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.14)
3 | project(yummify LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "yummify")
8 |
9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10 | # versions of CMake.
11 | cmake_policy(SET CMP0063 NEW)
12 |
13 | # Define build configuration option.
14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
15 | if(IS_MULTICONFIG)
16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
17 | CACHE STRING "" FORCE)
18 | else()
19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
20 | set(CMAKE_BUILD_TYPE "Debug" CACHE
21 | STRING "Flutter build mode" FORCE)
22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
23 | "Debug" "Profile" "Release")
24 | endif()
25 | endif()
26 | # Define settings for the Profile build mode.
27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
31 |
32 | # Use Unicode for all projects.
33 | add_definitions(-DUNICODE -D_UNICODE)
34 |
35 | # Compilation settings that should be applied to most targets.
36 | #
37 | # Be cautious about adding new options here, as plugins use this function by
38 | # default. In most cases, you should add new options to specific targets instead
39 | # of modifying this function.
40 | function(APPLY_STANDARD_SETTINGS TARGET)
41 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
43 | target_compile_options(${TARGET} PRIVATE /EHsc)
44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
46 | endfunction()
47 |
48 | # Flutter library and tool build rules.
49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
50 | add_subdirectory(${FLUTTER_MANAGED_DIR})
51 |
52 | # Application build; see runner/CMakeLists.txt.
53 | add_subdirectory("runner")
54 |
55 | # Generated plugin build rules, which manage building the plugins and adding
56 | # them to the application.
57 | include(flutter/generated_plugins.cmake)
58 |
59 |
60 | # === Installation ===
61 | # Support files are copied into place next to the executable, so that it can
62 | # run in place. This is done instead of making a separate bundle (as on Linux)
63 | # so that building and running from within Visual Studio will work.
64 | set(BUILD_BUNDLE_DIR "$")
65 | # Make the "install" step default, as it's required to run.
66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
69 | endif()
70 |
71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
73 |
74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
75 | COMPONENT Runtime)
76 |
77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
78 | COMPONENT Runtime)
79 |
80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
81 | COMPONENT Runtime)
82 |
83 | if(PLUGIN_BUNDLED_LIBRARIES)
84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
86 | COMPONENT Runtime)
87 | endif()
88 |
89 | # Fully re-copy the assets directory on each build to avoid having stale files
90 | # from a previous install.
91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
92 | install(CODE "
93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
94 | " COMPONENT Runtime)
95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
97 |
98 | # Install the AOT library on non-Debug builds only.
99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
100 | CONFIGURATIONS Profile;Release
101 | COMPONENT Runtime)
102 |
--------------------------------------------------------------------------------
/lib/ui/home/category/category_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:yummify/widgets/widgets.dart';
3 | import '../../../models/models.dart';
4 | import 'package:stacked/stacked.dart';
5 | import '../../../shared/shared.dart';
6 | import '../../badge/badge_view.dart';
7 | import '../meal/meal_view.dart';
8 | import 'category_view_model.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 |
11 | class CategoryView extends StatelessWidget {
12 | final CategoryModel categoryModel;
13 | const CategoryView({required this.categoryModel, Key? key}) : super(key: key);
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return ViewModelBuilder.reactive(
18 | viewModelBuilder: () => CategoryViewModel(categoryModel),
19 | builder: (context, model, child) {
20 | return Scaffold(
21 | floatingActionButton: const BadgeView(),
22 | body: Column(
23 | children: [
24 | //------------------ CATEGORY IMAGE ---------------------//
25 | Stack(
26 | children: [
27 | Container(
28 | height: 0.3.sw,
29 | width: 1.sw,
30 | decoration: const BoxDecoration(
31 | color: kcFontColor,
32 | borderRadius: BorderRadius.only(
33 | bottomRight: Radius.circular(20.0),
34 | bottomLeft: Radius.circular(20.0),
35 | ),
36 | ),
37 | padding: EdgeInsets.only(bottom: 2.h),
38 | margin: EdgeInsets.only(bottom: 10.h),
39 | child: ClipRRect(
40 | borderRadius: const BorderRadius.only(
41 | bottomRight: Radius.circular(20.0),
42 | bottomLeft: Radius.circular(20.0),
43 | ),
44 | child: YummifyImage(
45 | image: categoryModel.categoryImage!,
46 | phImage: 'assets/ph_category_slider.png',
47 | ),
48 | ),
49 | ),
50 | Positioned(
51 | left: 16.w,
52 | top: 0.1.sw,
53 | child: Material(
54 | shape: const CircleBorder(),
55 | color: kcSecondaryDarkColor,
56 | child: IconButton(
57 | onPressed: () => Navigator.pop(context),
58 | icon: const Icon(
59 | Icons.arrow_back_rounded,
60 | color: kcFontColor,
61 | ),
62 | ),
63 | ),
64 | ),
65 | ],
66 | ),
67 | Padding(
68 | padding: EdgeInsets.only(bottom: 5.h),
69 | child: Text(
70 | categoryModel.name!,
71 | style: ktsCatNameText,
72 | ),
73 | ),
74 | model.isBusy
75 | ? const Expanded(child: Center(child: LoadingWidget()))
76 | : Expanded(
77 | child: GridView.builder(
78 | padding: EdgeInsets.fromLTRB(16.w, 5.h, 16.w, 10.h),
79 | physics: const BouncingScrollPhysics(),
80 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
81 | crossAxisCount: 2,
82 | mainAxisSpacing: 12.h, //spaceTopBottom
83 | crossAxisSpacing: 12.w, //spaceLeftRight
84 | childAspectRatio: getDeviceType() == Constants.phone
85 | ? 1 / 1.675
86 | : 1 / 1.5,
87 | ),
88 | itemCount: model.categoryMeals.length,
89 | itemBuilder: (context, pos) => MealView(
90 | meal: model.categoryMeals[pos],
91 | ),
92 | ),
93 | ),
94 | ],
95 | ),
96 | );
97 | },
98 | );
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/lib/services/api_service.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:dio/dio.dart';
4 |
5 | import '../models/models.dart';
6 | import 'services.dart';
7 | import '../app/app.locator.dart';
8 | import '../app/app.logger.dart';
9 |
10 | /// ApiService is a service for REST APIs used in this app
11 | class ApiService {
12 | final log = getLogger('ApiService');
13 |
14 | final apiRootService = locator();
15 |
16 | //------------------ TABLES APIS ---------------------//
17 |
18 | /// GETS all existing tables from server
19 | Future> getTables() async {
20 | List tables = [];
21 | try {
22 | Response response = await apiRootService.dio.get('tables/');
23 | log.v('RESPONSE: api/tables/ => ${response.data}');
24 |
25 | if (response.data != null && response.statusCode == 200) {
26 | for (final singleTable in response.data) {
27 | tables.add(TableModel.fromJson(singleTable));
28 | }
29 | }
30 |
31 | return tables;
32 | } on DioError catch (error) {
33 | log.v('ERROR on api/tables/ :${error.response}');
34 | throw DioErrorType.response;
35 | }
36 | }
37 |
38 | //------------------ HOME APIS ---------------------//
39 |
40 | Future> getCategories() async {
41 | List categories = [];
42 | try {
43 | Response response = await apiRootService.dio.get('categories/');
44 | // log.v('RESPONSE: api/categories/ => ${response.data}');
45 |
46 | if (response.data != null && response.statusCode == 200) {
47 | for (final mainCategory in response.data) {
48 | categories.add(CategoryModel.fromJson(mainCategory));
49 | }
50 | }
51 | return categories;
52 | } catch (error) {
53 | log.v('ERROR on api/categories/ :$error');
54 | rethrow;
55 | }
56 | }
57 |
58 | //------------------ CATEGORY APIS ---------------------//
59 |
60 | Future getCategoryMeals({
61 | required int categoryId,
62 | Function(List)? onSuccess,
63 | Function()? onFail,
64 | }) async {
65 | List categoryMeals = [];
66 | try {
67 | Response response =
68 | await apiRootService.dio.get('categories/$categoryId/');
69 | // log.v('RESPONSE: api/categories/$categoryId/ => ${response.data}');
70 |
71 | if (response.data != null && response.statusCode == 200) {
72 | for (final categoryMeal in response.data) {
73 | categoryMeals.add(MealModel.fromJson(categoryMeal));
74 | }
75 |
76 | onSuccess!(categoryMeals);
77 | } else {
78 | onFail!();
79 | }
80 | } on DioError catch (error) {
81 | log.v('ERROR on api/categories/$categoryId/ :${error.response}');
82 | onFail!();
83 | throw DioErrorType.response;
84 | }
85 | }
86 |
87 | //------------------ CREATE ORDER API ---------------------//
88 |
89 | Future createOrder(
90 | HiveTable hiveTable,
91 | List cartMeals,
92 | Function()? onSuccess,
93 | Function()? onFail,
94 | ) async {
95 | List? orderMeals = [];
96 |
97 | /// Step 1. For each cartMeal in cartMeals, creating and assigning to orderItemList
98 | for (HiveMeal cartMeal in cartMeals) {
99 | orderMeals.add(CreateOrderItem(
100 | mealId: cartMeal.id,
101 | quantity: cartMeal.quantity,
102 | ));
103 | }
104 |
105 | /// Step 2. CREATE new order
106 | CreateOrder createOrder = CreateOrder(
107 | tableId: hiveTable.id,
108 | orderMeals: orderMeals,
109 | );
110 |
111 | log.i('_createOrder.toJson(): ${createOrder.toJson()}');
112 | log.i('_createOrder with jsonEncode: ${jsonEncode(createOrder)}');
113 |
114 | try {
115 | Response response = await apiRootService.dio.post(
116 | 'orders/',
117 | data: jsonEncode(
118 | createOrder), // Step 3. Instead of using formData I used jsonSerializable's toJson with built-in jsonEncode func
119 | );
120 | log.v('RESPONSE: orders/ => ${response.data}');
121 |
122 | if (response.data != null &&
123 | (response.statusCode == 200 || response.statusCode == 201)) {
124 | onSuccess!();
125 | } else {
126 | onFail!();
127 | }
128 | } on DioError catch (error) {
129 | log.v('ERROR orders/ with RESPONSE: ${error.response}');
130 | onFail!();
131 | throw DioErrorType.response;
132 | }
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/lib/ui/cart/cart_view_model.dart:
--------------------------------------------------------------------------------
1 | import '../../models/hive_models/hive_table.dart';
2 | import 'package:stacked/stacked.dart';
3 | import 'package:stacked_services/stacked_services.dart';
4 | import '../../app/app.locator.dart';
5 | import '../../app/app.logger.dart';
6 | import '../../app/app.router.dart';
7 | import '../../generated/locale_keys.g.dart';
8 | import '../../models/cart_meal_dialog_data.dart';
9 | import '../../models/hive_models/hive_meal.dart';
10 | import '../../services/services.dart';
11 | import '../../shared/shared.dart';
12 |
13 | class CartViewModel extends ReactiveViewModel {
14 | final log = getLogger('CartViewModel');
15 |
16 | final _api = locator();
17 | final _hiveDbService = locator();
18 | final _dialogService = locator();
19 | final _navService = locator();
20 |
21 | HiveTable get selectedHiveTable => _hiveDbService.selectedHiveTable;
22 | List get cartMeals => _hiveDbService.cartMeals;
23 |
24 | /// CLEARS CART
25 | Future clearCart() async {
26 | log.i('clearCart()');
27 |
28 | await _hiveDbService.clearCart();
29 | await _navService.pushNamedAndRemoveUntil(Routes.homeView);
30 | }
31 |
32 | /// GETS total cart meals' SUM
33 | num get getTotalCartMealsSum {
34 | num totalCartSum = 0;
35 | for (HiveMeal cartMeal in _hiveDbService.cartMeals) {
36 | totalCartSum += cartMeal.price! * cartMeal.quantity!;
37 | }
38 |
39 | return totalCartSum;
40 | }
41 |
42 | //------------------------ Clear CART DIALOG PART ----------------------------//
43 |
44 | /// SHOWS Clear CART Dialog
45 | Future showClearCartDialog(CartViewModel cartViewModel) async {
46 | log.i('showClearCartDialog()');
47 | await _dialogService.showCustomDialog(
48 | variant: DialogType.clearCart,
49 | title: LocaleKeys.wannaClearCart,
50 | mainButtonTitle: LocaleKeys.no,
51 | secondaryButtonTitle: LocaleKeys.letsClearCart,
52 | showIconInMainButton: false,
53 | barrierDismissible: true,
54 | data: cartViewModel,
55 | );
56 | }
57 |
58 | //------------------------ CART MEAL REMOVE DIALOG ----------------------------//
59 |
60 | /// SHOWS CART MEAL REMOVE Dialog
61 | Future showRemoveCartMealDialog(
62 | CartViewModel cartViewModel, HiveMeal cartMeal) async {
63 | log.i('showRemoveCartMealDialog()');
64 | await _dialogService.showCustomDialog(
65 | variant: DialogType.removeCartMeal,
66 | title: LocaleKeys.wannaRemoveMeal,
67 | mainButtonTitle: LocaleKeys.no,
68 | secondaryButtonTitle: LocaleKeys.remove,
69 | showIconInMainButton: false,
70 | barrierDismissible: true,
71 | data: CartMealDialogData(
72 | cartViewModel: cartViewModel,
73 | cartMeal: cartMeal,
74 | ),
75 | );
76 | }
77 |
78 | //------------------------ CART MEAL ----------------------------//
79 |
80 | /// GETS total cart meal's SUM
81 | num getTotalMealSum(HiveMeal cartMeal) {
82 | num totalCartMealSum = 0;
83 | totalCartMealSum += cartMeal.price!;
84 | totalCartMealSum *= cartMeal.quantity!;
85 | return totalCartMealSum;
86 | }
87 |
88 | /// UPDATES cartMeal. If cartMeals is empty then navBack bc CartView is empty
89 | Future updateCartMealInCart(
90 | HiveMeal cartMeal,
91 | int? mealQuantity,
92 | ) async {
93 | log.i(
94 | 'updateCartMealInCart() cartMeal.id: ${cartMeal.id}, mealQuantity: $mealQuantity');
95 |
96 | await _hiveDbService.updateCartMealInCart(cartMeal, mealQuantity);
97 |
98 | if (cartMeals.isEmpty) {
99 | await _navService.pushNamedAndRemoveUntil(Routes.homeView);
100 | }
101 |
102 | notifyListeners();
103 | }
104 |
105 | /// CREATES a new order
106 | Future createOrder({Function()? onFailForView}) async =>
107 | await runBusyFuture(
108 | _api.createOrder(
109 | selectedHiveTable,
110 | cartMeals,
111 | () async {
112 | await _hiveDbService.clearCart();
113 | await _navService.pushNamedAndRemoveUntil(Routes.successView);
114 | },
115 | () => onFailForView!(),
116 | ),
117 | );
118 |
119 | //------------------------ NAVIGATION ----------------------------//
120 | void navBack() => _navService.back(result: true);
121 |
122 | /// NAVIGATES to Home by removing all previous routes
123 | Future navToHomeByRemovingAll() async =>
124 | await _navService.pushNamedAndRemoveUntil(Routes.homeView);
125 |
126 | @override
127 | List get reactiveServices => [_hiveDbService];
128 | }
129 |
--------------------------------------------------------------------------------
/assets/success.json:
--------------------------------------------------------------------------------
1 | {"v":"4.8.0","meta":{"g":"LottieFiles AE 1.0.0","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":130,"w":512,"h":512,"nm":"HDFC Success","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"check","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[256,256,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-82.5,4.5],[-31,55],[73,-52.5]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[1],"y":[0.076]},"t":60,"s":[0]},{"t":85,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":30,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[256,257.86,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0,0,0.833],"y":[0.98,0.98,-66.114]},"o":{"x":[0.656,0.656,0.167],"y":[0.872,0.872,67.114]},"t":20,"s":[0,0,100]},{"t":60,"s":[150,150,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[236,236],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.8901960784313725,0.7529411764705882,0.5254901960784314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,-3],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.626],"y":[0.729]},"o":{"x":[0.912],"y":[0.073]},"t":76,"s":[100]},{"t":119,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[256,257.86,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0,0,0.667],"y":[0.999,0.999,1]},"o":{"x":[0.477,0.477,0.333],"y":[0.587,0.587,0]},"t":10,"s":[0,0,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":50,"s":[150,150,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":76,"s":[150,150,100]},{"t":123,"s":[210,210,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[236,236],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.9450980392156862,0.8549019607843137,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,-3],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"BG","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[256,256,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[554,556],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1,6],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":240,"op":240,"st":0,"bm":0,"hidden":240}],"markers":[]}
--------------------------------------------------------------------------------
/lib/ui/tables/tables_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_svg/flutter_svg.dart';
4 | import 'package:stacked/stacked.dart';
5 | import '../../generated/locale_keys.g.dart';
6 | import '../../shared/shared.dart';
7 | import '../../widgets/widgets.dart';
8 | import 'tables_view_model.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 |
11 | class TablesView extends StatelessWidget {
12 | const TablesView({Key? key}) : super(key: key);
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return ViewModelBuilder.reactive(
17 | builder: (context, model, child) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | backgroundColor: kcSecondaryDarkColor,
21 | elevation: 0.5,
22 | centerTitle: true,
23 | title: Text(
24 | LocaleKeys.tables,
25 | style: ktsCartTitleText,
26 | ).tr(),
27 | ),
28 | body: model.isBusy
29 | ? const Center(child: LoadingWidget())
30 | : GridView.builder(
31 | padding:
32 | EdgeInsets.symmetric(horizontal: 22.w, vertical: 15.h),
33 | physics: const BouncingScrollPhysics(),
34 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
35 | crossAxisCount: 2,
36 | mainAxisSpacing: 20.h, //spaceTopBottom
37 | crossAxisSpacing: 20.w, //spaceLeftRight
38 | childAspectRatio:
39 | getDeviceType() == Constants.phone ? 1 / 0.85 : 1 / 0.8,
40 | ),
41 | itemCount: model.tables.length,
42 | itemBuilder: (context, pos) =>
43 | LayoutBuilder(builder: (context, constraints) {
44 | return GestureDetector(
45 | onTap: () => model.addTableToHive(model.tables[pos]),
46 | child: Container(
47 | decoration: BoxDecoration(
48 | color: kcSecondaryDarkColor,
49 | borderRadius: kbr50,
50 | ),
51 | width: constraints.maxWidth,
52 | child: Column(
53 | children: [
54 | model.tables[pos].id == model.selectedHiveTable.id
55 | ? Padding(
56 | padding: EdgeInsets.only(top: 20.h),
57 | child: Row(
58 | mainAxisAlignment:
59 | MainAxisAlignment.center,
60 | children: [
61 | Text(
62 | model.tables[pos].name ?? '',
63 | style: ktsCartMealPriceText,
64 | ),
65 | SizedBox(width: 5.w),
66 | const Icon(
67 | Icons.check,
68 | color: kcFontColor,
69 | )
70 | ],
71 | ),
72 | )
73 | : Padding(
74 | padding: EdgeInsets.only(top: 20.h),
75 | child: Text(
76 | model.tables[pos].name ?? '',
77 | style: ktsCartMealPriceText,
78 | ),
79 | ),
80 | Padding(
81 | padding: EdgeInsets.symmetric(
82 | vertical: 10.h,
83 | horizontal: 15.w,
84 | ),
85 | child: SvgPicture.asset(
86 | 'assets/table.svg',
87 | color: kcFontColor,
88 | width: constraints.maxWidth / 1.6,
89 | ),
90 | ),
91 | ],
92 | ),
93 | ),
94 | );
95 | }),
96 | ),
97 | );
98 | },
99 | viewModelBuilder: () => TablesViewModel(),
100 | );
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/assets/logo_name.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/table_logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | ]>
13 |
63 |
--------------------------------------------------------------------------------