diff --git a/android/app/build.gradle b/android/app/build.gradle index f251401..6a78e7c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -48,7 +48,7 @@ android { applicationId "com.example.food_delivery" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion flutter.minSdkVersion + minSdkVersion 19 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..a6a98e1 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "386113379551", + "project_id": "food-delivery-5ccf6", + "storage_bucket": "food-delivery-5ccf6.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:386113379551:android:5de50f5cca859d8b2f5d6a", + "android_client_info": { + "package_name": "com.example.food_delivery" + } + }, + "oauth_client": [ + { + "client_id": "386113379551-mf393pb7ulp3kobavfb920jb19sqqqo9.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyB4dx-pxLS8uYja7UG-GfBAVAUgq9rdBY8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "386113379551-mf393pb7ulp3kobavfb920jb19sqqqo9.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java new file mode 100644 index 0000000..752fc18 --- /dev/null +++ b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -0,0 +1,25 @@ +// Generated file. +// +// If you wish to remove Flutter's multidex support, delete this entire file. +// +// Modifications to this file should be done in a copy under a different name +// as this file may be regenerated. + +package io.flutter.app; + +import android.app.Application; +import android.content.Context; +import androidx.annotation.CallSuper; +import androidx.multidex.MultiDex; + +/** + * Extension of {@link android.app.Application}, adding multidex support. + */ +public class FlutterMultiDexApplication extends Application { + @Override + @CallSuper + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } +} diff --git a/assets/fonts/Merriweather-Black.ttf b/assets/fonts/Merriweather-Black.ttf new file mode 100644 index 0000000..50c3b33 Binary files /dev/null and b/assets/fonts/Merriweather-Black.ttf differ diff --git a/assets/fonts/Merriweather-BlackItalic.ttf b/assets/fonts/Merriweather-BlackItalic.ttf new file mode 100644 index 0000000..4879aba Binary files /dev/null and b/assets/fonts/Merriweather-BlackItalic.ttf differ diff --git a/assets/fonts/Merriweather-Bold.ttf b/assets/fonts/Merriweather-Bold.ttf new file mode 100644 index 0000000..3e10e02 Binary files /dev/null and b/assets/fonts/Merriweather-Bold.ttf differ diff --git a/assets/fonts/Merriweather-BoldItalic.ttf b/assets/fonts/Merriweather-BoldItalic.ttf new file mode 100644 index 0000000..5b9d0ec Binary files /dev/null and b/assets/fonts/Merriweather-BoldItalic.ttf differ diff --git a/assets/fonts/Merriweather-Italic.ttf b/assets/fonts/Merriweather-Italic.ttf new file mode 100644 index 0000000..8e9d03d Binary files /dev/null and b/assets/fonts/Merriweather-Italic.ttf differ diff --git a/assets/fonts/Merriweather-Light.ttf b/assets/fonts/Merriweather-Light.ttf new file mode 100644 index 0000000..034ef03 Binary files /dev/null and b/assets/fonts/Merriweather-Light.ttf differ diff --git a/assets/fonts/Merriweather-LightItalic.ttf b/assets/fonts/Merriweather-LightItalic.ttf new file mode 100644 index 0000000..4d19550 Binary files /dev/null and b/assets/fonts/Merriweather-LightItalic.ttf differ diff --git a/assets/fonts/Merriweather-Regular.ttf b/assets/fonts/Merriweather-Regular.ttf new file mode 100644 index 0000000..3fecc77 Binary files /dev/null and b/assets/fonts/Merriweather-Regular.ttf differ diff --git a/assets/image/nothing_founded_icon.svg b/assets/image/nothing_founded_icon.svg new file mode 100644 index 0000000..186eab2 --- /dev/null +++ b/assets/image/nothing_founded_icon.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/analysis_options.yaml b/core/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/core/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/core/lib/config/di/app_di.dart b/core/lib/config/di/app_di.dart new file mode 100644 index 0000000..9236a69 --- /dev/null +++ b/core/lib/config/di/app_di.dart @@ -0,0 +1,17 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:navigation/navigation.dart'; + +import 'data_di.dart'; + +final AppDI appDI = AppDI(); + +class AppDI { + void initDependencies() async { + DataDI().initDependencies(); + + final FirebaseFirestore fireStore = FirebaseFirestore.instance; + instance.registerLazySingleton(() => fireStore); + + setupNavigationDependencies(); + } +} diff --git a/core/lib/config/di/data_di.dart b/core/lib/config/di/data_di.dart new file mode 100644 index 0000000..0fcd4f5 --- /dev/null +++ b/core/lib/config/di/data_di.dart @@ -0,0 +1,56 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:data/providers/menu_provider.dart'; +import 'package:data/repositories/menu_repository_impl/menu_repository_impl.dart'; +import 'package:domain/repositories/menu_repository.dart'; +import 'package:domain/usecases/fetch_menu_items_usecase.dart'; +import 'package:firebase_core/firebase_core.dart'; +import 'package:get_it/get_it.dart'; + +import 'firebase_options.dart'; + +final DataDI dataDI = DataDI(); +final GetIt instance = GetIt.instance; + +class DataDI { + Future initDependencies() async { + _initFirebaseOptions(); + _initFirebase(); + _initDataProvider(); + _initMenuItems(); + } + + void _initFirebaseOptions() { + instance.registerLazySingleton( + () => DefaultFirebaseOptions.currentPlatform, + ); + } + + void _initFirebase() async { + await Firebase.initializeApp( + name: "food delivery", + options: instance(), + ); + } + + void _initDataProvider() { + instance.registerLazySingleton( + () => MenuDataProvider( + FirebaseFirestore.instance, + ), + ); + } + + void _initMenuItems() { + instance.registerLazySingleton( + () => MenuRepositoryImpl( + menuDataProvider: instance.get(), + ), + ); + + instance.registerLazySingleton( + () => FetchMenuItemsUseCase( + menuRepository: instance.get(), + ), + ); + } +} diff --git a/core/lib/config/di/firebase_options.dart b/core/lib/config/di/firebase_options.dart new file mode 100644 index 0000000..a8fb199 --- /dev/null +++ b/core/lib/config/di/firebase_options.dart @@ -0,0 +1,75 @@ +// File generated by FlutterFire CLI. +// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + return web; + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for macos - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } + } + + static const FirebaseOptions web = FirebaseOptions( + apiKey: 'AIzaSyDC8Gnj6LAoYqNlgFfUe9Cs-jFgwja0rAY', + appId: '1:386113379551:web:6bd17e1c219f76252f5d6a', + messagingSenderId: '386113379551', + projectId: 'food-delivery-5ccf6', + authDomain: 'food-delivery-5ccf6.firebaseapp.com', + storageBucket: 'food-delivery-5ccf6.appspot.com', + ); + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyB4dx-pxLS8uYja7UG-GfBAVAUgq9rdBY8', + appId: '1:386113379551:android:5de50f5cca859d8b2f5d6a', + messagingSenderId: '386113379551', + projectId: 'food-delivery-5ccf6', + storageBucket: 'food-delivery-5ccf6.appspot.com', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyBY0Lh5bRGs4vOulq6T5SQ4F1BoirDSexI', + appId: '1:386113379551:ios:878c5cd3e8bc58482f5d6a', + messagingSenderId: '386113379551', + projectId: 'food-delivery-5ccf6', + storageBucket: 'food-delivery-5ccf6.appspot.com', + iosClientId: '386113379551-1ipl3s6v4u7o92mandq2nteojh2nl8q5.apps.googleusercontent.com', + iosBundleId: 'com.example.foodDelivery', + ); +} diff --git a/core/lib/core.dart b/core/lib/core.dart new file mode 100644 index 0000000..e3327b6 --- /dev/null +++ b/core/lib/core.dart @@ -0,0 +1,6 @@ +library core; + +export 'package:flutter_bloc/flutter_bloc.dart'; +export 'package:cloud_firestore/cloud_firestore.dart'; +export 'config/di/app_di.dart'; +export 'config/di/data_di.dart'; diff --git a/core/pubspec.lock b/core/pubspec.lock new file mode 100644 index 0000000..c50cce7 --- /dev/null +++ b/core/pubspec.lock @@ -0,0 +1,466 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + core_ui: + dependency: transitive + description: + path: "../core_ui" + relative: true + source: path + version: "0.0.1" + data: + dependency: "direct main" + description: + path: "../data" + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: "direct main" + description: + path: "../domain" + relative: true + source: path + version: "0.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + get_it: + dependency: "direct main" + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + main_page_view: + dependency: transitive + description: + path: "../features/main_page_view" + relative: true + source: path + version: "0.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + navigation: + dependency: "direct main" + description: + path: "../navigation" + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: transitive + description: + path: "../features/order_history" + relative: true + source: path + version: "0.0.1" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + settings: + dependency: transitive + description: + path: "../features/settings" + relative: true + source: path + version: "0.0.1" + shopping_cart: + dependency: transitive + description: + path: "../features/shopping_cart" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.7.0-0" diff --git a/core/pubspec.yaml b/core/pubspec.yaml new file mode 100644 index 0000000..a90be60 --- /dev/null +++ b/core/pubspec.yaml @@ -0,0 +1,30 @@ +name: core +version: 0.0.1 +publish_to: none +description: Project core module + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + data: + path: ../data + domain: + path: ../domain + navigation: + path: ../navigation + + cloud_firestore: ^4.8.1 + firebase_core: ^2.14.0 + + get_it: ^7.6.0 + flutter_bloc: ^8.1.2 + +dev_dependencies: + flutter_test: + sdk: flutter + + flutter_lints: ^2.0.0 diff --git a/core_ui/analysis_options.yaml b/core_ui/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/core_ui/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/core_ui/lib/core_ui.dart b/core_ui/lib/core_ui.dart new file mode 100644 index 0000000..e3c80de --- /dev/null +++ b/core_ui/lib/core_ui.dart @@ -0,0 +1,4 @@ +library core_ui; + +export 'src/theme/theme.dart'; +export 'src/widgets/widgets.dart'; diff --git a/core_ui/lib/src/theme/app_colors.dart b/core_ui/lib/src/theme/app_colors.dart new file mode 100644 index 0000000..5635a6f --- /dev/null +++ b/core_ui/lib/src/theme/app_colors.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +class AppColors { + ///general colors + static const Color primaryColor = Color(0xFFF5A12E); + static const Color primaryLightColor = Color(0xFFFFE0B2); + static const Color primaryDarkColor = Color(0xFF393D38); + + static const Color secondaryColor = Color(0xFFF5A12E); + static const Color secondaryDarkColor = Color(0xFFF69818); + static const Color unselectedItemColor = Color(0xFF9D9D9E); + + ///text colors + static const Color titleTextColor = Color(0xFF282828); + static const Color titleLightTextColor = Color(0xFFE2E2E3); + static const Color titleGreyTextColor = Color(0xFFC5C5C9); + static const Color titleDarkGreyTextColor = Color(0xFF86868A); + static const Color descriptionTextColor = Color(0xFF3B3B3B); + static const Color primaryButtonTextColor = Color(0xFFF4F4F4); + + ///background colors + static const Color backgroundColor = Color(0xFFF3EFEF); + static const Color backgroundBottomNavigationBarColor = Color(0xFFFCFCFC); + static const Color backgroundItemColor = Color(0xFFFFE0B2); + static const Color backgroundItemDarkColor = Color(0xFF9E773A); + static const Color backgroundDarkColor = Color(0xFFA27938); + + ///gradient + static List primaryGradient = [ + primaryLightColor, + primaryColor, + ]; +} diff --git a/core_ui/lib/src/theme/app_styles.dart b/core_ui/lib/src/theme/app_styles.dart new file mode 100644 index 0000000..53d4878 --- /dev/null +++ b/core_ui/lib/src/theme/app_styles.dart @@ -0,0 +1,16 @@ +import 'package:flutter/material.dart'; + +class AppStyles { + static final defaultBorderRadius = BorderRadius.circular(15); + static final largeBorderRadius = BorderRadius.circular(80); + + static final boxShadow = BoxShadow( + color: const Color(0xFFC0C2BF).withOpacity(0.2), + spreadRadius: 0, + blurRadius: 50, + offset: const Offset( + 0, + 3, + ), + ); +} diff --git a/core_ui/lib/src/theme/app_text_styles.dart b/core_ui/lib/src/theme/app_text_styles.dart new file mode 100644 index 0000000..e348e0a --- /dev/null +++ b/core_ui/lib/src/theme/app_text_styles.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; + +class AppTextStyles { + static const String _merriweatherFamily = 'Merriweather'; + + static TextStyle size14WeightBoldText(Color color) { + return TextStyle( + fontFamily: _merriweatherFamily, + fontSize: 14, + fontWeight: FontWeight.w600, + color: color, + ); + } + + static TextStyle size16WeightMediumText(Color color) { + return TextStyle( + fontFamily: _merriweatherFamily, + fontSize: 16, + fontWeight: FontWeight.w400, + color: color, + ); + } + + static TextStyle size16WeightSemiBoldText(Color color) { + return TextStyle( + fontFamily: _merriweatherFamily, + fontSize: 16, + fontWeight: FontWeight.w600, + color: color, + ); + } + + static TextStyle size18WeightSemiBoldText(Color color) { + return TextStyle( + fontFamily: _merriweatherFamily, + fontSize: 18, + fontWeight: FontWeight.w600, + color: color, + ); + } + + static TextStyle size20WeightSemiBoldText(Color color) { + return TextStyle( + fontFamily: _merriweatherFamily, + fontSize: 20, + fontWeight: FontWeight.w600, + color: color, + ); + } + + static TextStyle size22WeightSemiBoldText(Color color) { + return TextStyle( + fontFamily: _merriweatherFamily, + fontSize: 22, + fontWeight: FontWeight.w600, + color: color, + ); + } + + static TextStyle size24WeightBoldText(Color color) { + return TextStyle( + fontFamily: _merriweatherFamily, + fontSize: 24, + fontWeight: FontWeight.w700, + color: color, + ); + } +} diff --git a/core_ui/lib/src/theme/app_theme.dart b/core_ui/lib/src/theme/app_theme.dart new file mode 100644 index 0000000..95cd7ec --- /dev/null +++ b/core_ui/lib/src/theme/app_theme.dart @@ -0,0 +1,92 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class AppTheme { + ThemeData lightThemeData = ThemeData( + scaffoldBackgroundColor: AppColors.backgroundColor, + useMaterial3: true, + primaryColor: AppColors.primaryColor, + canvasColor: AppColors.secondaryColor, + cardColor: AppColors.backgroundItemColor, + disabledColor: AppColors.unselectedItemColor, + + /// text styles + textTheme: TextTheme( + titleLarge: AppTextStyles.size20WeightSemiBoldText( + AppColors.titleTextColor, + ), + titleMedium: AppTextStyles.size18WeightSemiBoldText( + AppColors.secondaryColor, + ), + titleSmall: AppTextStyles.size16WeightMediumText( + AppColors.titleDarkGreyTextColor, + ), + bodyMedium: AppTextStyles.size16WeightSemiBoldText( + AppColors.secondaryColor, + ), + bodyLarge: AppTextStyles.size18WeightSemiBoldText( + AppColors.titleTextColor, + ), + ), + + /// app bar styles + appBarTheme: AppBarTheme( + titleSpacing: 30, + backgroundColor: AppColors.primaryColor, + titleTextStyle: AppTextStyles.size24WeightBoldText( + AppColors.primaryButtonTextColor, + ), + ), + + /// navigation bar styles + bottomNavigationBarTheme: const BottomNavigationBarThemeData( + backgroundColor: AppColors.backgroundBottomNavigationBarColor, + selectedItemColor: AppColors.primaryColor, + unselectedItemColor: AppColors.unselectedItemColor, + ), + ); + + ThemeData darkThemeData = ThemeData( + scaffoldBackgroundColor: AppColors.backgroundDarkColor, + useMaterial3: true, + primaryColor: AppColors.primaryLightColor, + canvasColor: AppColors.secondaryColor, + cardColor: AppColors.backgroundItemDarkColor, + disabledColor: AppColors.titleDarkGreyTextColor, + + /// text styles + textTheme: TextTheme( + titleLarge: AppTextStyles.size20WeightSemiBoldText( + AppColors.titleLightTextColor, + ), + titleMedium: AppTextStyles.size18WeightSemiBoldText( + AppColors.secondaryDarkColor, + ), + titleSmall: AppTextStyles.size16WeightMediumText( + AppColors.titleGreyTextColor, + ), + bodyMedium: AppTextStyles.size16WeightSemiBoldText( + AppColors.secondaryDarkColor, + ), + bodyLarge: AppTextStyles.size18WeightSemiBoldText( + AppColors.titleLightTextColor, + ), + ), + + /// app bar styles + appBarTheme: AppBarTheme( + titleSpacing: 30, + backgroundColor: AppColors.primaryDarkColor, + titleTextStyle: AppTextStyles.size24WeightBoldText( + AppColors.primaryButtonTextColor, + ), + ), + + /// navigation bar styles + bottomNavigationBarTheme: const BottomNavigationBarThemeData( + backgroundColor: AppColors.primaryDarkColor, + selectedItemColor: AppColors.primaryLightColor, + unselectedItemColor: AppColors.primaryButtonTextColor, + ), + ); +} diff --git a/core_ui/lib/src/theme/theme.dart b/core_ui/lib/src/theme/theme.dart new file mode 100644 index 0000000..416d0ec --- /dev/null +++ b/core_ui/lib/src/theme/theme.dart @@ -0,0 +1,4 @@ +export 'app_colors.dart'; +export 'app_styles.dart'; +export 'app_text_styles.dart'; +export 'app_theme.dart'; diff --git a/core_ui/lib/src/widgets/app_bar.dart b/core_ui/lib/src/widgets/app_bar.dart new file mode 100644 index 0000000..3d14f81 --- /dev/null +++ b/core_ui/lib/src/widgets/app_bar.dart @@ -0,0 +1,44 @@ +import 'package:core/core.dart'; +import 'package:flutter/material.dart'; +import 'package:main_page_view/main_page.dart'; + +import '../../core_ui.dart'; + +class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { + const CustomAppBar({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (BuildContext context, AppThemeState state) { + return AppBar( + title: const Text('Food Delivery'), + backgroundColor: Theme.of(context).appBarTheme.backgroundColor, + titleSpacing: Theme.of(context).appBarTheme.titleSpacing, + titleTextStyle: Theme.of(context).appBarTheme.titleTextStyle, + actions: [ + Padding( + padding: const EdgeInsets.only(right: 10), + child: IconButton( + icon: Icon( + state.isLight + ? Icons.brightness_4_rounded + : Icons.brightness_2_outlined, + ), + color: AppColors.backgroundColor, + onPressed: () { + context.read().add( + (AppThemeChangingEvent()), + ); + }, + ), + ), + ], + ); + }, + ); + } + + @override + Size get preferredSize => const Size.fromHeight(kToolbarHeight); +} diff --git a/core_ui/lib/src/widgets/bottom_navigation_bar.dart b/core_ui/lib/src/widgets/bottom_navigation_bar.dart new file mode 100644 index 0000000..b4005c5 --- /dev/null +++ b/core_ui/lib/src/widgets/bottom_navigation_bar.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; + +class CustomBottomNavigationBar extends StatelessWidget { + final int currentIndex; + final void Function(int) onTap; + + const CustomBottomNavigationBar({ + Key? key, + required this.currentIndex, + required this.onTap, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + final List items = [ + const BottomNavigationBarItem( + icon: Icon(Icons.home_outlined), + label: 'Home', + ), + const BottomNavigationBarItem( + icon: Icon(Icons.shopping_cart_outlined), + label: 'Cart', + ), + const BottomNavigationBarItem( + icon: Icon(Icons.history_outlined), + label: 'Orders', + ), + const BottomNavigationBarItem( + icon: Icon(Icons.settings), + label: 'Settings', + ) + ]; + + return BottomNavigationBar( + currentIndex: currentIndex, + onTap: onTap, + items: items, + type: BottomNavigationBarType.fixed, + backgroundColor: + Theme.of(context).bottomNavigationBarTheme.backgroundColor, + selectedItemColor: + Theme.of(context).bottomNavigationBarTheme.selectedItemColor, + unselectedItemColor: + Theme.of(context).bottomNavigationBarTheme.unselectedItemColor, + ); + } +} diff --git a/core_ui/lib/src/widgets/buttons/buttons.dart b/core_ui/lib/src/widgets/buttons/buttons.dart new file mode 100644 index 0000000..ca35c5d --- /dev/null +++ b/core_ui/lib/src/widgets/buttons/buttons.dart @@ -0,0 +1 @@ +export 'primary_button.dart'; diff --git a/core_ui/lib/src/widgets/buttons/primary_button.dart b/core_ui/lib/src/widgets/buttons/primary_button.dart new file mode 100644 index 0000000..e8433c6 --- /dev/null +++ b/core_ui/lib/src/widgets/buttons/primary_button.dart @@ -0,0 +1,36 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class PrimaryButton extends StatelessWidget { + final VoidCallback onPressed; + final String buttonTitle; + + const PrimaryButton({ + required this.onPressed, + required this.buttonTitle, + super.key, + }); + + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: onPressed, + style: ElevatedButton.styleFrom( + backgroundColor: AppColors.primaryColor, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(15)), + ), + ), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), + child: Text( + buttonTitle, + textAlign: TextAlign.center, + style: AppTextStyles.size22WeightSemiBoldText( + AppColors.primaryButtonTextColor, + ), + ), + ), + ); + } +} diff --git a/core_ui/lib/src/widgets/custom_bullet_point.dart b/core_ui/lib/src/widgets/custom_bullet_point.dart new file mode 100644 index 0000000..49e56a1 --- /dev/null +++ b/core_ui/lib/src/widgets/custom_bullet_point.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; + +class CustomDotPoint extends StatelessWidget { + const CustomDotPoint({super.key}); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + + return Container( + height: size.height * 0.01, + width: size.width * 0.01, + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + shape: BoxShape.circle, + ), + ); + } +} diff --git a/core_ui/lib/src/widgets/image_placeholder.dart b/core_ui/lib/src/widgets/image_placeholder.dart new file mode 100644 index 0000000..c9a01a7 --- /dev/null +++ b/core_ui/lib/src/widgets/image_placeholder.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; + +import '../../core_ui.dart'; + +class ImagePlaceholder extends StatelessWidget { + final IconData iconData; + final double iconSize; + + const ImagePlaceholder({ + Key? key, + required this.iconData, + required this.iconSize, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: AppColors.primaryGradient, + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Icon( + iconData, + color: AppColors.primaryButtonTextColor, + size: iconSize, + ), + ); + } +} diff --git a/core_ui/lib/src/widgets/loading_indicator.dart b/core_ui/lib/src/widgets/loading_indicator.dart new file mode 100644 index 0000000..0eaa2fd --- /dev/null +++ b/core_ui/lib/src/widgets/loading_indicator.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; + +import '../../core_ui.dart'; + +class LoadingIndicator extends StatelessWidget { + const LoadingIndicator({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return const Center( + child: SpinKitSpinningLines( + color: AppColors.primaryColor, + ), + ); + } +} diff --git a/core_ui/lib/src/widgets/widgets.dart b/core_ui/lib/src/widgets/widgets.dart new file mode 100644 index 0000000..76b95fd --- /dev/null +++ b/core_ui/lib/src/widgets/widgets.dart @@ -0,0 +1,6 @@ +export 'image_placeholder.dart'; +export 'loading_indicator.dart'; +export 'bottom_navigation_bar.dart'; +export 'app_bar.dart'; +export 'buttons/buttons.dart'; +export 'custom_bullet_point.dart'; diff --git a/core_ui/pubspec.lock b/core_ui/pubspec.lock new file mode 100644 index 0000000..90392cf --- /dev/null +++ b/core_ui/pubspec.lock @@ -0,0 +1,466 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + core: + dependency: "direct main" + description: + path: "../core" + relative: true + source: path + version: "0.0.1" + data: + dependency: transitive + description: + path: "../data" + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: "direct main" + description: + path: "../domain" + relative: true + source: path + version: "0.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: "direct main" + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + main_page_view: + dependency: "direct main" + description: + path: "../features/main_page_view" + relative: true + source: path + version: "0.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + navigation: + dependency: "direct main" + description: + path: "../navigation" + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: transitive + description: + path: "../features/order_history" + relative: true + source: path + version: "0.0.1" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + settings: + dependency: transitive + description: + path: "../features/settings" + relative: true + source: path + version: "0.0.1" + shopping_cart: + dependency: transitive + description: + path: "../features/shopping_cart" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.7.0-0" diff --git a/core_ui/pubspec.yaml b/core_ui/pubspec.yaml new file mode 100644 index 0000000..96db448 --- /dev/null +++ b/core_ui/pubspec.yaml @@ -0,0 +1,28 @@ +name: core_ui +version: 0.0.1 +publish_to: none +description: Project Core UI module + +environment: + sdk: '>=3.0.5 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + + flutter_spinkit: ^5.2.0 + + core: + path: ../core + domain: + path: ../domain + main_page_view: + path: ../features/main_page_view + navigation: + path: ../navigation + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 diff --git a/data/analysis_options.yaml b/data/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/data/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/data/lib/data.dart b/data/lib/data.dart new file mode 100644 index 0000000..f123f7a --- /dev/null +++ b/data/lib/data.dart @@ -0,0 +1,3 @@ +library data; + +export 'package:dio/dio.dart'; diff --git a/data/lib/entity/menu_item_entity.dart b/data/lib/entity/menu_item_entity.dart new file mode 100644 index 0000000..71128a3 --- /dev/null +++ b/data/lib/entity/menu_item_entity.dart @@ -0,0 +1,19 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'menu_item_entity.freezed.dart'; +part 'menu_item_entity.g.dart'; + +@freezed +class MenuItemEntity with _$MenuItemEntity { + factory MenuItemEntity({ + required int id, + required String title, + required double cost, + required String image, + required String description, + required List ingredients, + }) = _MenuItemEntity; + + factory MenuItemEntity.fromJson(Map json) => + _$MenuItemEntityFromJson(json); +} diff --git a/data/lib/entity/menu_item_entity.freezed.dart b/data/lib/entity/menu_item_entity.freezed.dart new file mode 100644 index 0000000..b63c55e --- /dev/null +++ b/data/lib/entity/menu_item_entity.freezed.dart @@ -0,0 +1,264 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'menu_item_entity.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +MenuItemEntity _$MenuItemEntityFromJson(Map json) { + return _MenuItemEntity.fromJson(json); +} + +/// @nodoc +mixin _$MenuItemEntity { + int get id => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + double get cost => throw _privateConstructorUsedError; + String get image => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + List get ingredients => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $MenuItemEntityCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $MenuItemEntityCopyWith<$Res> { + factory $MenuItemEntityCopyWith( + MenuItemEntity value, $Res Function(MenuItemEntity) then) = + _$MenuItemEntityCopyWithImpl<$Res, MenuItemEntity>; + @useResult + $Res call( + {int id, + String title, + double cost, + String image, + String description, + List ingredients}); +} + +/// @nodoc +class _$MenuItemEntityCopyWithImpl<$Res, $Val extends MenuItemEntity> + implements $MenuItemEntityCopyWith<$Res> { + _$MenuItemEntityCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? title = null, + Object? cost = null, + Object? image = null, + Object? description = null, + Object? ingredients = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + cost: null == cost + ? _value.cost + : cost // ignore: cast_nullable_to_non_nullable + as double, + image: null == image + ? _value.image + : image // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + ingredients: null == ingredients + ? _value.ingredients + : ingredients // ignore: cast_nullable_to_non_nullable + as List, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_MenuItemEntityCopyWith<$Res> + implements $MenuItemEntityCopyWith<$Res> { + factory _$$_MenuItemEntityCopyWith( + _$_MenuItemEntity value, $Res Function(_$_MenuItemEntity) then) = + __$$_MenuItemEntityCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {int id, + String title, + double cost, + String image, + String description, + List ingredients}); +} + +/// @nodoc +class __$$_MenuItemEntityCopyWithImpl<$Res> + extends _$MenuItemEntityCopyWithImpl<$Res, _$_MenuItemEntity> + implements _$$_MenuItemEntityCopyWith<$Res> { + __$$_MenuItemEntityCopyWithImpl( + _$_MenuItemEntity _value, $Res Function(_$_MenuItemEntity) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? title = null, + Object? cost = null, + Object? image = null, + Object? description = null, + Object? ingredients = null, + }) { + return _then(_$_MenuItemEntity( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + cost: null == cost + ? _value.cost + : cost // ignore: cast_nullable_to_non_nullable + as double, + image: null == image + ? _value.image + : image // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + ingredients: null == ingredients + ? _value._ingredients + : ingredients // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_MenuItemEntity implements _MenuItemEntity { + _$_MenuItemEntity( + {required this.id, + required this.title, + required this.cost, + required this.image, + required this.description, + required final List ingredients}) + : _ingredients = ingredients; + + factory _$_MenuItemEntity.fromJson(Map json) => + _$$_MenuItemEntityFromJson(json); + + @override + final int id; + @override + final String title; + @override + final double cost; + @override + final String image; + @override + final String description; + final List _ingredients; + @override + List get ingredients { + if (_ingredients is EqualUnmodifiableListView) return _ingredients; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_ingredients); + } + + @override + String toString() { + return 'MenuItemEntity(id: $id, title: $title, cost: $cost, image: $image, description: $description, ingredients: $ingredients)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_MenuItemEntity && + (identical(other.id, id) || other.id == id) && + (identical(other.title, title) || other.title == title) && + (identical(other.cost, cost) || other.cost == cost) && + (identical(other.image, image) || other.image == image) && + (identical(other.description, description) || + other.description == description) && + const DeepCollectionEquality() + .equals(other._ingredients, _ingredients)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, id, title, cost, image, + description, const DeepCollectionEquality().hash(_ingredients)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_MenuItemEntityCopyWith<_$_MenuItemEntity> get copyWith => + __$$_MenuItemEntityCopyWithImpl<_$_MenuItemEntity>(this, _$identity); + + @override + Map toJson() { + return _$$_MenuItemEntityToJson( + this, + ); + } +} + +abstract class _MenuItemEntity implements MenuItemEntity { + factory _MenuItemEntity( + {required final int id, + required final String title, + required final double cost, + required final String image, + required final String description, + required final List ingredients}) = _$_MenuItemEntity; + + factory _MenuItemEntity.fromJson(Map json) = + _$_MenuItemEntity.fromJson; + + @override + int get id; + @override + String get title; + @override + double get cost; + @override + String get image; + @override + String get description; + @override + List get ingredients; + @override + @JsonKey(ignore: true) + _$$_MenuItemEntityCopyWith<_$_MenuItemEntity> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/data/lib/entity/menu_item_entity.g.dart b/data/lib/entity/menu_item_entity.g.dart new file mode 100644 index 0000000..80ecda9 --- /dev/null +++ b/data/lib/entity/menu_item_entity.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'menu_item_entity.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$_MenuItemEntity _$$_MenuItemEntityFromJson(Map json) => + _$_MenuItemEntity( + id: json['id'] as int, + title: json['title'] as String, + cost: (json['cost'] as num).toDouble(), + image: json['image'] as String, + description: json['description'] as String, + ingredients: (json['ingredients'] as List) + .map((e) => e as String) + .toList(), + ); + +Map _$$_MenuItemEntityToJson(_$_MenuItemEntity instance) => + { + 'id': instance.id, + 'title': instance.title, + 'cost': instance.cost, + 'image': instance.image, + 'description': instance.description, + 'ingredients': instance.ingredients, + }; diff --git a/data/lib/mappers/menu_item_mapper.dart b/data/lib/mappers/menu_item_mapper.dart new file mode 100644 index 0000000..c6c29b4 --- /dev/null +++ b/data/lib/mappers/menu_item_mapper.dart @@ -0,0 +1,27 @@ +import 'package:domain/models/menu_item_model/menu_item_model.dart'; + +import '../entity/menu_item_entity.dart'; + +abstract class MenuItemMapper { + static MenuItemEntity toEntity(MenuItemModel model) { + return MenuItemEntity( + id: model.id, + title: model.title, + cost: model.cost, + image: model.image, + description: model.description, + ingredients: model.ingredients, + ); + } + + static MenuItemModel toModel(MenuItemEntity entity) { + return MenuItemModel( + id: entity.id, + title: entity.title, + cost: entity.cost, + image: entity.image, + description: entity.description, + ingredients: entity.ingredients, + ); + } +} diff --git a/data/lib/providers/menu_provider.dart b/data/lib/providers/menu_provider.dart new file mode 100644 index 0000000..be3c852 --- /dev/null +++ b/data/lib/providers/menu_provider.dart @@ -0,0 +1,18 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:data/entity/menu_item_entity.dart'; + +class MenuDataProvider { + final FirebaseFirestore _firestore; + + MenuDataProvider(this._firestore); + + Future> fetchMenuItems() async { + final querySnapshot = await _firestore.collection('menu').get(); + + return querySnapshot.docs + .map( + (doc) => MenuItemEntity.fromJson(doc.data()), + ) + .toList(); + } +} diff --git a/data/lib/repositories/menu_repository_impl/menu_repository_impl.dart b/data/lib/repositories/menu_repository_impl/menu_repository_impl.dart new file mode 100644 index 0000000..283c2fc --- /dev/null +++ b/data/lib/repositories/menu_repository_impl/menu_repository_impl.dart @@ -0,0 +1,24 @@ +import 'dart:async'; + +import 'package:data/entity/menu_item_entity.dart'; +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:domain/repositories/menu_repository.dart'; + +import '../../mappers/menu_item_mapper.dart'; +import '../../providers/menu_provider.dart'; + +class MenuRepositoryImpl implements MenuRepository { + final MenuDataProvider _menuDataProvider; + + MenuRepositoryImpl({required MenuDataProvider menuDataProvider}) + : _menuDataProvider = menuDataProvider; + + @override + Future> fetchMenuItems() async { + final List menuItems = + await _menuDataProvider.fetchMenuItems(); + return menuItems + .map((MenuItemEntity e) => MenuItemMapper.toModel(e)) + .toList(); + } +} diff --git a/data/pubspec.lock b/data/pubspec.lock new file mode 100644 index 0000000..c09e190 --- /dev/null +++ b/data/pubspec.lock @@ -0,0 +1,778 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" + source: hosted + version: "2.4.6" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" + url: "https://pub.dev" + source: hosted + version: "7.2.10" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" + url: "https://pub.dev" + source: hosted + version: "8.6.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" + url: "https://pub.dev" + source: hosted + version: "4.5.0" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + core: + dependency: "direct main" + description: + path: "../core" + relative: true + source: path + version: "0.0.1" + core_ui: + dependency: transitive + description: + path: "../core_ui" + relative: true + source: path + version: "0.0.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + dio: + dependency: "direct main" + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: "direct main" + description: + path: "../domain" + relative: true + source: path + version: "0.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: a9520490532087cf38bf3f7de478ab6ebeb5f68bb1eb2641546d92719b224445 + url: "https://pub.dev" + source: hosted + version: "2.3.5" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 + url: "https://pub.dev" + source: hosted + version: "6.7.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + main_page_view: + dependency: transitive + description: + path: "../features/main_page_view" + relative: true + source: path + version: "0.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + navigation: + dependency: transitive + description: + path: "../navigation" + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: transitive + description: + path: "../features/order_history" + relative: true + source: path + version: "0.0.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + settings: + dependency: transitive + description: + path: "../features/settings" + relative: true + source: path + version: "0.0.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + shopping_cart: + dependency: transitive + description: + path: "../features/shopping_cart" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + url: "https://pub.dev" + source: hosted + version: "1.3.4" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.7.0-0" diff --git a/data/pubspec.yaml b/data/pubspec.yaml new file mode 100644 index 0000000..f7dadfa --- /dev/null +++ b/data/pubspec.yaml @@ -0,0 +1,28 @@ +name: data +description: Project data module. +version: 0.0.1 +publish_to: none + +environment: + sdk: '>=3.0.5 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + core: + path: ../core + domain: + path: ../domain + + dio: ^4.0.6 + freezed_annotation: ^2.2.0 + json_annotation: ^4.8.1 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + json_serializable: ^6.7.0 + build_runner: ^2.4.5 + freezed: ^2.3.5 diff --git a/domain/analysis_options.yaml b/domain/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/domain/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/domain/lib/domain.dart b/domain/lib/domain.dart new file mode 100644 index 0000000..bb77d0f --- /dev/null +++ b/domain/lib/domain.dart @@ -0,0 +1,3 @@ +library domain; + +export 'package:domain/repositories/menu_repository.dart'; diff --git a/domain/lib/models/menu_item_model/menu_item_model.dart b/domain/lib/models/menu_item_model/menu_item_model.dart new file mode 100644 index 0000000..f4e0cea --- /dev/null +++ b/domain/lib/models/menu_item_model/menu_item_model.dart @@ -0,0 +1,15 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'menu_item_model.freezed.dart'; + +@freezed +class MenuItemModel with _$MenuItemModel { + factory MenuItemModel({ + required int id, + required String title, + required double cost, + required String image, + required String description, + required List ingredients, + }) = _MenuItemModel; +} diff --git a/domain/lib/models/menu_item_model/menu_item_model.freezed.dart b/domain/lib/models/menu_item_model/menu_item_model.freezed.dart new file mode 100644 index 0000000..94ad7a8 --- /dev/null +++ b/domain/lib/models/menu_item_model/menu_item_model.freezed.dart @@ -0,0 +1,245 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'menu_item_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +mixin _$MenuItemModel { + int get id => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + double get cost => throw _privateConstructorUsedError; + String get image => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + List get ingredients => throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $MenuItemModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $MenuItemModelCopyWith<$Res> { + factory $MenuItemModelCopyWith( + MenuItemModel value, $Res Function(MenuItemModel) then) = + _$MenuItemModelCopyWithImpl<$Res, MenuItemModel>; + @useResult + $Res call( + {int id, + String title, + double cost, + String image, + String description, + List ingredients}); +} + +/// @nodoc +class _$MenuItemModelCopyWithImpl<$Res, $Val extends MenuItemModel> + implements $MenuItemModelCopyWith<$Res> { + _$MenuItemModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? title = null, + Object? cost = null, + Object? image = null, + Object? description = null, + Object? ingredients = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + cost: null == cost + ? _value.cost + : cost // ignore: cast_nullable_to_non_nullable + as double, + image: null == image + ? _value.image + : image // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + ingredients: null == ingredients + ? _value.ingredients + : ingredients // ignore: cast_nullable_to_non_nullable + as List, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_MenuItemModelCopyWith<$Res> + implements $MenuItemModelCopyWith<$Res> { + factory _$$_MenuItemModelCopyWith( + _$_MenuItemModel value, $Res Function(_$_MenuItemModel) then) = + __$$_MenuItemModelCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {int id, + String title, + double cost, + String image, + String description, + List ingredients}); +} + +/// @nodoc +class __$$_MenuItemModelCopyWithImpl<$Res> + extends _$MenuItemModelCopyWithImpl<$Res, _$_MenuItemModel> + implements _$$_MenuItemModelCopyWith<$Res> { + __$$_MenuItemModelCopyWithImpl( + _$_MenuItemModel _value, $Res Function(_$_MenuItemModel) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? title = null, + Object? cost = null, + Object? image = null, + Object? description = null, + Object? ingredients = null, + }) { + return _then(_$_MenuItemModel( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + cost: null == cost + ? _value.cost + : cost // ignore: cast_nullable_to_non_nullable + as double, + image: null == image + ? _value.image + : image // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + ingredients: null == ingredients + ? _value._ingredients + : ingredients // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// @nodoc + +class _$_MenuItemModel implements _MenuItemModel { + _$_MenuItemModel( + {required this.id, + required this.title, + required this.cost, + required this.image, + required this.description, + required final List ingredients}) + : _ingredients = ingredients; + + @override + final int id; + @override + final String title; + @override + final double cost; + @override + final String image; + @override + final String description; + final List _ingredients; + @override + List get ingredients { + if (_ingredients is EqualUnmodifiableListView) return _ingredients; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_ingredients); + } + + @override + String toString() { + return 'MenuItemModel(id: $id, title: $title, cost: $cost, image: $image, description: $description, ingredients: $ingredients)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_MenuItemModel && + (identical(other.id, id) || other.id == id) && + (identical(other.title, title) || other.title == title) && + (identical(other.cost, cost) || other.cost == cost) && + (identical(other.image, image) || other.image == image) && + (identical(other.description, description) || + other.description == description) && + const DeepCollectionEquality() + .equals(other._ingredients, _ingredients)); + } + + @override + int get hashCode => Object.hash(runtimeType, id, title, cost, image, + description, const DeepCollectionEquality().hash(_ingredients)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_MenuItemModelCopyWith<_$_MenuItemModel> get copyWith => + __$$_MenuItemModelCopyWithImpl<_$_MenuItemModel>(this, _$identity); +} + +abstract class _MenuItemModel implements MenuItemModel { + factory _MenuItemModel( + {required final int id, + required final String title, + required final double cost, + required final String image, + required final String description, + required final List ingredients}) = _$_MenuItemModel; + + @override + int get id; + @override + String get title; + @override + double get cost; + @override + String get image; + @override + String get description; + @override + List get ingredients; + @override + @JsonKey(ignore: true) + _$$_MenuItemModelCopyWith<_$_MenuItemModel> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/domain/lib/models/shopping_cart_model/shopping_cart_item_model.dart b/domain/lib/models/shopping_cart_model/shopping_cart_item_model.dart new file mode 100644 index 0000000..34eccb9 --- /dev/null +++ b/domain/lib/models/shopping_cart_model/shopping_cart_item_model.dart @@ -0,0 +1,26 @@ +import '../menu_item_model/menu_item_model.dart'; + +class ShoppingCartItemModel { + final MenuItemModel menuItem; + int amount; + + ShoppingCartItemModel({ + required this.menuItem, + required this.amount, + }); + + ShoppingCartItemModel copyWith({ + MenuItemModel? menuItem, + int? amount, + }) { + return ShoppingCartItemModel( + menuItem: menuItem ?? this.menuItem, + amount: amount ?? this.amount, + ); + } + + List get props => [ + menuItem, + amount, + ]; +} diff --git a/domain/lib/models/shopping_cart_model/shopping_cart_model.dart b/domain/lib/models/shopping_cart_model/shopping_cart_model.dart new file mode 100644 index 0000000..04d5d11 --- /dev/null +++ b/domain/lib/models/shopping_cart_model/shopping_cart_model.dart @@ -0,0 +1,31 @@ +import 'package:domain/models/shopping_cart_model/shopping_cart_item_model.dart'; + +class ShoppingCartModel { + final List shoppingCartItems; + final double totalPrice; + final bool addCutlery; + + const ShoppingCartModel({ + required this.shoppingCartItems, + required this.totalPrice, + required this.addCutlery, + }); + + ShoppingCartModel copyWith({ + List? shoppingCartItems, + double? totalPrice, + bool? addCutlery, + }) { + return ShoppingCartModel( + shoppingCartItems: shoppingCartItems ?? this.shoppingCartItems, + totalPrice: totalPrice ?? this.totalPrice, + addCutlery: addCutlery ?? this.addCutlery, + ); + } + + List get props => [ + shoppingCartItems, + totalPrice, + addCutlery, + ]; +} diff --git a/domain/lib/repositories/menu_repository.dart b/domain/lib/repositories/menu_repository.dart new file mode 100644 index 0000000..5b741f9 --- /dev/null +++ b/domain/lib/repositories/menu_repository.dart @@ -0,0 +1,5 @@ +import 'package:domain/models/menu_item_model/menu_item_model.dart'; + +abstract class MenuRepository { + Future> fetchMenuItems(); +} diff --git a/domain/lib/usecases/fetch_menu_items_usecase.dart b/domain/lib/usecases/fetch_menu_items_usecase.dart new file mode 100644 index 0000000..f3c3983 --- /dev/null +++ b/domain/lib/usecases/fetch_menu_items_usecase.dart @@ -0,0 +1,17 @@ +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:domain/usecases/usecase.dart'; + +import '../repositories/menu_repository.dart'; + +class FetchMenuItemsUseCase + implements FutureUseCase> { + final MenuRepository _menuRepository; + + const FetchMenuItemsUseCase({required MenuRepository menuRepository}) + : _menuRepository = menuRepository; + + @override + Future> execute(NoParams input) async { + return _menuRepository.fetchMenuItems(); + } +} diff --git a/domain/lib/usecases/usecase.dart b/domain/lib/usecases/usecase.dart new file mode 100644 index 0000000..d6be936 --- /dev/null +++ b/domain/lib/usecases/usecase.dart @@ -0,0 +1,7 @@ +abstract class FutureUseCase { + Future execute(Input input); +} + +class NoParams { + const NoParams(); +} diff --git a/domain/pubspec.lock b/domain/pubspec.lock new file mode 100644 index 0000000..5121ddc --- /dev/null +++ b/domain/pubspec.lock @@ -0,0 +1,778 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" + source: hosted + version: "2.4.6" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" + url: "https://pub.dev" + source: hosted + version: "7.2.10" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" + url: "https://pub.dev" + source: hosted + version: "8.6.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" + url: "https://pub.dev" + source: hosted + version: "4.5.0" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + core: + dependency: "direct main" + description: + path: "../core" + relative: true + source: path + version: "0.0.1" + core_ui: + dependency: transitive + description: + path: "../core_ui" + relative: true + source: path + version: "0.0.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + data: + dependency: transitive + description: + path: "../data" + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: a9520490532087cf38bf3f7de478ab6ebeb5f68bb1eb2641546d92719b224445 + url: "https://pub.dev" + source: hosted + version: "2.3.5" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 + url: "https://pub.dev" + source: hosted + version: "6.7.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + main_page_view: + dependency: transitive + description: + path: "../features/main_page_view" + relative: true + source: path + version: "0.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + navigation: + dependency: transitive + description: + path: "../navigation" + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: transitive + description: + path: "../features/order_history" + relative: true + source: path + version: "0.0.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + settings: + dependency: transitive + description: + path: "../features/settings" + relative: true + source: path + version: "0.0.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + shopping_cart: + dependency: transitive + description: + path: "../features/shopping_cart" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + url: "https://pub.dev" + source: hosted + version: "1.3.4" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.7.0-0" diff --git a/domain/pubspec.yaml b/domain/pubspec.yaml new file mode 100644 index 0000000..b547fc7 --- /dev/null +++ b/domain/pubspec.yaml @@ -0,0 +1,25 @@ +name: domain +version: 0.0.1 +publish_to: none +description: Project domain module + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + core: + path: ../core + + freezed_annotation: ^2.2.0 + json_annotation: ^4.8.1 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + json_serializable: ^6.7.0 + build_runner: ^2.4.5 + freezed: ^2.3.5 diff --git a/features/main_page_view/lib/main_page.dart b/features/main_page_view/lib/main_page.dart new file mode 100644 index 0000000..5c376be --- /dev/null +++ b/features/main_page_view/lib/main_page.dart @@ -0,0 +1,6 @@ +library main_page_view; + +export 'src/ui/main_page.dart'; +export 'src/bloc/bloc.dart'; +export 'src/ui/components/main_page_screen.dart'; +export 'src/ui/components/menu_item_details_screen.dart'; diff --git a/features/main_page_view/lib/src/bloc/app_theme/bloc.dart b/features/main_page_view/lib/src/bloc/app_theme/bloc.dart new file mode 100644 index 0000000..eef69e1 --- /dev/null +++ b/features/main_page_view/lib/src/bloc/app_theme/bloc.dart @@ -0,0 +1,19 @@ +import 'package:core/core.dart'; + +part 'event.dart'; +part 'state.dart'; + +class AppThemeBloc extends Bloc { + AppThemeBloc() : super(const AppThemeState(isLight: true)) { + on(_appThemeChanged); + } + + _appThemeChanged( + AppThemeEvent event, + Emitter emit, + ) { + emit( + state.copyWith(isLight: !state.isLight), + ); + } +} diff --git a/features/main_page_view/lib/src/bloc/app_theme/event.dart b/features/main_page_view/lib/src/bloc/app_theme/event.dart new file mode 100644 index 0000000..d11ed85 --- /dev/null +++ b/features/main_page_view/lib/src/bloc/app_theme/event.dart @@ -0,0 +1,7 @@ +part of 'bloc.dart'; + +abstract class AppThemeEvent {} + +class AppThemeChangingEvent extends AppThemeEvent { + AppThemeChangingEvent(); +} diff --git a/features/main_page_view/lib/src/bloc/app_theme/state.dart b/features/main_page_view/lib/src/bloc/app_theme/state.dart new file mode 100644 index 0000000..bad4ea5 --- /dev/null +++ b/features/main_page_view/lib/src/bloc/app_theme/state.dart @@ -0,0 +1,15 @@ +part of 'bloc.dart'; + +class AppThemeState { + final bool isLight; + + const AppThemeState({ + required this.isLight, + }); + + AppThemeState copyWith({required bool isLight}) { + return AppThemeState( + isLight: isLight, + ); + } +} diff --git a/features/main_page_view/lib/src/bloc/bloc.dart b/features/main_page_view/lib/src/bloc/bloc.dart new file mode 100644 index 0000000..a2cccc8 --- /dev/null +++ b/features/main_page_view/lib/src/bloc/bloc.dart @@ -0,0 +1,3 @@ +export 'main_page/bloc.dart'; +export 'app_theme/bloc.dart'; +export 'navigate_to_page/bloc.dart'; diff --git a/features/main_page_view/lib/src/bloc/main_page/bloc.dart b/features/main_page_view/lib/src/bloc/main_page/bloc.dart new file mode 100644 index 0000000..33361a7 --- /dev/null +++ b/features/main_page_view/lib/src/bloc/main_page/bloc.dart @@ -0,0 +1,37 @@ +import 'package:bloc/bloc.dart'; +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:domain/usecases/fetch_menu_items_usecase.dart'; +import 'package:domain/usecases/usecase.dart'; + +part 'event.dart'; + +part 'state.dart'; + +class MenuBloc extends Bloc { + final FetchMenuItemsUseCase _fetchMenuItemsUseCase; + + MenuBloc({required FetchMenuItemsUseCase fetchMenuItemsUseCase}) + : _fetchMenuItemsUseCase = fetchMenuItemsUseCase, + super(EmptyState()) { + on(_onLoadMenu); + + add(InitEvent()); + } + + Future _onLoadMenu( + InitEvent event, + Emitter emit, + ) async { + emit(MenuLoadingState()); + try { + final List menu = await _fetchMenuItemsUseCase.execute( + const NoParams(), + ); + emit(MenuLoadedState(menu: menu)); + } catch (e, _) { + emit( + MenuErrorState(errorMessage: e.toString()), + ); + } + } +} diff --git a/features/main_page_view/lib/src/bloc/main_page/event.dart b/features/main_page_view/lib/src/bloc/main_page/event.dart new file mode 100644 index 0000000..1c841d7 --- /dev/null +++ b/features/main_page_view/lib/src/bloc/main_page/event.dart @@ -0,0 +1,7 @@ +part of 'bloc.dart'; + +abstract class MenuEvent {} + +class InitEvent extends MenuEvent {} + +class LoadMenuEvent extends MenuEvent {} diff --git a/features/main_page_view/lib/src/bloc/main_page/state.dart b/features/main_page_view/lib/src/bloc/main_page/state.dart new file mode 100644 index 0000000..256c7e2 --- /dev/null +++ b/features/main_page_view/lib/src/bloc/main_page/state.dart @@ -0,0 +1,19 @@ +part of 'bloc.dart'; + +abstract class MenuState {} + +class EmptyState extends MenuState {} + +class MenuLoadingState extends MenuState {} + +class MenuLoadedState extends MenuState { + final List menu; + + MenuLoadedState({required this.menu}); +} + +class MenuErrorState extends MenuState { + final String errorMessage; + + MenuErrorState({required this.errorMessage}); +} diff --git a/features/main_page_view/lib/src/bloc/navigate_to_page/bloc.dart b/features/main_page_view/lib/src/bloc/navigate_to_page/bloc.dart new file mode 100644 index 0000000..9854c5e --- /dev/null +++ b/features/main_page_view/lib/src/bloc/navigate_to_page/bloc.dart @@ -0,0 +1,43 @@ +import 'package:core/core.dart'; +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:navigation/navigation.dart'; + +part 'event.dart'; +part 'state.dart'; + +class NavigateToPageBloc + extends Bloc { + NavigateToPageBloc() : super(NavigateToPageState()) { + on(_onNavigateBack); + on(_onNavigateToMenuItem); + on(_onNavigateToMainPage); + } + + void _onNavigateBack( + NavigateBackEvent event, + Emitter emit, + ) { + AutoRouter.of(event.context).pop(); + } + + void _onNavigateToMenuItem( + NavigateToMenuItemEvent event, + Emitter emit, + ) { + AutoRouter.of(event.context).push( + MenuItemDetailsScreenRoute( + menuItem: event.menuItem, + ), + ); + } + + void _onNavigateToMainPage( + NavigateToMainPageEvent event, + Emitter emit, + ) { + AutoRouter.of(event.context).push( + const MainPageRoute(), + ); + } +} diff --git a/features/main_page_view/lib/src/bloc/navigate_to_page/event.dart b/features/main_page_view/lib/src/bloc/navigate_to_page/event.dart new file mode 100644 index 0000000..3edc483 --- /dev/null +++ b/features/main_page_view/lib/src/bloc/navigate_to_page/event.dart @@ -0,0 +1,29 @@ +part of 'bloc.dart'; + +abstract class NavigateToPageEvent {} + +class NavigateBackEvent extends NavigateToPageEvent { + final BuildContext context; + + NavigateBackEvent({ + required this.context, + }); +} + +class NavigateToMenuItemEvent extends NavigateToPageEvent { + final MenuItemModel menuItem; + final BuildContext context; + + NavigateToMenuItemEvent({ + required this.menuItem, + required this.context, + }); +} + +class NavigateToMainPageEvent extends NavigateToPageEvent { + final BuildContext context; + + NavigateToMainPageEvent({ + required this.context, + }); +} diff --git a/features/main_page_view/lib/src/bloc/navigate_to_page/state.dart b/features/main_page_view/lib/src/bloc/navigate_to_page/state.dart new file mode 100644 index 0000000..8a0564c --- /dev/null +++ b/features/main_page_view/lib/src/bloc/navigate_to_page/state.dart @@ -0,0 +1,13 @@ +part of 'bloc.dart'; + +class NavigateToPageState { + final String? route; + + NavigateToPageState({this.route}); + + NavigateToPageState copyWith({String? route}) { + return NavigateToPageState( + route: route, + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/main_page_screen.dart b/features/main_page_view/lib/src/ui/components/main_page_screen.dart new file mode 100644 index 0000000..ead71de --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/main_page_screen.dart @@ -0,0 +1,61 @@ +import 'package:core/core.dart'; +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +import '../../bloc/bloc.dart'; +import 'menu_list_items.dart'; + +class MainPageScreen extends StatefulWidget { + const MainPageScreen({Key? key}) : super(key: key); + + @override + State createState() => _MainPageScreenState(); +} + +class _MainPageScreenState extends State { + final ScrollController _scrollController = ScrollController(); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + + return Scaffold( + body: SafeArea( + child: Container( + height: size.height, + padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), + child: Center( + child: SingleChildScrollView( + controller: _scrollController, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 20), + ], + ), + BlocBuilder( + builder: (BuildContext context, MenuState state) { + if (state is MenuLoadingState) { + return const LoadingIndicator(); + } + if (state is MenuLoadedState) { + return MenuListItems(menu: state.menu); + } else { + return const Center( + child: Text('Error loading dishes'), + ); + } + }, + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/menu_item.dart b/features/main_page_view/lib/src/ui/components/menu_item.dart new file mode 100644 index 0000000..7e85856 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/menu_item.dart @@ -0,0 +1,84 @@ +import 'package:core/core.dart'; +import 'package:core_ui/core_ui.dart'; +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:domain/models/shopping_cart_model/shopping_cart_item_model.dart'; +import 'package:flutter/material.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item/menu_item_image.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item/menu_item_title.dart'; +import 'package:shopping_cart/shopping_cart.dart'; + +import 'widgets/menu_item/item_list_button.dart'; + +class MenuItem extends StatefulWidget { + final MenuItemModel menuItem; + final VoidCallback onTap; + + const MenuItem({ + super.key, + required this.menuItem, + required this.onTap, + }); + + @override + State createState() => _MenuItemState(); +} + +class _MenuItemState extends State { + @override + Widget build(BuildContext context) { + final ShoppingCartBloc shoppingCartBloc = context.read(); + + ShoppingCartItemModel? findItemInShoppingCart(MenuItemModel menuItem) { + for (final item + in shoppingCartBloc.state.shoppingCart.shoppingCartItems) { + if (item.menuItem == widget.menuItem) { + return item; + } + } + return null; + } + + return BlocBuilder( + builder: (context, state) { + return Ink( + child: InkWell( + borderRadius: AppStyles.largeBorderRadius, + onTap: widget.onTap, + child: Padding( + padding: const EdgeInsets.only(bottom: 10), + child: Stack( + children: [ + MenuItemTitle( + title: widget.menuItem.title, + cost: widget.menuItem.cost, + ), + MenuItemImage( + image: widget.menuItem.image, + ), + Positioned( + right: 10, + bottom: 40, + child: SizedBox( + width: 75, + height: 75, + child: ItemListButton( + amount: findItemInShoppingCart(widget.menuItem)?.amount, + onPressed: () { + shoppingCartBloc.add( + AddShoppingCartItemEvent( + menuItem: widget.menuItem, + ), + ); + }, + ), + ) + ) + ], + ), + ), + ), + ); + }, + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/menu_item_details_screen.dart b/features/main_page_view/lib/src/ui/components/menu_item_details_screen.dart new file mode 100644 index 0000000..23855a3 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/menu_item_details_screen.dart @@ -0,0 +1,114 @@ +import 'package:core/core.dart'; +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:domain/models/shopping_cart_model/shopping_cart_item_model.dart'; +import 'package:flutter/material.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item_details/back_to_previous_page_button.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item_details/decoration_block.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item_details/menu_item_details_bottom_bar.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item_details/menu_item_details_description.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item_details/menu_item_details_image.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item_details/menu_item_details_ingredients.dart'; +import 'package:main_page_view/src/ui/components/widgets/menu_item_details/menu_item_details_title.dart'; +import 'package:shopping_cart/shopping_cart.dart'; + +import '../../../main_page.dart'; + +class MenuItemDetailsScreen extends StatefulWidget { + final MenuItemModel menuItem; + + const MenuItemDetailsScreen({ + super.key, + required this.menuItem, + }); + + @override + State createState() => _MenuItemDetailsScreenState(); +} + +class _MenuItemDetailsScreenState extends State { + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + final ShoppingCartBloc shoppingCartBloc = context.read(); + final NavigateToPageBloc navigateToPageBloc = + context.read(); + + ShoppingCartItemModel? findItemInShoppingCart(MenuItemModel menuItem) { + for (final item + in shoppingCartBloc.state.shoppingCart.shoppingCartItems) { + if (item.menuItem == widget.menuItem) { + return item; + } + } + return null; + } + + return BlocBuilder( + builder: (context, state) { + return Scaffold( + bottomNavigationBar: MenuItemDetailsBottomBar( + amount: findItemInShoppingCart(widget.menuItem)?.amount, + onPressed: () { + shoppingCartBloc.add( + AddShoppingCartItemEvent( + menuItem: widget.menuItem, + ), + ); + }, + ), + body: CustomScrollView( + slivers: [ + SliverAppBar( + leading: BackToPreviousPageButton( + onPressed: () { + navigateToPageBloc.add( + NavigateBackEvent( + context: context, + ), + ); + }, + ), + expandedHeight: size.height * 0.4, + flexibleSpace: Stack( + children: [ + FlexibleSpaceBar( + background: MenuItemDetailsImage( + image: widget.menuItem.image, + ), + ), + const DecorationBlock(), + ], + ), + ), + SliverToBoxAdapter( + child: Container( + padding: const EdgeInsets.fromLTRB(30, 0, 30, 40), + color: Theme.of(context).cardColor, + height: size.height * 0.6, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 20), + MenuItemDetailsTitle( + title: widget.menuItem.title, + cost: widget.menuItem.cost, + ), + const SizedBox(height: 20), + MenuItemDetailsDescription( + description: widget.menuItem.description, + ), + const SizedBox(height: 20), + MenuItemDetailsIngredients( + ingredients: widget.menuItem.ingredients, + ), + ], + ), + ), + ), + ], + ), + ); + }, + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/menu_list_items.dart b/features/main_page_view/lib/src/ui/components/menu_list_items.dart new file mode 100644 index 0000000..c464cb4 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/menu_list_items.dart @@ -0,0 +1,44 @@ +import 'package:core/core.dart'; +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:flutter/material.dart'; + +import '../../../main_page.dart'; +import 'menu_item.dart'; + +class MenuListItems extends StatelessWidget { + final List menu; + + const MenuListItems({ + Key? key, + required this.menu, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + final NavigateToPageBloc navigateToPageBloc = context.read(); + + return ListView.builder( + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: menu.length, + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.only(bottom: 10), + child: MenuItem( + key: ValueKey(menu[index].id), + menuItem: menu[index], + onTap: () { + navigateToPageBloc.add( + NavigateToMenuItemEvent( + context: context, + menuItem: menu[index], + ), + ); + }, + ), + ); + }, + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item/item_list_button.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item/item_list_button.dart new file mode 100644 index 0000000..b4116a6 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item/item_list_button.dart @@ -0,0 +1,77 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class ItemListButton extends StatefulWidget { + final VoidCallback onPressed; + final int? amount; + + const ItemListButton({ + Key? key, + required this.onPressed, + required this.amount, + }) : super(key: key); + + @override + ItemListButtonState createState() => ItemListButtonState(); +} + +class ItemListButtonState extends State { + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + + return Ink( + child: InkWell( + child: CircleAvatar( + minRadius: 13, + backgroundColor: widget.amount != null + ? Theme.of(context).canvasColor + : Theme.of(context).primaryColor, + child: Container( + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: IconButton( + onPressed: widget.onPressed, + icon: Stack( + children: [ + widget.amount != null + ? Stack( + children: [ + Icon( + Icons.shopping_cart, + color: AppColors.primaryButtonTextColor, + size: size.width / 12, + ), + Positioned( + right: 6, + top: 1.5, + child: Container( + width: size.width * 0.05, + padding: const EdgeInsets.all(0), + child: Center( + child: Text( + widget.amount.toString(), + style: AppTextStyles.size14WeightBoldText( + AppColors.descriptionTextColor, + ), + ), + ), + ), + ), + ], + ) + : Icon( + Icons.shopping_cart_outlined, + color: AppColors.primaryButtonTextColor, + size: size.width / 12, + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item/menu_item_image.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item/menu_item_image.dart new file mode 100644 index 0000000..da6f4d8 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item/menu_item_image.dart @@ -0,0 +1,36 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class MenuItemImage extends StatelessWidget { + final String image; + + const MenuItemImage({ + super.key, + required this.image, + }); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + + return Container( + height: size.height / 6, + width: size.width / 2.85, + decoration: BoxDecoration( + color: AppColors.backgroundItemColor, + borderRadius: BorderRadius.circular(100), + boxShadow: [AppStyles.boxShadow], + ), + child: ClipOval( + child: image.isEmpty + ? const ImagePlaceholder( + iconData: Icons.fastfood_rounded, + iconSize: 50, + ) + : Image.network( + image, + ), + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item/menu_item_title.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item/menu_item_title.dart new file mode 100644 index 0000000..6e89b62 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item/menu_item_title.dart @@ -0,0 +1,56 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class MenuItemTitle extends StatelessWidget { + final String title; + final double cost; + + const MenuItemTitle({ + super.key, + required this.title, + required this.cost, + }); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + + return Align( + alignment: Alignment.centerRight, + child: Container( + height: size.height / 6, + width: size.width / 1.2, + alignment: Alignment.centerLeft, + decoration: BoxDecoration( + borderRadius: AppStyles.largeBorderRadius, + color: Theme.of(context).cardColor, + ), + child: Align( + alignment: Alignment.center, + child: Container( + width: size.width / 2, + padding: const EdgeInsets.only(left: 40), + alignment: Alignment.centerLeft, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + title, + style: Theme.of(context).textTheme.titleLarge, + ), + const SizedBox(height: 40), + Text( + '\$$cost', + style: AppTextStyles.size22WeightSemiBoldText( + Theme.of(context).primaryColor, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/add_to_cart_button.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/add_to_cart_button.dart new file mode 100644 index 0000000..c288265 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/add_to_cart_button.dart @@ -0,0 +1,41 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class AddToCartButton extends StatelessWidget { + final VoidCallback onPressed; + final int? amount; + + const AddToCartButton({ + required this.onPressed, + required this.amount, + super.key, + }); + + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: onPressed, + style: ElevatedButton.styleFrom( + backgroundColor: amount != null + ? AppColors.secondaryColor + : AppColors.primaryColor, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(15)), + ), + ), + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 10, + ), + child: Text( + amount != null ? '$amount in cart' : 'Add to cart', + textAlign: TextAlign.center, + style: AppTextStyles.size22WeightSemiBoldText( + AppColors.primaryButtonTextColor, + ), + ), + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/back_to_previous_page_button.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/back_to_previous_page_button.dart new file mode 100644 index 0000000..9512f51 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/back_to_previous_page_button.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; + +class BackToPreviousPageButton extends StatelessWidget { + final VoidCallback onPressed; + + const BackToPreviousPageButton({ + super.key, + required this.onPressed, + }); + + @override + Widget build(BuildContext context) { + return IconButton( + onPressed: onPressed, + icon: const Icon( + Icons.arrow_back_rounded, + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/decoration_block.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/decoration_block.dart new file mode 100644 index 0000000..b7a54da --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/decoration_block.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; + +class DecorationBlock extends StatelessWidget { + const DecorationBlock({super.key}); + + @override + Widget build(BuildContext context) { + return Align( + alignment: Alignment.bottomCenter, + child: Container( + height: 20, + decoration: BoxDecoration( + color: Theme.of(context).cardColor, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(50), + topRight: Radius.circular(50), + ), + border: Border.all( + width: 0, + color: Theme.of(context).cardColor, + ), + ), + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_bottom_bar.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_bottom_bar.dart new file mode 100644 index 0000000..7255490 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_bottom_bar.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +import 'add_to_cart_button.dart'; + +class MenuItemDetailsBottomBar extends StatelessWidget { + final VoidCallback onPressed; + final int? amount; + + const MenuItemDetailsBottomBar({ + super.key, + required this.onPressed, + required this.amount, + }); + + @override + Widget build(BuildContext context) { + return Material( + color: Theme.of(context).cardColor, + child: Container( + padding: const EdgeInsets.fromLTRB(30, 0, 30, 20), + child: AddToCartButton( + amount: amount, + onPressed: onPressed, + ), + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_description.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_description.dart new file mode 100644 index 0000000..d8751dd --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_description.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; + +class MenuItemDetailsDescription extends StatelessWidget { + final String description; + + const MenuItemDetailsDescription({ + super.key, + required this.description, + }); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + description.isNotEmpty + ? Text( + description, + style: Theme.of(context).textTheme.titleSmall, + ) + : Center( + child: Text( + 'No description available', + style: Theme.of(context).textTheme.titleSmall, + ), + ), + ], + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_image.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_image.dart new file mode 100644 index 0000000..7327a31 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_image.dart @@ -0,0 +1,32 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class MenuItemDetailsImage extends StatelessWidget { + final String image; + + const MenuItemDetailsImage({ + super.key, + required this.image, + }); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + + return FlexibleSpaceBar( + background: image.isNotEmpty + ? Image.network( + image, + fit: BoxFit.cover, + errorBuilder: (_, __, ___) => ImagePlaceholder( + iconData: Icons.fastfood, + iconSize: size.width * 0.3, + ), + ) + : ImagePlaceholder( + iconData: Icons.fastfood, + iconSize: size.width * 0.3, + ), + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_ingredients.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_ingredients.dart new file mode 100644 index 0000000..22979b9 --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_ingredients.dart @@ -0,0 +1,53 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class MenuItemDetailsIngredients extends StatelessWidget { + final List ingredients; + + const MenuItemDetailsIngredients({ + super.key, + required this.ingredients, + }); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Ingredients:', + style: Theme.of(context).textTheme.bodyMedium, + ), + const SizedBox(height: 10), + ingredients.isNotEmpty + ? ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: ingredients.length, + padding: const EdgeInsets.all(0), + itemBuilder: (context, index) { + return Row( + children: [ + const SizedBox(width: 15), + const CustomDotPoint(), + const SizedBox(width: 10), + Text( + ingredients[index], + style: Theme.of(context).textTheme.titleSmall, + ), + ], + ); + }, + ) + : Center( + child: Text( + 'No ingredients available', + style: AppTextStyles.size14WeightBoldText( + AppColors.primaryColor, + ), + ), + ), + ], + ); + } +} diff --git a/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_title.dart b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_title.dart new file mode 100644 index 0000000..d6d5dbe --- /dev/null +++ b/features/main_page_view/lib/src/ui/components/widgets/menu_item_details/menu_item_details_title.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; + +class MenuItemDetailsTitle extends StatelessWidget { + final String title; + final double cost; + + const MenuItemDetailsTitle({ + super.key, + required this.title, + required this.cost, + }); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + title, + style: Theme.of(context).textTheme.titleLarge, + ), + ), + Text( + '\$$cost', + style: Theme.of(context).textTheme.titleMedium, + ), + ], + ); + } +} diff --git a/features/main_page_view/lib/src/ui/main_page.dart b/features/main_page_view/lib/src/ui/main_page.dart new file mode 100644 index 0000000..6c82389 --- /dev/null +++ b/features/main_page_view/lib/src/ui/main_page.dart @@ -0,0 +1,33 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:navigation/navigation.dart'; + +class MainPage extends StatefulWidget { + const MainPage({Key? key}) : super(key: key); + + @override + State createState() => _MainPageState(); +} + +class _MainPageState extends State { + @override + Widget build(BuildContext context) { + return AutoTabsScaffold( + routes: const [ + MainPageScreenRoute(), + ShoppingCartPageScreenRoute(), + OrderHistoryPageContentRoute(), + SettingsPageContentRoute(), + ], + appBarBuilder: (_, tabsRouter) { + return const CustomAppBar(); + }, + bottomNavigationBuilder: (_, tabsRouter) { + return CustomBottomNavigationBar( + currentIndex: tabsRouter.activeIndex, + onTap: tabsRouter.setActiveIndex, + ); + }, + ); + } +} diff --git a/features/main_page_view/pubspec.lock b/features/main_page_view/pubspec.lock new file mode 100644 index 0000000..8abd933 --- /dev/null +++ b/features/main_page_view/pubspec.lock @@ -0,0 +1,402 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + core: + dependency: "direct main" + description: + path: "../../core" + relative: true + source: path + version: "0.0.1" + core_ui: + dependency: "direct main" + description: + path: "../../core_ui" + relative: true + source: path + version: "0.0.1" + data: + dependency: transitive + description: + path: "../../data" + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: "direct main" + description: + path: "../../domain" + relative: true + source: path + version: "0.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + navigation: + dependency: "direct main" + description: + path: "../../navigation" + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: transitive + description: + path: "../order_history" + relative: true + source: path + version: "0.0.1" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + settings: + dependency: transitive + description: + path: "../settings" + relative: true + source: path + version: "0.0.1" + shopping_cart: + dependency: "direct main" + description: + path: "../shopping_cart" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.3.0" diff --git a/features/main_page_view/pubspec.yaml b/features/main_page_view/pubspec.yaml new file mode 100644 index 0000000..6a1407e --- /dev/null +++ b/features/main_page_view/pubspec.yaml @@ -0,0 +1,27 @@ +name: main_page_view +description: Main page view feature +version: 0.0.1 +publish_to: none + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + core: + path: ../../core + domain: + path: ../../domain + core_ui: + path: ../../core_ui + navigation: + path: ../../navigation + shopping_cart: + path: ../shopping_cart + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 diff --git a/features/order_history/lib/order_history.dart b/features/order_history/lib/order_history.dart new file mode 100644 index 0000000..209b56a --- /dev/null +++ b/features/order_history/lib/order_history.dart @@ -0,0 +1,3 @@ +library order_history; + +export 'src/ui/order_history.dart'; diff --git a/features/order_history/lib/src/ui/order_history.dart b/features/order_history/lib/src/ui/order_history.dart new file mode 100644 index 0000000..ecb060c --- /dev/null +++ b/features/order_history/lib/src/ui/order_history.dart @@ -0,0 +1,29 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class OrderHistoryPageContent extends StatelessWidget { + const OrderHistoryPageContent({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + + return Center( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Icon( + // Icons.history_outlined, + // size: size.width * 0.15, + // color: Theme.of(context).primaryColor, + // ), + // Text( + // 'Order history coming soon', + // style: AppTextStyles.size18WeightSemiBoldText( + // Theme.of(context).primaryColor), + // ), + // ], + // ), + ); + } +} diff --git a/features/order_history/pubspec.lock b/features/order_history/pubspec.lock new file mode 100644 index 0000000..b673c5d --- /dev/null +++ b/features/order_history/pubspec.lock @@ -0,0 +1,402 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + core: + dependency: transitive + description: + path: "../../core" + relative: true + source: path + version: "0.0.1" + core_ui: + dependency: "direct main" + description: + path: "../../core_ui" + relative: true + source: path + version: "0.0.1" + data: + dependency: transitive + description: + path: "../../data" + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: transitive + description: + path: "../../domain" + relative: true + source: path + version: "0.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + main_page_view: + dependency: transitive + description: + path: "../main_page_view" + relative: true + source: path + version: "0.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + navigation: + dependency: transitive + description: + path: "../../navigation" + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + settings: + dependency: transitive + description: + path: "../settings" + relative: true + source: path + version: "0.0.1" + shopping_cart: + dependency: transitive + description: + path: "../shopping_cart" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.3.0" diff --git a/features/order_history/pubspec.yaml b/features/order_history/pubspec.yaml new file mode 100644 index 0000000..b93409d --- /dev/null +++ b/features/order_history/pubspec.yaml @@ -0,0 +1,19 @@ +name: order_history +description: Order history module +version: 0.0.1 +publish_to: 'none' + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + core_ui: + path: ../../core_ui + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 diff --git a/features/settings/lib/settings.dart b/features/settings/lib/settings.dart new file mode 100644 index 0000000..3af6de8 --- /dev/null +++ b/features/settings/lib/settings.dart @@ -0,0 +1,3 @@ +library settings; + +export 'src/ui/settings.dart'; diff --git a/features/settings/lib/src/ui/settings.dart b/features/settings/lib/src/ui/settings.dart new file mode 100644 index 0000000..d75c8e7 --- /dev/null +++ b/features/settings/lib/src/ui/settings.dart @@ -0,0 +1,30 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class SettingsPageContent extends StatelessWidget { + const SettingsPageContent({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Icon( + // Icons.settings, + // size: size.width * 0.15, + // color: Theme.of(context).primaryColor, + // ), + // Text( + // 'Settings coming soon', + // style: AppTextStyles.size18WeightSemiBoldText( + // Theme.of(context).primaryColor, + // ), + // ), + // ], + ), + ); + } +} diff --git a/features/settings/pubspec.lock b/features/settings/pubspec.lock new file mode 100644 index 0000000..d56f27d --- /dev/null +++ b/features/settings/pubspec.lock @@ -0,0 +1,402 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + core: + dependency: transitive + description: + path: "../../core" + relative: true + source: path + version: "0.0.1" + core_ui: + dependency: "direct main" + description: + path: "../../core_ui" + relative: true + source: path + version: "0.0.1" + data: + dependency: transitive + description: + path: "../../data" + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: transitive + description: + path: "../../domain" + relative: true + source: path + version: "0.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + main_page_view: + dependency: transitive + description: + path: "../main_page_view" + relative: true + source: path + version: "0.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + navigation: + dependency: transitive + description: + path: "../../navigation" + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: transitive + description: + path: "../order_history" + relative: true + source: path + version: "0.0.1" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + shopping_cart: + dependency: transitive + description: + path: "../shopping_cart" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.3.0" diff --git a/features/settings/pubspec.yaml b/features/settings/pubspec.yaml new file mode 100644 index 0000000..c8702d0 --- /dev/null +++ b/features/settings/pubspec.yaml @@ -0,0 +1,19 @@ +name: settings +description: Settings module +version: 0.0.1 +publish_to: 'none' + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + core_ui: + path: ../../core_ui + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 diff --git a/features/shopping_cart/lib/shopping_cart.dart b/features/shopping_cart/lib/shopping_cart.dart new file mode 100644 index 0000000..cd43069 --- /dev/null +++ b/features/shopping_cart/lib/shopping_cart.dart @@ -0,0 +1,4 @@ +library shopping_cart; + +export 'src/bloc/bloc.dart'; +export 'src/ui/shopping_cart_page_screen.dart'; diff --git a/features/shopping_cart/lib/src/bloc/bloc.dart b/features/shopping_cart/lib/src/bloc/bloc.dart new file mode 100644 index 0000000..d4fedf3 --- /dev/null +++ b/features/shopping_cart/lib/src/bloc/bloc.dart @@ -0,0 +1,109 @@ +import 'package:core/core.dart'; +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:domain/models/shopping_cart_model/shopping_cart_item_model.dart'; +import 'package:domain/models/shopping_cart_model/shopping_cart_model.dart'; + +part 'event.dart'; + +part 'state.dart'; + +class ShoppingCartBloc extends Bloc { + ShoppingCartBloc() : super(const ShoppingCartState.empty()) { + on(_onAddItemToShoppingCart); + on(_onRemoveItemToShoppingCart); + on(_addCutleryEvent); + } + + Future _onAddItemToShoppingCart( + AddShoppingCartItemEvent event, + Emitter emit, + ) async { + try { + final List shoppingCartItems = + List.from(state.shoppingCart.shoppingCartItems); + bool itemIsInCart = false; + int i = 0; + + while (i < shoppingCartItems.length && !itemIsInCart) { + if (shoppingCartItems[i].menuItem == event.menuItem) { + shoppingCartItems[i].amount++; + itemIsInCart = true; + } + i++; + } + + if (!itemIsInCart) { + shoppingCartItems.add( + ShoppingCartItemModel( + menuItem: event.menuItem, + amount: 1, + ), + ); + } + + emit( + state.copyWith( + shoppingCart: state.shoppingCart.copyWith( + shoppingCartItems: shoppingCartItems, + totalPrice: state.shoppingCart.totalPrice + event.menuItem.cost, + ), + ), + ); + } catch (e, _) { + emit( + state.copyWith(exception: e), + ); + } + } + + Future _onRemoveItemToShoppingCart( + RemoveShoppingCartItemEvent event, + Emitter emit, + ) async { + try { + final List shoppingCartItems = + List.from(state.shoppingCart.shoppingCartItems); + + event.shoppingCartItem.amount > 1 + ? event.shoppingCartItem.amount-- + : shoppingCartItems.remove(event.shoppingCartItem); + + emit( + state.copyWith( + shoppingCart: state.shoppingCart.copyWith( + shoppingCartItems: shoppingCartItems, + totalPrice: state.shoppingCart.totalPrice - + event.shoppingCartItem.menuItem.cost, + ), + ), + ); + } catch (e, _) { + emit( + state.copyWith(exception: e), + ); + } + } + + Future _addCutleryEvent( + AddCutleryEvent event, + Emitter emit, + ) async { + try { + final newAddCutlery = !state.shoppingCart.addCutlery; + emit( + state.copyWith( + shoppingCart: state.shoppingCart.copyWith( + addCutlery: newAddCutlery, + totalPrice: newAddCutlery + ? state.shoppingCart.totalPrice + 0.5 + : state.shoppingCart.totalPrice - 0.5, + ), + ), + ); + } catch (e, _) { + emit( + state.copyWith(exception: e), + ); + } + } +} diff --git a/features/shopping_cart/lib/src/bloc/event.dart b/features/shopping_cart/lib/src/bloc/event.dart new file mode 100644 index 0000000..b837d34 --- /dev/null +++ b/features/shopping_cart/lib/src/bloc/event.dart @@ -0,0 +1,21 @@ +part of 'bloc.dart'; + +abstract class ShoppingCartEvent {} + +class InitShoppingCartEvent extends ShoppingCartEvent {} + +class AddShoppingCartItemEvent extends ShoppingCartEvent { + final MenuItemModel menuItem; + + AddShoppingCartItemEvent({required this.menuItem}); +} + +class RemoveShoppingCartItemEvent extends ShoppingCartEvent { + final ShoppingCartItemModel shoppingCartItem; + + RemoveShoppingCartItemEvent({required this.shoppingCartItem}); +} + +class AddCutleryEvent extends ShoppingCartEvent { + AddCutleryEvent(); +} diff --git a/features/shopping_cart/lib/src/bloc/state.dart b/features/shopping_cart/lib/src/bloc/state.dart new file mode 100644 index 0000000..0c85660 --- /dev/null +++ b/features/shopping_cart/lib/src/bloc/state.dart @@ -0,0 +1,29 @@ +part of 'bloc.dart'; + +class ShoppingCartState { + final ShoppingCartModel shoppingCart; + final Object? exception; + + const ShoppingCartState({ + required this.shoppingCart, + this.exception, + }); + + const ShoppingCartState.empty( + {this.shoppingCart = const ShoppingCartModel( + shoppingCartItems: [], + totalPrice: 0.0, + addCutlery: false, + ), + this.exception}); + + ShoppingCartState copyWith({ + ShoppingCartModel? shoppingCart, + Object? exception, + }) { + return ShoppingCartState( + shoppingCart: shoppingCart ?? this.shoppingCart, + exception: exception ?? this.exception, + ); + } +} diff --git a/features/shopping_cart/lib/src/ui/empty_shopping_cart_screen.dart b/features/shopping_cart/lib/src/ui/empty_shopping_cart_screen.dart new file mode 100644 index 0000000..db7fd73 --- /dev/null +++ b/features/shopping_cart/lib/src/ui/empty_shopping_cart_screen.dart @@ -0,0 +1,46 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; + +class EmptyShoppingCartScreen extends StatelessWidget { + final VoidCallback onPressed; + + const EmptyShoppingCartScreen({ + super.key, + required this.onPressed, + }); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + final ThemeData theme = Theme.of(context); + + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // SizedBox( + // width: size.width / 2.5, + // height: size.height / 2.5, + // child: SvgPicture.asset( + // 'assets/image/nothing_founded_icon.svg', + // ), + // ), + Text( + "Seems like you didn't choose anything yet", + style: theme.textTheme.titleLarge, + textAlign: TextAlign.center, + ), + const SizedBox( + height: 10, + ), + PrimaryButton( + buttonTitle: 'Return to menu', + onPressed: onPressed, + ), + ], + ), + ); + } +} diff --git a/features/shopping_cart/lib/src/ui/shopping_cart_item.dart b/features/shopping_cart/lib/src/ui/shopping_cart_item.dart new file mode 100644 index 0000000..f5f757b --- /dev/null +++ b/features/shopping_cart/lib/src/ui/shopping_cart_item.dart @@ -0,0 +1,97 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:domain/models/shopping_cart_model/shopping_cart_item_model.dart'; +import 'package:flutter/material.dart'; +import 'package:shopping_cart/src/ui/widgets/item_amount.dart'; + +class ShoppingCartItem extends StatelessWidget { + final ShoppingCartItemModel shoppingCartItem; + final VoidCallback onTap; + + const ShoppingCartItem({ + Key? key, + required this.shoppingCartItem, + required this.onTap, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + + return Ink( + child: InkWell( + borderRadius: AppStyles.largeBorderRadius, + onTap: onTap, + child: Padding( + padding: const EdgeInsets.only(bottom: 10), + child: Stack( + children: [ + Align( + alignment: Alignment.centerRight, + child: Container( + height: size.height / 8, + width: size.width / 1.2, + alignment: Alignment.centerLeft, + decoration: BoxDecoration( + borderRadius: AppStyles.largeBorderRadius, + color: Theme.of(context).cardColor, + ), + child: Align( + alignment: Alignment.center, + child: Container( + width: size.width / 2, + padding: const EdgeInsets.only(left: 10), + alignment: Alignment.centerLeft, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + shoppingCartItem.menuItem.title, + style: Theme.of(context).textTheme.bodyLarge, + ), + const SizedBox(height: 20), + Text( + '\$${shoppingCartItem.menuItem.cost}', + style: AppTextStyles.size18WeightSemiBoldText( + Theme.of(context).primaryColor, + ), + ), + ], + ), + ), + ), + ), + ), + Container( + height: size.height / 8, + width: size.width / 3.8, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + boxShadow: [AppStyles.boxShadow], + ), + child: ClipOval( + child: shoppingCartItem.menuItem.image.isEmpty + ? const ImagePlaceholder( + iconData: Icons.fastfood_rounded, + iconSize: 50, + ) + : Image.network( + shoppingCartItem.menuItem.image, + ), + ), + ), + Positioned( + right: 25, + bottom: 15, + child: ItemAmount( + shoppingCartItem: shoppingCartItem, + amount: shoppingCartItem.amount, + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/features/shopping_cart/lib/src/ui/shopping_cart_list_items.dart b/features/shopping_cart/lib/src/ui/shopping_cart_list_items.dart new file mode 100644 index 0000000..3c5d4e3 --- /dev/null +++ b/features/shopping_cart/lib/src/ui/shopping_cart_list_items.dart @@ -0,0 +1,44 @@ +import 'package:core/core.dart'; +import 'package:domain/models/shopping_cart_model/shopping_cart_model.dart'; +import 'package:flutter/material.dart'; +import 'package:main_page_view/main_page.dart'; +import 'package:shopping_cart/src/ui/shopping_cart_item.dart'; + +class ShoppingCartListItems extends StatelessWidget { + final ShoppingCartModel shoppingCart; + + const ShoppingCartListItems({ + Key? key, + required this.shoppingCart, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + final NavigateToPageBloc navigateToPageBloc = + context.read(); + + return ListView.builder( + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: shoppingCart.shoppingCartItems.length, + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.only(bottom: 10), + child: ShoppingCartItem( + key: ValueKey(shoppingCart.shoppingCartItems[index].menuItem.id), + shoppingCartItem: shoppingCart.shoppingCartItems[index], + onTap: () { + navigateToPageBloc.add( + NavigateToMenuItemEvent( + context: context, + menuItem: shoppingCart.shoppingCartItems[index].menuItem, + ), + ); + }, + ), + ); + }, + ); + } +} diff --git a/features/shopping_cart/lib/src/ui/shopping_cart_page_screen.dart b/features/shopping_cart/lib/src/ui/shopping_cart_page_screen.dart new file mode 100644 index 0000000..16a5897 --- /dev/null +++ b/features/shopping_cart/lib/src/ui/shopping_cart_page_screen.dart @@ -0,0 +1,73 @@ +import 'package:core/core.dart'; +import 'package:flutter/material.dart'; +import 'package:main_page_view/main_page.dart'; +import 'package:shopping_cart/src/ui/shopping_cart_list_items.dart'; +import 'package:shopping_cart/src/ui/widgets/switch_for_cutlery.dart'; + +import '../bloc/bloc.dart'; +import 'empty_shopping_cart_screen.dart'; +import 'widgets/order_bottom_bar.dart'; + +class ShoppingCartPageScreen extends StatefulWidget { + const ShoppingCartPageScreen({Key? key}) : super(key: key); + + @override + State createState() => _ShoppingCartPageScreenState(); +} + +class _ShoppingCartPageScreenState extends State { + final ScrollController _scrollController = ScrollController(); + + @override + Widget build(BuildContext context) { + final NavigateToPageBloc navigateToPageBloc = + context.read(); + + return SafeArea( + child: BlocBuilder( + builder: (BuildContext context, ShoppingCartState state) { + if (state.shoppingCart.shoppingCartItems.isNotEmpty) { + return Scaffold( + bottomNavigationBar: OrderBottomBar( + totalPrice: state.shoppingCart.totalPrice, + ), + body: Container( + padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), + child: SingleChildScrollView( + controller: _scrollController, + child: Column( + children: [ + // SwitchForCutlery( + // switchValue: state.shoppingCart.addCutlery, + // ), + const SizedBox( + height: 15, + ), + Column( + children: [ + ShoppingCartListItems( + shoppingCart: state.shoppingCart, + ), + ], + ), + ], + ), + ), + ), + ); + } else { + return EmptyShoppingCartScreen( + onPressed: () { + navigateToPageBloc.add( + NavigateToMainPageEvent( + context: context, + ), + ); + }, + ); + } + }, + ), + ); + } +} diff --git a/features/shopping_cart/lib/src/ui/widgets/item_amount.dart b/features/shopping_cart/lib/src/ui/widgets/item_amount.dart new file mode 100644 index 0000000..fdc4e8a --- /dev/null +++ b/features/shopping_cart/lib/src/ui/widgets/item_amount.dart @@ -0,0 +1,60 @@ +import 'package:core/core.dart'; +import 'package:domain/models/shopping_cart_model/shopping_cart_item_model.dart'; +import 'package:flutter/material.dart'; +import 'package:shopping_cart/src/ui/widgets/update_count_button.dart'; + +import '../../../shopping_cart.dart'; + +class ItemAmount extends StatelessWidget { + final ShoppingCartItemModel shoppingCartItem; + final int amount; + + const ItemAmount({ + super.key, + required this.shoppingCartItem, + required this.amount, + }); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + final ShoppingCartBloc shoppingCartBloc = context.read(); + + return Row( + children: [ + UpdateCountButton( + icon: Icons.remove, + onPressed: () { + shoppingCartBloc.add( + RemoveShoppingCartItemEvent( + shoppingCartItem: shoppingCartItem, + ), + ); + }, + ), + const SizedBox(width: 15), + SizedBox( + width: size.width / 16, + child: Align( + alignment: Alignment.center, + child: Text( + '$amount', + style: Theme.of(context).textTheme.titleMedium, + ), + ), + ), + const SizedBox(width: 15), + UpdateCountButton( + icon: Icons.add, + onPressed: () { + shoppingCartBloc.add( + AddShoppingCartItemEvent( + menuItem: shoppingCartItem.menuItem, + ), + ); + }, + ), + ], + ); + } +} diff --git a/features/shopping_cart/lib/src/ui/widgets/order_bottom_bar.dart b/features/shopping_cart/lib/src/ui/widgets/order_bottom_bar.dart new file mode 100644 index 0000000..b2efefb --- /dev/null +++ b/features/shopping_cart/lib/src/ui/widgets/order_bottom_bar.dart @@ -0,0 +1,58 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class OrderBottomBar extends StatelessWidget { + final double totalPrice; + + const OrderBottomBar({ + super.key, + required this.totalPrice, + }); + + @override + Widget build(BuildContext context) { + return IntrinsicHeight( + child: Container( + margin: const EdgeInsets.fromLTRB(20, 5, 20, 15), + decoration: BoxDecoration( + borderRadius: AppStyles.largeBorderRadius, + ), + child: Stack( + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(30, 0, 30, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Total price', + style: Theme.of(context).textTheme.titleMedium, + ), + Text( + '\$${totalPrice.toStringAsFixed(2)}', + style: Theme.of(context).textTheme.titleLarge, + ), + ], + ), + ), + const SizedBox(height: 10), + Row( + children: [ + Expanded( + child: PrimaryButton( + buttonTitle: 'Make an order', + onPressed: () {}, + ), + ), + ], + ) + ], + ), + ], + ), + ), + ); + } +} diff --git a/features/shopping_cart/lib/src/ui/widgets/switch_for_cutlery.dart b/features/shopping_cart/lib/src/ui/widgets/switch_for_cutlery.dart new file mode 100644 index 0000000..b2447b1 --- /dev/null +++ b/features/shopping_cart/lib/src/ui/widgets/switch_for_cutlery.dart @@ -0,0 +1,43 @@ +import 'package:core/core.dart'; +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +import '../../../shopping_cart.dart'; + +class SwitchForCutlery extends StatelessWidget { + final bool switchValue; + + const SwitchForCutlery({ + super.key, + required this.switchValue, + }); + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + final ShoppingCartBloc shoppingCartBloc = context.read(); + + return Padding( + padding: const EdgeInsets.only(left: 15), + child: SizedBox( + height: size.height / 20, + child: SwitchListTile( + dense: false, + value: switchValue, + title: Text( + 'Do you need cutlery?', + style: Theme.of(context).textTheme.bodyLarge, + ), + activeColor: Theme.of(context).primaryColor, + inactiveThumbColor: Theme.of(context).disabledColor, + inactiveTrackColor: AppColors.backgroundItemColor, + onChanged: (bool newValue) { + shoppingCartBloc.add( + AddCutleryEvent(), + ); + }, + ), + ), + ); + } +} diff --git a/features/shopping_cart/lib/src/ui/widgets/update_count_button.dart b/features/shopping_cart/lib/src/ui/widgets/update_count_button.dart new file mode 100644 index 0000000..d71102f --- /dev/null +++ b/features/shopping_cart/lib/src/ui/widgets/update_count_button.dart @@ -0,0 +1,33 @@ +import 'package:core_ui/core_ui.dart'; +import 'package:flutter/material.dart'; + +class UpdateCountButton extends StatelessWidget { + final VoidCallback onPressed; + final IconData icon; + + const UpdateCountButton({ + super.key, + required this.onPressed, + required this.icon, + }); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onPressed, + child: Container( + height: 26, + width: 26, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: AppColors.primaryColor, + ), + child: Icon( + icon, + color: AppColors.titleLightTextColor, + size: 16, + ), + ), + ); + } +} diff --git a/features/shopping_cart/pubspec.lock b/features/shopping_cart/pubspec.lock new file mode 100644 index 0000000..29c0f39 --- /dev/null +++ b/features/shopping_cart/pubspec.lock @@ -0,0 +1,466 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + core: + dependency: "direct main" + description: + path: "../../core" + relative: true + source: path + version: "0.0.1" + core_ui: + dependency: "direct main" + description: + path: "../../core_ui" + relative: true + source: path + version: "0.0.1" + data: + dependency: transitive + description: + path: "../../data" + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: "direct main" + description: + path: "../../domain" + relative: true + source: path + version: "0.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + main_page_view: + dependency: "direct main" + description: + path: "../main_page_view" + relative: true + source: path + version: "0.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + navigation: + dependency: "direct main" + description: + path: "../../navigation" + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: transitive + description: + path: "../order_history" + relative: true + source: path + version: "0.0.1" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + settings: + dependency: transitive + description: + path: "../settings" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.7.0-0" diff --git a/features/shopping_cart/pubspec.yaml b/features/shopping_cart/pubspec.yaml new file mode 100644 index 0000000..e4ceafe --- /dev/null +++ b/features/shopping_cart/pubspec.yaml @@ -0,0 +1,29 @@ +name: shopping_cart +description: Shopping cart module +version: 0.0.1 +publish_to: 'none' + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + domain: + path: ../../domain + core: + path: ../../core + core_ui: + path: ../../core_ui + navigation: + path: ../../navigation + main_page_view: + path: ../main_page_view + + flutter_svg: ^2.0.6 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..a829020 --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,34 @@ + + + + + CLIENT_ID + 386113379551-1ipl3s6v4u7o92mandq2nteojh2nl8q5.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.386113379551-1ipl3s6v4u7o92mandq2nteojh2nl8q5 + API_KEY + AIzaSyBY0Lh5bRGs4vOulq6T5SQ4F1BoirDSexI + GCM_SENDER_ID + 386113379551 + PLIST_VERSION + 1 + BUNDLE_ID + com.example.foodDelivery + PROJECT_ID + food-delivery-5ccf6 + STORAGE_BUCKET + food-delivery-5ccf6.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:386113379551:ios:878c5cd3e8bc58482f5d6a + + \ No newline at end of file diff --git a/ios/firebase_app_id_file.json b/ios/firebase_app_id_file.json new file mode 100644 index 0000000..9fccd78 --- /dev/null +++ b/ios/firebase_app_id_file.json @@ -0,0 +1,7 @@ +{ + "file_generated_by": "FlutterFire CLI", + "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", + "GOOGLE_APP_ID": "1:386113379551:ios:878c5cd3e8bc58482f5d6a", + "FIREBASE_PROJECT_ID": "food-delivery-5ccf6", + "GCM_SENDER_ID": "386113379551" +} \ No newline at end of file diff --git a/lib/food_app/food_app.dart b/lib/food_app/food_app.dart new file mode 100644 index 0000000..49dbbdb --- /dev/null +++ b/lib/food_app/food_app.dart @@ -0,0 +1,45 @@ +import 'package:core/core.dart'; +import 'package:core_ui/core_ui.dart'; +import 'package:domain/usecases/fetch_menu_items_usecase.dart'; +import 'package:flutter/material.dart'; +import 'package:main_page_view/main_page.dart'; +import 'package:navigation/navigation.dart'; +import 'package:shopping_cart/shopping_cart.dart'; + +class FoodApp extends StatelessWidget { + const FoodApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (_) => AppThemeBloc(), + ), + BlocProvider( + create: (_) => NavigateToPageBloc(), + ), + BlocProvider( + create: (_) => MenuBloc( + fetchMenuItemsUseCase: instance.get(), + ), + ), + BlocProvider( + create: (_) => ShoppingCartBloc(), + ) + ], + child: BlocBuilder( + builder: (BuildContext context, AppThemeState state) { + return MaterialApp.router( + theme: state.isLight + ? AppTheme().lightThemeData + : AppTheme().darkThemeData, + routerDelegate: instance.get().delegate(), + routeInformationParser: + instance.get().defaultRouteParser(), + ); + }, + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index ade5025..6860e29 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,63 +1,21 @@ +import 'package:core/config/di/app_di.dart'; +import 'package:core/config/di/firebase_options.dart'; +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; -void main() => runApp(MealApp()); +import 'food_app/food_app.dart'; -class MealApp extends StatelessWidget { - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Meal App', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: MealScreen(), - ); - } -} +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); -class MealScreen extends StatelessWidget { - final List meals = List.generate( - 100, - (i) => 'Meal $i', + await Firebase.initializeApp( + options: DefaultFirebaseOptions.currentPlatform, ); - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Meals'), - ), - body: ListView.builder( - itemCount: meals.length, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - ListTile( - title: Row( - children: [ - Expanded( - child: Text(meals[index]), - ), - const Expanded( - child: Text('Price: ') - ), - ElevatedButton.icon( - icon: const Icon(Icons.add_shopping_cart), - label: const Text('Add'), - onPressed: () { - //Add-to-cart logic here - }, - ), - ], - ), - ), - const Divider( - thickness: 3, - ), - ], - ); - }, - ), - ); - } + appDI.initDependencies(); + + runApp( + const FoodApp(), + ); } + diff --git a/navigation/lib/navigation.dart b/navigation/lib/navigation.dart new file mode 100644 index 0000000..37ef0f0 --- /dev/null +++ b/navigation/lib/navigation.dart @@ -0,0 +1,5 @@ +library navigation; + +export 'package:auto_route/auto_route.dart'; +export 'src/navigation_di.dart'; +export 'src/app_router/app_router.dart'; diff --git a/navigation/lib/src/app_router/app_router.dart b/navigation/lib/src/app_router/app_router.dart new file mode 100644 index 0000000..afafc09 --- /dev/null +++ b/navigation/lib/src/app_router/app_router.dart @@ -0,0 +1,47 @@ +/*import 'package:auto_route/auto_route.dart'; +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:main_page_view/main_page.dart'; +import 'package:order_history/order_history.dart'; +import 'package:settings/settings.dart'; +import 'package:shopping_cart/shopping_cart_content.dart';*/ + +import 'package:domain/models/menu_item_model/menu_item_model.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:main_page_view/main_page.dart'; +import 'package:order_history/order_history.dart'; +import 'package:settings/settings.dart'; +import 'package:shopping_cart/shopping_cart.dart'; + +import '../../navigation.dart'; + +part 'app_router.gr.dart'; + +@MaterialAutoRouter( + replaceInRouteName: 'Page, Screen, Route', + routes: [ + AutoRoute( + path: "/", + page: MainPage, + children: [ + AutoRoute( + page: MainPageScreen, + initial: true, + ), + AutoRoute( + page:ShoppingCartPageScreen, + ), + AutoRoute( + page: OrderHistoryPageContent, + ), + AutoRoute( + page: SettingsPageContent, + ), + ], + ), + AutoRoute( + page: MenuItemDetailsScreen, + ) + ], +) +class AppRouter extends _$AppRouter {} diff --git a/navigation/lib/src/app_router/app_router.gr.dart b/navigation/lib/src/app_router/app_router.gr.dart new file mode 100644 index 0000000..982b20e --- /dev/null +++ b/navigation/lib/src/app_router/app_router.gr.dart @@ -0,0 +1,191 @@ +// ************************************************************************** +// AutoRouteGenerator +// ************************************************************************** + +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ************************************************************************** +// AutoRouteGenerator +// ************************************************************************** +// +// ignore_for_file: type=lint + +part of 'app_router.dart'; + +class _$AppRouter extends RootStackRouter { + _$AppRouter([GlobalKey? navigatorKey]) : super(navigatorKey); + + @override + final Map pagesMap = { + MainPageRoute.name: (routeData) { + return MaterialPageX( + routeData: routeData, + child: const MainPage(), + ); + }, + MenuItemDetailsScreenRoute.name: (routeData) { + final args = routeData.argsAs(); + return MaterialPageX( + routeData: routeData, + child: MenuItemDetailsScreen( + menuItem: args.menuItem, + key: args.key, + ), + ); + }, + MainPageScreenRoute.name: (routeData) { + return MaterialPageX( + routeData: routeData, + child: const MainPageScreen(), + ); + }, + ShoppingCartPageScreenRoute.name: (routeData) { + return MaterialPageX( + routeData: routeData, + child: const ShoppingCartPageScreen(), + ); + }, + OrderHistoryPageContentRoute.name: (routeData) { + return MaterialPageX( + routeData: routeData, + child: const OrderHistoryPageContent(), + ); + }, + SettingsPageContentRoute.name: (routeData) { + return MaterialPageX( + routeData: routeData, + child: const SettingsPageContent(), + ); + }, + }; + + @override + List get routes => [ + RouteConfig( + MainPageRoute.name, + path: '/', + children: [ + RouteConfig( + MainPageScreenRoute.name, + path: '', + parent: MainPageRoute.name, + ), + RouteConfig( + ShoppingCartPageScreenRoute.name, + path: 'shopping-cart-page-screen', + parent: MainPageRoute.name, + ), + RouteConfig( + OrderHistoryPageContentRoute.name, + path: 'order-history-page-content', + parent: MainPageRoute.name, + ), + RouteConfig( + SettingsPageContentRoute.name, + path: 'settings-page-content', + parent: MainPageRoute.name, + ), + ], + ), + RouteConfig( + MenuItemDetailsScreenRoute.name, + path: '/menu-item-details-screen', + ), + ]; +} + +/// generated route for +/// [MainPage] +class MainPageRoute extends PageRouteInfo { + const MainPageRoute({List? children}) + : super( + MainPageRoute.name, + path: '/', + initialChildren: children, + ); + + static const String name = 'MainPageRoute'; +} + +/// generated route for +/// [MenuItemDetailsScreen] +class MenuItemDetailsScreenRoute + extends PageRouteInfo { + MenuItemDetailsScreenRoute({ + required MenuItemModel menuItem, + Key? key, + }) : super( + MenuItemDetailsScreenRoute.name, + path: '/menu-item-details-screen', + args: MenuItemDetailsScreenRouteArgs( + menuItem: menuItem, + key: key, + ), + ); + + static const String name = 'MenuItemDetailsScreenRoute'; +} + +class MenuItemDetailsScreenRouteArgs { + const MenuItemDetailsScreenRouteArgs({ + required this.menuItem, + this.key, + }); + + final MenuItemModel menuItem; + + final Key? key; + + @override + String toString() { + return 'MenuItemDetailsScreenRouteArgs{menuItem: $menuItem, key: $key}'; + } +} + +/// generated route for +/// [MainPageScreen] +class MainPageScreenRoute extends PageRouteInfo { + const MainPageScreenRoute() + : super( + MainPageScreenRoute.name, + path: '', + ); + + static const String name = 'MainPageScreenRoute'; +} + +/// generated route for +/// [ShoppingCartPageScreen] +class ShoppingCartPageScreenRoute extends PageRouteInfo { + const ShoppingCartPageScreenRoute() + : super( + ShoppingCartPageScreenRoute.name, + path: 'shopping-cart-page-screen', + ); + + static const String name = 'ShoppingCartPageScreenRoute'; +} + +/// generated route for +/// [OrderHistoryPageContent] +class OrderHistoryPageContentRoute extends PageRouteInfo { + const OrderHistoryPageContentRoute() + : super( + OrderHistoryPageContentRoute.name, + path: 'order-history-page-content', + ); + + static const String name = 'OrderHistoryPageContentRoute'; +} + +/// generated route for +/// [SettingsPageContent] +class SettingsPageContentRoute extends PageRouteInfo { + const SettingsPageContentRoute() + : super( + SettingsPageContentRoute.name, + path: 'settings-page-content', + ); + + static const String name = 'SettingsPageContentRoute'; +} diff --git a/navigation/lib/src/navigation_di.dart b/navigation/lib/src/navigation_di.dart new file mode 100644 index 0000000..a204b73 --- /dev/null +++ b/navigation/lib/src/navigation_di.dart @@ -0,0 +1,7 @@ +import 'package:core/config/di/data_di.dart'; + +import '../navigation.dart'; + +void setupNavigationDependencies() { + instance.registerSingleton(AppRouter()); +} diff --git a/navigation/pubspec.lock b/navigation/pubspec.lock new file mode 100644 index 0000000..cdbb816 --- /dev/null +++ b/navigation/pubspec.lock @@ -0,0 +1,810 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 + url: "https://pub.dev" + source: hosted + version: "1.3.3" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: c1d5f167683de03d5ab6c3b53fc9aeefc5d59476e7810ba7bbddff50c6f4392d + url: "https://pub.dev" + source: hosted + version: "0.11.2" + ansicolor: + dependency: transitive + description: + name: ansicolor + sha256: "607f8fa9786f392043f169898923e6c59b4518242b68b8862eb8a8b7d9c30b4a" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + auto_route: + dependency: "direct main" + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + auto_route_generator: + dependency: "direct dev" + description: + name: auto_route_generator + sha256: de5bfbc02ae4eebb339dd90d325749ae7536e903f6513ef72b88954072d72b0e + url: "https://pub.dev" + source: hosted + version: "5.0.3" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" + source: hosted + version: "2.4.6" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" + url: "https://pub.dev" + source: hosted + version: "7.2.10" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" + url: "https://pub.dev" + source: hosted + version: "8.6.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "5bbc1f5bffa79af54ca035b92b57f81c6fb35ee5471ead67e29c8e12de8432f8" + url: "https://pub.dev" + source: hosted + version: "4.8.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "8e0aafeb727087f84710275d59a101b2acf2290ffbb3b111aab70423f8350d5d" + url: "https://pub.dev" + source: hosted + version: "5.15.2" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: bbf0ebb9d1e9251caa00e8727389313c64cb4240c1c31f895971c52d0c782316 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" + url: "https://pub.dev" + source: hosted + version: "4.5.0" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + core: + dependency: "direct main" + description: + path: "../core" + relative: true + source: path + version: "0.0.1" + core_ui: + dependency: "direct main" + description: + path: "../core_ui" + relative: true + source: path + version: "0.0.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + dart_code_metrics: + dependency: "direct dev" + description: + name: dart_code_metrics + sha256: "1dc1fa763b73ed52147bd91b015d81903edc3f227b77b1672fcddba43390ed18" + url: "https://pub.dev" + source: hosted + version: "5.7.5" + dart_code_metrics_presets: + dependency: transitive + description: + name: dart_code_metrics_presets + sha256: b71eadf02a3787ebd5c887623f83f6fdc204d45c75a081bd636c4104b3fd8b73 + url: "https://pub.dev" + source: hosted + version: "1.8.0" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + data: + dependency: transitive + description: + path: "../data" + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: "direct main" + description: + path: "../domain" + relative: true + source: path + version: "0.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be + url: "https://pub.dev" + source: hosted + version: "2.14.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" + source: hosted + version: "2.0.1" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_test: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + html: + dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" + http: + dependency: transitive + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + main_page_view: + dependency: "direct main" + description: + path: "../features/main_page_view" + relative: true + source: path + version: "0.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: "direct main" + description: + path: "../features/order_history" + relative: true + source: path + version: "0.0.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + platform: + dependency: transitive + description: + name: platform + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + process: + dependency: transitive + description: + name: process + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" + source: hosted + version: "4.2.4" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pub_updater: + dependency: transitive + description: + name: pub_updater + sha256: "05ae70703e06f7fdeb05f7f02dd680b8aad810e87c756a618f33e1794635115c" + url: "https://pub.dev" + source: hosted + version: "0.3.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + settings: + dependency: "direct main" + description: + path: "../features/settings" + relative: true + source: path + version: "0.0.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + shopping_cart: + dependency: "direct main" + description: + path: "../features/shopping_cart" + relative: true + source: path + version: "0.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" + source: hosted + version: "3.0.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.0.5 <4.0.0" + flutter: ">=3.3.0" diff --git a/navigation/pubspec.yaml b/navigation/pubspec.yaml new file mode 100644 index 0000000..f062ba3 --- /dev/null +++ b/navigation/pubspec.yaml @@ -0,0 +1,35 @@ +name: navigation +description: Main page view feature +version: 0.0.1 +publish_to: none + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + + auto_route: ^5.0.4 + + core: + path: ../core + core_ui: + path: ../core_ui + domain: + path: ../domain + main_page_view: + path: ../features/main_page_view + settings: + path: ../features/settings + order_history: + path: ../features/order_history + shopping_cart: + path: ../features/shopping_cart + +dev_dependencies: + flutter_lints: 2.0.1 + dart_code_metrics: ^5.7.5 + auto_route_generator: ^5.0.2 + build_runner: ^2.4.5 diff --git a/pubspec.lock b/pubspec.lock index 5cba5dd..5afb9a1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,22 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8" + url: "https://pub.dev" + source: hosted + version: "1.3.4" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" async: dependency: transitive description: @@ -9,6 +25,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.11.0" + auto_route: + dependency: transitive + description: + name: auto_route + sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + bloc: + dependency: transitive + description: + name: bloc + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + url: "https://pub.dev" + source: hosted + version: "8.1.2" boolean_selector: dependency: transitive description: @@ -33,6 +65,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" + cloud_firestore: + dependency: transitive + description: + name: cloud_firestore + sha256: "035b91f66b60dab5eefcc217accc734020234f79d963b075699920b95334a755" + url: "https://pub.dev" + source: hosted + version: "4.8.3" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "86bd1865abbeb09a7d09da3e70364a09f894937270651fc611a1c6d6a9f7b02c" + url: "https://pub.dev" + source: hosted + version: "5.15.3" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: ac2eeb2a7ab1928c3aacc30eed750fa839d6f620e112a5459e321df217be2f47 + url: "https://pub.dev" + source: hosted + version: "3.6.3" collection: dependency: transitive description: @@ -41,6 +97,20 @@ packages: url: "https://pub.dev" source: hosted version: "1.17.1" + core: + dependency: "direct main" + description: + path: core + relative: true + source: path + version: "0.0.1" + core_ui: + dependency: "direct main" + description: + path: core_ui + relative: true + source: path + version: "0.0.1" cupertino_icons: dependency: "direct main" description: @@ -49,6 +119,28 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" + data: + dependency: transitive + description: + path: data + relative: true + source: path + version: "0.0.1" + dio: + dependency: transitive + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + domain: + dependency: "direct main" + description: + path: domain + relative: true + source: path + version: "0.0.1" fake_async: dependency: transitive description: @@ -57,24 +149,101 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192" + url: "https://pub.dev" + source: hosted + version: "2.15.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + url: "https://pub.dev" + source: hosted + version: "8.1.3" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" + source: hosted + version: "5.2.0" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.7" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d + url: "https://pub.dev" + source: hosted + version: "2.4.1" + get_it: + dependency: transitive + description: + name: get_it + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + url: "https://pub.dev" + source: hosted + version: "7.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" js: dependency: transitive description: @@ -83,6 +252,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" lints: dependency: transitive description: @@ -91,6 +268,13 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + main_page_view: + dependency: "direct main" + description: + path: "features/main_page_view" + relative: true + source: path + version: "0.0.1" matcher: dependency: transitive description: @@ -115,6 +299,28 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + navigation: + dependency: "direct main" + description: + path: navigation + relative: true + source: path + version: "0.0.1" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + order_history: + dependency: transitive + description: + path: "features/order_history" + relative: true + source: path + version: "0.0.1" path: dependency: transitive description: @@ -123,6 +329,52 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + settings: + dependency: transitive + description: + path: "features/settings" + relative: true + source: path + version: "0.0.1" + shopping_cart: + dependency: "direct main" + description: + path: "features/shopping_cart" + relative: true + source: path + version: "0.0.1" sky_engine: dependency: transitive description: flutter @@ -176,6 +428,38 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" vector_math: dependency: transitive description: @@ -184,5 +468,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" sdks: dart: ">=3.0.5 <4.0.0" + flutter: ">=3.7.0-0" diff --git a/pubspec.yaml b/pubspec.yaml index a3c8a2b..0145351 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,90 +1,53 @@ -name: food_delivery +name: food_delivery_app description: A new Flutter project. -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 +publish_to: 'none' + environment: - sdk: '>=3.0.5 <4.0.0' + sdk: '>=3.0.0 <4.0.0' -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter + domain: + path: ./domain + core: + path: ./core + core_ui: + path: ./core_ui + navigation: + path: ./navigation + main_page_view: + path: ./features/main_page_view + shopping_cart: + path: ./features/shopping_cart - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 + firebase_core: ^2.14.0 dev_dependencies: flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.0 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + assets: + - assets/image/ + + fonts: + - family: Merriweather + fonts: + - asset: assets/fonts/Merriweather-Black.ttf + - asset: assets/fonts/Merriweather-BlackItalic.ttf + - asset: assets/fonts/Merriweather-Bold.ttf + - asset: assets/fonts/Merriweather-BoldItalic.ttf + - asset: assets/fonts/Merriweather-Italic.ttf + - asset: assets/fonts/Merriweather-Light.ttf + - asset: assets/fonts/Merriweather-LightItalic.ttf + - asset: assets/fonts/Merriweather-Regular.ttf diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index 410a92b..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:food_delivery/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8b6d468..1a82e7d 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index b93c4c3..fa8a39b 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + firebase_core ) list(APPEND FLUTTER_FFI_PLUGIN_LIST