6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 44b648d3
Changed files
comwell_key_app/assets/translations/intl_da.arb | 5 +- comwell_key_app/assets/translations/intl_en.arb | 5 +- .../lib/.generated/assets/assets.gen.dart | 5 +- .../lib/.generated/l10n/app_localizations.dart | 60 +---- .../lib/.generated/l10n/app_localizations_da.dart | 31 +-- .../lib/.generated/l10n/app_localizations_en.dart | 31 +-- .../concierge/bloc/concierge_state.freezed.dart | 277 +++++++++++++++++++++ .../screens/concierge/concierge_route.g.dart | 38 +++ .../authentication/authentication_repository.dart | 4 + .../booking_details/bloc/booking_details_bloc.dart | 8 +- .../components/booking_details_bottom_sheet.dart | 3 +- .../components/concierge_button.dart | 82 ++++++ .../choose_share_room/choose_share_room_mvp.dart | 30 +++ .../choose_share_room/choose_share_room_route.dart | 3 +- .../lib/find_booking/find_booking_mvp.dart | 30 +++ .../lib/find_booking/find_booking_route.dart | 3 +- .../screens/concierge/bloc/concierge_cubit.dart | 22 ++ .../screens/concierge/bloc/concierge_state.dart | 15 ++ .../screens/concierge/concierge_route.dart | 38 +++ .../screens/concierge/concierge_screen.dart | 38 +++ comwell_key_app/lib/routing/app_router.dart | 2 + comwell_key_app/scripts/dart/new_feature.dart | 2 +- 22 files changed, 620 insertions(+), 112 deletions(-)
Diff
diff --git a/comwell_key_app/assets/translations/intl_da.arb b/comwell_key_app/assets/translations/intl_da.arb
index 6d3fa581..bfd6a42f 100644
--- a/comwell_key_app/assets/translations/intl_da.arb
+++ b/comwell_key_app/assets/translations/intl_da.arb
@@ -397,5 +397,8 @@
"bluetooth_disabled": "Bluetooth er deaktiveret",
"please_enable_bluetooth": "Aktivér venligst Bluetooth",
"allow_usage_tracking": "Tillad brugssporing",
- "usage_tracking_rationale": "Tillad venligst sporing af, hvordan du bruger appen"
+ "usage_tracking_rationale": "Tillad venligst sporing af, hvordan du bruger appen",
+ "share_room_subtitle_mvp": "Vi arbejder i øjeblikket på at gøre det muligt at uddelegere værelser her i appen.",
+ "subtitle_mvp": "For nu kan vi desværre kun hjælpe dig via vores kundeservice. Ring os op, så finder vi en løsning. ",
+ "find_booking_subtitle_mvp": "Vi arbejder i øjeblikket på at gøre det muligt at finde din booking digitalt her i appen."
}
\ No newline at end of file
diff --git a/comwell_key_app/assets/translations/intl_en.arb b/comwell_key_app/assets/translations/intl_en.arb
index 20c614ee..b32c76f6 100644
--- a/comwell_key_app/assets/translations/intl_en.arb
+++ b/comwell_key_app/assets/translations/intl_en.arb
@@ -397,5 +397,8 @@
"bluetooth_disabled": "Bluetooth is disabled",
"please_enable_bluetooth": "Please enable bluetooth",
"allow_usage_tracking": "Allow usage tracking",
- "usage_tracking_rationale": "Please allow tracking how you use the app"
+ "usage_tracking_rationale": "Please allow tracking how you use the app",
+ "share_room_subtitle_mvp": "We are currently working on making it possible to delegate rooms here in the app.",
+ "subtitle_mvp": "Unfortunately, for now we can only help you through our customer service. Please call us and we will find a solution.",
+ "find_booking_subtitle_mvp": "We are currently working on making it possible to find your booking digitally here in the app."
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/.generated/assets/assets.gen.dart b/comwell_key_app/lib/.generated/assets/assets.gen.dart
index 5436c09a..3d9bc7bb 100644
--- a/comwell_key_app/lib/.generated/assets/assets.gen.dart
+++ b/comwell_key_app/lib/.generated/assets/assets.gen.dart
@@ -23,11 +23,8 @@ class $EnvGen {
/// File path: env/.stage.env
String get aStage => 'env/.stage.env';
- /// File path: env/Archive.zip
- String get archive => 'env/Archive.zip';
-
/// List of all assets
- List<String> get values => [aProd, aStage, archive];
+ List<String> get values => [aProd, aStage];
}
class $AssetsAnimationsGen {
diff --git a/comwell_key_app/lib/.generated/l10n/app_localizations.dart b/comwell_key_app/lib/.generated/l10n/app_localizations.dart
index 7bf1f2cb..b5fc8c5e 100644
--- a/comwell_key_app/lib/.generated/l10n/app_localizations.dart
+++ b/comwell_key_app/lib/.generated/l10n/app_localizations.dart
@@ -2481,65 +2481,23 @@ abstract class AppLocalizations {
/// **'Please allow tracking how you use the app'**
String get usage_tracking_rationale;
- /// No description provided for @accept_notifications.
+ /// No description provided for @share_room_subtitle_mvp.
///
/// In en, this message translates to:
- /// **'Allow notifications'**
- String get accept_notifications;
+ /// **'We are currently working on making it possible to delegate rooms here in the app.'**
+ String get share_room_subtitle_mvp;
- /// No description provided for @accept_notifications_rationale.
+ /// No description provided for @subtitle_mvp.
///
/// In en, this message translates to:
- /// **'To get the latest updates on your booking, please allow notifications'**
- String get accept_notifications_rationale;
+ /// **'Unfortunately, for now we can only help you through our customer service. Please call us and we will find a solution.'**
+ String get subtitle_mvp;
- /// No description provided for @allow.
- ///
- /// In en, this message translates to:
- /// **'Allow'**
- String get allow;
-
- /// No description provided for @skip.
- ///
- /// In en, this message translates to:
- /// **'Skip'**
- String get skip;
-
- /// No description provided for @internet_disabled.
- ///
- /// In en, this message translates to:
- /// **'Internet disconnected'**
- String get internet_disabled;
-
- /// No description provided for @please_enable_internet.
+ /// No description provided for @find_booking_subtitle_mvp.
///
/// In en, this message translates to:
- /// **'Please check your internet connected'**
- String get please_enable_internet;
-
- /// No description provided for @bluetooth_disabled.
- ///
- /// In en, this message translates to:
- /// **'Bluetooth is disabled'**
- String get bluetooth_disabled;
-
- /// No description provided for @please_enable_bluetooth.
- ///
- /// In en, this message translates to:
- /// **'Please enable bluetooth'**
- String get please_enable_bluetooth;
-
- /// No description provided for @allow_usage_tracking.
- ///
- /// In en, this message translates to:
- /// **'Allow usage tracking'**
- String get allow_usage_tracking;
-
- /// No description provided for @uasge_tracking_rationale.
- ///
- /// In en, this message translates to:
- /// **'Please allow tracking how you use the app'**
- String get uasge_tracking_rationale;
+ /// **'We are currently working on making it possible to find your booking digitally here in the app.'**
+ String get find_booking_subtitle_mvp;
}
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
diff --git a/comwell_key_app/lib/.generated/l10n/app_localizations_da.dart b/comwell_key_app/lib/.generated/l10n/app_localizations_da.dart
index 3f639030..566e6932 100644
--- a/comwell_key_app/lib/.generated/l10n/app_localizations_da.dart
+++ b/comwell_key_app/lib/.generated/l10n/app_localizations_da.dart
@@ -1284,33 +1284,14 @@ class AppLocalizationsDa extends AppLocalizations {
String get usage_tracking_rationale => 'Tillad venligst sporing af, hvordan du bruger appen';
@override
- String get accept_notifications => 'Tillad notifikationer';
-
- @override
- String get accept_notifications_rationale =>
- 'For at få de seneste opdateringer om din booking, bedes du tillade notifikationer';
-
- @override
- String get allow => 'Tillad';
-
- @override
- String get skip => 'Spring over';
-
- @override
- String get internet_disabled => 'Internettet er afbrudt';
-
- @override
- String get please_enable_internet => 'Tjek venligst din internetforbindelse';
-
- @override
- String get bluetooth_disabled => 'Bluetooth er deaktiveret';
-
- @override
- String get please_enable_bluetooth => 'Aktivér venligst Bluetooth';
+ String get share_room_subtitle_mvp =>
+ 'Vi arbejder i øjeblikket på at gøre det muligt at uddelegere værelser her i appen.';
@override
- String get allow_usage_tracking => 'Tillad brugssporing';
+ String get subtitle_mvp =>
+ 'For nu kan vi desværre kun hjælpe dig via vores kundeservice. Ring os op, så finder vi en løsning. ';
@override
- String get uasge_tracking_rationale => 'Tillad venligst sporing af, hvordan du bruger appen';
+ String get find_booking_subtitle_mvp =>
+ 'Vi arbejder i øjeblikket på at gøre det muligt at finde din booking digitalt her i appen.';
}
diff --git a/comwell_key_app/lib/.generated/l10n/app_localizations_en.dart b/comwell_key_app/lib/.generated/l10n/app_localizations_en.dart
index 22bf2dc8..5bb79a8f 100644
--- a/comwell_key_app/lib/.generated/l10n/app_localizations_en.dart
+++ b/comwell_key_app/lib/.generated/l10n/app_localizations_en.dart
@@ -1280,33 +1280,14 @@ class AppLocalizationsEn extends AppLocalizations {
String get usage_tracking_rationale => 'Please allow tracking how you use the app';
@override
- String get accept_notifications => 'Allow notifications';
-
- @override
- String get accept_notifications_rationale =>
- 'To get the latest updates on your booking, please allow notifications';
-
- @override
- String get allow => 'Allow';
-
- @override
- String get skip => 'Skip';
-
- @override
- String get internet_disabled => 'Internet disconnected';
-
- @override
- String get please_enable_internet => 'Please check your internet connected';
-
- @override
- String get bluetooth_disabled => 'Bluetooth is disabled';
-
- @override
- String get please_enable_bluetooth => 'Please enable bluetooth';
+ String get share_room_subtitle_mvp =>
+ 'We are currently working on making it possible to delegate rooms here in the app.';
@override
- String get allow_usage_tracking => 'Allow usage tracking';
+ String get subtitle_mvp =>
+ 'Unfortunately, for now we can only help you through our customer service. Please call us and we will find a solution.';
@override
- String get uasge_tracking_rationale => 'Please allow tracking how you use the app';
+ String get find_booking_subtitle_mvp =>
+ 'We are currently working on making it possible to find your booking digitally here in the app.';
}
diff --git a/comwell_key_app/lib/.generated/presentation/screens/concierge/bloc/concierge_state.freezed.dart b/comwell_key_app/lib/.generated/presentation/screens/concierge/bloc/concierge_state.freezed.dart
new file mode 100644
index 00000000..74003edf
--- /dev/null
+++ b/comwell_key_app/lib/.generated/presentation/screens/concierge/bloc/concierge_state.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/screens/concierge/bloc/concierge_state.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$ConciergeState {
+
+ bool get isLoading; AppError get error; String get userToken;
+/// 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&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error)&&(identical(other.userToken, userToken) || other.userToken == userToken));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error,userToken);
+
+@override
+String toString() {
+ return 'ConciergeState(isLoading: $isLoading, error: $error, userToken: $userToken)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $ConciergeStateCopyWith<$Res> {
+ factory $ConciergeStateCopyWith(ConciergeState value, $Res Function(ConciergeState) _then) = _$ConciergeStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, AppError error, String userToken
+});
+
+
+
+
+}
+/// @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? isLoading = null,Object? error = null,Object? userToken = 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,userToken: null == userToken ? _self.userToken : userToken // ignore: cast_nullable_to_non_nullable
+as String,
+ ));
+}
+
+}
+
+
+/// 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( bool isLoading, AppError error, String userToken)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _ConciergeState() when $default != null:
+return $default(_that.isLoading,_that.error,_that.userToken);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, String userToken) $default,) {final _that = this;
+switch (_that) {
+case _ConciergeState():
+return $default(_that.isLoading,_that.error,_that.userToken);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, String userToken)? $default,) {final _that = this;
+switch (_that) {
+case _ConciergeState() when $default != null:
+return $default(_that.isLoading,_that.error,_that.userToken);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _ConciergeState implements ConciergeState {
+ const _ConciergeState({this.isLoading = false, this.error = AppError.none, this.userToken = ""});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final AppError error;
+@override@JsonKey() final String userToken;
+
+/// 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&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error)&&(identical(other.userToken, userToken) || other.userToken == userToken));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,error,userToken);
+
+@override
+String toString() {
+ return 'ConciergeState(isLoading: $isLoading, error: $error, userToken: $userToken)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$ConciergeStateCopyWith<$Res> implements $ConciergeStateCopyWith<$Res> {
+ factory _$ConciergeStateCopyWith(_ConciergeState value, $Res Function(_ConciergeState) _then) = __$ConciergeStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, AppError error, String userToken
+});
+
+
+
+
+}
+/// @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? isLoading = null,Object? error = null,Object? userToken = null,}) {
+ return _then(_ConciergeState(
+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,userToken: null == userToken ? _self.userToken : userToken // ignore: cast_nullable_to_non_nullable
+as String,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/comwell_key_app/lib/.generated/presentation/screens/concierge/concierge_route.g.dart b/comwell_key_app/lib/.generated/presentation/screens/concierge/concierge_route.g.dart
new file mode 100644
index 00000000..95e40b17
--- /dev/null
+++ b/comwell_key_app/lib/.generated/presentation/screens/concierge/concierge_route.g.dart
@@ -0,0 +1,38 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../../presentation/screens/concierge/concierge_route.dart';
+
+// **************************************************************************
+// GoRouterGenerator
+// **************************************************************************
+
+List<RouteBase> get $appRoutes => [$conciergeRoute];
+
+RouteBase get $conciergeRoute =>
+ GoRouteData.$route(path: '/concierge', factory: $ConciergeRoute._fromState);
+
+mixin $ConciergeRoute on GoRouteData {
+ static ConciergeRoute _fromState(GoRouterState state) =>
+ ConciergeRoute(hotelCode: state.uri.queryParameters['hotel-code']!);
+
+ ConciergeRoute get _self => this as ConciergeRoute;
+
+ @override
+ String get location => GoRouteData.$location(
+ '/concierge',
+ queryParams: {'hotel-code': _self.hotelCode},
+ );
+
+ @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/comwell_key_app/lib/authentication/authentication_repository.dart b/comwell_key_app/lib/authentication/authentication_repository.dart
index 3cc2bdc0..aeb45119 100644
--- a/comwell_key_app/lib/authentication/authentication_repository.dart
+++ b/comwell_key_app/lib/authentication/authentication_repository.dart
@@ -56,4 +56,8 @@ class AuthenticationRepository {
value: 'true',
);
}
+
+ Future<String> getAccessToken() async {
+ return await _msalService.acquireTokenSilent();
+ }
}
diff --git a/comwell_key_app/lib/booking_details/bloc/booking_details_bloc.dart b/comwell_key_app/lib/booking_details/bloc/booking_details_bloc.dart
index 1872bebf..8f43ea5a 100644
--- a/comwell_key_app/lib/booking_details/bloc/booking_details_bloc.dart
+++ b/comwell_key_app/lib/booking_details/bloc/booking_details_bloc.dart
@@ -300,7 +300,13 @@ class BookingDetailsBloc extends Bloc<BookingDetailsEvent, BookingDetailsState>
DateTime getCheckOutTime() => booking.endDate.add(const Duration(hours: 5));
- bool get isHouseKeepingTime => booking.endDate.difference(booking.startDate).inDays >= 2;
+ bool get isHouseKeepingTime {
+ final now = DateTime.now();
+ final tomorrow = DateTime(now.year, now.month, now.day + 1);
+ final checkoutDay = DateTime(booking.endDate.year, booking.endDate.month, booking.endDate.day);
+ if (checkoutDay == tomorrow) return false;
+ return booking.endDate.difference(booking.startDate).inDays >= 2;
+ }
Future<void> getUser(Emitter<BookingDetailsState> emit, {bool fetchRemote = false}) async {
user = await profileRepository.fetchProfileSettings(fetchRemote: fetchRemote);
diff --git a/comwell_key_app/lib/booking_details/components/booking_details_bottom_sheet.dart b/comwell_key_app/lib/booking_details/components/booking_details_bottom_sheet.dart
index e809dd58..423491b7 100644
--- a/comwell_key_app/lib/booking_details/components/booking_details_bottom_sheet.dart
+++ b/comwell_key_app/lib/booking_details/components/booking_details_bottom_sheet.dart
@@ -1,5 +1,6 @@
import 'package:comwell_key_app/booking_details/bloc/booking_details_bloc.dart';
import 'package:comwell_key_app/booking_details/components/check_out_button.dart';
+import 'package:comwell_key_app/booking_details/components/concierge_button.dart';
import 'package:comwell_key_app/booking_details/components/housekeeping_button.dart';
import 'package:comwell_key_app/booking_details/components/practical_information_button.dart';
import 'package:comwell_key_app/common/components/comwell_error_widget.dart';
@@ -133,7 +134,7 @@ class BookingDetailsBottomSheet extends StatelessWidget {
Widget _buildUpSalesCatalogButton(ReservationStatus reservationStatus, BuildContext context) {
switch (reservationStatus) {
case ReservationStatus.checkedin:
- return const SizedBox();
+ return ConciergeButton(hotelCode: cubit.booking.hotelCode);
case ReservationStatus.newreservation:
return _buildServices(context);
case ReservationStatus.preregistered:
diff --git a/comwell_key_app/lib/booking_details/components/concierge_button.dart b/comwell_key_app/lib/booking_details/components/concierge_button.dart
new file mode 100644
index 00000000..f92515bc
--- /dev/null
+++ b/comwell_key_app/lib/booking_details/components/concierge_button.dart
@@ -0,0 +1,82 @@
+
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:comwell_key_app/utils/l10n_utils.dart';
+import 'package:flutter/material.dart';
+import 'package:go_router/go_router.dart';
+
+class ConciergeButton extends StatelessWidget {
+ final String hotelCode;
+ const ConciergeButton({super.key, required this.hotelCode});
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+
+ return GestureDetector(
+ onTap: () {
+ context.push(AppRoutes.concierge, extra: [hotelCode]);
+ },
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+ child: Container(
+ width: double.infinity,
+ height: 211,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(12),
+ border: Border.all(color: colorDivider, width: 1),
+ ),
+ child: Stack(
+ children: [
+ ClipRRect(
+ borderRadius: BorderRadius.circular(12),
+ child: Image.asset(
+ 'assets/images/catalog_image.png',
+ width: double.infinity,
+ height: double.infinity,
+ fit: BoxFit.cover,
+ ),
+ ),
+ Container(
+ decoration: const BoxDecoration(
+ borderRadius: BorderRadius.all(Radius.circular(12)),
+ gradient: LinearGradient(
+ begin: Alignment.topCenter,
+ end: Alignment.bottomCenter,
+ colors: [
+ Colors.black26,
+ Colors.black54,
+ ],
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.end,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ context.strings.up_sales_catalog_button_title,
+ style: theme.textTheme.headlineMedium?.copyWith(
+ color: Colors.white,
+ ),
+ ),
+ Text(
+ context.strings.up_sales_catalog_button_subtitle,
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: Colors.white,
+ ),
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/choose_share_room/choose_share_room_mvp.dart b/comwell_key_app/lib/choose_share_room/choose_share_room_mvp.dart
new file mode 100644
index 00000000..76a1eea3
--- /dev/null
+++ b/comwell_key_app/lib/choose_share_room/choose_share_room_mvp.dart
@@ -0,0 +1,30 @@
+import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
+import 'package:comwell_key_app/utils/l10n_utils.dart';
+import 'package:flutter/material.dart';
+
+class ChooseShareRoomMVP extends StatelessWidget {
+ const ChooseShareRoomMVP({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ return Scaffold(
+ backgroundColor: theme.colorScheme.surface,
+ appBar: const ComwellAppBar(),
+ body: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const SizedBox(height: 24),
+ Text(context.strings.share_room, style: theme.textTheme.headlineLarge),
+ const SizedBox(height: 16),
+ Text(context.strings.share_room_subtitle_mvp, style: theme.textTheme.bodySmall),
+ const SizedBox(height: 16),
+ Text(context.strings.subtitle_mvp, style: theme.textTheme.bodySmall),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/choose_share_room/choose_share_room_route.dart b/comwell_key_app/lib/choose_share_room/choose_share_room_route.dart
index 536ab0d1..be4ae2f0 100644
--- a/comwell_key_app/lib/choose_share_room/choose_share_room_route.dart
+++ b/comwell_key_app/lib/choose_share_room/choose_share_room_route.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/choose_share_room/choose_share_room_mvp.dart';
import 'package:comwell_key_app/choose_share_room/choose_share_room_page.dart';
import 'package:comwell_key_app/choose_share_room/cubit/choose_share_room_cubit.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
@@ -12,7 +13,7 @@ final chooseShareRoomRoute = GoRoute(
final booking = state.extra as Booking;
return BlocProvider(
create: (context) => ChooseShareRoomCubit(locator()),
- child: ChooseShareRoomPage(booking: booking),
+ child: const ChooseShareRoomMVP(),
);
},
);
diff --git a/comwell_key_app/lib/find_booking/find_booking_mvp.dart b/comwell_key_app/lib/find_booking/find_booking_mvp.dart
new file mode 100644
index 00000000..40045722
--- /dev/null
+++ b/comwell_key_app/lib/find_booking/find_booking_mvp.dart
@@ -0,0 +1,30 @@
+import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
+import 'package:comwell_key_app/utils/l10n_utils.dart';
+import 'package:flutter/material.dart';
+
+class FindBookingMVP extends StatelessWidget {
+ const FindBookingMVP({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ return Scaffold(
+ backgroundColor: theme.colorScheme.surface,
+ appBar: const ComwellAppBar(),
+ body: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const SizedBox(height: 24),
+ Text(context.strings.find_booking, style: theme.textTheme.headlineLarge),
+ const SizedBox(height: 16),
+ Text(context.strings.find_booking_subtitle_mvp, style: theme.textTheme.bodySmall),
+ const SizedBox(height: 16),
+ Text(context.strings.subtitle_mvp, style: theme.textTheme.bodySmall),
+ ],
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/find_booking/find_booking_route.dart b/comwell_key_app/lib/find_booking/find_booking_route.dart
index 56ff61c5..50ca3439 100644
--- a/comwell_key_app/lib/find_booking/find_booking_route.dart
+++ b/comwell_key_app/lib/find_booking/find_booking_route.dart
@@ -1,4 +1,5 @@
import 'package:comwell_key_app/find_booking/cubit/find_booking_cubit.dart';
+import 'package:comwell_key_app/find_booking/find_booking_mvp.dart';
import 'package:comwell_key_app/find_booking/find_booking_page.dart';
import 'package:comwell_key_app/find_booking/loading_page.dart';
import 'package:comwell_key_app/routing/app_routes.dart';
@@ -10,7 +11,7 @@ final findBookingRoute = GoRoute(
builder: (context, state) {
return BlocProvider(
create: (context) => FindBookingCubit(),
- child: const FindBookingPage(),
+ child: const FindBookingMVP(),
);
},
);
diff --git a/comwell_key_app/lib/presentation/screens/concierge/bloc/concierge_cubit.dart b/comwell_key_app/lib/presentation/screens/concierge/bloc/concierge_cubit.dart
new file mode 100644
index 00000000..4f6013eb
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/concierge/bloc/concierge_cubit.dart
@@ -0,0 +1,22 @@
+import 'package:comwell_key_app/authentication/authentication_repository.dart';
+import 'package:comwell_key_app/domain/models/app_error.dart';
+import 'package:comwell_key_app/presentation/base/base_cubit.dart';
+import 'package:comwell_key_app/presentation/screens/concierge/bloc/concierge_state.dart';
+
+class ConciergeCubit extends BaseCubit<ConciergeState> {
+ final AuthenticationRepository _authenticationRepository;
+ ConciergeCubit(this._authenticationRepository,) : super(const ConciergeState()) {
+ init();
+ }
+
+ Future<void> init() async {
+ try {
+ safeEmit(state.copyWith(isLoading: true));
+ final userToken = await _authenticationRepository.getAccessToken();
+ safeEmit(state.copyWith(userToken: userToken, isLoading: false, error: AppError.none));
+ } catch (e, st) {
+ logError(e, st);
+ safeEmit(state.copyWith(error: AppError.unknown(e.toString())));
+ }
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/presentation/screens/concierge/bloc/concierge_state.dart b/comwell_key_app/lib/presentation/screens/concierge/bloc/concierge_state.dart
new file mode 100644
index 00000000..8ec2ab87
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/concierge/bloc/concierge_state.dart
@@ -0,0 +1,15 @@
+import 'package:comwell_key_app/domain/models/app_error.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part '../../../../.generated/presentation/screens/concierge/bloc/concierge_state.freezed.dart';
+
+@freezed
+abstract class ConciergeState with _$ConciergeState {
+ const factory ConciergeState({
+ @Default(false) bool isLoading,
+ @Default(AppError.none) AppError error,
+ @Default("") String userToken,
+ }) = _ConciergeState;
+
+
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/presentation/screens/concierge/concierge_route.dart b/comwell_key_app/lib/presentation/screens/concierge/concierge_route.dart
new file mode 100644
index 00000000..da94e333
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/concierge/concierge_route.dart
@@ -0,0 +1,38 @@
+import 'package:comwell_key_app/presentation/screens/concierge/bloc/concierge_state.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:comwell_key_app/utils/locator.dart';
+import 'package:concierge/concierge_config.dart';
+import 'package:concierge/flavors.dart';
+import 'package:concierge/presentation/app/concierge_hotel_overview.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+import 'package:comwell_key_app/presentation/navigation/transitions/slide_in_transition.dart';
+import 'package:comwell_key_app/presentation/screens/concierge/bloc/concierge_cubit.dart';
+import 'package:comwell_key_app/presentation/screens/concierge/concierge_screen.dart';
+
+part '../../../.generated/presentation/screens/concierge/concierge_route.g.dart';
+
+@TypedGoRoute<ConciergeRoute>(
+ path: AppRoutes.concierge,
+)
+class ConciergeRoute extends GoRouteData with $ConciergeRoute {
+ final String hotelCode;
+
+ ConciergeRoute({required this.hotelCode});
+
+ @override
+ Page<void> buildPage(BuildContext context, GoRouterState state) {
+ return SlideInTransition(
+ state: state,
+ child: BlocProvider(
+ create: (context) => ConciergeCubit(locator()),
+ child: BlocBuilder<ConciergeCubit, ConciergeState>(
+ builder: (context, state) {
+ return ConciergeHotelOverview(config: ConciergeConfig(hotelCode: hotelCode, flavor: Flavor.production, userToken: state.userToken));
+ },
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/presentation/screens/concierge/concierge_screen.dart b/comwell_key_app/lib/presentation/screens/concierge/concierge_screen.dart
new file mode 100644
index 00000000..2513cbe8
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/concierge/concierge_screen.dart
@@ -0,0 +1,38 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:comwell_key_app/presentation/screens/concierge/bloc/concierge_cubit.dart';
+import 'package:comwell_key_app/presentation/screens/concierge/bloc/concierge_state.dart';
+
+class ConciergeScreen extends StatelessWidget {
+ const ConciergeScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return BlocBuilder<ConciergeCubit, ConciergeState>(
+ builder: (context, state) {
+ final cubit = context.read<ConciergeCubit>();
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<ConciergeCubit, ConciergeState>(
+ listenWhen: (prev, curr) =>
+ prev.isLoading && !curr.isLoading && curr.error.isError,
+ listener: (context, state) {
+ // context.showErrorSnackBar(state.errorMessage);
+ },
+ )
+ ],
+ child: Scaffold(
+ appBar: AppBar(),
+ body: Center(
+ child: Column(
+ children: [
+ Text("Concierge"),
+ ],
+ ),
+ ),
+ ),
+ );
+ },
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index 51e06c28..1e881033 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -8,6 +8,7 @@ import 'package:comwell_key_app/my_booking/my_booking_route.dart';
import 'package:comwell_key_app/notifications/notifications_route.dart';
import 'package:comwell_key_app/pregistration/preregistration_route.dart';
import 'package:comwell_key_app/presentation/screens/change_password/change_password_route.dart';
+import 'package:comwell_key_app/presentation/screens/concierge/concierge_route.dart';
import 'package:comwell_key_app/presentation/screens/payment_processing/payment_processing_route.dart';
import 'package:comwell_key_app/presentation/screens/room_info/room_info_route.dart';
import 'package:comwell_key_app/contact/contact_route.dart';
@@ -102,6 +103,7 @@ final router = GoRouter(
receivedSharedBookingRoute,
bookingDetailsWithIdRoute,
findBookingLoadingRoute,
+ $conciergeRoute,
myBookingRoute,
paymentCardRoute,
preregistrationRoute,
diff --git a/comwell_key_app/scripts/dart/new_feature.dart b/comwell_key_app/scripts/dart/new_feature.dart
index 3ad9fae4..15565744 100644
--- a/comwell_key_app/scripts/dart/new_feature.dart
+++ b/comwell_key_app/scripts/dart/new_feature.dart
@@ -94,7 +94,7 @@ abstract class $stateName with _\$$stateName {
@Default(AppError.none) AppError error,
}) = _$stateName;
- TestState loading() => copyWith(isLoading: true, error: AppError.none);
+ $stateName loading() => copyWith(isLoading: true, error: AppError.none);
}
"""