6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 331173f5
Changed files
comwell_key_app/lib/main.dart | 2 + .../components/concierge_button.dart | 6 +- .../presentation/app/concierge_cubit.freezed.dart | 277 +++++++++++++++++++++ .../bloc/confirm_order_state.freezed.dart | 274 ++++++++++++++++++++ .../confirm_order/confirm_order_route.g.dart | 35 +++ .../bloc/hotel_overview_page_state.freezed.dart | 49 ++-- .../hotel_overview_page_route.g.dart | 4 +- .../payment/bloc/payment_state.freezed.dart | 274 ++++++++++++++++++++ .../screens/payment/payment_route.g.dart | 34 +++ .../product_details/product_details_route.g.dart | 4 +- .../bloc/provide_location_state.freezed.dart | 274 ++++++++++++++++++++ .../provide_location/provide_location_route.g.dart | 35 +++ .../receipt/bloc/receipt_state.freezed.dart | 274 ++++++++++++++++++++ .../screens/receipt/receipt_route.g.dart | 34 +++ .../bloc/review_order_state.freezed.dart | 274 ++++++++++++++++++++ .../screens/review_order/review_order_route.g.dart | 34 +++ concierge/lib/concierge_route.dart | 24 +- .../domain/repositories/property_repository.dart | 2 +- .../lib/presentation/app/concierge_cubit.dart | 52 ++++ .../lib/presentation/navigation/app_routes.dart | 9 +- concierge/lib/presentation/navigation/router.dart | 18 +- .../confirm_order/bloc/confirm_order_cubit.dart | 12 + .../confirm_order/bloc/confirm_order_state.dart | 12 + .../screens/confirm_order/confirm_order_route.dart | 23 ++ .../confirm_order/confirm_order_screen.dart | 37 +++ .../bloc/hotel_overview_page_cubit.dart | 19 -- .../bloc/hotel_overview_page_state.dart | 1 - .../hotel_overview_page_screen.dart | 71 +++--- .../widgets/product_list_tile.dart | 121 +++++---- .../screens/payment/bloc/payment_cubit.dart | 12 + .../screens/payment/bloc/payment_state.dart | 12 + .../screens/payment/payment_route.dart | 23 ++ .../screens/payment/payment_screen.dart | 37 +++ .../bloc/product_details_cubit.dart | 48 +++- .../product_details/product_details_screen.dart | 2 +- .../bloc/provide_location_cubit.dart | 12 + .../bloc/provide_location_state.dart | 12 + .../provide_location/provide_location_route.dart | 23 ++ .../provide_location/provide_location_screen.dart | 37 +++ .../screens/receipt/bloc/receipt_cubit.dart | 12 + .../screens/receipt/bloc/receipt_state.dart | 12 + .../screens/receipt/receipt_route.dart | 23 ++ .../screens/receipt/receipt_screen.dart | 37 +++ .../review_order/bloc/review_order_cubit.dart | 12 + .../review_order/bloc/review_order_state.dart | 12 + .../screens/review_order/review_order_route.dart | 23 ++ .../screens/review_order/review_order_screen.dart | 37 +++ 47 files changed, 2497 insertions(+), 174 deletions(-)
Diff
diff --git a/comwell_key_app/lib/main.dart b/comwell_key_app/lib/main.dart
index 4bf029d9..2fea02e6 100644
--- a/comwell_key_app/lib/main.dart
+++ b/comwell_key_app/lib/main.dart
@@ -5,6 +5,7 @@ import 'package:comwell_key_app/utils/firebase.dart';
import 'package:comwell_key_app/utils/locator.dart';
import 'package:comwell_key_app/services/http_client.dart';
import 'package:comwell_key_app/utils/secure_storage.dart';
+import 'package:concierge/flavors.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
@@ -16,6 +17,7 @@ import 'firebase_options_prod.dart' as fb_prod;
import 'package:payment_plugin/payment_plugin.dart';
void main() async {
+ F.appFlavor = Flavor.values.firstWhere((f) => f.name == appFlavor?.toLowerCase());
await AppLocalizations.delegate.load(const Locale("en"));
WidgetsFlutterBinding.ensureInitialized();
debugPrint("Current flavor: $appFlavor");
diff --git a/comwell_key_app/lib/presentation/screens/booking_details/components/concierge_button.dart b/comwell_key_app/lib/presentation/screens/booking_details/components/concierge_button.dart
index 8cd81dc3..b1c6c872 100644
--- a/comwell_key_app/lib/presentation/screens/booking_details/components/concierge_button.dart
+++ b/comwell_key_app/lib/presentation/screens/booking_details/components/concierge_button.dart
@@ -1,11 +1,10 @@
import 'package:comwell_key_app/data/remote/msal_service.dart';
-import 'package:comwell_key_app/presentation/screens/concierge/concierge_route.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:comwell_key_app/utils/l10n_utils.dart';
import 'package:comwell_key_app/utils/locator.dart';
+import 'package:concierge/flavors.dart';
import 'package:concierge/presentation/screens/hotel_overview_page/hotel_overview_page_route.dart';
import 'package:flutter/material.dart';
-import 'package:go_router/go_router.dart';
class ConciergeButton extends StatelessWidget {
final String hotelCode;
@@ -24,10 +23,9 @@ class ConciergeButton extends StatelessWidget {
HotelOverviewPageRoute(
hotelCode: hotelCode,
authToken: token,
- flavor: "stage",
+ flavor: F.appFlavor.name,
).push(context);
}
- //await ConciergeRoute(hotelCode: hotelCode).push<void>(context);
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
diff --git a/concierge/lib/_generated/presentation/app/concierge_cubit.freezed.dart b/concierge/lib/_generated/presentation/app/concierge_cubit.freezed.dart
new file mode 100644
index 00000000..7c2973aa
--- /dev/null
+++ b/concierge/lib/_generated/presentation/app/concierge_cubit.freezed.dart
@@ -0,0 +1,277 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// 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 '../../../presentation/app/concierge_cubit.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$ConciergeState {
+
+ Map<int, DataState> get products;
+/// Create a copy of ConciergeState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$ConciergeStateCopyWith<ConciergeState> get copyWith => _$ConciergeStateCopyWithImpl<ConciergeState>(this as ConciergeState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is ConciergeState&&const DeepCollectionEquality().equals(other.products, products));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(products));
+
+@override
+String toString() {
+ return 'ConciergeState(products: $products)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $ConciergeStateCopyWith<$Res> {
+ factory $ConciergeStateCopyWith(ConciergeState value, $Res Function(ConciergeState) _then) = _$ConciergeStateCopyWithImpl;
+@useResult
+$Res call({
+ Map<int, DataState> products
+});
+
+
+
+
+}
+/// @nodoc
+class _$ConciergeStateCopyWithImpl<$Res>
+ implements $ConciergeStateCopyWith<$Res> {
+ _$ConciergeStateCopyWithImpl(this._self, this._then);
+
+ final ConciergeState _self;
+ final $Res Function(ConciergeState) _then;
+
+/// Create a copy of ConciergeState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? products = null,}) {
+ return _then(_self.copyWith(
+products: null == products ? _self.products : products // ignore: cast_nullable_to_non_nullable
+as Map<int, DataState>,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [ConciergeState].
+extension ConciergeStatePatterns on ConciergeState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ConciergeState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _ConciergeState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ConciergeState value) $default,){
+final _that = this;
+switch (_that) {
+case _ConciergeState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ConciergeState value)? $default,){
+final _that = this;
+switch (_that) {
+case _ConciergeState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( Map<int, DataState> products)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _ConciergeState() when $default != null:
+return $default(_that.products);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( Map<int, DataState> products) $default,) {final _that = this;
+switch (_that) {
+case _ConciergeState():
+return $default(_that.products);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( Map<int, DataState> products)? $default,) {final _that = this;
+switch (_that) {
+case _ConciergeState() when $default != null:
+return $default(_that.products);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _ConciergeState implements ConciergeState {
+ const _ConciergeState({final Map<int, DataState> products = const {}}): _products = products;
+
+
+ final Map<int, DataState> _products;
+@override@JsonKey() Map<int, DataState> get products {
+ if (_products is EqualUnmodifiableMapView) return _products;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableMapView(_products);
+}
+
+
+/// Create a copy of ConciergeState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$ConciergeStateCopyWith<_ConciergeState> get copyWith => __$ConciergeStateCopyWithImpl<_ConciergeState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConciergeState&&const DeepCollectionEquality().equals(other._products, _products));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_products));
+
+@override
+String toString() {
+ return 'ConciergeState(products: $products)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$ConciergeStateCopyWith<$Res> implements $ConciergeStateCopyWith<$Res> {
+ factory _$ConciergeStateCopyWith(_ConciergeState value, $Res Function(_ConciergeState) _then) = __$ConciergeStateCopyWithImpl;
+@override @useResult
+$Res call({
+ Map<int, DataState> products
+});
+
+
+
+
+}
+/// @nodoc
+class __$ConciergeStateCopyWithImpl<$Res>
+ implements _$ConciergeStateCopyWith<$Res> {
+ __$ConciergeStateCopyWithImpl(this._self, this._then);
+
+ final _ConciergeState _self;
+ final $Res Function(_ConciergeState) _then;
+
+/// Create a copy of ConciergeState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? products = null,}) {
+ return _then(_ConciergeState(
+products: null == products ? _self._products : products // ignore: cast_nullable_to_non_nullable
+as Map<int, DataState>,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/concierge/lib/_generated/presentation/screens/confirm_order/bloc/confirm_order_state.freezed.dart b/concierge/lib/_generated/presentation/screens/confirm_order/bloc/confirm_order_state.freezed.dart
new file mode 100644
index 00000000..573d7566
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/confirm_order/bloc/confirm_order_state.freezed.dart
@@ -0,0 +1,274 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// 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 '../../../../../presentation/screens/confirm_order/bloc/confirm_order_state.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$ConfirmOrderState {
+
+ bool get isLoading; AppError get error;
+/// Create a copy of ConfirmOrderState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$ConfirmOrderStateCopyWith<ConfirmOrderState> get copyWith => _$ConfirmOrderStateCopyWithImpl<ConfirmOrderState>(this as ConfirmOrderState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmOrderState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'ConfirmOrderState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $ConfirmOrderStateCopyWith<$Res> {
+ factory $ConfirmOrderStateCopyWith(ConfirmOrderState value, $Res Function(ConfirmOrderState) _then) = _$ConfirmOrderStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class _$ConfirmOrderStateCopyWithImpl<$Res>
+ implements $ConfirmOrderStateCopyWith<$Res> {
+ _$ConfirmOrderStateCopyWithImpl(this._self, this._then);
+
+ final ConfirmOrderState _self;
+ final $Res Function(ConfirmOrderState) _then;
+
+/// Create a copy of ConfirmOrderState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [ConfirmOrderState].
+extension ConfirmOrderStatePatterns on ConfirmOrderState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ConfirmOrderState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _ConfirmOrderState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ConfirmOrderState value) $default,){
+final _that = this;
+switch (_that) {
+case _ConfirmOrderState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ConfirmOrderState value)? $default,){
+final _that = this;
+switch (_that) {
+case _ConfirmOrderState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _ConfirmOrderState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, AppError error) $default,) {final _that = this;
+switch (_that) {
+case _ConfirmOrderState():
+return $default(_that.isLoading,_that.error);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, AppError error)? $default,) {final _that = this;
+switch (_that) {
+case _ConfirmOrderState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _ConfirmOrderState implements ConfirmOrderState {
+ const _ConfirmOrderState({this.isLoading = false, this.error = AppError.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final AppError error;
+
+/// Create a copy of ConfirmOrderState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$ConfirmOrderStateCopyWith<_ConfirmOrderState> get copyWith => __$ConfirmOrderStateCopyWithImpl<_ConfirmOrderState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmOrderState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'ConfirmOrderState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$ConfirmOrderStateCopyWith<$Res> implements $ConfirmOrderStateCopyWith<$Res> {
+ factory _$ConfirmOrderStateCopyWith(_ConfirmOrderState value, $Res Function(_ConfirmOrderState) _then) = __$ConfirmOrderStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class __$ConfirmOrderStateCopyWithImpl<$Res>
+ implements _$ConfirmOrderStateCopyWith<$Res> {
+ __$ConfirmOrderStateCopyWithImpl(this._self, this._then);
+
+ final _ConfirmOrderState _self;
+ final $Res Function(_ConfirmOrderState) _then;
+
+/// Create a copy of ConfirmOrderState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_ConfirmOrderState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/concierge/lib/_generated/presentation/screens/confirm_order/confirm_order_route.g.dart b/concierge/lib/_generated/presentation/screens/confirm_order/confirm_order_route.g.dart
new file mode 100644
index 00000000..ebcb3f66
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/confirm_order/confirm_order_route.g.dart
@@ -0,0 +1,35 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../../presentation/screens/confirm_order/confirm_order_route.dart';
+
+// **************************************************************************
+// GoRouterGenerator
+// **************************************************************************
+
+List<RouteBase> get $appRoutes => [$confirmOrderRoute];
+
+RouteBase get $confirmOrderRoute => GoRouteData.$route(
+ path: '/concierge/confirm-order',
+ factory: $ConfirmOrderRoute._fromState,
+);
+
+mixin $ConfirmOrderRoute on GoRouteData {
+ static ConfirmOrderRoute _fromState(GoRouterState state) =>
+ ConfirmOrderRoute();
+
+ @override
+ String get location => GoRouteData.$location('/concierge/confirm-order');
+
+ @override
+ void go(BuildContext context) => context.go(location);
+
+ @override
+ Future<T?> push<T>(BuildContext context) => context.push<T>(location);
+
+ @override
+ void pushReplacement(BuildContext context) =>
+ context.pushReplacement(location);
+
+ @override
+ void replace(BuildContext context) => context.replace(location);
+}
diff --git a/concierge/lib/_generated/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.freezed.dart b/concierge/lib/_generated/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.freezed.dart
index 5a3ff1b5..ef3f123c 100644
--- a/concierge/lib/_generated/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.freezed.dart
+++ b/concierge/lib/_generated/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.freezed.dart
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$HotelOverviewPageState {
- bool get isLoading; String get errorMessage; int get selectedAreaId; Map<int, DataState> get areas; Map<int, Product> get products; Property? get property;
+ bool get isLoading; String get errorMessage; int get selectedAreaId; Map<int, DataState> get areas; Property? get property;
/// Create a copy of HotelOverviewPageState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $HotelOverviewPageStateCopyWith<HotelOverviewPageState> get copyWith => _$HotelO
@override
bool operator ==(Object other) {
- return identical(this, other) || (other.runtimeType == runtimeType&&other is HotelOverviewPageState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.selectedAreaId, selectedAreaId) || other.selectedAreaId == selectedAreaId)&&const DeepCollectionEquality().equals(other.areas, areas)&&const DeepCollectionEquality().equals(other.products, products)&&(identical(other.property, property) || other.property == property));
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is HotelOverviewPageState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.selectedAreaId, selectedAreaId) || other.selectedAreaId == selectedAreaId)&&const DeepCollectionEquality().equals(other.areas, areas)&&(identical(other.property, property) || other.property == property));
}
@override
-int get hashCode => Object.hash(runtimeType,isLoading,errorMessage,selectedAreaId,const DeepCollectionEquality().hash(areas),const DeepCollectionEquality().hash(products),property);
+int get hashCode => Object.hash(runtimeType,isLoading,errorMessage,selectedAreaId,const DeepCollectionEquality().hash(areas),property);
@override
String toString() {
- return 'HotelOverviewPageState(isLoading: $isLoading, errorMessage: $errorMessage, selectedAreaId: $selectedAreaId, areas: $areas, products: $products, property: $property)';
+ return 'HotelOverviewPageState(isLoading: $isLoading, errorMessage: $errorMessage, selectedAreaId: $selectedAreaId, areas: $areas, property: $property)';
}
@@ -45,7 +45,7 @@ abstract mixin class $HotelOverviewPageStateCopyWith<$Res> {
factory $HotelOverviewPageStateCopyWith(HotelOverviewPageState value, $Res Function(HotelOverviewPageState) _then) = _$HotelOverviewPageStateCopyWithImpl;
@useResult
$Res call({
- bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Map<int, Product> products, Property? property
+ bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Property? property
});
@@ -62,14 +62,13 @@ class _$HotelOverviewPageStateCopyWithImpl<$Res>
/// Create a copy of HotelOverviewPageState
/// with the given fields replaced by the non-null parameter values.
-@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? errorMessage = null,Object? selectedAreaId = null,Object? areas = null,Object? products = null,Object? property = freezed,}) {
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? errorMessage = null,Object? selectedAreaId = null,Object? areas = null,Object? property = freezed,}) {
return _then(_self.copyWith(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
as String,selectedAreaId: null == selectedAreaId ? _self.selectedAreaId : selectedAreaId // ignore: cast_nullable_to_non_nullable
as int,areas: null == areas ? _self.areas : areas // ignore: cast_nullable_to_non_nullable
-as Map<int, DataState>,products: null == products ? _self.products : products // ignore: cast_nullable_to_non_nullable
-as Map<int, Product>,property: freezed == property ? _self.property : property // ignore: cast_nullable_to_non_nullable
+as Map<int, DataState>,property: freezed == property ? _self.property : property // ignore: cast_nullable_to_non_nullable
as Property?,
));
}
@@ -155,10 +154,10 @@ return $default(_that);case _:
/// }
/// ```
-@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Map<int, Product> products, Property? property)? $default,{required TResult orElse(),}) {final _that = this;
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Property? property)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _HotelOverviewPageState() when $default != null:
-return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.areas,_that.products,_that.property);case _:
+return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.areas,_that.property);case _:
return orElse();
}
@@ -176,10 +175,10 @@ return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.ar
/// }
/// ```
-@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Map<int, Product> products, Property? property) $default,) {final _that = this;
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Property? property) $default,) {final _that = this;
switch (_that) {
case _HotelOverviewPageState():
-return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.areas,_that.products,_that.property);case _:
+return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.areas,_that.property);case _:
throw StateError('Unexpected subclass');
}
@@ -196,10 +195,10 @@ return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.ar
/// }
/// ```
-@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Map<int, Product> products, Property? property)? $default,) {final _that = this;
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Property? property)? $default,) {final _that = this;
switch (_that) {
case _HotelOverviewPageState() when $default != null:
-return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.areas,_that.products,_that.property);case _:
+return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.areas,_that.property);case _:
return null;
}
@@ -211,7 +210,7 @@ return $default(_that.isLoading,_that.errorMessage,_that.selectedAreaId,_that.ar
class _HotelOverviewPageState implements HotelOverviewPageState {
- const _HotelOverviewPageState({this.isLoading = false, this.errorMessage = "", this.selectedAreaId = 0, final Map<int, DataState> areas = const {}, final Map<int, Product> products = const {}, this.property}): _areas = areas,_products = products;
+ const _HotelOverviewPageState({this.isLoading = false, this.errorMessage = "", this.selectedAreaId = 0, final Map<int, DataState> areas = const {}, this.property}): _areas = areas;
@override@JsonKey() final bool isLoading;
@@ -224,13 +223,6 @@ class _HotelOverviewPageState implements HotelOverviewPageState {
return EqualUnmodifiableMapView(_areas);
}
- final Map<int, Product> _products;
-@override@JsonKey() Map<int, Product> get products {
- if (_products is EqualUnmodifiableMapView) return _products;
- // ignore: implicit_dynamic_type
- return EqualUnmodifiableMapView(_products);
-}
-
@override final Property? property;
/// Create a copy of HotelOverviewPageState
@@ -243,16 +235,16 @@ _$HotelOverviewPageStateCopyWith<_HotelOverviewPageState> get copyWith => __$Hot
@override
bool operator ==(Object other) {
- return identical(this, other) || (other.runtimeType == runtimeType&&other is _HotelOverviewPageState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.selectedAreaId, selectedAreaId) || other.selectedAreaId == selectedAreaId)&&const DeepCollectionEquality().equals(other._areas, _areas)&&const DeepCollectionEquality().equals(other._products, _products)&&(identical(other.property, property) || other.property == property));
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _HotelOverviewPageState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.selectedAreaId, selectedAreaId) || other.selectedAreaId == selectedAreaId)&&const DeepCollectionEquality().equals(other._areas, _areas)&&(identical(other.property, property) || other.property == property));
}
@override
-int get hashCode => Object.hash(runtimeType,isLoading,errorMessage,selectedAreaId,const DeepCollectionEquality().hash(_areas),const DeepCollectionEquality().hash(_products),property);
+int get hashCode => Object.hash(runtimeType,isLoading,errorMessage,selectedAreaId,const DeepCollectionEquality().hash(_areas),property);
@override
String toString() {
- return 'HotelOverviewPageState(isLoading: $isLoading, errorMessage: $errorMessage, selectedAreaId: $selectedAreaId, areas: $areas, products: $products, property: $property)';
+ return 'HotelOverviewPageState(isLoading: $isLoading, errorMessage: $errorMessage, selectedAreaId: $selectedAreaId, areas: $areas, property: $property)';
}
@@ -263,7 +255,7 @@ abstract mixin class _$HotelOverviewPageStateCopyWith<$Res> implements $HotelOve
factory _$HotelOverviewPageStateCopyWith(_HotelOverviewPageState value, $Res Function(_HotelOverviewPageState) _then) = __$HotelOverviewPageStateCopyWithImpl;
@override @useResult
$Res call({
- bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Map<int, Product> products, Property? property
+ bool isLoading, String errorMessage, int selectedAreaId, Map<int, DataState> areas, Property? property
});
@@ -280,14 +272,13 @@ class __$HotelOverviewPageStateCopyWithImpl<$Res>
/// Create a copy of HotelOverviewPageState
/// with the given fields replaced by the non-null parameter values.
-@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? errorMessage = null,Object? selectedAreaId = null,Object? areas = null,Object? products = null,Object? property = freezed,}) {
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? errorMessage = null,Object? selectedAreaId = null,Object? areas = null,Object? property = freezed,}) {
return _then(_HotelOverviewPageState(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
as String,selectedAreaId: null == selectedAreaId ? _self.selectedAreaId : selectedAreaId // ignore: cast_nullable_to_non_nullable
as int,areas: null == areas ? _self._areas : areas // ignore: cast_nullable_to_non_nullable
-as Map<int, DataState>,products: null == products ? _self._products : products // ignore: cast_nullable_to_non_nullable
-as Map<int, Product>,property: freezed == property ? _self.property : property // ignore: cast_nullable_to_non_nullable
+as Map<int, DataState>,property: freezed == property ? _self.property : property // ignore: cast_nullable_to_non_nullable
as Property?,
));
}
diff --git a/concierge/lib/_generated/presentation/screens/hotel_overview_page/hotel_overview_page_route.g.dart b/concierge/lib/_generated/presentation/screens/hotel_overview_page/hotel_overview_page_route.g.dart
index d6f6b950..6d278ff1 100644
--- a/concierge/lib/_generated/presentation/screens/hotel_overview_page/hotel_overview_page_route.g.dart
+++ b/concierge/lib/_generated/presentation/screens/hotel_overview_page/hotel_overview_page_route.g.dart
@@ -9,7 +9,7 @@ part of '../../../../presentation/screens/hotel_overview_page/hotel_overview_pag
List<RouteBase> get $appRoutes => [$hotelOverviewPageRoute];
RouteBase get $hotelOverviewPageRoute => GoRouteData.$route(
- path: '/hotel-overview-page',
+ path: '/concierge/hotel-overview-page',
factory: $HotelOverviewPageRoute._fromState,
);
@@ -25,7 +25,7 @@ mixin $HotelOverviewPageRoute on GoRouteData {
@override
String get location => GoRouteData.$location(
- '/hotel-overview-page',
+ '/concierge/hotel-overview-page',
queryParams: {
'hotel-code': _self.hotelCode,
'auth-token': _self.authToken,
diff --git a/concierge/lib/_generated/presentation/screens/payment/bloc/payment_state.freezed.dart b/concierge/lib/_generated/presentation/screens/payment/bloc/payment_state.freezed.dart
new file mode 100644
index 00000000..10a782df
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/payment/bloc/payment_state.freezed.dart
@@ -0,0 +1,274 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// 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 '../../../../../presentation/screens/payment/bloc/payment_state.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$PaymentState {
+
+ bool get isLoading; AppError get error;
+/// Create a copy of PaymentState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$PaymentStateCopyWith<PaymentState> get copyWith => _$PaymentStateCopyWithImpl<PaymentState>(this as PaymentState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'PaymentState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $PaymentStateCopyWith<$Res> {
+ factory $PaymentStateCopyWith(PaymentState value, $Res Function(PaymentState) _then) = _$PaymentStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class _$PaymentStateCopyWithImpl<$Res>
+ implements $PaymentStateCopyWith<$Res> {
+ _$PaymentStateCopyWithImpl(this._self, this._then);
+
+ final PaymentState _self;
+ final $Res Function(PaymentState) _then;
+
+/// Create a copy of PaymentState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [PaymentState].
+extension PaymentStatePatterns on PaymentState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _PaymentState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _PaymentState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _PaymentState value) $default,){
+final _that = this;
+switch (_that) {
+case _PaymentState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _PaymentState value)? $default,){
+final _that = this;
+switch (_that) {
+case _PaymentState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _PaymentState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, AppError error) $default,) {final _that = this;
+switch (_that) {
+case _PaymentState():
+return $default(_that.isLoading,_that.error);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, AppError error)? $default,) {final _that = this;
+switch (_that) {
+case _PaymentState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _PaymentState implements PaymentState {
+ const _PaymentState({this.isLoading = false, this.error = AppError.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final AppError error;
+
+/// Create a copy of PaymentState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$PaymentStateCopyWith<_PaymentState> get copyWith => __$PaymentStateCopyWithImpl<_PaymentState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'PaymentState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$PaymentStateCopyWith<$Res> implements $PaymentStateCopyWith<$Res> {
+ factory _$PaymentStateCopyWith(_PaymentState value, $Res Function(_PaymentState) _then) = __$PaymentStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class __$PaymentStateCopyWithImpl<$Res>
+ implements _$PaymentStateCopyWith<$Res> {
+ __$PaymentStateCopyWithImpl(this._self, this._then);
+
+ final _PaymentState _self;
+ final $Res Function(_PaymentState) _then;
+
+/// Create a copy of PaymentState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_PaymentState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/concierge/lib/_generated/presentation/screens/payment/payment_route.g.dart b/concierge/lib/_generated/presentation/screens/payment/payment_route.g.dart
new file mode 100644
index 00000000..a98d357f
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/payment/payment_route.g.dart
@@ -0,0 +1,34 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../../presentation/screens/payment/payment_route.dart';
+
+// **************************************************************************
+// GoRouterGenerator
+// **************************************************************************
+
+List<RouteBase> get $appRoutes => [$paymentRoute];
+
+RouteBase get $paymentRoute => GoRouteData.$route(
+ path: '/concierge/payment',
+ factory: $PaymentRoute._fromState,
+);
+
+mixin $PaymentRoute on GoRouteData {
+ static PaymentRoute _fromState(GoRouterState state) => PaymentRoute();
+
+ @override
+ String get location => GoRouteData.$location('/concierge/payment');
+
+ @override
+ void go(BuildContext context) => context.go(location);
+
+ @override
+ Future<T?> push<T>(BuildContext context) => context.push<T>(location);
+
+ @override
+ void pushReplacement(BuildContext context) =>
+ context.pushReplacement(location);
+
+ @override
+ void replace(BuildContext context) => context.replace(location);
+}
diff --git a/concierge/lib/_generated/presentation/screens/product_details/product_details_route.g.dart b/concierge/lib/_generated/presentation/screens/product_details/product_details_route.g.dart
index 59cc9475..0b14509e 100644
--- a/concierge/lib/_generated/presentation/screens/product_details/product_details_route.g.dart
+++ b/concierge/lib/_generated/presentation/screens/product_details/product_details_route.g.dart
@@ -9,7 +9,7 @@ part of '../../../../presentation/screens/product_details/product_details_route.
List<RouteBase> get $appRoutes => [$productDetailsRoute];
RouteBase get $productDetailsRoute => GoRouteData.$route(
- path: '/products/:id',
+ path: '/concierge/products/:id',
factory: $ProductDetailsRoute._fromState,
);
@@ -21,7 +21,7 @@ mixin $ProductDetailsRoute on GoRouteData {
@override
String get location => GoRouteData.$location(
- '/products/${Uri.encodeComponent(_self.id.toString())}',
+ '/concierge/products/${Uri.encodeComponent(_self.id.toString())}',
);
@override
diff --git a/concierge/lib/_generated/presentation/screens/provide_location/bloc/provide_location_state.freezed.dart b/concierge/lib/_generated/presentation/screens/provide_location/bloc/provide_location_state.freezed.dart
new file mode 100644
index 00000000..23e5f40a
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/provide_location/bloc/provide_location_state.freezed.dart
@@ -0,0 +1,274 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// 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 '../../../../../presentation/screens/provide_location/bloc/provide_location_state.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$ProvideLocationState {
+
+ bool get isLoading; AppError get error;
+/// Create a copy of ProvideLocationState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$ProvideLocationStateCopyWith<ProvideLocationState> get copyWith => _$ProvideLocationStateCopyWithImpl<ProvideLocationState>(this as ProvideLocationState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is ProvideLocationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'ProvideLocationState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $ProvideLocationStateCopyWith<$Res> {
+ factory $ProvideLocationStateCopyWith(ProvideLocationState value, $Res Function(ProvideLocationState) _then) = _$ProvideLocationStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class _$ProvideLocationStateCopyWithImpl<$Res>
+ implements $ProvideLocationStateCopyWith<$Res> {
+ _$ProvideLocationStateCopyWithImpl(this._self, this._then);
+
+ final ProvideLocationState _self;
+ final $Res Function(ProvideLocationState) _then;
+
+/// Create a copy of ProvideLocationState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [ProvideLocationState].
+extension ProvideLocationStatePatterns on ProvideLocationState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ProvideLocationState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _ProvideLocationState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ProvideLocationState value) $default,){
+final _that = this;
+switch (_that) {
+case _ProvideLocationState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ProvideLocationState value)? $default,){
+final _that = this;
+switch (_that) {
+case _ProvideLocationState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _ProvideLocationState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, AppError error) $default,) {final _that = this;
+switch (_that) {
+case _ProvideLocationState():
+return $default(_that.isLoading,_that.error);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, AppError error)? $default,) {final _that = this;
+switch (_that) {
+case _ProvideLocationState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _ProvideLocationState implements ProvideLocationState {
+ const _ProvideLocationState({this.isLoading = false, this.error = AppError.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final AppError error;
+
+/// Create a copy of ProvideLocationState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$ProvideLocationStateCopyWith<_ProvideLocationState> get copyWith => __$ProvideLocationStateCopyWithImpl<_ProvideLocationState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProvideLocationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'ProvideLocationState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$ProvideLocationStateCopyWith<$Res> implements $ProvideLocationStateCopyWith<$Res> {
+ factory _$ProvideLocationStateCopyWith(_ProvideLocationState value, $Res Function(_ProvideLocationState) _then) = __$ProvideLocationStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class __$ProvideLocationStateCopyWithImpl<$Res>
+ implements _$ProvideLocationStateCopyWith<$Res> {
+ __$ProvideLocationStateCopyWithImpl(this._self, this._then);
+
+ final _ProvideLocationState _self;
+ final $Res Function(_ProvideLocationState) _then;
+
+/// Create a copy of ProvideLocationState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_ProvideLocationState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/concierge/lib/_generated/presentation/screens/provide_location/provide_location_route.g.dart b/concierge/lib/_generated/presentation/screens/provide_location/provide_location_route.g.dart
new file mode 100644
index 00000000..03c83360
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/provide_location/provide_location_route.g.dart
@@ -0,0 +1,35 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../../presentation/screens/provide_location/provide_location_route.dart';
+
+// **************************************************************************
+// GoRouterGenerator
+// **************************************************************************
+
+List<RouteBase> get $appRoutes => [$provideLocationRoute];
+
+RouteBase get $provideLocationRoute => GoRouteData.$route(
+ path: '/concierge/provide-location',
+ factory: $ProvideLocationRoute._fromState,
+);
+
+mixin $ProvideLocationRoute on GoRouteData {
+ static ProvideLocationRoute _fromState(GoRouterState state) =>
+ ProvideLocationRoute();
+
+ @override
+ String get location => GoRouteData.$location('/concierge/provide-location');
+
+ @override
+ void go(BuildContext context) => context.go(location);
+
+ @override
+ Future<T?> push<T>(BuildContext context) => context.push<T>(location);
+
+ @override
+ void pushReplacement(BuildContext context) =>
+ context.pushReplacement(location);
+
+ @override
+ void replace(BuildContext context) => context.replace(location);
+}
diff --git a/concierge/lib/_generated/presentation/screens/receipt/bloc/receipt_state.freezed.dart b/concierge/lib/_generated/presentation/screens/receipt/bloc/receipt_state.freezed.dart
new file mode 100644
index 00000000..a5458491
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/receipt/bloc/receipt_state.freezed.dart
@@ -0,0 +1,274 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// 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 '../../../../../presentation/screens/receipt/bloc/receipt_state.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$ReceiptState {
+
+ bool get isLoading; AppError get error;
+/// Create a copy of ReceiptState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$ReceiptStateCopyWith<ReceiptState> get copyWith => _$ReceiptStateCopyWithImpl<ReceiptState>(this as ReceiptState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is ReceiptState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'ReceiptState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $ReceiptStateCopyWith<$Res> {
+ factory $ReceiptStateCopyWith(ReceiptState value, $Res Function(ReceiptState) _then) = _$ReceiptStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class _$ReceiptStateCopyWithImpl<$Res>
+ implements $ReceiptStateCopyWith<$Res> {
+ _$ReceiptStateCopyWithImpl(this._self, this._then);
+
+ final ReceiptState _self;
+ final $Res Function(ReceiptState) _then;
+
+/// Create a copy of ReceiptState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [ReceiptState].
+extension ReceiptStatePatterns on ReceiptState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ReceiptState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _ReceiptState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ReceiptState value) $default,){
+final _that = this;
+switch (_that) {
+case _ReceiptState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ReceiptState value)? $default,){
+final _that = this;
+switch (_that) {
+case _ReceiptState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _ReceiptState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, AppError error) $default,) {final _that = this;
+switch (_that) {
+case _ReceiptState():
+return $default(_that.isLoading,_that.error);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, AppError error)? $default,) {final _that = this;
+switch (_that) {
+case _ReceiptState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _ReceiptState implements ReceiptState {
+ const _ReceiptState({this.isLoading = false, this.error = AppError.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final AppError error;
+
+/// Create a copy of ReceiptState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$ReceiptStateCopyWith<_ReceiptState> get copyWith => __$ReceiptStateCopyWithImpl<_ReceiptState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _ReceiptState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'ReceiptState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$ReceiptStateCopyWith<$Res> implements $ReceiptStateCopyWith<$Res> {
+ factory _$ReceiptStateCopyWith(_ReceiptState value, $Res Function(_ReceiptState) _then) = __$ReceiptStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class __$ReceiptStateCopyWithImpl<$Res>
+ implements _$ReceiptStateCopyWith<$Res> {
+ __$ReceiptStateCopyWithImpl(this._self, this._then);
+
+ final _ReceiptState _self;
+ final $Res Function(_ReceiptState) _then;
+
+/// Create a copy of ReceiptState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_ReceiptState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/concierge/lib/_generated/presentation/screens/receipt/receipt_route.g.dart b/concierge/lib/_generated/presentation/screens/receipt/receipt_route.g.dart
new file mode 100644
index 00000000..55d63b20
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/receipt/receipt_route.g.dart
@@ -0,0 +1,34 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../../presentation/screens/receipt/receipt_route.dart';
+
+// **************************************************************************
+// GoRouterGenerator
+// **************************************************************************
+
+List<RouteBase> get $appRoutes => [$receiptRoute];
+
+RouteBase get $receiptRoute => GoRouteData.$route(
+ path: '/concierge/receipt',
+ factory: $ReceiptRoute._fromState,
+);
+
+mixin $ReceiptRoute on GoRouteData {
+ static ReceiptRoute _fromState(GoRouterState state) => ReceiptRoute();
+
+ @override
+ String get location => GoRouteData.$location('/concierge/receipt');
+
+ @override
+ void go(BuildContext context) => context.go(location);
+
+ @override
+ Future<T?> push<T>(BuildContext context) => context.push<T>(location);
+
+ @override
+ void pushReplacement(BuildContext context) =>
+ context.pushReplacement(location);
+
+ @override
+ void replace(BuildContext context) => context.replace(location);
+}
diff --git a/concierge/lib/_generated/presentation/screens/review_order/bloc/review_order_state.freezed.dart b/concierge/lib/_generated/presentation/screens/review_order/bloc/review_order_state.freezed.dart
new file mode 100644
index 00000000..71ad9de2
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/review_order/bloc/review_order_state.freezed.dart
@@ -0,0 +1,274 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// 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 '../../../../../presentation/screens/review_order/bloc/review_order_state.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$ReviewOrderState {
+
+ bool get isLoading; AppError get error;
+/// Create a copy of ReviewOrderState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$ReviewOrderStateCopyWith<ReviewOrderState> get copyWith => _$ReviewOrderStateCopyWithImpl<ReviewOrderState>(this as ReviewOrderState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is ReviewOrderState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'ReviewOrderState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $ReviewOrderStateCopyWith<$Res> {
+ factory $ReviewOrderStateCopyWith(ReviewOrderState value, $Res Function(ReviewOrderState) _then) = _$ReviewOrderStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class _$ReviewOrderStateCopyWithImpl<$Res>
+ implements $ReviewOrderStateCopyWith<$Res> {
+ _$ReviewOrderStateCopyWithImpl(this._self, this._then);
+
+ final ReviewOrderState _self;
+ final $Res Function(ReviewOrderState) _then;
+
+/// Create a copy of ReviewOrderState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [ReviewOrderState].
+extension ReviewOrderStatePatterns on ReviewOrderState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ReviewOrderState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _ReviewOrderState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ReviewOrderState value) $default,){
+final _that = this;
+switch (_that) {
+case _ReviewOrderState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ReviewOrderState value)? $default,){
+final _that = this;
+switch (_that) {
+case _ReviewOrderState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _ReviewOrderState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, AppError error) $default,) {final _that = this;
+switch (_that) {
+case _ReviewOrderState():
+return $default(_that.isLoading,_that.error);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, AppError error)? $default,) {final _that = this;
+switch (_that) {
+case _ReviewOrderState() when $default != null:
+return $default(_that.isLoading,_that.error);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _ReviewOrderState implements ReviewOrderState {
+ const _ReviewOrderState({this.isLoading = false, this.error = AppError.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final AppError error;
+
+/// Create a copy of ReviewOrderState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$ReviewOrderStateCopyWith<_ReviewOrderState> get copyWith => __$ReviewOrderStateCopyWithImpl<_ReviewOrderState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _ReviewOrderState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error);
+
+@override
+String toString() {
+ return 'ReviewOrderState(isLoading: $isLoading, error: $error)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$ReviewOrderStateCopyWith<$Res> implements $ReviewOrderStateCopyWith<$Res> {
+ factory _$ReviewOrderStateCopyWith(_ReviewOrderState value, $Res Function(_ReviewOrderState) _then) = __$ReviewOrderStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, AppError error
+});
+
+
+
+
+}
+/// @nodoc
+class __$ReviewOrderStateCopyWithImpl<$Res>
+ implements _$ReviewOrderStateCopyWith<$Res> {
+ __$ReviewOrderStateCopyWithImpl(this._self, this._then);
+
+ final _ReviewOrderState _self;
+ final $Res Function(_ReviewOrderState) _then;
+
+/// Create a copy of ReviewOrderState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? error = null,}) {
+ return _then(_ReviewOrderState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as AppError,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/concierge/lib/_generated/presentation/screens/review_order/review_order_route.g.dart b/concierge/lib/_generated/presentation/screens/review_order/review_order_route.g.dart
new file mode 100644
index 00000000..c2427196
--- /dev/null
+++ b/concierge/lib/_generated/presentation/screens/review_order/review_order_route.g.dart
@@ -0,0 +1,34 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../../presentation/screens/review_order/review_order_route.dart';
+
+// **************************************************************************
+// GoRouterGenerator
+// **************************************************************************
+
+List<RouteBase> get $appRoutes => [$reviewOrderRoute];
+
+RouteBase get $reviewOrderRoute => GoRouteData.$route(
+ path: '/concierge/review-order',
+ factory: $ReviewOrderRoute._fromState,
+);
+
+mixin $ReviewOrderRoute on GoRouteData {
+ static ReviewOrderRoute _fromState(GoRouterState state) => ReviewOrderRoute();
+
+ @override
+ String get location => GoRouteData.$location('/concierge/review-order');
+
+ @override
+ void go(BuildContext context) => context.go(location);
+
+ @override
+ Future<T?> push<T>(BuildContext context) => context.push<T>(location);
+
+ @override
+ void pushReplacement(BuildContext context) =>
+ context.pushReplacement(location);
+
+ @override
+ void replace(BuildContext context) => context.replace(location);
+}
diff --git a/concierge/lib/concierge_route.dart b/concierge/lib/concierge_route.dart
index b32e7bc4..9ebe9746 100644
--- a/concierge/lib/concierge_route.dart
+++ b/concierge/lib/concierge_route.dart
@@ -1,7 +1,12 @@
-
import 'package:concierge/presentation/app/cart_cubit.dart';
+import 'package:concierge/presentation/app/concierge_cubit.dart';
+import 'package:concierge/presentation/screens/confirm_order/confirm_order_route.dart';
import 'package:concierge/presentation/screens/hotel_overview_page/hotel_overview_page_route.dart';
+import 'package:concierge/presentation/screens/payment/payment_route.dart';
import 'package:concierge/presentation/screens/product_details/product_details_route.dart';
+import 'package:concierge/presentation/screens/provide_location/provide_location_route.dart';
+import 'package:concierge/presentation/screens/receipt/receipt_route.dart';
+import 'package:concierge/presentation/screens/review_order/review_order_route.dart';
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
@@ -17,11 +22,20 @@ import 'domain/repositories/property_repository.dart';
import 'flavors.dart';
final conciergeShellRoute = StatefulShellRoute.indexedStack(
+ redirect: (context, state) {
+ print("qqq concierge: ${state.matchedLocation}");
+ return null;
+ },
branches: [
StatefulShellBranch(
routes: [
$hotelOverviewPageRoute,
$productDetailsRoute,
+ $reviewOrderRoute,
+ $confirmOrderRoute,
+ $paymentRoute,
+ $provideLocationRoute,
+ $receiptRoute,
],
),
],
@@ -31,7 +45,6 @@ final conciergeShellRoute = StatefulShellRoute.indexedStack(
final authToken = state.uri.queryParameters["auth-token"].toString();
final storage = ConciergeSecureStorage(FlutterSecureStorage());
if (state.uri.queryParameters.isNotEmpty) {
- print("qqq init ${state.uri.queryParameters}");
await storage.setUserToken(authToken);
F.appFlavor = Flavor.values.firstWhere((flavor) => flavor.name == flavorName);
}
@@ -62,11 +75,14 @@ final conciergeShellRoute = StatefulShellRoute.indexedStack(
RepositoryProvider(create: (context) => storage),
],
child: MultiBlocProvider(
- providers: [BlocProvider(create: (context) => CartCubit())],
+ providers: [
+ BlocProvider(create: (context) => ConciergeCubit(context.read())),
+ BlocProvider(create: (context) => CartCubit()),
+ ],
child: child,
),
);
},
);
},
-);
\ No newline at end of file
+);
diff --git a/concierge/lib/domain/repositories/property_repository.dart b/concierge/lib/domain/repositories/property_repository.dart
index b3563fe4..bbe6d3a8 100644
--- a/concierge/lib/domain/repositories/property_repository.dart
+++ b/concierge/lib/domain/repositories/property_repository.dart
@@ -16,7 +16,7 @@ class PropertyRepository {
}
Future<AreaDetails> getArea(int areaId) async {
- return AreaDetails.fromJson(mockAreaResponse);
+ //return AreaDetails.fromJson(mockAreaResponse);
final response = await _service.getArea(areaId);
return response.data;
}
diff --git a/concierge/lib/presentation/app/concierge_cubit.dart b/concierge/lib/presentation/app/concierge_cubit.dart
new file mode 100644
index 00000000..56e79d57
--- /dev/null
+++ b/concierge/lib/presentation/app/concierge_cubit.dart
@@ -0,0 +1,52 @@
+import 'package:concierge/data/remote/models/product.dart';
+import 'package:concierge/domain/models/app_error.dart';
+import 'package:concierge/domain/models/data_state.dart';
+import 'package:concierge/domain/repositories/property_repository.dart';
+import 'package:concierge/presentation/base/base_cubit.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part '../../_generated/presentation/app/concierge_cubit.freezed.dart';
+
+class ConciergeCubit extends BaseCubit<ConciergeState> {
+ final PropertyRepository _propertyRepository;
+
+ ConciergeCubit(this._propertyRepository) : super(const ConciergeState());
+
+ DataState getProductState(int pId) {
+ final pExists = state.products.containsKey(pId);
+ if (!pExists) {
+ _loadProduct(pId);
+ return DataState.loading;
+ }
+ return state.products[pId]!;
+ }
+
+ Future<void> _loadProduct(int pId) async {
+ if (state.products.containsKey(pId)) {
+ if (state.products[pId] == DataState.loading) return;
+ if (state.products[pId] is Success<Product>) return;
+ }
+ try {
+ _updateProductDataState(pId, DataState.loading);
+ final product = await _propertyRepository.getProduct(pId);
+ _updateProductDataState(pId, DataState.success(product));
+ } catch (e, st) {
+ handleError(e, st);
+ _updateProductDataState(pId, DataState.failure(AppError.unknown(e.toString())));
+ }
+ }
+
+ void _updateProductDataState(int pId, DataState dataState) {
+ print("qqq set [$pId]=${dataState.runtimeType}");
+ final copy = Map.of(state.products);
+ copy[pId] = dataState;
+ safeEmit(state.copyWith(products: copy));
+ }
+}
+
+@freezed
+abstract class ConciergeState with _$ConciergeState {
+ const factory ConciergeState({
+ @Default({}) Map<int, DataState> products,
+ }) = _ConciergeState;
+}
diff --git a/concierge/lib/presentation/navigation/app_routes.dart b/concierge/lib/presentation/navigation/app_routes.dart
index 01d7a5af..492c58c3 100644
--- a/concierge/lib/presentation/navigation/app_routes.dart
+++ b/concierge/lib/presentation/navigation/app_routes.dart
@@ -1,4 +1,9 @@
abstract class AppRoutes {
- static const hotelOverviewPage = "/hotel-overview-page";
- static const productDetails = "/products/:id";
+ static const hotelOverviewPage = "/concierge/hotel-overview-page";
+ static const productDetails = "/concierge/products/:id";
+ static const reviewOrder = "/concierge/review-order";
+ static const receipt = "/concierge/receipt";
+ static const provideLocation = "/concierge/provide-location";
+ static const payment = "/concierge/payment";
+ static const confirmOrder = "/concierge/confirm-order";
}
diff --git a/concierge/lib/presentation/navigation/router.dart b/concierge/lib/presentation/navigation/router.dart
index 44ca0cb4..74638de1 100644
--- a/concierge/lib/presentation/navigation/router.dart
+++ b/concierge/lib/presentation/navigation/router.dart
@@ -1,8 +1,14 @@
import 'package:concierge/presentation/navigation/app_routes.dart';
+import 'package:concierge/presentation/screens/confirm_order/confirm_order_route.dart';
+import 'package:concierge/presentation/screens/payment/payment_route.dart';
import 'package:concierge/presentation/screens/product_details/product_details_route.dart';
+import 'package:concierge/presentation/screens/provide_location/provide_location_route.dart';
+import 'package:concierge/presentation/screens/receipt/receipt_route.dart';
+import 'package:concierge/presentation/screens/review_order/review_order_route.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:go_router/go_router.dart';
import '../screens/hotel_overview_page/hotel_overview_page_route.dart';
@@ -14,15 +20,13 @@ GoRouter router = GoRouter(
observers: [],
initialLocation: AppRoutes.hotelOverviewPage,
debugLogDiagnostics: kDebugMode,
- redirect: (context, state) {
- final uri = state.uri;
- debugPrint("qqq uri=$uri");
- // will exit app
- if (state.matchedLocation == "/exit") context.pop();
- return null;
- },
routes: [
$hotelOverviewPageRoute,
$productDetailsRoute,
+ $reviewOrderRoute,
+ $confirmOrderRoute,
+ $paymentRoute,
+ $provideLocationRoute,
+ $receiptRoute,
],
);
diff --git a/concierge/lib/presentation/screens/confirm_order/bloc/confirm_order_cubit.dart b/concierge/lib/presentation/screens/confirm_order/bloc/confirm_order_cubit.dart
new file mode 100644
index 00000000..9584692d
--- /dev/null
+++ b/concierge/lib/presentation/screens/confirm_order/bloc/confirm_order_cubit.dart
@@ -0,0 +1,12 @@
+import 'package:concierge/presentation/base/base_cubit.dart';
+import 'package:concierge/presentation/screens/confirm_order/bloc/confirm_order_state.dart';
+
+class ConfirmOrderCubit extends BaseCubit<ConfirmOrderState> {
+ ConfirmOrderCubit() : super(const ConfirmOrderState()) {
+ init();
+ }
+
+ Future<void> init() async {
+
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/confirm_order/bloc/confirm_order_state.dart b/concierge/lib/presentation/screens/confirm_order/bloc/confirm_order_state.dart
new file mode 100644
index 00000000..5b459039
--- /dev/null
+++ b/concierge/lib/presentation/screens/confirm_order/bloc/confirm_order_state.dart
@@ -0,0 +1,12 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:concierge/domain/models/app_error.dart';
+
+part '../../../../_generated/presentation/screens/confirm_order/bloc/confirm_order_state.freezed.dart';
+
+@freezed
+abstract class ConfirmOrderState with _$ConfirmOrderState {
+ const factory ConfirmOrderState({
+ @Default(false) bool isLoading,
+ @Default(AppError.none) AppError error,
+ }) = _ConfirmOrderState;
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/confirm_order/confirm_order_route.dart b/concierge/lib/presentation/screens/confirm_order/confirm_order_route.dart
new file mode 100644
index 00000000..ead528d9
--- /dev/null
+++ b/concierge/lib/presentation/screens/confirm_order/confirm_order_route.dart
@@ -0,0 +1,23 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/navigation/app_routes.dart';
+import 'package:go_router/go_router.dart';
+import 'package:concierge/presentation/navigation/transitions/slide_up_transition.dart';
+import 'package:concierge/presentation/screens/confirm_order/bloc/confirm_order_cubit.dart';
+import 'package:concierge/presentation/screens/confirm_order/confirm_order_screen.dart';
+
+part '../../../_generated/presentation/screens/confirm_order/confirm_order_route.g.dart';
+
+@TypedGoRoute<ConfirmOrderRoute>(path: AppRoutes.confirmOrder)
+class ConfirmOrderRoute extends GoRouteData with $ConfirmOrderRoute {
+ @override
+ Page<void> buildPage(BuildContext context, GoRouterState state) {
+ return slideUpTransition(
+ state: state,
+ child: BlocProvider(
+ create: (context) => ConfirmOrderCubit(),
+ child: ConfirmOrderScreen(),
+ ),
+ );
+ }
+}
diff --git a/concierge/lib/presentation/screens/confirm_order/confirm_order_screen.dart b/concierge/lib/presentation/screens/confirm_order/confirm_order_screen.dart
new file mode 100644
index 00000000..8841ba6d
--- /dev/null
+++ b/concierge/lib/presentation/screens/confirm_order/confirm_order_screen.dart
@@ -0,0 +1,37 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/screens/confirm_order/bloc/confirm_order_cubit.dart';
+import 'package:concierge/presentation/screens/confirm_order/bloc/confirm_order_state.dart';
+
+class ConfirmOrderScreen extends StatelessWidget {
+ const ConfirmOrderScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return BlocBuilder<ConfirmOrderCubit, ConfirmOrderState>(
+ builder: (context, state) {
+ final cubit = context.read<ConfirmOrderCubit>();
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<ConfirmOrderCubit, ConfirmOrderState>(
+ listenWhen: (prev, curr) =>
+ prev.isLoading && curr.error.isError,
+ listener: (context, state) {
+ },
+ )
+ ],
+ child: Scaffold(
+ appBar: AppBar(),
+ body: Center(
+ child: Column(
+ children: [
+ Text("ConfirmOrder"),
+ ],
+ ),
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_cubit.dart b/concierge/lib/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_cubit.dart
index af7acc54..01acf044 100644
--- a/concierge/lib/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_cubit.dart
+++ b/concierge/lib/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_cubit.dart
@@ -3,7 +3,6 @@ import 'package:concierge/domain/models/data_state.dart';
import 'package:concierge/domain/repositories/property_repository.dart';
import 'package:concierge/presentation/base/base_cubit.dart';
import 'package:concierge/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.dart';
-import 'package:fpdart/fpdart.dart';
class HotelOverviewPageCubit extends BaseCubit<HotelOverviewPageState> {
final String hotelCode;
@@ -15,7 +14,6 @@ class HotelOverviewPageCubit extends BaseCubit<HotelOverviewPageState> {
}
Future<void> init() async {
- print("qqq init $runtimeType");
try {
safeEmit(state.copyWith(isLoading: true, errorMessage: ""));
final property = await _propertyRepository.getHotelOverview(hotelCode: hotelCode);
@@ -41,14 +39,6 @@ class HotelOverviewPageCubit extends BaseCubit<HotelOverviewPageState> {
try {
_updateAreaDataState(areaId, DataState.loading);
final response = await _propertyRepository.getArea(areaId);
- final productIds = response.categories
- .map((cat) => cat.subCategories)
- .flatten
- .map((sub) => sub.products)
- .flatten
- .toSet();
- print("qqq loadArea=$areaId, products=${productIds.length}");
- await _loadProducts(productIds);
_updateAreaDataState(areaId, DataState.success(response));
} catch (e, st) {
handleError(e, st);
@@ -56,15 +46,6 @@ class HotelOverviewPageCubit extends BaseCubit<HotelOverviewPageState> {
}
}
- Future<void> _loadProducts(Iterable<int> pIds) async {
- final futures = pIds.map(_propertyRepository.getProduct);
- final products = await Future.wait(futures);
- final pMap = Map.fromEntries(products.map((p) => MapEntry(p.id, p)));
- final stateCopy = Map.of(state.products);
- stateCopy.addAll(pMap);
- safeEmit(state.copyWith(products: stateCopy));
- }
-
void _updateAreaDataState(int areaId, DataState dataState) {
final copy = Map.of(state.areas);
copy[areaId] = dataState;
diff --git a/concierge/lib/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.dart b/concierge/lib/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.dart
index 31fa47c5..c7ccce6e 100644
--- a/concierge/lib/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.dart
+++ b/concierge/lib/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_state.dart
@@ -12,7 +12,6 @@ abstract class HotelOverviewPageState with _$HotelOverviewPageState {
@Default("") String errorMessage,
@Default(0) int selectedAreaId,
@Default({}) Map<int, DataState> areas,
- @Default({}) Map<int, Product> products,
Property? property,
}) = _HotelOverviewPageState;
}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/hotel_overview_page/hotel_overview_page_screen.dart b/concierge/lib/presentation/screens/hotel_overview_page/hotel_overview_page_screen.dart
index b27ee560..111d2335 100644
--- a/concierge/lib/presentation/screens/hotel_overview_page/hotel_overview_page_screen.dart
+++ b/concierge/lib/presentation/screens/hotel_overview_page/hotel_overview_page_screen.dart
@@ -44,11 +44,13 @@ class HotelOverviewPageScreen extends StatelessWidget {
return Center(child: Text((areaState).error.toString()));
}
final areaDetails = (areaState as Success<AreaDetails>).data;
- return CustomScrollView(
- slivers: [
- ...buildCategories(context, areaDetails.categories),
- const SliverToBoxAdapter(child: SizedBox(height: 100)),
- ],
+ final widgets = buildCategories(context, areaDetails.categories).toList();
+ return ListView.builder(
+ itemCount: widgets.length,
+ itemBuilder: (context, index) {
+ final widget = widgets[index];
+ return widget;
+ },
);
},
),
@@ -58,21 +60,19 @@ class HotelOverviewPageScreen extends StatelessWidget {
);
}
- Iterable<SingleChildRenderObjectWidget> buildCategories(
+ Iterable<Widget> buildCategories(
BuildContext context,
List<AreaCategory> categories,
) sync* {
for (final category in categories) {
- yield SliverToBoxAdapter(
- child: Padding(
- padding: const EdgeInsets.all(16.0),
- child: Text(
- category.name,
- style: TextStyle(fontSize: 24),
- ),
+ yield Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Text(
+ category.name,
+ style: TextStyle(fontSize: 24),
),
);
- yield SliverToBoxAdapter(child: Gap(16));
+ yield Gap(16);
yield* buildSubCategories(
context,
category.subCategories,
@@ -80,37 +80,32 @@ class HotelOverviewPageScreen extends StatelessWidget {
}
}
- Iterable<SingleChildRenderObjectWidget> buildSubCategories(
+ Iterable<Widget> buildSubCategories(
BuildContext context,
List<AreaSubCategory> subCategories,
) sync* {
for (final category in subCategories) {
final products = category.products;
- yield SliverToBoxAdapter(
- child: Padding(
- padding: const EdgeInsets.all(16.0),
- child: Text(
- category.name,
- style: TextStyle(fontSize: 16),
- ),
+ yield Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Text(
+ category.name,
+ style: TextStyle(fontSize: 16),
),
);
- yield SliverToBoxAdapter(
- child: SizedBox(
- height: 320,
- child: ListView.builder(
- itemCount: products.length,
- scrollDirection: Axis.horizontal,
- padding: EdgeInsets.symmetric(horizontal: 12),
- itemBuilder: (context, index) {
- final pid = products[index];
- final product = context.read<HotelOverviewPageCubit>().state.products[pid]!;
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4.0),
- child: ProductListTile(product: product),
- );
- },
- ),
+ yield SizedBox(
+ height: 320,
+ child: ListView.builder(
+ itemCount: products.length,
+ scrollDirection: Axis.horizontal,
+ padding: EdgeInsets.symmetric(horizontal: 12),
+ itemBuilder: (context, index) {
+ final pid = products[index];
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4.0),
+ child: ProductListTile(productId: pid),
+ );
+ },
),
);
}
diff --git a/concierge/lib/presentation/screens/hotel_overview_page/widgets/product_list_tile.dart b/concierge/lib/presentation/screens/hotel_overview_page/widgets/product_list_tile.dart
index 4aecca20..00db1887 100644
--- a/concierge/lib/presentation/screens/hotel_overview_page/widgets/product_list_tile.dart
+++ b/concierge/lib/presentation/screens/hotel_overview_page/widgets/product_list_tile.dart
@@ -1,70 +1,89 @@
import 'package:concierge/data/remote/models/product.dart';
+import 'package:concierge/domain/models/data_state.dart';
+import 'package:concierge/presentation/app/concierge_cubit.dart';
+import 'package:concierge/presentation/screens/hotel_overview_page/bloc/hotel_overview_page_cubit.dart';
import 'package:concierge/presentation/screens/product_details/product_details_route.dart';
import 'package:concierge/presentation/widgets/padded_column.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:gap/gap.dart';
class ProductListTile extends StatelessWidget {
- const ProductListTile({super.key, required this.product});
+ const ProductListTile({super.key, required this.productId});
- final Product product;
+ final int productId;
@override
Widget build(BuildContext context) {
- return Material(
- child: Ink(
- width: MediaQuery.of(context).size.width * 0.8,
- decoration: BoxDecoration(
- border: Border.all(color: Colors.grey, width: 1),
- borderRadius: BorderRadius.all(Radius.circular(16)),
- ),
- child: InkWell(
- borderRadius: BorderRadius.all(Radius.circular(16)),
-
- onTap: () {
- ProductDetailsRoute(product.id).push(context);
- },
- child: ClipRect(
- clipBehavior: Clip.antiAlias,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- if (product.images.isNotEmpty)
- Image.network(
-
- product.images.first.url,
- fit: BoxFit.fitWidth,
- height: 180,
- width: double.infinity,
- )
- else
- SizedBox(height: 180),
- PaddedColumn(
- padding: EdgeInsets.all(16),
- children: [
- Row(
- children: [
- Icon(Icons.watch_later_outlined),
- Text(product.estimatedDeliveryTime),
- ],
- ),
- Gap(16),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ final cubit = context.read<ConciergeCubit>();
+ return BlocBuilder<ConciergeCubit, ConciergeState>(
+ builder: (context, state) {
+ final dataState = cubit.getProductState(productId);
+ return Material(
+ child: Ink(
+ width: MediaQuery.of(context).size.width * 0.8,
+ decoration: BoxDecoration(
+ border: Border.all(color: Colors.grey, width: 1),
+ borderRadius: BorderRadius.all(Radius.circular(16)),
+ ),
+ child: Builder(
+ builder: (context) {
+ if (dataState is Loading) {
+ return Center(child: Text("LOADING"));
+ }
+ if (dataState is Failure) {
+ return Center(child: Text(dataState.error.toString()));
+ }
+ final product = (dataState as Success<Product>).data;
+ return InkWell(
+ borderRadius: BorderRadius.all(Radius.circular(16)),
+ onTap: () {
+ ProductDetailsRoute(product.id).push(context);
+ },
+ child: ClipRect(
+ clipBehavior: Clip.antiAlias,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(product.title),
- Text(product.price.toString()),
+ if (product.images.isNotEmpty)
+ Image.network(
+ product.images.first.url,
+ fit: BoxFit.fitWidth,
+ height: 180,
+ width: double.infinity,
+ )
+ else
+ SizedBox(height: 180),
+ PaddedColumn(
+ padding: EdgeInsets.all(16),
+ children: [
+ Row(
+ children: [
+ Icon(Icons.watch_later_outlined),
+ Text(product.estimatedDeliveryTime),
+ ],
+ ),
+ Gap(16),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text(product.title),
+ Text(product.price.toString()),
+ ],
+ ),
+ Gap(8),
+ Text(product.subTitle),
+ ],
+ ),
],
),
- Gap(8),
- Text(product.subTitle),
- ],
- ),
- ],
+ ),
+ );
+ },
),
),
- ),
- ),
+ );
+ },
);
}
}
diff --git a/concierge/lib/presentation/screens/payment/bloc/payment_cubit.dart b/concierge/lib/presentation/screens/payment/bloc/payment_cubit.dart
new file mode 100644
index 00000000..938f2702
--- /dev/null
+++ b/concierge/lib/presentation/screens/payment/bloc/payment_cubit.dart
@@ -0,0 +1,12 @@
+import 'package:concierge/presentation/base/base_cubit.dart';
+import 'package:concierge/presentation/screens/payment/bloc/payment_state.dart';
+
+class PaymentCubit extends BaseCubit<PaymentState> {
+ PaymentCubit() : super(const PaymentState()) {
+ init();
+ }
+
+ Future<void> init() async {
+
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/payment/bloc/payment_state.dart b/concierge/lib/presentation/screens/payment/bloc/payment_state.dart
new file mode 100644
index 00000000..6875d33b
--- /dev/null
+++ b/concierge/lib/presentation/screens/payment/bloc/payment_state.dart
@@ -0,0 +1,12 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:concierge/domain/models/app_error.dart';
+
+part '../../../../_generated/presentation/screens/payment/bloc/payment_state.freezed.dart';
+
+@freezed
+abstract class PaymentState with _$PaymentState {
+ const factory PaymentState({
+ @Default(false) bool isLoading,
+ @Default(AppError.none) AppError error,
+ }) = _PaymentState;
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/payment/payment_route.dart b/concierge/lib/presentation/screens/payment/payment_route.dart
new file mode 100644
index 00000000..4df7a2e8
--- /dev/null
+++ b/concierge/lib/presentation/screens/payment/payment_route.dart
@@ -0,0 +1,23 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/navigation/app_routes.dart';
+import 'package:go_router/go_router.dart';
+import 'package:concierge/presentation/navigation/transitions/slide_up_transition.dart';
+import 'package:concierge/presentation/screens/payment/bloc/payment_cubit.dart';
+import 'package:concierge/presentation/screens/payment/payment_screen.dart';
+
+part '../../../_generated/presentation/screens/payment/payment_route.g.dart';
+
+@TypedGoRoute<PaymentRoute>(path: AppRoutes.payment)
+class PaymentRoute extends GoRouteData with $PaymentRoute {
+ @override
+ Page<void> buildPage(BuildContext context, GoRouterState state) {
+ return slideUpTransition(
+ state: state,
+ child: BlocProvider(
+ create: (context) => PaymentCubit(),
+ child: PaymentScreen(),
+ ),
+ );
+ }
+}
diff --git a/concierge/lib/presentation/screens/payment/payment_screen.dart b/concierge/lib/presentation/screens/payment/payment_screen.dart
new file mode 100644
index 00000000..cec212bd
--- /dev/null
+++ b/concierge/lib/presentation/screens/payment/payment_screen.dart
@@ -0,0 +1,37 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/screens/payment/bloc/payment_cubit.dart';
+import 'package:concierge/presentation/screens/payment/bloc/payment_state.dart';
+
+class PaymentScreen extends StatelessWidget {
+ const PaymentScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return BlocBuilder<PaymentCubit, PaymentState>(
+ builder: (context, state) {
+ final cubit = context.read<PaymentCubit>();
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<PaymentCubit, PaymentState>(
+ listenWhen: (prev, curr) =>
+ prev.isLoading && curr.error.isError,
+ listener: (context, state) {
+ },
+ )
+ ],
+ child: Scaffold(
+ appBar: AppBar(),
+ body: Center(
+ child: Column(
+ children: [
+ Text("Payment"),
+ ],
+ ),
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/product_details/bloc/product_details_cubit.dart b/concierge/lib/presentation/screens/product_details/bloc/product_details_cubit.dart
index 17662c66..ed90cf96 100644
--- a/concierge/lib/presentation/screens/product_details/bloc/product_details_cubit.dart
+++ b/concierge/lib/presentation/screens/product_details/bloc/product_details_cubit.dart
@@ -1,30 +1,52 @@
+import 'dart:async';
+
+import 'package:concierge/data/remote/models/product.dart';
import 'package:concierge/domain/models/app_error.dart';
-import 'package:concierge/domain/repositories/property_repository.dart';
+import 'package:concierge/domain/models/data_state.dart';
+import 'package:concierge/presentation/app/concierge_cubit.dart';
import 'package:concierge/presentation/base/base_cubit.dart';
import 'package:concierge/presentation/screens/product_details/bloc/product_details_state.dart';
class ProductDetailsCubit extends BaseCubit<ProductDetailsState> {
- final PropertyRepository _propertyRepository;
+ final ConciergeCubit _conciergeCubit;
ProductDetailsCubit(
- this._propertyRepository, {
+ this._conciergeCubit, {
required this.productId,
}) : super(const ProductDetailsState()) {
init();
}
+ late final StreamSubscription<ConciergeState> conciergeStateStream;
final int productId;
Future<void> init() async {
- try {
- safeEmit(state.copyWith(isLoading: true));
- final product = await _propertyRepository.getProduct(productId);
- safeEmit(state.copyWith(product: product));
- } catch (e, st) {
- handleError(e, st);
- safeEmit(state.copyWith(error: AppError.unknown(e.toString())));
- } finally {
- safeEmit(state.copyWith(isLoading: false));
- }
+ conciergeStateStream = _conciergeCubit.stream.listen((conciergeState) {
+ final dataState = _conciergeCubit.getProductState(productId);
+ switch (dataState) {
+ case Initial _:
+ case Loading _:
+ safeEmit(state.copyWith(isLoading: true, error: AppError.none));
+ break;
+ case Success _:
+ safeEmit(
+ state.copyWith(isLoading: false, product: dataState.data as Product),
+ );
+ break;
+ case Failure _:
+ safeEmit(
+ state.copyWith(
+ isLoading: false,
+ error: AppError.unknown((dataState).error.toString()),
+ ),
+ );
+ }
+ });
+ }
+
+ @override
+ Future<void> close() async {
+ await conciergeStateStream.cancel();
+ return super.close();
}
}
diff --git a/concierge/lib/presentation/screens/product_details/product_details_screen.dart b/concierge/lib/presentation/screens/product_details/product_details_screen.dart
index 90f95db4..733b7459 100644
--- a/concierge/lib/presentation/screens/product_details/product_details_screen.dart
+++ b/concierge/lib/presentation/screens/product_details/product_details_screen.dart
@@ -36,7 +36,7 @@ class ProductDetailsScreen extends StatelessWidget {
}
return Column(
children: [
- ProductListTile(product: state.requireProduct),
+ ProductListTile(productId: cubit.productId),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
diff --git a/concierge/lib/presentation/screens/provide_location/bloc/provide_location_cubit.dart b/concierge/lib/presentation/screens/provide_location/bloc/provide_location_cubit.dart
new file mode 100644
index 00000000..21874548
--- /dev/null
+++ b/concierge/lib/presentation/screens/provide_location/bloc/provide_location_cubit.dart
@@ -0,0 +1,12 @@
+import 'package:concierge/presentation/base/base_cubit.dart';
+import 'package:concierge/presentation/screens/provide_location/bloc/provide_location_state.dart';
+
+class ProvideLocationCubit extends BaseCubit<ProvideLocationState> {
+ ProvideLocationCubit() : super(const ProvideLocationState()) {
+ init();
+ }
+
+ Future<void> init() async {
+
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/provide_location/bloc/provide_location_state.dart b/concierge/lib/presentation/screens/provide_location/bloc/provide_location_state.dart
new file mode 100644
index 00000000..d4bb64e8
--- /dev/null
+++ b/concierge/lib/presentation/screens/provide_location/bloc/provide_location_state.dart
@@ -0,0 +1,12 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:concierge/domain/models/app_error.dart';
+
+part '../../../../_generated/presentation/screens/provide_location/bloc/provide_location_state.freezed.dart';
+
+@freezed
+abstract class ProvideLocationState with _$ProvideLocationState {
+ const factory ProvideLocationState({
+ @Default(false) bool isLoading,
+ @Default(AppError.none) AppError error,
+ }) = _ProvideLocationState;
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/provide_location/provide_location_route.dart b/concierge/lib/presentation/screens/provide_location/provide_location_route.dart
new file mode 100644
index 00000000..28fe2a72
--- /dev/null
+++ b/concierge/lib/presentation/screens/provide_location/provide_location_route.dart
@@ -0,0 +1,23 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/navigation/app_routes.dart';
+import 'package:go_router/go_router.dart';
+import 'package:concierge/presentation/navigation/transitions/slide_up_transition.dart';
+import 'package:concierge/presentation/screens/provide_location/bloc/provide_location_cubit.dart';
+import 'package:concierge/presentation/screens/provide_location/provide_location_screen.dart';
+
+part '../../../_generated/presentation/screens/provide_location/provide_location_route.g.dart';
+
+@TypedGoRoute<ProvideLocationRoute>(path: AppRoutes.provideLocation)
+class ProvideLocationRoute extends GoRouteData with $ProvideLocationRoute {
+ @override
+ Page<void> buildPage(BuildContext context, GoRouterState state) {
+ return slideUpTransition(
+ state: state,
+ child: BlocProvider(
+ create: (context) => ProvideLocationCubit(),
+ child: ProvideLocationScreen(),
+ ),
+ );
+ }
+}
diff --git a/concierge/lib/presentation/screens/provide_location/provide_location_screen.dart b/concierge/lib/presentation/screens/provide_location/provide_location_screen.dart
new file mode 100644
index 00000000..f056b288
--- /dev/null
+++ b/concierge/lib/presentation/screens/provide_location/provide_location_screen.dart
@@ -0,0 +1,37 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/screens/provide_location/bloc/provide_location_cubit.dart';
+import 'package:concierge/presentation/screens/provide_location/bloc/provide_location_state.dart';
+
+class ProvideLocationScreen extends StatelessWidget {
+ const ProvideLocationScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return BlocBuilder<ProvideLocationCubit, ProvideLocationState>(
+ builder: (context, state) {
+ final cubit = context.read<ProvideLocationCubit>();
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<ProvideLocationCubit, ProvideLocationState>(
+ listenWhen: (prev, curr) =>
+ prev.isLoading && curr.error.isError,
+ listener: (context, state) {
+ },
+ )
+ ],
+ child: Scaffold(
+ appBar: AppBar(),
+ body: Center(
+ child: Column(
+ children: [
+ Text("ProvideLocation"),
+ ],
+ ),
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/receipt/bloc/receipt_cubit.dart b/concierge/lib/presentation/screens/receipt/bloc/receipt_cubit.dart
new file mode 100644
index 00000000..cec1eb70
--- /dev/null
+++ b/concierge/lib/presentation/screens/receipt/bloc/receipt_cubit.dart
@@ -0,0 +1,12 @@
+import 'package:concierge/presentation/base/base_cubit.dart';
+import 'package:concierge/presentation/screens/receipt/bloc/receipt_state.dart';
+
+class ReceiptCubit extends BaseCubit<ReceiptState> {
+ ReceiptCubit() : super(const ReceiptState()) {
+ init();
+ }
+
+ Future<void> init() async {
+
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/receipt/bloc/receipt_state.dart b/concierge/lib/presentation/screens/receipt/bloc/receipt_state.dart
new file mode 100644
index 00000000..9b6340a4
--- /dev/null
+++ b/concierge/lib/presentation/screens/receipt/bloc/receipt_state.dart
@@ -0,0 +1,12 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:concierge/domain/models/app_error.dart';
+
+part '../../../../_generated/presentation/screens/receipt/bloc/receipt_state.freezed.dart';
+
+@freezed
+abstract class ReceiptState with _$ReceiptState {
+ const factory ReceiptState({
+ @Default(false) bool isLoading,
+ @Default(AppError.none) AppError error,
+ }) = _ReceiptState;
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/receipt/receipt_route.dart b/concierge/lib/presentation/screens/receipt/receipt_route.dart
new file mode 100644
index 00000000..4409d222
--- /dev/null
+++ b/concierge/lib/presentation/screens/receipt/receipt_route.dart
@@ -0,0 +1,23 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/navigation/app_routes.dart';
+import 'package:go_router/go_router.dart';
+import 'package:concierge/presentation/navigation/transitions/slide_up_transition.dart';
+import 'package:concierge/presentation/screens/receipt/bloc/receipt_cubit.dart';
+import 'package:concierge/presentation/screens/receipt/receipt_screen.dart';
+
+part '../../../_generated/presentation/screens/receipt/receipt_route.g.dart';
+
+@TypedGoRoute<ReceiptRoute>(path: AppRoutes.receipt)
+class ReceiptRoute extends GoRouteData with $ReceiptRoute {
+ @override
+ Page<void> buildPage(BuildContext context, GoRouterState state) {
+ return slideUpTransition(
+ state: state,
+ child: BlocProvider(
+ create: (context) => ReceiptCubit(),
+ child: ReceiptScreen(),
+ ),
+ );
+ }
+}
diff --git a/concierge/lib/presentation/screens/receipt/receipt_screen.dart b/concierge/lib/presentation/screens/receipt/receipt_screen.dart
new file mode 100644
index 00000000..46fc6d70
--- /dev/null
+++ b/concierge/lib/presentation/screens/receipt/receipt_screen.dart
@@ -0,0 +1,37 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/screens/receipt/bloc/receipt_cubit.dart';
+import 'package:concierge/presentation/screens/receipt/bloc/receipt_state.dart';
+
+class ReceiptScreen extends StatelessWidget {
+ const ReceiptScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return BlocBuilder<ReceiptCubit, ReceiptState>(
+ builder: (context, state) {
+ final cubit = context.read<ReceiptCubit>();
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<ReceiptCubit, ReceiptState>(
+ listenWhen: (prev, curr) =>
+ prev.isLoading && curr.error.isError,
+ listener: (context, state) {
+ },
+ )
+ ],
+ child: Scaffold(
+ appBar: AppBar(),
+ body: Center(
+ child: Column(
+ children: [
+ Text("Receipt"),
+ ],
+ ),
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/review_order/bloc/review_order_cubit.dart b/concierge/lib/presentation/screens/review_order/bloc/review_order_cubit.dart
new file mode 100644
index 00000000..bc581cc8
--- /dev/null
+++ b/concierge/lib/presentation/screens/review_order/bloc/review_order_cubit.dart
@@ -0,0 +1,12 @@
+import 'package:concierge/presentation/base/base_cubit.dart';
+import 'package:concierge/presentation/screens/review_order/bloc/review_order_state.dart';
+
+class ReviewOrderCubit extends BaseCubit<ReviewOrderState> {
+ ReviewOrderCubit() : super(const ReviewOrderState()) {
+ init();
+ }
+
+ Future<void> init() async {
+
+ }
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/review_order/bloc/review_order_state.dart b/concierge/lib/presentation/screens/review_order/bloc/review_order_state.dart
new file mode 100644
index 00000000..1bb83bc3
--- /dev/null
+++ b/concierge/lib/presentation/screens/review_order/bloc/review_order_state.dart
@@ -0,0 +1,12 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:concierge/domain/models/app_error.dart';
+
+part '../../../../_generated/presentation/screens/review_order/bloc/review_order_state.freezed.dart';
+
+@freezed
+abstract class ReviewOrderState with _$ReviewOrderState {
+ const factory ReviewOrderState({
+ @Default(false) bool isLoading,
+ @Default(AppError.none) AppError error,
+ }) = _ReviewOrderState;
+}
\ No newline at end of file
diff --git a/concierge/lib/presentation/screens/review_order/review_order_route.dart b/concierge/lib/presentation/screens/review_order/review_order_route.dart
new file mode 100644
index 00000000..596e7c0c
--- /dev/null
+++ b/concierge/lib/presentation/screens/review_order/review_order_route.dart
@@ -0,0 +1,23 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/navigation/app_routes.dart';
+import 'package:go_router/go_router.dart';
+import 'package:concierge/presentation/navigation/transitions/slide_up_transition.dart';
+import 'package:concierge/presentation/screens/review_order/bloc/review_order_cubit.dart';
+import 'package:concierge/presentation/screens/review_order/review_order_screen.dart';
+
+part '../../../_generated/presentation/screens/review_order/review_order_route.g.dart';
+
+@TypedGoRoute<ReviewOrderRoute>(path: AppRoutes.reviewOrder)
+class ReviewOrderRoute extends GoRouteData with $ReviewOrderRoute {
+ @override
+ Page<void> buildPage(BuildContext context, GoRouterState state) {
+ return slideUpTransition(
+ state: state,
+ child: BlocProvider(
+ create: (context) => ReviewOrderCubit(),
+ child: ReviewOrderScreen(),
+ ),
+ );
+ }
+}
diff --git a/concierge/lib/presentation/screens/review_order/review_order_screen.dart b/concierge/lib/presentation/screens/review_order/review_order_screen.dart
new file mode 100644
index 00000000..edc8083b
--- /dev/null
+++ b/concierge/lib/presentation/screens/review_order/review_order_screen.dart
@@ -0,0 +1,37 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:concierge/presentation/screens/review_order/bloc/review_order_cubit.dart';
+import 'package:concierge/presentation/screens/review_order/bloc/review_order_state.dart';
+
+class ReviewOrderScreen extends StatelessWidget {
+ const ReviewOrderScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return BlocBuilder<ReviewOrderCubit, ReviewOrderState>(
+ builder: (context, state) {
+ final cubit = context.read<ReviewOrderCubit>();
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<ReviewOrderCubit, ReviewOrderState>(
+ listenWhen: (prev, curr) =>
+ prev.isLoading && curr.error.isError,
+ listener: (context, state) {
+ },
+ )
+ ],
+ child: Scaffold(
+ appBar: AppBar(),
+ body: Center(
+ child: Column(
+ children: [
+ Text("ReviewOrder"),
+ ],
+ ),
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
\ No newline at end of file