6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit ea96bd93
Changed files
.../assets/translations/all_translations.csv | 1 + comwell_key_app/assets/translations/intl_da.arb | 17 +- comwell_key_app/assets/translations/intl_en.arb | 21 ++- .../lib/.generated/assets/assets.gen.dart | 5 +- .../hotel_information/models/addon_upgrade.g.dart | 4 +- .../lib/.generated/l10n/app_localizations.dart | 94 +++++++++- .../lib/.generated/l10n/app_localizations_da.dart | 51 +++++- .../lib/.generated/l10n/app_localizations_en.dart | 53 +++++- .../models/add_card_payment_method.g.dart | 29 ---- .../cubit/preregistration_state.freezed.dart | 78 ++++++--- .../.generated/services/adyen/adyen_amount.g.dart | 18 -- .../services/adyen/payment_method.g.dart | 38 ---- .../services/adyen/stored_payment_method.g.dart | 28 --- .../adyen/stored_payment_methods_response.g.dart | 25 --- .../up_sales/models/dto/addon_upgrade_dto.g.dart | 4 +- .../lib/common/components/comwell_text_field.dart | 7 +- comwell_key_app/lib/database/daos/upsales_dao.dart | 2 +- .../repositories/pregistration_repository.dart | 2 +- .../hotel_information/models/addon_upgrade.dart | 3 +- .../bloc/booking_details_cubit.dart | 3 +- .../booking_details/booking_details_page.dart | 44 +++-- .../components/booking_details_bottom_sheet.dart | 2 +- .../components/check_in_button_timer.dart | 140 +++++++++------ .../pregistration/cubit/preregistration_cubit.dart | 96 +++++----- .../pregistration/cubit/preregistration_state.dart | 3 + .../pregistration/pages/prereg_address_page.dart | 55 +----- .../pages/prereg_confirmation_page.dart | 193 ++++++++++++++++++++- .../pregistration/pages/prereg_profile_page.dart | 100 +++++++++++ .../pregistration/prereg_request_model.dart | 7 +- .../pregistration/preregistration_flow.dart | 8 +- .../bloc/profile_settings_cubit.dart | 2 +- .../components/date_time_picker.dart | 96 ++++++---- .../components/intl_phone_field.dart | 29 ++-- .../profile_settings/profile_settings_screen.dart | 3 + comwell_key_app/lib/services/api.dart | 4 +- .../lib/services/mappers/user_mapper.dart | 6 +- .../lib/services/utils/api_endpoints.dart | 2 +- .../lib/up_sales/cubit/up_sales_cubit.dart | 2 +- .../lib/up_sales/cubit/up_sales_state.dart | 6 +- .../lib/up_sales/models/dto/addon_upgrade_dto.dart | 34 ++-- .../lib/up_sales/pages/services_upgrade_page.dart | 10 +- .../lib/up_sales/up_sales_repository.dart | 4 +- comwell_key_app/lib/up_sales/up_sales_route.dart | 12 +- 43 files changed, 885 insertions(+), 456 deletions(-)
Diff
diff --git a/comwell_key_app/assets/translations/all_translations.csv b/comwell_key_app/assets/translations/all_translations.csv
index d8d46ac9..2ffacc8c 100644
--- a/comwell_key_app/assets/translations/all_translations.csv
+++ b/comwell_key_app/assets/translations/all_translations.csv
@@ -268,6 +268,7 @@
"edit","Edit","Rediger"
"error_cards","Failed to load cards, try again later","Fejl ved indlæsning af kort, prøv igen senere."
"check_in_button_timer_days_hours_minutes","In {d} days, {h} hours and {m} minutes","Om {d} dage, {h} timer og {m} minutter"
+"check_in_button_timer_days_minutes","In {d} days and {m} minutes","Om {d} dage og {m} minutter"
"check_in_button_timer_hours_minutes","In {h} hours and {m} minutes","Om {h} timer og {m} minutter"
"check_in_button_timer_minutes","In {m} minutes","Om {m} minutter"
"check_in_button_timer_seconds","In {s} seconds","Om {s} sekunder"
diff --git a/comwell_key_app/assets/translations/intl_da.arb b/comwell_key_app/assets/translations/intl_da.arb
index e8fa69f0..fad6bc8f 100644
--- a/comwell_key_app/assets/translations/intl_da.arb
+++ b/comwell_key_app/assets/translations/intl_da.arb
@@ -108,6 +108,10 @@
"preregistration_address_label_postal_code": "Postnummer",
"preregistration_address_label_city": "By",
"preregistration_address_label_country": "Land",
+ "preregistration_profile_title": "Din info",
+ "preregistration_profile_subtitle": "Det er lovpligtigt at vi kender adressen på den primære beboer på værelset. Dette er pga. brandsikkerhed.",
+ "preregistration_birthdate_error_message": "Indtast venligst en gyldig fødselsdato",
+ "nationality": "Nationalitet",
"preregistration_payment_title": "Betalingskort",
"preregistration_payment_subtitle": "For at kunne overnatte på Comwell, skal vi bruge et betalingskort.",
"preregistration_payment_add_card": "Tilføj kort",
@@ -117,6 +121,8 @@
"preregistration_confirmation_payment_card_title": "Betalingskort",
"preregistration_confirmation_extras_card_title_singular": "1 valgt Tilkøb",
"preregistration_confirmation_extras_card_title_plural": "{amount} valgte tilkøb",
+ "preregistration_my_addons": "Mine tilkøb",
+ "preregistration_my_addons_subtitle": "Ea sit sunt sunt sint exercitation id cupidatat ipsum quis eu quis incididunt mollit ea pariatur.",
"preregistration_confirmation_extras_card_subtitle": "Skrives på din værelsesregning",
"need_help": "Har du brug for hjælp?",
"call_us": "Ring til os",
@@ -270,6 +276,7 @@
"edit": "Rediger",
"error_cards": "Fejl ved indlæsning af kort, prøv igen senere.",
"check_in_button_timer_days_hours_minutes": "Om {d} dage, {h} timer og {m} minutter",
+ "check_in_button_timer_days_minutes": "Om {d} dage og {m} minutter",
"check_in_button_timer_hours_minutes": "Om {h} timer og {m} minutter",
"check_in_button_timer_minutes": "Om {m} minutter",
"check_in_button_timer_seconds": "Om {s} sekunder",
@@ -404,5 +411,13 @@
"bluetooth_permission_title": "Tillad Bluetooth til for at låse dit værelse op",
"bluetooth_permission_description": "For at kunne åbne døren til dit hotelværelse skal du give tilladelse til at vi må bruge bluetooth på din telefon.",
"allow_bluetooth": "Tillad bluetooth",
- "permissions": "tilladelser"
+ "permissions": "Tilladelser",
+ "buy_early_checkin": "Køb tidlig check-in",
+ "preregistration_serving_time_label": "Ønsket serveringstidspunkt for tilkøb",
+ "preregistration_comment_label": "Kommentar",
+ "preregistration_comment_hint": "Indsæt evt. kommentar",
+ "preregistration_accept_terms_prefix": "Jeg accepterer Comwells",
+ "preregistration_accept_terms_privacy_policy": "persondataspolitik",
+ "preregistration_accept_terms_and": "og",
+ "preregistration_accept_terms_trade_conditions": "handelsbetingelser"
}
\ 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 8572f43b..3c124626 100644
--- a/comwell_key_app/assets/translations/intl_en.arb
+++ b/comwell_key_app/assets/translations/intl_en.arb
@@ -108,6 +108,10 @@
"preregistration_address_label_postal_code": "Postal code",
"preregistration_address_label_city": "Town",
"preregistration_address_label_country": "Country",
+ "preregistration_profile_title": "Your info",
+ "preregistration_profile_subtitle": "It is a legal requirement that we know the address of the primary occupant of the room. This is for fire safety reasons.",
+ "preregistration_birthdate_error_message": "Please enter a valid birth date",
+ "nationality": "Nationality",
"preregistration_payment_title": "Payment card",
"preregistration_payment_subtitle": "To stay overnight at Comwell, we need a payment card.",
"preregistration_payment_add_card": "Add map",
@@ -117,6 +121,8 @@
"preregistration_confirmation_payment_card_title": "Payment card",
"preregistration_confirmation_extras_card_title_singular": "1 selected Purchase",
"preregistration_confirmation_extras_card_title_plural": "{amount} selected add-ons",
+ "preregistration_my_addons": "My purchases",
+ "preregistration_my_addons_subtitle": "Ea sit sunt sunt sint exercitation id cupidatat ipsum quis eu quis incididunt mollit ea pariatur.",
"preregistration_confirmation_extras_card_subtitle": "Written on your room bill",
"need_help": "Do you need help?",
"call_us": "Call us",
@@ -221,7 +227,7 @@
"notifications_page_title": "Notifications",
"subscribe_all": "Subscribe to all notifications",
"company_deal": "Company agreement",
- "company_deal_subtitle": "Yes, I would like to receive relevant information related to the company agreement from Comwell A/S via email and SMS. You can terminate your registration at any time by clicking the exit link at the bottom of the email.",
+ "company_deal_subtitle": "Yes, I would like to receive relevant information related to the company agreement from Comwell A/S via email and SMS. You can end your registration at any time by clicking the exit link at the bottom of the email.",
"club_newsletter": "Comwell Club newsletter",
"club_newsletter_subtitle": "Yes, I would like to receive emails with exciting offers on hotel stays and events at Comwell Hotels. I can unsubscribe at any time.",
"digital_media": "Digital media",
@@ -270,6 +276,7 @@
"edit": "Edit",
"error_cards": "Error loading map, please try again later.",
"check_in_button_timer_days_hours_minutes": "In {d} days, {h} hours and {m} minutes",
+ "check_in_button_timer_days_minutes": "In {d} days and {m} minutes",
"check_in_button_timer_hours_minutes": "In {h} hours and {m} minutes",
"check_in_button_timer_minutes": "In {m} minutes",
"check_in_button_timer_seconds": "In {s} seconds",
@@ -392,7 +399,7 @@
"accept_notifications_rationale": "To get the latest updates about your booking, please allow notifications.",
"allow": "Allow",
"skip": "Skip",
- "internet_disabled": "The Internet is down.",
+ "internet_disabled": "The internet is down.",
"please_enable_internet": "Please check your internet connection.",
"bluetooth_disabled": "Bluetooth is disabled.",
"please_enable_bluetooth": "Activate Bluetooth",
@@ -404,5 +411,13 @@
"bluetooth_permission_title": "Allow Bluetooth to unlock your room",
"bluetooth_permission_description": "In order to open the door to your hotel room, you must give us permission to use Bluetooth on your phone.",
"allow_bluetooth": "Allow Bluetooth",
- "permissions": "Permissions"
+ "permissions": "Permissions",
+ "buy_early_checkin": "Buy early check-in",
+ "preregistration_serving_time_label": "Desired serving time for additional purchases",
+ "preregistration_comment_label": "Comment",
+ "preregistration_comment_hint": "Please insert any comment.",
+ "preregistration_accept_terms_prefix": "I accept Comwell's",
+ "preregistration_accept_terms_privacy_policy": "personal data policy",
+ "preregistration_accept_terms_and": "and",
+ "preregistration_accept_terms_trade_conditions": "terms of trade"
}
\ 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/hotel_information/models/addon_upgrade.g.dart b/comwell_key_app/lib/.generated/hotel_information/models/addon_upgrade.g.dart
index 6120ec26..53e9b628 100644
--- a/comwell_key_app/lib/.generated/hotel_information/models/addon_upgrade.g.dart
+++ b/comwell_key_app/lib/.generated/hotel_information/models/addon_upgrade.g.dart
@@ -11,8 +11,8 @@ AddonUpgrade _$AddonUpgradeFromJson(Map json) => AddonUpgrade(
name: json['name'] as String,
images:
(json['images'] as List<dynamic>?)?.map((e) => e as String?).toList() ??
- [],
- description: json['description'] as String,
+ [null],
+ description: json['description'] as String? ?? '',
isService: json['isService'] as bool,
onlyAvailableBeforeCheckin: json['onlyAvailableBeforeCheckin'] as bool,
isPopular: json['isPopular'] as bool,
diff --git a/comwell_key_app/lib/.generated/l10n/app_localizations.dart b/comwell_key_app/lib/.generated/l10n/app_localizations.dart
index 8b0ffd5c..97cf35c4 100644
--- a/comwell_key_app/lib/.generated/l10n/app_localizations.dart
+++ b/comwell_key_app/lib/.generated/l10n/app_localizations.dart
@@ -741,6 +741,30 @@ abstract class AppLocalizations {
/// **'Country'**
String get preregistration_address_label_country;
+ /// No description provided for @preregistration_profile_title.
+ ///
+ /// In en, this message translates to:
+ /// **'Your info'**
+ String get preregistration_profile_title;
+
+ /// No description provided for @preregistration_profile_subtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'It is a legal requirement that we know the address of the primary occupant of the room. This is for fire safety reasons.'**
+ String get preregistration_profile_subtitle;
+
+ /// No description provided for @preregistration_birthdate_error_message.
+ ///
+ /// In en, this message translates to:
+ /// **'Please enter a valid birth date'**
+ String get preregistration_birthdate_error_message;
+
+ /// No description provided for @nationality.
+ ///
+ /// In en, this message translates to:
+ /// **'Nationality'**
+ String get nationality;
+
/// No description provided for @preregistration_payment_title.
///
/// In en, this message translates to:
@@ -795,6 +819,18 @@ abstract class AppLocalizations {
/// **'{amount} selected add-ons'**
String preregistration_confirmation_extras_card_title_plural(Object amount);
+ /// No description provided for @preregistration_my_addons.
+ ///
+ /// In en, this message translates to:
+ /// **'My purchases'**
+ String get preregistration_my_addons;
+
+ /// No description provided for @preregistration_my_addons_subtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Ea sit sunt sunt sint exercitation id cupidatat ipsum quis eu quis incididunt mollit ea pariatur.'**
+ String get preregistration_my_addons_subtitle;
+
/// No description provided for @preregistration_confirmation_extras_card_subtitle.
///
/// In en, this message translates to:
@@ -1422,7 +1458,7 @@ abstract class AppLocalizations {
/// No description provided for @company_deal_subtitle.
///
/// In en, this message translates to:
- /// **'Yes, I would like to receive relevant information related to the company agreement from Comwell A/S via email and SMS. You can terminate your registration at any time by clicking the exit link at the bottom of the email.'**
+ /// **'Yes, I would like to receive relevant information related to the company agreement from Comwell A/S via email and SMS. You can end your registration at any time by clicking the exit link at the bottom of the email.'**
String get company_deal_subtitle;
/// No description provided for @club_newsletter.
@@ -1713,6 +1749,12 @@ abstract class AppLocalizations {
/// **'In {d} days, {h} hours and {m} minutes'**
String check_in_button_timer_days_hours_minutes(Object d, Object h, Object m);
+ /// No description provided for @check_in_button_timer_days_minutes.
+ ///
+ /// In en, this message translates to:
+ /// **'In {d} days and {m} minutes'**
+ String check_in_button_timer_days_minutes(Object d, Object m);
+
/// No description provided for @check_in_button_timer_hours_minutes.
///
/// In en, this message translates to:
@@ -2448,7 +2490,7 @@ abstract class AppLocalizations {
/// No description provided for @internet_disabled.
///
/// In en, this message translates to:
- /// **'The Internet is down.'**
+ /// **'The internet is down.'**
String get internet_disabled;
/// No description provided for @please_enable_internet.
@@ -2522,6 +2564,54 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Permissions'**
String get permissions;
+
+ /// No description provided for @buy_early_checkin.
+ ///
+ /// In en, this message translates to:
+ /// **'Buy early check-in'**
+ String get buy_early_checkin;
+
+ /// No description provided for @preregistration_serving_time_label.
+ ///
+ /// In en, this message translates to:
+ /// **'Desired serving time for additional purchases'**
+ String get preregistration_serving_time_label;
+
+ /// No description provided for @preregistration_comment_label.
+ ///
+ /// In en, this message translates to:
+ /// **'Comment'**
+ String get preregistration_comment_label;
+
+ /// No description provided for @preregistration_comment_hint.
+ ///
+ /// In en, this message translates to:
+ /// **'Please insert any comment.'**
+ String get preregistration_comment_hint;
+
+ /// No description provided for @preregistration_accept_terms_prefix.
+ ///
+ /// In en, this message translates to:
+ /// **'I accept Comwell\'s'**
+ String get preregistration_accept_terms_prefix;
+
+ /// No description provided for @preregistration_accept_terms_privacy_policy.
+ ///
+ /// In en, this message translates to:
+ /// **'personal data policy'**
+ String get preregistration_accept_terms_privacy_policy;
+
+ /// No description provided for @preregistration_accept_terms_and.
+ ///
+ /// In en, this message translates to:
+ /// **'and'**
+ String get preregistration_accept_terms_and;
+
+ /// No description provided for @preregistration_accept_terms_trade_conditions.
+ ///
+ /// In en, this message translates to:
+ /// **'terms of trade'**
+ String get preregistration_accept_terms_trade_conditions;
}
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 53e25aff..46e3fe14 100644
--- a/comwell_key_app/lib/.generated/l10n/app_localizations_da.dart
+++ b/comwell_key_app/lib/.generated/l10n/app_localizations_da.dart
@@ -341,6 +341,19 @@ class AppLocalizationsDa extends AppLocalizations {
@override
String get preregistration_address_label_country => 'Land';
+ @override
+ String get preregistration_profile_title => 'Din info';
+
+ @override
+ String get preregistration_profile_subtitle =>
+ 'Det er lovpligtigt at vi kender adressen på den primære beboer på værelset. Dette er pga. brandsikkerhed.';
+
+ @override
+ String get preregistration_birthdate_error_message => 'Indtast venligst en gyldig fødselsdato';
+
+ @override
+ String get nationality => 'Nationalitet';
+
@override
String get preregistration_payment_title => 'Betalingskort';
@@ -371,6 +384,13 @@ class AppLocalizationsDa extends AppLocalizations {
return '$amount valgte tilkøb';
}
+ @override
+ String get preregistration_my_addons => 'Mine tilkøb';
+
+ @override
+ String get preregistration_my_addons_subtitle =>
+ 'Ea sit sunt sunt sint exercitation id cupidatat ipsum quis eu quis incididunt mollit ea pariatur.';
+
@override
String get preregistration_confirmation_extras_card_subtitle => 'Skrives på din værelsesregning';
@@ -864,6 +884,11 @@ class AppLocalizationsDa extends AppLocalizations {
return 'Om $d dage, $h timer og $m minutter';
}
+ @override
+ String check_in_button_timer_days_minutes(Object d, Object m) {
+ return 'Om $d dage og $m minutter';
+ }
+
@override
String check_in_button_timer_hours_minutes(Object h, Object m) {
return 'Om $h timer og $m minutter';
@@ -1305,5 +1330,29 @@ class AppLocalizationsDa extends AppLocalizations {
String get allow_bluetooth => 'Tillad bluetooth';
@override
- String get permissions => 'tilladelser';
+ String get permissions => 'Tilladelser';
+
+ @override
+ String get buy_early_checkin => 'Køb tidlig check-in';
+
+ @override
+ String get preregistration_serving_time_label => 'Ønsket serveringstidspunkt for tilkøb';
+
+ @override
+ String get preregistration_comment_label => 'Kommentar';
+
+ @override
+ String get preregistration_comment_hint => 'Indsæt evt. kommentar';
+
+ @override
+ String get preregistration_accept_terms_prefix => 'Jeg accepterer Comwells';
+
+ @override
+ String get preregistration_accept_terms_privacy_policy => 'persondataspolitik';
+
+ @override
+ String get preregistration_accept_terms_and => 'og';
+
+ @override
+ String get preregistration_accept_terms_trade_conditions => 'handelsbetingelser';
}
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 85fe2e23..3cd7adb3 100644
--- a/comwell_key_app/lib/.generated/l10n/app_localizations_en.dart
+++ b/comwell_key_app/lib/.generated/l10n/app_localizations_en.dart
@@ -340,6 +340,19 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get preregistration_address_label_country => 'Country';
+ @override
+ String get preregistration_profile_title => 'Your info';
+
+ @override
+ String get preregistration_profile_subtitle =>
+ 'It is a legal requirement that we know the address of the primary occupant of the room. This is for fire safety reasons.';
+
+ @override
+ String get preregistration_birthdate_error_message => 'Please enter a valid birth date';
+
+ @override
+ String get nationality => 'Nationality';
+
@override
String get preregistration_payment_title => 'Payment card';
@@ -370,6 +383,13 @@ class AppLocalizationsEn extends AppLocalizations {
return '$amount selected add-ons';
}
+ @override
+ String get preregistration_my_addons => 'My purchases';
+
+ @override
+ String get preregistration_my_addons_subtitle =>
+ 'Ea sit sunt sunt sint exercitation id cupidatat ipsum quis eu quis incididunt mollit ea pariatur.';
+
@override
String get preregistration_confirmation_extras_card_subtitle => 'Written on your room bill';
@@ -706,7 +726,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get company_deal_subtitle =>
- 'Yes, I would like to receive relevant information related to the company agreement from Comwell A/S via email and SMS. You can terminate your registration at any time by clicking the exit link at the bottom of the email.';
+ 'Yes, I would like to receive relevant information related to the company agreement from Comwell A/S via email and SMS. You can end your registration at any time by clicking the exit link at the bottom of the email.';
@override
String get club_newsletter => 'Comwell Club newsletter';
@@ -867,6 +887,11 @@ class AppLocalizationsEn extends AppLocalizations {
return 'In $d days, $h hours and $m minutes';
}
+ @override
+ String check_in_button_timer_days_minutes(Object d, Object m) {
+ return 'In $d days and $m minutes';
+ }
+
@override
String check_in_button_timer_hours_minutes(Object h, Object m) {
return 'In $h hours and $m minutes';
@@ -1268,7 +1293,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get skip => 'Skip';
@override
- String get internet_disabled => 'The Internet is down.';
+ String get internet_disabled => 'The internet is down.';
@override
String get please_enable_internet => 'Please check your internet connection.';
@@ -1309,4 +1334,28 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get permissions => 'Permissions';
+
+ @override
+ String get buy_early_checkin => 'Buy early check-in';
+
+ @override
+ String get preregistration_serving_time_label => 'Desired serving time for additional purchases';
+
+ @override
+ String get preregistration_comment_label => 'Comment';
+
+ @override
+ String get preregistration_comment_hint => 'Please insert any comment.';
+
+ @override
+ String get preregistration_accept_terms_prefix => 'I accept Comwell\'s';
+
+ @override
+ String get preregistration_accept_terms_privacy_policy => 'personal data policy';
+
+ @override
+ String get preregistration_accept_terms_and => 'and';
+
+ @override
+ String get preregistration_accept_terms_trade_conditions => 'terms of trade';
}
diff --git a/comwell_key_app/lib/.generated/payment_cards/models/add_card_payment_method.g.dart b/comwell_key_app/lib/.generated/payment_cards/models/add_card_payment_method.g.dart
deleted file mode 100644
index 0075fefc..00000000
--- a/comwell_key_app/lib/.generated/payment_cards/models/add_card_payment_method.g.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of '../../../payment_cards/models/add_card_payment_method.dart';
-
-// **************************************************************************
-// JsonSerializableGenerator
-// **************************************************************************
-
-AddCardPaymentMethod _$AddCardPaymentMethodFromJson(Map json) =>
- AddCardPaymentMethod(
- brands: (json['brands'] as List<dynamic>)
- .map((e) => $enumDecode(_$CardTypeEnumMap, e)),
- name: json['name'] as String,
- type: json['type'] as String,
- );
-
-Map<String, dynamic> _$AddCardPaymentMethodToJson(
- AddCardPaymentMethod instance) =>
- <String, dynamic>{
- 'brands': instance.brands.map((e) => _$CardTypeEnumMap[e]!).toList(),
- 'name': instance.name,
- 'type': instance.type,
- };
-
-const _$CardTypeEnumMap = {
- CardType.visa: 'visa',
- CardType.mc: 'mc',
- CardType.amex: 'amex',
-};
diff --git a/comwell_key_app/lib/.generated/presentation/screens/pregistration/cubit/preregistration_state.freezed.dart b/comwell_key_app/lib/.generated/presentation/screens/pregistration/cubit/preregistration_state.freezed.dart
index 6f05be56..fb39c98e 100644
--- a/comwell_key_app/lib/.generated/presentation/screens/pregistration/cubit/preregistration_state.freezed.dart
+++ b/comwell_key_app/lib/.generated/presentation/screens/pregistration/cubit/preregistration_state.freezed.dart
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$PreregistrationState {
- bool get isLoading; bool get selected; List<AddOnUpgrade> get addOnUpgrades; List<RoomUpgrade> get availableRoomUpgrades; String get selectedRoomUpgrade; bool get missingInformation; int get extrasTotalPrice; bool get termsAndConditionsAccepted; bool get forceUpdate; User? get user; CountryCode? get countryCode; String get selectedCountry; String? get phoneNumber; bool get isPhoneNumberValid; bool get isFirstNameValid; bool get isLastNameValid; bool get isAddressValid; bool get isPostalCodeValid; bool get isCityValid; String get selectedDocumentType; StoredPaymentMethod? get selectedPaymentMethod; AppError get error;
+ bool get isLoading; bool get selected; List<AddOnUpgrade> get addOnUpgrades; List<RoomUpgrade> get availableRoomUpgrades; String get selectedRoomUpgrade; bool get missingInformation; int get extrasTotalPrice; bool get termsAndConditionsAccepted; bool get forceUpdate; User? get user; CountryCode? get countryCode; String get selectedCountry; String? get phoneNumber; bool get isPhoneNumberValid; bool get isFirstNameValid; bool get isLastNameValid; bool get isAddressValid; bool get isPostalCodeValid; bool get isCityValid; bool get isBirthDateValid; String get selectedDocumentType; StoredPaymentMethod? get selectedPaymentMethod; TimeOfDay? get servingTime; AppError get error;
/// Create a copy of PreregistrationState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $PreregistrationStateCopyWith<PreregistrationState> get copyWith => _$Preregistr
@override
bool operator ==(Object other) {
- return identical(this, other) || (other.runtimeType == runtimeType&&other is PreregistrationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.selected, selected) || other.selected == selected)&&const DeepCollectionEquality().equals(other.addOnUpgrades, addOnUpgrades)&&const DeepCollectionEquality().equals(other.availableRoomUpgrades, availableRoomUpgrades)&&(identical(other.selectedRoomUpgrade, selectedRoomUpgrade) || other.selectedRoomUpgrade == selectedRoomUpgrade)&&(identical(other.missingInformation, missingInformation) || other.missingInformation == missingInformation)&&(identical(other.extrasTotalPrice, extrasTotalPrice) || other.extrasTotalPrice == extrasTotalPrice)&&(identical(other.termsAndConditionsAccepted, termsAndConditionsAccepted) || other.termsAndConditionsAccepted == termsAndConditionsAccepted)&&(identical(other.forceUpdate, forceUpdate) || other.forceUpdate == forceUpdate)&&(identical(other.user, user) || other.user == user)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.selectedCountry, selectedCountry) || other.selectedCountry == selectedCountry)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.isPhoneNumberValid, isPhoneNumberValid) || other.isPhoneNumberValid == isPhoneNumberValid)&&(identical(other.isFirstNameValid, isFirstNameValid) || other.isFirstNameValid == isFirstNameValid)&&(identical(other.isLastNameValid, isLastNameValid) || other.isLastNameValid == isLastNameValid)&&(identical(other.isAddressValid, isAddressValid) || other.isAddressValid == isAddressValid)&&(identical(other.isPostalCodeValid, isPostalCodeValid) || other.isPostalCodeValid == isPostalCodeValid)&&(identical(other.isCityValid, isCityValid) || other.isCityValid == isCityValid)&&(identical(other.selectedDocumentType, selectedDocumentType) || other.selectedDocumentType == selectedDocumentType)&&(identical(other.selectedPaymentMethod, selectedPaymentMethod) || other.selectedPaymentMethod == selectedPaymentMethod)&&(identical(other.error, error) || other.error == error));
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is PreregistrationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.selected, selected) || other.selected == selected)&&const DeepCollectionEquality().equals(other.addOnUpgrades, addOnUpgrades)&&const DeepCollectionEquality().equals(other.availableRoomUpgrades, availableRoomUpgrades)&&(identical(other.selectedRoomUpgrade, selectedRoomUpgrade) || other.selectedRoomUpgrade == selectedRoomUpgrade)&&(identical(other.missingInformation, missingInformation) || other.missingInformation == missingInformation)&&(identical(other.extrasTotalPrice, extrasTotalPrice) || other.extrasTotalPrice == extrasTotalPrice)&&(identical(other.termsAndConditionsAccepted, termsAndConditionsAccepted) || other.termsAndConditionsAccepted == termsAndConditionsAccepted)&&(identical(other.forceUpdate, forceUpdate) || other.forceUpdate == forceUpdate)&&(identical(other.user, user) || other.user == user)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.selectedCountry, selectedCountry) || other.selectedCountry == selectedCountry)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.isPhoneNumberValid, isPhoneNumberValid) || other.isPhoneNumberValid == isPhoneNumberValid)&&(identical(other.isFirstNameValid, isFirstNameValid) || other.isFirstNameValid == isFirstNameValid)&&(identical(other.isLastNameValid, isLastNameValid) || other.isLastNameValid == isLastNameValid)&&(identical(other.isAddressValid, isAddressValid) || other.isAddressValid == isAddressValid)&&(identical(other.isPostalCodeValid, isPostalCodeValid) || other.isPostalCodeValid == isPostalCodeValid)&&(identical(other.isCityValid, isCityValid) || other.isCityValid == isCityValid)&&(identical(other.isBirthDateValid, isBirthDateValid) || other.isBirthDateValid == isBirthDateValid)&&(identical(other.selectedDocumentType, selectedDocumentType) || other.selectedDocumentType == selectedDocumentType)&&(identical(other.selectedPaymentMethod, selectedPaymentMethod) || other.selectedPaymentMethod == selectedPaymentMethod)&&(identical(other.servingTime, servingTime) || other.servingTime == servingTime)&&(identical(other.error, error) || other.error == error));
}
@override
-int get hashCode => Object.hashAll([runtimeType,isLoading,selected,const DeepCollectionEquality().hash(addOnUpgrades),const DeepCollectionEquality().hash(availableRoomUpgrades),selectedRoomUpgrade,missingInformation,extrasTotalPrice,termsAndConditionsAccepted,forceUpdate,user,countryCode,selectedCountry,phoneNumber,isPhoneNumberValid,isFirstNameValid,isLastNameValid,isAddressValid,isPostalCodeValid,isCityValid,selectedDocumentType,selectedPaymentMethod,error]);
+int get hashCode => Object.hashAll([runtimeType,isLoading,selected,const DeepCollectionEquality().hash(addOnUpgrades),const DeepCollectionEquality().hash(availableRoomUpgrades),selectedRoomUpgrade,missingInformation,extrasTotalPrice,termsAndConditionsAccepted,forceUpdate,user,countryCode,selectedCountry,phoneNumber,isPhoneNumberValid,isFirstNameValid,isLastNameValid,isAddressValid,isPostalCodeValid,isCityValid,isBirthDateValid,selectedDocumentType,selectedPaymentMethod,servingTime,error]);
@override
String toString() {
- return 'PreregistrationState(isLoading: $isLoading, selected: $selected, addOnUpgrades: $addOnUpgrades, availableRoomUpgrades: $availableRoomUpgrades, selectedRoomUpgrade: $selectedRoomUpgrade, missingInformation: $missingInformation, extrasTotalPrice: $extrasTotalPrice, termsAndConditionsAccepted: $termsAndConditionsAccepted, forceUpdate: $forceUpdate, user: $user, countryCode: $countryCode, selectedCountry: $selectedCountry, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, error: $error)';
+ return 'PreregistrationState(isLoading: $isLoading, selected: $selected, addOnUpgrades: $addOnUpgrades, availableRoomUpgrades: $availableRoomUpgrades, selectedRoomUpgrade: $selectedRoomUpgrade, missingInformation: $missingInformation, extrasTotalPrice: $extrasTotalPrice, termsAndConditionsAccepted: $termsAndConditionsAccepted, forceUpdate: $forceUpdate, user: $user, countryCode: $countryCode, selectedCountry: $selectedCountry, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, isBirthDateValid: $isBirthDateValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, servingTime: $servingTime, error: $error)';
}
@@ -45,11 +45,11 @@ abstract mixin class $PreregistrationStateCopyWith<$Res> {
factory $PreregistrationStateCopyWith(PreregistrationState value, $Res Function(PreregistrationState) _then) = _$PreregistrationStateCopyWithImpl;
@useResult
$Res call({
- bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, AppError error
+ bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error
});
-
+$UserCopyWith<$Res>? get user;
}
/// @nodoc
@@ -62,7 +62,7 @@ class _$PreregistrationStateCopyWithImpl<$Res>
/// Create a copy of PreregistrationState
/// with the given fields replaced by the non-null parameter values.
-@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? selected = null,Object? addOnUpgrades = null,Object? availableRoomUpgrades = null,Object? selectedRoomUpgrade = null,Object? missingInformation = null,Object? extrasTotalPrice = null,Object? termsAndConditionsAccepted = null,Object? forceUpdate = null,Object? user = freezed,Object? countryCode = freezed,Object? selectedCountry = null,Object? phoneNumber = freezed,Object? isPhoneNumberValid = null,Object? isFirstNameValid = null,Object? isLastNameValid = null,Object? isAddressValid = null,Object? isPostalCodeValid = null,Object? isCityValid = null,Object? selectedDocumentType = null,Object? selectedPaymentMethod = freezed,Object? error = null,}) {
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? selected = null,Object? addOnUpgrades = null,Object? availableRoomUpgrades = null,Object? selectedRoomUpgrade = null,Object? missingInformation = null,Object? extrasTotalPrice = null,Object? termsAndConditionsAccepted = null,Object? forceUpdate = null,Object? user = freezed,Object? countryCode = freezed,Object? selectedCountry = null,Object? phoneNumber = freezed,Object? isPhoneNumberValid = null,Object? isFirstNameValid = null,Object? isLastNameValid = null,Object? isAddressValid = null,Object? isPostalCodeValid = null,Object? isCityValid = null,Object? isBirthDateValid = null,Object? selectedDocumentType = null,Object? selectedPaymentMethod = freezed,Object? servingTime = freezed,Object? error = null,}) {
return _then(_self.copyWith(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,selected: null == selected ? _self.selected : selected // ignore: cast_nullable_to_non_nullable
@@ -83,13 +83,27 @@ as bool,isLastNameValid: null == isLastNameValid ? _self.isLastNameValid : isLas
as bool,isAddressValid: null == isAddressValid ? _self.isAddressValid : isAddressValid // ignore: cast_nullable_to_non_nullable
as bool,isPostalCodeValid: null == isPostalCodeValid ? _self.isPostalCodeValid : isPostalCodeValid // ignore: cast_nullable_to_non_nullable
as bool,isCityValid: null == isCityValid ? _self.isCityValid : isCityValid // ignore: cast_nullable_to_non_nullable
+as bool,isBirthDateValid: null == isBirthDateValid ? _self.isBirthDateValid : isBirthDateValid // ignore: cast_nullable_to_non_nullable
as bool,selectedDocumentType: null == selectedDocumentType ? _self.selectedDocumentType : selectedDocumentType // ignore: cast_nullable_to_non_nullable
as String,selectedPaymentMethod: freezed == selectedPaymentMethod ? _self.selectedPaymentMethod : selectedPaymentMethod // ignore: cast_nullable_to_non_nullable
-as StoredPaymentMethod?,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as StoredPaymentMethod?,servingTime: freezed == servingTime ? _self.servingTime : servingTime // ignore: cast_nullable_to_non_nullable
+as TimeOfDay?,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as AppError,
));
}
-
+/// Create a copy of PreregistrationState
+/// with the given fields replaced by the non-null parameter values.
+@override
+@pragma('vm:prefer-inline')
+$UserCopyWith<$Res>? get user {
+ if (_self.user == null) {
+ return null;
+ }
+
+ return $UserCopyWith<$Res>(_self.user!, (value) {
+ return _then(_self.copyWith(user: value));
+ });
+}
}
@@ -171,10 +185,10 @@ return $default(_that);case _:
/// }
/// ```
-@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _PreregistrationState() when $default != null:
-return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.error);case _:
+return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
return orElse();
}
@@ -192,10 +206,10 @@ return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availab
/// }
/// ```
-@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, AppError error) $default,) {final _that = this;
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error) $default,) {final _that = this;
switch (_that) {
case _PreregistrationState():
-return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.error);case _:
+return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
throw StateError('Unexpected subclass');
}
@@ -212,10 +226,10 @@ return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availab
/// }
/// ```
-@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, AppError error)? $default,) {final _that = this;
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error)? $default,) {final _that = this;
switch (_that) {
case _PreregistrationState() when $default != null:
-return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.error);case _:
+return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
return null;
}
@@ -227,7 +241,7 @@ return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availab
class _PreregistrationState implements PreregistrationState {
- const _PreregistrationState({this.isLoading = false, this.selected = false, final List<AddOnUpgrade> addOnUpgrades = const [], final List<RoomUpgrade> availableRoomUpgrades = const [], this.selectedRoomUpgrade = '', this.missingInformation = false, this.extrasTotalPrice = 0, this.termsAndConditionsAccepted = false, this.forceUpdate = false, this.user = null, this.countryCode = null, this.selectedCountry = '', this.phoneNumber = null, this.isPhoneNumberValid = false, this.isFirstNameValid = false, this.isLastNameValid = false, this.isAddressValid = false, this.isPostalCodeValid = false, this.isCityValid = false, this.selectedDocumentType = '', this.selectedPaymentMethod = null, this.error = AppError.none}): _addOnUpgrades = addOnUpgrades,_availableRoomUpgrades = availableRoomUpgrades;
+ const _PreregistrationState({this.isLoading = false, this.selected = false, final List<AddOnUpgrade> addOnUpgrades = const [], final List<RoomUpgrade> availableRoomUpgrades = const [], this.selectedRoomUpgrade = '', this.missingInformation = false, this.extrasTotalPrice = 0, this.termsAndConditionsAccepted = false, this.forceUpdate = false, this.user = null, this.countryCode = null, this.selectedCountry = '', this.phoneNumber = null, this.isPhoneNumberValid = false, this.isFirstNameValid = false, this.isLastNameValid = false, this.isAddressValid = false, this.isPostalCodeValid = false, this.isCityValid = false, this.isBirthDateValid = false, this.selectedDocumentType = '', this.selectedPaymentMethod = null, this.servingTime = null, this.error = AppError.none}): _addOnUpgrades = addOnUpgrades,_availableRoomUpgrades = availableRoomUpgrades;
@override@JsonKey() final bool isLoading;
@@ -261,8 +275,10 @@ class _PreregistrationState implements PreregistrationState {
@override@JsonKey() final bool isAddressValid;
@override@JsonKey() final bool isPostalCodeValid;
@override@JsonKey() final bool isCityValid;
+@override@JsonKey() final bool isBirthDateValid;
@override@JsonKey() final String selectedDocumentType;
@override@JsonKey() final StoredPaymentMethod? selectedPaymentMethod;
+@override@JsonKey() final TimeOfDay? servingTime;
@override@JsonKey() final AppError error;
/// Create a copy of PreregistrationState
@@ -275,16 +291,16 @@ _$PreregistrationStateCopyWith<_PreregistrationState> get copyWith => __$Preregi
@override
bool operator ==(Object other) {
- return identical(this, other) || (other.runtimeType == runtimeType&&other is _PreregistrationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.selected, selected) || other.selected == selected)&&const DeepCollectionEquality().equals(other._addOnUpgrades, _addOnUpgrades)&&const DeepCollectionEquality().equals(other._availableRoomUpgrades, _availableRoomUpgrades)&&(identical(other.selectedRoomUpgrade, selectedRoomUpgrade) || other.selectedRoomUpgrade == selectedRoomUpgrade)&&(identical(other.missingInformation, missingInformation) || other.missingInformation == missingInformation)&&(identical(other.extrasTotalPrice, extrasTotalPrice) || other.extrasTotalPrice == extrasTotalPrice)&&(identical(other.termsAndConditionsAccepted, termsAndConditionsAccepted) || other.termsAndConditionsAccepted == termsAndConditionsAccepted)&&(identical(other.forceUpdate, forceUpdate) || other.forceUpdate == forceUpdate)&&(identical(other.user, user) || other.user == user)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.selectedCountry, selectedCountry) || other.selectedCountry == selectedCountry)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.isPhoneNumberValid, isPhoneNumberValid) || other.isPhoneNumberValid == isPhoneNumberValid)&&(identical(other.isFirstNameValid, isFirstNameValid) || other.isFirstNameValid == isFirstNameValid)&&(identical(other.isLastNameValid, isLastNameValid) || other.isLastNameValid == isLastNameValid)&&(identical(other.isAddressValid, isAddressValid) || other.isAddressValid == isAddressValid)&&(identical(other.isPostalCodeValid, isPostalCodeValid) || other.isPostalCodeValid == isPostalCodeValid)&&(identical(other.isCityValid, isCityValid) || other.isCityValid == isCityValid)&&(identical(other.selectedDocumentType, selectedDocumentType) || other.selectedDocumentType == selectedDocumentType)&&(identical(other.selectedPaymentMethod, selectedPaymentMethod) || other.selectedPaymentMethod == selectedPaymentMethod)&&(identical(other.error, error) || other.error == error));
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _PreregistrationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.selected, selected) || other.selected == selected)&&const DeepCollectionEquality().equals(other._addOnUpgrades, _addOnUpgrades)&&const DeepCollectionEquality().equals(other._availableRoomUpgrades, _availableRoomUpgrades)&&(identical(other.selectedRoomUpgrade, selectedRoomUpgrade) || other.selectedRoomUpgrade == selectedRoomUpgrade)&&(identical(other.missingInformation, missingInformation) || other.missingInformation == missingInformation)&&(identical(other.extrasTotalPrice, extrasTotalPrice) || other.extrasTotalPrice == extrasTotalPrice)&&(identical(other.termsAndConditionsAccepted, termsAndConditionsAccepted) || other.termsAndConditionsAccepted == termsAndConditionsAccepted)&&(identical(other.forceUpdate, forceUpdate) || other.forceUpdate == forceUpdate)&&(identical(other.user, user) || other.user == user)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.selectedCountry, selectedCountry) || other.selectedCountry == selectedCountry)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.isPhoneNumberValid, isPhoneNumberValid) || other.isPhoneNumberValid == isPhoneNumberValid)&&(identical(other.isFirstNameValid, isFirstNameValid) || other.isFirstNameValid == isFirstNameValid)&&(identical(other.isLastNameValid, isLastNameValid) || other.isLastNameValid == isLastNameValid)&&(identical(other.isAddressValid, isAddressValid) || other.isAddressValid == isAddressValid)&&(identical(other.isPostalCodeValid, isPostalCodeValid) || other.isPostalCodeValid == isPostalCodeValid)&&(identical(other.isCityValid, isCityValid) || other.isCityValid == isCityValid)&&(identical(other.isBirthDateValid, isBirthDateValid) || other.isBirthDateValid == isBirthDateValid)&&(identical(other.selectedDocumentType, selectedDocumentType) || other.selectedDocumentType == selectedDocumentType)&&(identical(other.selectedPaymentMethod, selectedPaymentMethod) || other.selectedPaymentMethod == selectedPaymentMethod)&&(identical(other.servingTime, servingTime) || other.servingTime == servingTime)&&(identical(other.error, error) || other.error == error));
}
@override
-int get hashCode => Object.hashAll([runtimeType,isLoading,selected,const DeepCollectionEquality().hash(_addOnUpgrades),const DeepCollectionEquality().hash(_availableRoomUpgrades),selectedRoomUpgrade,missingInformation,extrasTotalPrice,termsAndConditionsAccepted,forceUpdate,user,countryCode,selectedCountry,phoneNumber,isPhoneNumberValid,isFirstNameValid,isLastNameValid,isAddressValid,isPostalCodeValid,isCityValid,selectedDocumentType,selectedPaymentMethod,error]);
+int get hashCode => Object.hashAll([runtimeType,isLoading,selected,const DeepCollectionEquality().hash(_addOnUpgrades),const DeepCollectionEquality().hash(_availableRoomUpgrades),selectedRoomUpgrade,missingInformation,extrasTotalPrice,termsAndConditionsAccepted,forceUpdate,user,countryCode,selectedCountry,phoneNumber,isPhoneNumberValid,isFirstNameValid,isLastNameValid,isAddressValid,isPostalCodeValid,isCityValid,isBirthDateValid,selectedDocumentType,selectedPaymentMethod,servingTime,error]);
@override
String toString() {
- return 'PreregistrationState(isLoading: $isLoading, selected: $selected, addOnUpgrades: $addOnUpgrades, availableRoomUpgrades: $availableRoomUpgrades, selectedRoomUpgrade: $selectedRoomUpgrade, missingInformation: $missingInformation, extrasTotalPrice: $extrasTotalPrice, termsAndConditionsAccepted: $termsAndConditionsAccepted, forceUpdate: $forceUpdate, user: $user, countryCode: $countryCode, selectedCountry: $selectedCountry, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, error: $error)';
+ return 'PreregistrationState(isLoading: $isLoading, selected: $selected, addOnUpgrades: $addOnUpgrades, availableRoomUpgrades: $availableRoomUpgrades, selectedRoomUpgrade: $selectedRoomUpgrade, missingInformation: $missingInformation, extrasTotalPrice: $extrasTotalPrice, termsAndConditionsAccepted: $termsAndConditionsAccepted, forceUpdate: $forceUpdate, user: $user, countryCode: $countryCode, selectedCountry: $selectedCountry, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, isBirthDateValid: $isBirthDateValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, servingTime: $servingTime, error: $error)';
}
@@ -295,11 +311,11 @@ abstract mixin class _$PreregistrationStateCopyWith<$Res> implements $Preregistr
factory _$PreregistrationStateCopyWith(_PreregistrationState value, $Res Function(_PreregistrationState) _then) = __$PreregistrationStateCopyWithImpl;
@override @useResult
$Res call({
- bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, AppError error
+ bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error
});
-
+@override $UserCopyWith<$Res>? get user;
}
/// @nodoc
@@ -312,7 +328,7 @@ class __$PreregistrationStateCopyWithImpl<$Res>
/// Create a copy of PreregistrationState
/// with the given fields replaced by the non-null parameter values.
-@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? selected = null,Object? addOnUpgrades = null,Object? availableRoomUpgrades = null,Object? selectedRoomUpgrade = null,Object? missingInformation = null,Object? extrasTotalPrice = null,Object? termsAndConditionsAccepted = null,Object? forceUpdate = null,Object? user = freezed,Object? countryCode = freezed,Object? selectedCountry = null,Object? phoneNumber = freezed,Object? isPhoneNumberValid = null,Object? isFirstNameValid = null,Object? isLastNameValid = null,Object? isAddressValid = null,Object? isPostalCodeValid = null,Object? isCityValid = null,Object? selectedDocumentType = null,Object? selectedPaymentMethod = freezed,Object? error = null,}) {
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? selected = null,Object? addOnUpgrades = null,Object? availableRoomUpgrades = null,Object? selectedRoomUpgrade = null,Object? missingInformation = null,Object? extrasTotalPrice = null,Object? termsAndConditionsAccepted = null,Object? forceUpdate = null,Object? user = freezed,Object? countryCode = freezed,Object? selectedCountry = null,Object? phoneNumber = freezed,Object? isPhoneNumberValid = null,Object? isFirstNameValid = null,Object? isLastNameValid = null,Object? isAddressValid = null,Object? isPostalCodeValid = null,Object? isCityValid = null,Object? isBirthDateValid = null,Object? selectedDocumentType = null,Object? selectedPaymentMethod = freezed,Object? servingTime = freezed,Object? error = null,}) {
return _then(_PreregistrationState(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,selected: null == selected ? _self.selected : selected // ignore: cast_nullable_to_non_nullable
@@ -333,14 +349,28 @@ as bool,isLastNameValid: null == isLastNameValid ? _self.isLastNameValid : isLas
as bool,isAddressValid: null == isAddressValid ? _self.isAddressValid : isAddressValid // ignore: cast_nullable_to_non_nullable
as bool,isPostalCodeValid: null == isPostalCodeValid ? _self.isPostalCodeValid : isPostalCodeValid // ignore: cast_nullable_to_non_nullable
as bool,isCityValid: null == isCityValid ? _self.isCityValid : isCityValid // ignore: cast_nullable_to_non_nullable
+as bool,isBirthDateValid: null == isBirthDateValid ? _self.isBirthDateValid : isBirthDateValid // ignore: cast_nullable_to_non_nullable
as bool,selectedDocumentType: null == selectedDocumentType ? _self.selectedDocumentType : selectedDocumentType // ignore: cast_nullable_to_non_nullable
as String,selectedPaymentMethod: freezed == selectedPaymentMethod ? _self.selectedPaymentMethod : selectedPaymentMethod // ignore: cast_nullable_to_non_nullable
-as StoredPaymentMethod?,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
+as StoredPaymentMethod?,servingTime: freezed == servingTime ? _self.servingTime : servingTime // ignore: cast_nullable_to_non_nullable
+as TimeOfDay?,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as AppError,
));
}
-
+/// Create a copy of PreregistrationState
+/// with the given fields replaced by the non-null parameter values.
+@override
+@pragma('vm:prefer-inline')
+$UserCopyWith<$Res>? get user {
+ if (_self.user == null) {
+ return null;
+ }
+
+ return $UserCopyWith<$Res>(_self.user!, (value) {
+ return _then(_self.copyWith(user: value));
+ });
+}
}
// dart format on
diff --git a/comwell_key_app/lib/.generated/services/adyen/adyen_amount.g.dart b/comwell_key_app/lib/.generated/services/adyen/adyen_amount.g.dart
deleted file mode 100644
index 9b150dff..00000000
--- a/comwell_key_app/lib/.generated/services/adyen/adyen_amount.g.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of '../../../services/adyen/adyen_amount.dart';
-
-// **************************************************************************
-// JsonSerializableGenerator
-// **************************************************************************
-
-AdyenAmount _$AdyenAmountFromJson(Map json) => AdyenAmount(
- currency: json['currency'] as String,
- value: (json['value'] as num).toInt(),
- );
-
-Map<String, dynamic> _$AdyenAmountToJson(AdyenAmount instance) =>
- <String, dynamic>{
- 'currency': instance.currency,
- 'value': instance.value,
- };
diff --git a/comwell_key_app/lib/.generated/services/adyen/payment_method.g.dart b/comwell_key_app/lib/.generated/services/adyen/payment_method.g.dart
deleted file mode 100644
index 552af401..00000000
--- a/comwell_key_app/lib/.generated/services/adyen/payment_method.g.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of '../../../services/adyen/payment_method.dart';
-
-// **************************************************************************
-// JsonSerializableGenerator
-// **************************************************************************
-
-PaymentMethod _$PaymentMethodFromJson(Map json) => PaymentMethod(
- brand: json['brand'] as String?,
- cvc: json['cvc'] as String?,
- encryptedCard: json['encryptedCard'] as String?,
- encryptedCardNumber: json['encryptedCardNumber'] as String?,
- encryptedExpiryMonth: json['encryptedExpiryMonth'] as String?,
- encryptedExpiryYear: json['encryptedExpiryYear'] as String?,
- encryptedSecurityCode: json['encryptedSecurityCode'] as String?,
- expiryMonth: json['expiryMonth'] as String?,
- expiryYear: json['expiryYear'] as String?,
- holderName: json['holderName'] as String?,
- number: json['number'] as String?,
- type: json['type'] as String?,
- );
-
-Map<String, dynamic> _$PaymentMethodToJson(PaymentMethod instance) =>
- <String, dynamic>{
- 'brand': instance.brand,
- 'cvc': instance.cvc,
- 'encryptedCard': instance.encryptedCard,
- 'encryptedCardNumber': instance.encryptedCardNumber,
- 'encryptedExpiryMonth': instance.encryptedExpiryMonth,
- 'encryptedExpiryYear': instance.encryptedExpiryYear,
- 'encryptedSecurityCode': instance.encryptedSecurityCode,
- 'expiryMonth': instance.expiryMonth,
- 'expiryYear': instance.expiryYear,
- 'holderName': instance.holderName,
- 'number': instance.number,
- 'type': instance.type,
- };
diff --git a/comwell_key_app/lib/.generated/services/adyen/stored_payment_method.g.dart b/comwell_key_app/lib/.generated/services/adyen/stored_payment_method.g.dart
deleted file mode 100644
index 6b2d6b18..00000000
--- a/comwell_key_app/lib/.generated/services/adyen/stored_payment_method.g.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of '../../../services/adyen/stored_payment_method.dart';
-
-// **************************************************************************
-// JsonSerializableGenerator
-// **************************************************************************
-
-StoredPaymentMethod _$StoredPaymentMethodFromJson(Map json) =>
- StoredPaymentMethod(
- brand: json['brand'] as String,
- expiryMonth: json['expiryMonth'] as String,
- expiryYear: json['expiryYear'] as String,
- holderName: json['holderName'] as String,
- id: json['id'] as String,
- lastFour: json['lastFour'] as String,
- );
-
-Map<String, dynamic> _$StoredPaymentMethodToJson(
- StoredPaymentMethod instance) =>
- <String, dynamic>{
- 'brand': instance.brand,
- 'expiryMonth': instance.expiryMonth,
- 'expiryYear': instance.expiryYear,
- 'holderName': instance.holderName,
- 'id': instance.id,
- 'lastFour': instance.lastFour,
- };
diff --git a/comwell_key_app/lib/.generated/services/adyen/stored_payment_methods_response.g.dart b/comwell_key_app/lib/.generated/services/adyen/stored_payment_methods_response.g.dart
deleted file mode 100644
index 899c42ef..00000000
--- a/comwell_key_app/lib/.generated/services/adyen/stored_payment_methods_response.g.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of '../../../services/adyen/stored_payment_methods_response.dart';
-
-// **************************************************************************
-// JsonSerializableGenerator
-// **************************************************************************
-
-StoredPaymentsResponse _$StoredPaymentsResponseFromJson(Map json) =>
- StoredPaymentsResponse(
- merchantAccount: json['merchantAccount'] as String,
- shopperReference: json['shopperReference'] as String,
- storedPaymentMethods: (json['storedPaymentMethods'] as List<dynamic>?)
- ?.map((e) => StoredPaymentMethod.fromJson(
- Map<String, dynamic>.from(e as Map))),
- );
-
-Map<String, dynamic> _$StoredPaymentsResponseToJson(
- StoredPaymentsResponse instance) =>
- <String, dynamic>{
- 'merchantAccount': instance.merchantAccount,
- 'shopperReference': instance.shopperReference,
- 'storedPaymentMethods':
- instance.storedPaymentMethods?.map((e) => e.toJson()).toList(),
- };
diff --git a/comwell_key_app/lib/.generated/up_sales/models/dto/addon_upgrade_dto.g.dart b/comwell_key_app/lib/.generated/up_sales/models/dto/addon_upgrade_dto.g.dart
index 34a4cb40..cb41c914 100644
--- a/comwell_key_app/lib/.generated/up_sales/models/dto/addon_upgrade_dto.g.dart
+++ b/comwell_key_app/lib/.generated/up_sales/models/dto/addon_upgrade_dto.g.dart
@@ -12,7 +12,7 @@ AddOnUpgradeDTO _$AddOnUpgradeDTOFromJson(Map json) => AddOnUpgradeDTO(
price: (json['price'] as num).toInt(),
currency: json['currency'] as String,
isSelected: json['isSelected'] as bool,
- images: (json['images'] as List<dynamic>).map((e) => e as String),
+ images: AddOnUpgradeDTO._imagesFromJson(json['images'] as List?),
description: json['description'] as String,
quantity: (json['quantity'] as num?)?.toInt() ?? 0,
isService: json['isService'] as bool? ?? false,
@@ -28,7 +28,7 @@ Map<String, dynamic> _$AddOnUpgradeDTOToJson(AddOnUpgradeDTO instance) =>
'price': instance.price,
'currency': instance.currency,
'isSelected': instance.isSelected,
- 'images': instance.images.toList(),
+ 'images': instance.images,
'description': instance.description,
'quantity': instance.quantity,
'isService': instance.isService,
diff --git a/comwell_key_app/lib/common/components/comwell_text_field.dart b/comwell_key_app/lib/common/components/comwell_text_field.dart
index 23290718..7cd12f23 100644
--- a/comwell_key_app/lib/common/components/comwell_text_field.dart
+++ b/comwell_key_app/lib/common/components/comwell_text_field.dart
@@ -1,4 +1,5 @@
-import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:comwell_key_app/themes/comwell_colors.dart';
+import 'package:comwell_key_app/themes/light_theme.dart' hide colorDivider, colorTertiary;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -75,10 +76,10 @@ class ComwellTextFieldState extends State<ComwellTextField> {
errorStyle: Theme.of(context)
.textTheme
.bodySmall
- ?.copyWith(color: const Color(0xFFEB0026)),
+ ?.copyWith(color: colorError),
label: Text(widget.fieldName, style: textStyle),
errorBorder: OutlineInputBorder(
- borderSide: const BorderSide(color: Color(0xFFEB0026)),
+ borderSide: const BorderSide(color: Colors.red),
borderRadius: BorderRadius.circular(8)),
focusedErrorBorder: OutlineInputBorder(
borderSide: const BorderSide(color: colorDivider),
diff --git a/comwell_key_app/lib/database/daos/upsales_dao.dart b/comwell_key_app/lib/database/daos/upsales_dao.dart
index e08cede7..6f3b739f 100644
--- a/comwell_key_app/lib/database/daos/upsales_dao.dart
+++ b/comwell_key_app/lib/database/daos/upsales_dao.dart
@@ -28,7 +28,7 @@ class UpsalesDAO extends DatabaseAccessor<ComwellDatabase>
Future<void> insertUpsale(UpSalesDTO upsale) async {
final entity = UpsaleEntityCompanion.insert(
id: upsale.confirmationNumber,
- json: jsonEncode(upsale),
+ json: jsonEncode(upsale.toJson()),
);
await batch((batch) =>
batch.insert(upsaleEntity, entity, mode: InsertMode.insertOrReplace));
diff --git a/comwell_key_app/lib/domain/repositories/pregistration_repository.dart b/comwell_key_app/lib/domain/repositories/pregistration_repository.dart
index b2428dbc..066ae58c 100644
--- a/comwell_key_app/lib/domain/repositories/pregistration_repository.dart
+++ b/comwell_key_app/lib/domain/repositories/pregistration_repository.dart
@@ -92,7 +92,7 @@ class PreregistrationRepository {
Future<dynamic> createPreregistration(PreregRequestDto request) async {
try {
debugPrint("request: $request.toString()");
- final response = await _api.preRegistration(request);
+ final response = await _api.preArrival(request);
return response.data!;
} catch (e) {
diff --git a/comwell_key_app/lib/hotel_information/models/addon_upgrade.dart b/comwell_key_app/lib/hotel_information/models/addon_upgrade.dart
index c6b355d9..9cfdd922 100644
--- a/comwell_key_app/lib/hotel_information/models/addon_upgrade.dart
+++ b/comwell_key_app/lib/hotel_information/models/addon_upgrade.dart
@@ -7,8 +7,9 @@ part '../../.generated/hotel_information/models/addon_upgrade.g.dart';
class AddonUpgrade {
final String id;
final String name;
- @JsonKey(defaultValue: [])
+ @JsonKey(defaultValue: [null])
final List<String?> images;
+ @JsonKey(defaultValue: "")
final String description;
final bool isService;
final bool onlyAvailableBeforeCheckin;
diff --git a/comwell_key_app/lib/presentation/screens/booking_details/bloc/booking_details_cubit.dart b/comwell_key_app/lib/presentation/screens/booking_details/bloc/booking_details_cubit.dart
index dd0831dc..5503364b 100644
--- a/comwell_key_app/lib/presentation/screens/booking_details/bloc/booking_details_cubit.dart
+++ b/comwell_key_app/lib/presentation/screens/booking_details/bloc/booking_details_cubit.dart
@@ -50,7 +50,8 @@ class BookingDetailsCubit extends BaseCubit<BookingDetailsState> {
hotelCode: booking.hotelCode,
fetchRemote: true,
);
- if (booking.reservationStatus == ReservationStatus.newreservation) {
+ if (booking.reservationStatus == ReservationStatus.newreservation ||
+ booking.reservationStatus == ReservationStatus.preregistered) {
await getUpSales(fetchRemote: true);
}
await updateRemainingTime();
diff --git a/comwell_key_app/lib/presentation/screens/booking_details/booking_details_page.dart b/comwell_key_app/lib/presentation/screens/booking_details/booking_details_page.dart
index a8e0aa71..840adbb8 100644
--- a/comwell_key_app/lib/presentation/screens/booking_details/booking_details_page.dart
+++ b/comwell_key_app/lib/presentation/screens/booking_details/booking_details_page.dart
@@ -1,4 +1,3 @@
-
import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
import 'package:comwell_key_app/common/components/shimmer_loader/booking_details_shimmer_loader.dart';
@@ -12,6 +11,7 @@ import 'package:comwell_key_app/presentation/screens/booking_details/components/
import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/services/mappers/booking_mapper.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:comwell_key_app/up_sales/models/room_upgrade_list.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -58,6 +58,10 @@ class BookingDetailsPage extends StatelessWidget {
) {
final theme = Theme.of(context);
final screenHeight = MediaQuery.of(context).size.height;
+ final isPreregistered = cubit.booking.reservationStatus == ReservationStatus.preregistered;
+ final isCheckedIn = cubit.booking.reservationStatus == ReservationStatus.checkedin;
+ final isPrimaryGuest = cubit.booking.isPrimaryGuest;
+ final shouldShowShareButton = isPrimaryGuest && isCheckedIn || isPreregistered;
return Stack(
children: [
@@ -84,16 +88,9 @@ class BookingDetailsPage extends StatelessWidget {
),
),
// Share button - fixed at top
- if (cubit.booking.reservationStatus == ReservationStatus.preregistered ||
- cubit.booking.reservationStatus == ReservationStatus.preregistered ||
- cubit.booking.reservationStatus == ReservationStatus.checkedin)
- SafeArea(
- child:
- cubit.booking.isPrimaryGuest &&
- cubit.booking.reservationStatus == ReservationStatus.checkedin
- ? ShareButton(guests: state.guests)
- : const SizedBox(),
- ),
+ SafeArea(
+ child: shouldShowShareButton ? ShareButton(guests: state.guests) : const SizedBox(),
+ ),
// Scrollable content with haptic feedback
_ScrollableBookingContent(
screenHeight: screenHeight,
@@ -116,7 +113,6 @@ class BookingDetailsPage extends StatelessWidget {
return InkWell(
onTap: () async {
await context.push(AppRoutes.myBooking, extra: cubit.booking);
-
},
child: Container(
width: double.infinity,
@@ -207,7 +203,7 @@ class _ScrollableBookingContentState extends State<_ScrollableBookingContent> {
final isKeyLoadedForBooking = keys.any((key) => key.label == widget.cubit.booking.roomNumber);
final isKeysEmpty = keys.isEmpty;
final hasRoomNumber = widget.cubit.booking.roomNumber != '';
-
+
return NotificationListener<ScrollNotification>(
onNotification: (notification) {
_onScroll(notification.metrics.pixels);
@@ -233,15 +229,29 @@ class _ScrollableBookingContentState extends State<_ScrollableBookingContent> {
child: Divider(color: colorDivider),
),
const SizedBox(height: 10),
- if (!isKeysEmpty &&
- hasRoomNumber &&
- isKeyLoadedForBooking)
+ if (!isKeysEmpty && hasRoomNumber && isKeyLoadedForBooking)
UnlockRoomButton(roomNumber: widget.cubit.booking.roomNumber)
else if (widget.cubit.booking.reservationStatus == ReservationStatus.checkedin)
const GetKeysButton()
else if (widget.cubit.booking.reservationStatus ==
ReservationStatus.preregistered)
- const CheckInButtonTimer()
+ CheckInButtonTimer(
+ buyEarlyCheckin: () async {
+ final earlyCheckin = widget.cubit.state.upSales?.addOnUpgrades
+ .where((upgrade) => upgrade.id == 'EARCHI')
+ .firstOrNull;
+ final roomUpgradeList = RoomUpgradeList(
+ booking: widget.cubit.booking,
+ addOnUpgrade: earlyCheckin,
+ isRoomUpgradeSelected: false,
+ isSinglePurchase: true,
+ );
+ final result = await context.push(AppRoutes.servicesUpgrade, extra: roomUpgradeList);
+ if (result == true && context.mounted) {
+ widget.cubit.init();
+ }
+ },
+ )
else if (widget.cubit.booking.reservationStatus ==
ReservationStatus.newreservation)
const PreregisterButton()
diff --git a/comwell_key_app/lib/presentation/screens/booking_details/components/booking_details_bottom_sheet.dart b/comwell_key_app/lib/presentation/screens/booking_details/components/booking_details_bottom_sheet.dart
index a09defa2..9830155a 100644
--- a/comwell_key_app/lib/presentation/screens/booking_details/components/booking_details_bottom_sheet.dart
+++ b/comwell_key_app/lib/presentation/screens/booking_details/components/booking_details_bottom_sheet.dart
@@ -141,7 +141,7 @@ class BookingDetailsBottomSheet extends StatelessWidget {
case ReservationStatus.newreservation:
return _buildServices(context);
case ReservationStatus.preregistered:
- return const SizedBox();
+ return _buildServices(context);
case ReservationStatus.cancelled:
return const SizedBox();
case ReservationStatus.checkedout:
diff --git a/comwell_key_app/lib/presentation/screens/booking_details/components/check_in_button_timer.dart b/comwell_key_app/lib/presentation/screens/booking_details/components/check_in_button_timer.dart
index 2d4aadcb..2034c695 100644
--- a/comwell_key_app/lib/presentation/screens/booking_details/components/check_in_button_timer.dart
+++ b/comwell_key_app/lib/presentation/screens/booking_details/components/check_in_button_timer.dart
@@ -12,9 +12,8 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart';
class CheckInButtonTimer extends StatefulWidget {
- const CheckInButtonTimer({
- super.key,
- });
+ final VoidCallback buyEarlyCheckin;
+ const CheckInButtonTimer({super.key, required this.buyEarlyCheckin});
@override
State<CheckInButtonTimer> createState() => _CheckInButtonTimerState();
@@ -51,17 +50,24 @@ class _CheckInButtonTimerState extends State<CheckInButtonTimer> {
key: const ValueKey('timer_view'),
builder: (context, state) {
final cubit = context.read<BookingDetailsCubit>();
+ final booking = cubit.booking;
+ final hasAddons = booking.addOnItems?.isNotEmpty ?? false;
final (days, hours, minutes, seconds) = getDurationInMinutes(state.remainingTime);
final checkInTime = cubit.getCheckInTime();
final dateStr = DateFormat('d. MMM', 'da').format(checkInTime);
final theme = Theme.of(context);
- final timeStr = days > 0
+ final timeStr = days > 0 && hours > 0
? context.strings.check_in_button_timer_days_hours_minutes(
days.toString(),
hours.toString(),
minutes.toString(),
)
+ : days > 0
+ ? context.strings.check_in_button_timer_days_minutes(
+ days.toString(),
+ minutes.toString(),
+ )
: hours > 0
? context.strings.check_in_button_timer_hours_minutes(
hours.toString(),
@@ -75,71 +81,99 @@ class _CheckInButtonTimerState extends State<CheckInButtonTimer> {
margin: const EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.grey[900]?.withValues(alpha: 0.8),
- borderRadius: BorderRadius.circular(8),
+ borderRadius: BorderRadius.circular(12),
),
- padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
- child: Row(
+ child: Column(
children: [
- SvgPicture.asset(
- Assets.icons.icLocked.path,
- colorFilter: const ColorFilter.mode(
- colorBackground,
- BlendMode.srcIn,
- ),
- ),
- const SizedBox(width: 16),
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
+ child: Row(
children: [
- Text(
- 'Check-in',
- style: theme.textTheme.titleMedium?.copyWith(
- color: colorBackground,
- fontWeight: FontWeight.w600,
+ SvgPicture.asset(
+ Assets.icons.icLocked.path,
+ colorFilter: const ColorFilter.mode(
+ colorBackground,
+ BlendMode.srcIn,
),
),
- Text(
- timeStr,
- style: theme.textTheme.bodyMedium?.copyWith(
- color: colorBackground.withValues(alpha: 0.8),
+ const SizedBox(width: 16),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ context.strings.check_in,
+ style: theme.textTheme.titleMedium?.copyWith(
+ color: colorBackground,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ Text(
+ timeStr,
+ style: theme.textTheme.bodyMedium?.copyWith(
+ color: colorBackground.withValues(alpha: 0.8),
+ ),
+ ),
+ ],
),
),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Text(
+ dateStr.toUpperCase(),
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: colorBackground.withValues(alpha: 0.7),
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ Text(
+ DateFormat('HH:mm').format(checkInTime),
+ style: theme.textTheme.titleMedium?.copyWith(
+ color: colorBackground,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ],
+ ),
],
),
),
- Column(
- crossAxisAlignment: CrossAxisAlignment.end,
- children: [
- Text(
- dateStr.toUpperCase(),
- style: theme.textTheme.bodySmall?.copyWith(
- color: colorBackground.withValues(alpha: 0.7),
- fontWeight: FontWeight.w600,
- ),
- ),
- Text(
- DateFormat('HH:mm').format(checkInTime),
- style: theme.textTheme.titleMedium?.copyWith(
- color: colorBackground,
- fontWeight: FontWeight.w600,
+ if (!hasAddons) ...[
+ Divider(color: colorBackground.withValues(alpha: 0.1)),
+ GestureDetector(
+ onTap: widget.buyEarlyCheckin,
+ child: Padding(
+ padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0, bottom: 16.0),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text(
+ context.strings.buy_early_checkin,
+ style: theme.textTheme.bodyLarge?.copyWith(
+ color: colorBackground,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ const Icon(Icons.arrow_forward_ios, color: colorBackground, size: 20),
+ ],
),
),
- ],
- ),
+ ),
+ ],
],
),
);
- if (_isDevOrStage) {
- return GestureDetector(
- onTap: () {
- // Bypass timer in dev/stage - show check-in button
- cubit.bypassTimer();
- },
- child: timerContent,
- );
- }
+ // if (_isDevOrStage) {
+ // return GestureDetector(
+ // onTap: () {
+ // // Bypass timer in dev/stage - show check-in button
+ // cubit.bypassTimer();
+ // },
+ // child: timerContent,
+ // );
+ // }
return timerContent;
},
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_cubit.dart b/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_cubit.dart
index dcdfd7e1..15773596 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_cubit.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_cubit.dart
@@ -20,7 +20,9 @@ import 'package:comwell_key_app/utils/locator.dart';
import 'package:comwell_key_app/utils/phone_utils.dart';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
+import 'package:path/path.dart';
import 'package:payment_plugin/domain/models/stored_payment_method.dart';
class PreregistrationCubit extends BaseCubit<PreregistrationState> {
@@ -41,16 +43,17 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
final emailTextController = TextEditingController();
final phoneNumberTextController = TextEditingController();
final documentNumberTextController = TextEditingController();
+ final commentTextController = TextEditingController();
CountryCode? countryCode;
String? phoneNumber;
final List<String> favoriteCountries = ['DK', 'SE', 'NO', 'FI'];
- final List<String> documentTypes = [
- 'document_type_passport',
- 'document_type_id_card',
- 'document_type_driver_license',
- 'document_type_other',
+ List<String> documentTypes(BuildContext context) => [
+ context.strings.document_type_passport,
+ context.strings.document_type_id_card,
+ context.strings.document_type_driver_license,
+ context.strings.document_type_other,
];
String selectedDocumentType = '';
@@ -103,39 +106,27 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
void setupListeners() {
phoneNumberTextController.addListener(() {
- emit(
- state.copyWith(
- isPhoneNumberValid: isPhoneNumberValid,
- missingInformation: false,
- ),
- );
+ if (state.missingInformation) {
+ emit(state.copyWith(missingInformation: false));
+ }
});
addressTextController.addListener(() {
- emit(
- state.copyWith(
- isAddressValid: isAddressValid,
- missingInformation: false,
- ),
- );
+ if (state.missingInformation) {
+ emit(state.copyWith(missingInformation: false));
+ }
});
postalCodeTextController.addListener(() {
- emit(
- state.copyWith(
- isPostalCodeValid: isPostalCodeValid,
- missingInformation: false,
- ),
- );
+ if (state.missingInformation) {
+ emit(state.copyWith(missingInformation: false));
+ }
});
cityTextController.addListener(() {
- emit(
- state.copyWith(
- isCityValid: isCityValid,
- missingInformation: false,
- ),
- );
+ if (state.missingInformation) {
+ emit(state.copyWith(missingInformation: false));
+ }
});
}
@@ -163,7 +154,7 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
}
void onProfileContinueClicked() {
- if (isFirstNameValid && isLastNameValid && isPhoneNumberValid) {
+ if (isFirstNameValid && isLastNameValid && isPhoneNumberValid && isBirthDateValid) {
final phoneNumber = concatCountryCodeAndPhoneNumber(
countryCode!,
phoneNumberTextController.text,
@@ -181,19 +172,6 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
}
}
- bool onPaymentContinueClicked() {
- if (state.selectedPaymentMethod != null) {
- _navigateNextPage();
- return true;
- } else {
- return false;
- }
- }
-
- void onPaymentMethodValidationError() {
- emit(state.copyWith(missingInformation: true));
- }
-
void onUpSalesContinueClicked() {
_navigateNextPage();
}
@@ -207,10 +185,6 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
case PreregistrationPage.address:
onAddressContinueClicked();
break;
- /* case PreregistrationPage.payment:
- // Payment validation is handled in preregistration_flow.dart
- onPaymentContinueClicked();
- break; */
case PreregistrationPage.upSales:
onUpSalesContinueClicked();
break;
@@ -264,8 +238,7 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
try {
final hasUpSales =
state.addOnUpgrades.any((e) => e.isAddedToCart) || state.selectedRoomUpgrade.isNotEmpty;
-
- await _profileSettingsRepository.updateUser(state.user!);
+
if (hasUpSales) {
addUpSalesToBooking();
}
@@ -282,6 +255,8 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
city: state.user!.address.city,
country: state.user!.address.country,
confirmationNumber: booking.confirmationNumber,
+ arrivalTime: state.servingTime?.toString() ?? '',
+ comment: commentTextController.text,
hotelCode: booking.hotelCode,
comwellClubTermsOfUseConsentChoice: state.termsAndConditionsAccepted,
comwellClubMarketingConsentChoice: false,
@@ -330,10 +305,6 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
_navigateTo(PreregistrationPage.address);
}
- /* void onEditPaymentMethodCLickked() {
- _navigateTo(PreregistrationPage.payment);
- } */
-
void onEditExtrasClicked() {
_navigateTo(PreregistrationPage.upSales);
}
@@ -348,6 +319,11 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
emit(state.copyWith(countryCode: country, selectedCountry: country.code ?? ''));
}
+ Future<void> onBirthDateSelected(DateTime date) async {
+ final updatedUser = state.user!.copyWith(birthDate: date);
+ emit(state.copyWith(user: updatedUser));
+ }
+
bool onBackClicked() {
if (_isAnimating) return true;
final hasPage = pageController.page != null;
@@ -427,6 +403,7 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
emailTextController.dispose();
phoneNumberTextController.dispose();
documentNumberTextController.dispose();
+ commentTextController.dispose();
return super.close();
}
@@ -445,20 +422,25 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
bool get isLastNameValid => lastNameTextController.text.isNotEmpty;
+ bool get isBirthDateValid => state.user!.birthDate!.isBefore(validBirthDate);
+
+ DateTime get validBirthDate => DateTime.now().subtract(const Duration(days: 365 * 18));
+
bool get canContinue {
int page = pageController.page?.ceil() ?? 0;
final preregPage = PreregistrationPage.fromIndex(page);
switch (preregPage) {
+
case PreregistrationPage.profile:
- return isFirstNameValid && isLastNameValid && isPhoneNumberValid;
+ return isFirstNameValid && isLastNameValid && isPhoneNumberValid && isBirthDateValid;
case PreregistrationPage.address:
return isAddressValid && isPostalCodeValid && isCityValid;
case PreregistrationPage.upSales:
return true;
case PreregistrationPage.confirmation:
- return true;
+ return state.termsAndConditionsAccepted;
}
}
@@ -484,6 +466,10 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
emit(state.copyWith(termsAndConditionsAccepted: toggle));
}
+ void onServingTimeSelected(TimeOfDay time) {
+ emit(state.copyWith(servingTime: time));
+ }
+
void toggleSelectedUpgrade(Upgrade upgrade) {
if (upgrade is RoomUpgrade) {
if (state.selectedRoomUpgrade == upgrade.id) {
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_state.dart b/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_state.dart
index 8cdd8021..5c7b78ce 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_state.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_state.dart
@@ -2,6 +2,7 @@ import 'package:comwell_key_app/domain/models/app_error.dart';
import 'package:comwell_key_app/up_sales/models/addon_upgrade.dart';
import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
import 'package:country_code_picker/country_code_picker.dart';
+import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:payment_plugin/domain/models/stored_payment_method.dart';
@@ -31,8 +32,10 @@ abstract class PreregistrationState with _$PreregistrationState {
@Default(false) bool isAddressValid,
@Default(false) bool isPostalCodeValid,
@Default(false) bool isCityValid,
+ @Default(false) bool isBirthDateValid,
@Default('') String selectedDocumentType,
@Default(null) StoredPaymentMethod? selectedPaymentMethod,
+ @Default(null) TimeOfDay? servingTime,
@Default(AppError.none) AppError error,
}) = _PreregistrationState;
}
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_address_page.dart b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_address_page.dart
index 399e176c..7320306e 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_address_page.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_address_page.dart
@@ -15,14 +15,13 @@ class PreregAddressPage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocBuilder<PreregistrationCubit, PreregistrationState>(
builder: (context, state) {
+ final theme = Theme.of(context);
final cubit = context.read<PreregistrationCubit>();
if (state.isLoading) {
return const Center(child: PreregAddressShimmerLoader());
}
- final isFavoriteCountry = cubit.favoriteCountries.contains(state.selectedCountry);
-
final addressErrorMessage = !cubit.isAddressValid && state.missingInformation
? context.strings.generic_information_required
: null;
@@ -33,10 +32,6 @@ class PreregAddressPage extends StatelessWidget {
? context.strings.generic_information_required
: null;
- final documentNumberErrorMessage = !cubit.isDocumentNumberValid && state.missingInformation
- ? context.strings.generic_information_required
- : null;
-
return ListView(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
key: const PageStorageKey("information_form"),
@@ -89,10 +84,10 @@ class PreregAddressPage extends StatelessWidget {
alignLeft: true,
textOverflow: TextOverflow.visible,
initialSelection: cubit.countryCode?.name,
- showFlag: true,
+ showFlag: false,
favorite: cubit.favoriteCountries,
showDropDownButton: true,
- textStyle: Theme.of(context).textTheme.headlineSmall,
+ textStyle: theme.textTheme.headlineSmall,
showCountryOnly: true,
showOnlyCountryWhenClosed: true,
onChanged: (CountryCode countryCode) {
@@ -100,50 +95,6 @@ class PreregAddressPage extends StatelessWidget {
},
),
),
- const SizedBox(height: 12),
- if (!isFavoriteCountry) ...[
- const Divider(color: colorDivider),
- const SizedBox(height: 12),
- Container(
- height: 62,
- width: double.infinity,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8),
- border: Border.all(color: colorDivider),
- ),
- child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
- child: DropdownButtonFormField<String>(
- hint: Text(context.strings.document_type),
- initialValue: state.selectedDocumentType.isNotEmpty
- ? state.selectedDocumentType
- : null,
- style: Theme.of(context).textTheme.headlineSmall?.copyWith(color: Colors.black),
- items: cubit.documentTypes
- .map(
- (documentType) =>
- DropdownMenuItem(value: documentType, child: Text(documentType)),
- )
- .toList(),
- onChanged: (value) {
- if (value != null) {
- cubit.onDocumentTypeSelected(value);
- }
- },
- ),
- ),
- ),
- const SizedBox(height: 12),
- ComwellTextField(
- key: const Key("document_number"),
- fieldName: context.strings.document_number,
- textInputType: TextInputType.number,
- initialValue: "",
- readOnly: false,
- errorMessage: documentNumberErrorMessage,
- controller: cubit.documentNumberTextController,
- ),
- ],
],
);
},
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_confirmation_page.dart b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_confirmation_page.dart
index b031fc63..d216ad47 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_confirmation_page.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_confirmation_page.dart
@@ -1,18 +1,19 @@
import 'package:comwell_key_app/presentation/screens/pregistration/cubit/preregistration_cubit.dart';
import 'package:comwell_key_app/presentation/screens/pregistration/components/information_card.dart';
+import 'package:comwell_key_app/presentation/screens/pregistration/cubit/preregistration_state.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/urls.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:payment_plugin/presentation/app/bloc/payment_cards_cubit.dart';
-import 'package:payment_plugin/presentation/app/bloc/payment_cards_state.dart';
+import 'package:url_launcher/url_launcher.dart';
class PreregConfirmationPage extends StatelessWidget {
const PreregConfirmationPage({super.key});
@override
Widget build(BuildContext context) {
- return BlocBuilder<PaymentCardsCubit, PaymentCardsState>(
+ return BlocBuilder<PreregistrationCubit, PreregistrationState>(
builder: (context, state) {
final cubit = context.read<PreregistrationCubit>();
@@ -89,7 +90,20 @@ class PreregConfirmationPage extends StatelessWidget {
],
),
),
- const SizedBox(height: 12),
+ const SizedBox(height: 24),
+ // My addons section
+ Text(
+ context.strings.preregistration_my_addons,
+ style: theme.textTheme.headlineSmall,
+ ),
+ const SizedBox(height: 8),
+ Text(
+ context.strings.preregistration_my_addons_subtitle,
+ style: theme.textTheme.bodyMedium?.copyWith(
+ color: colorHeadlineText,
+ ),
+ ),
+ const SizedBox(height: 16),
InformationCard(
title: extrasTitleText,
titleStyle: theme.textTheme.titleMedium?.copyWith(
@@ -102,7 +116,9 @@ class PreregConfirmationPage extends StatelessWidget {
children: [
Text(
context.strings.total_charge_value(cubit.extrasTotalPrice.toString()),
- style: theme.textTheme.bodyMedium,
+ style: theme.textTheme.bodyMedium?.copyWith(
+ fontWeight: FontWeight.w600,
+ ),
),
Text(
context.strings.preregistration_confirmation_extras_card_subtitle,
@@ -113,6 +129,173 @@ class PreregConfirmationPage extends StatelessWidget {
],
),
),
+ const SizedBox(height: 12),
+ // Serving time field
+ Container(
+ padding: const EdgeInsets.all(12),
+ decoration: BoxDecoration(
+ color: sandColor[10],
+ borderRadius: const BorderRadius.all(Radius.circular(10)),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ context.strings.preregistration_serving_time_label,
+ style: theme.textTheme.titleMedium?.copyWith(
+ fontWeight: FontWeight.w500,
+ color: colorHeadlineText,
+ ),
+ ),
+ const SizedBox(height: 8),
+ GestureDetector(
+ onTap: () async {
+ final time = await showTimePicker(
+ builder: (context, child) {
+ return Theme(
+ data: theme.copyWith(
+ timePickerTheme: TimePickerThemeData(
+ hourMinuteColor: sandColor,
+ hourMinuteTextColor: Colors.white,
+ dialHandColor: sandColor,
+ dialBackgroundColor: sandColor[10],
+ entryModeIconColor: sandColor,
+ ),
+ textButtonTheme: TextButtonThemeData(
+ style: TextButton.styleFrom(
+ foregroundColor: sandColor,
+ textStyle: theme.textTheme.labelLarge,
+ ),
+ ),
+ ),
+ child: MediaQuery(
+ data: MediaQuery.of(context).copyWith(
+ alwaysUse24HourFormat: true,
+ ),
+ child: child!,
+ ),
+ );
+ },
+ context: context,
+ initialTime: state.servingTime ?? TimeOfDay.now(),
+ initialEntryMode: TimePickerEntryMode.inputOnly,
+ );
+ if (time != null) {
+ cubit.onServingTimeSelected(time);
+ }
+ },
+ child: Text(
+ state.servingTime != null
+ ? state.servingTime!.format(context)
+ : '--:--',
+ style: theme.textTheme.bodyMedium
+ ),
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(height: 16),
+ // Comment field
+ Container(
+ padding: const EdgeInsets.all(12),
+ decoration: BoxDecoration(
+ color: sandColor[10],
+ borderRadius: const BorderRadius.all(Radius.circular(10)),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ context.strings.preregistration_comment_label,
+ style: theme.textTheme.titleMedium?.copyWith(
+ fontWeight: FontWeight.w500,
+ color: colorHeadlineText,
+ ),
+ ),
+ const SizedBox(height: 8),
+ TextField(
+ controller: cubit.commentTextController,
+ maxLines: 3,
+ decoration: InputDecoration(
+ hintText: context.strings.preregistration_comment_hint,
+ hintStyle: theme.textTheme.bodyMedium?.copyWith(
+ color: colorHeadlineText,
+ fontWeight: FontWeight.w600,
+ ),
+ border: InputBorder.none,
+ contentPadding: EdgeInsets.zero,
+ ),
+ style: theme.textTheme.bodyMedium?.copyWith(
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(height: 16),
+ // Accept terms checkbox
+ Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Checkbox(
+ value: state.termsAndConditionsAccepted,
+ onChanged: (_) => cubit.onTermsAndConditionsToggled(
+ !state.termsAndConditionsAccepted,
+ ),
+ side: const BorderSide(color: colorDivider, width: 2),
+ visualDensity: VisualDensity.compact,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(4),
+ ),
+ activeColor: sandColor[80],
+ ),
+ const SizedBox(width: 4),
+ Expanded(
+ child: Wrap(
+ children: [
+ Text(
+ '${context.strings.preregistration_accept_terms_prefix} ',
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: colorHeadlineText,
+ ),
+ ),
+ GestureDetector(
+ onTap: () {
+ launchUrl(Uri.parse(ComwellUrls.clubPermission));
+ },
+ child: Text(
+ context.strings.preregistration_accept_terms_privacy_policy,
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: sandColor,
+ decoration: TextDecoration.underline,
+ decorationColor: sandColor,
+ ),
+ ),
+ ),
+ Text(
+ ' ${context.strings.preregistration_accept_terms_and} ',
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: colorHeadlineText,
+ ),
+ ),
+ GestureDetector(
+ onTap: () {
+ launchUrl(Uri.parse(ComwellUrls.termsAndConditions));
+ },
+ child: Text(
+ context.strings.preregistration_accept_terms_trade_conditions,
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: sandColor,
+ decoration: TextDecoration.underline,
+ decorationColor: sandColor,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
const SizedBox(height: 40),
],
),
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart
index 16312716..83d1e9aa 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart
@@ -2,6 +2,8 @@ import 'package:comwell_key_app/common/components/comwell_error_widget.dart';
import 'package:comwell_key_app/common/components/comwell_text_field.dart';
import 'package:comwell_key_app/presentation/screens/pregistration/cubit/preregistration_cubit.dart';
import 'package:comwell_key_app/presentation/screens/pregistration/cubit/preregistration_state.dart';
+import 'package:comwell_key_app/presentation/screens/profile_settings/components/date_time_picker.dart';
+import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:comwell_key_app/utils/l10n_utils.dart';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:flutter/material.dart';
@@ -39,16 +41,28 @@ class PreregProfilePage extends StatelessWidget {
Widget _buildProfilePage(ThemeData theme, PreregistrationState state, BuildContext context) {
final cubit = context.read<PreregistrationCubit>();
+ final isFavoriteCountry = cubit.favoriteCountries.contains(state.selectedCountry);
+
final firstNameErrorMessage = !cubit.isFirstNameValid && state.missingInformation
? context.strings.generic_information_required
: null;
+
final lastNameErrorMessage = !cubit.isLastNameValid && state.missingInformation
? context.strings.generic_information_required
: null;
+
final phoneNumberErrorMessage = !cubit.isPhoneNumberValid && state.missingInformation
? context.strings.generic_information_required
: null;
+ final birthDateErrorMessage = !cubit.isBirthDateValid && state.missingInformation
+ ? context.strings.preregistration_birthdate_error_message
+ : null;
+
+ final documentNumberErrorMessage = !cubit.isDocumentNumberValid && state.missingInformation
+ ? context.strings.generic_information_required
+ : null;
+
return ListView(
children: [
Padding(
@@ -57,6 +71,16 @@ class PreregProfilePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 36),
+ Text(
+ context.strings.preregistration_profile_title,
+ style: theme.textTheme.headlineLarge,
+ ),
+ const SizedBox(height: 18),
+ Text(
+ context.strings.preregistration_profile_subtitle,
+ style: theme.textTheme.bodySmall,
+ ),
+ const SizedBox(height: 40),
ComwellTextField(
key: const Key("firstName"),
fieldName: context.strings.profile_settings_firstname,
@@ -81,6 +105,15 @@ class PreregProfilePage extends StatelessWidget {
},
),
const SizedBox(height: 8),
+ DateTimePicker(
+ title: context.strings.profile_settings_birthday,
+ initialValue: state.user!.birthDate!,
+ onDateSelected: (date) async {
+ await cubit.onBirthDateSelected(date);
+ },
+ errorMessage: birthDateErrorMessage,
+ ),
+ const SizedBox(height: 8),
ComwellTextField(
key: const Key("email"),
fieldName: context.strings.profile_settings_email,
@@ -107,6 +140,73 @@ class PreregProfilePage extends StatelessWidget {
// NO OP
},
),
+ const SizedBox(height: 12),
+ Container(
+ height: 62,
+ width: double.infinity,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(color: colorDivider),
+ ),
+ child: CountryCodePicker(
+ alignLeft: true,
+ textOverflow: TextOverflow.visible,
+ initialSelection: cubit.countryCode?.name,
+ showFlag: false,
+ favorite: cubit.favoriteCountries,
+ showDropDownButton: true,
+ textStyle: theme.textTheme.headlineSmall,
+ showCountryOnly: true,
+ showOnlyCountryWhenClosed: true,
+ onChanged: (CountryCode countryCode) {
+ cubit.onCountryCodeSelected(countryCode);
+ },
+ ),
+ ),
+ if (!isFavoriteCountry) ...[
+ const SizedBox(height: 12),
+ Container(
+ height: 62,
+ width: double.infinity,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(color: colorDivider),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
+ child: DropdownButtonFormField<String>(
+ hint: Text(context.strings.document_type),
+ decoration: const InputDecoration(border: InputBorder.none),
+ initialValue: state.selectedDocumentType.isNotEmpty
+ ? state.selectedDocumentType
+ : null,
+ style: theme.textTheme.headlineSmall?.copyWith(color: Colors.black),
+ items: cubit.documentTypes(context)
+ .map(
+ (documentType) =>
+ DropdownMenuItem(value: documentType, child: Text(documentType)),
+ )
+ .toList(),
+ onChanged: (value) {
+ if (value != null) {
+ cubit.onDocumentTypeSelected(value);
+ }
+ },
+ ),
+ ),
+ ),
+ const SizedBox(height: 12),
+ ComwellTextField(
+ key: const Key("document_number"),
+ fieldName: context.strings.document_number,
+ textInputType: TextInputType.number,
+ initialValue: "",
+ readOnly: false,
+ errorMessage: documentNumberErrorMessage,
+ controller: cubit.documentNumberTextController,
+ ),
+ ],
+ const SizedBox(height: 50),
],
),
),
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/prereg_request_model.dart b/comwell_key_app/lib/presentation/screens/pregistration/prereg_request_model.dart
index 087b01a3..9eb1c6f7 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/prereg_request_model.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/prereg_request_model.dart
@@ -9,7 +9,8 @@ class PreregRequestDto {
final String city;
final String country;
final String confirmationNumber;
-
+ final String arrivalTime;
+ final String comment;
final String hotelCode;
final bool comwellClubTermsOfUseConsentChoice;
final bool comwellClubMarketingConsentChoice;
@@ -25,6 +26,8 @@ class PreregRequestDto {
required this.city,
required this.country,
required this.confirmationNumber,
+ required this.arrivalTime,
+ required this.comment,
required this.hotelCode,
required this.comwellClubTermsOfUseConsentChoice,
required this.comwellClubMarketingConsentChoice,
@@ -42,6 +45,8 @@ class PreregRequestDto {
'city': city,
'country': country,
'confirmationNumber': confirmationNumber,
+ 'arrivalTime': arrivalTime,
+ 'comment': comment,
'hotelCode': hotelCode,
'comwellClubTermsOfUseConsentChoice': comwellClubTermsOfUseConsentChoice,
'comwellClubMarketingConsentChoice': comwellClubMarketingConsentChoice,
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/preregistration_flow.dart b/comwell_key_app/lib/presentation/screens/pregistration/preregistration_flow.dart
index ccb8d416..40cc96d1 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/preregistration_flow.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/preregistration_flow.dart
@@ -66,9 +66,11 @@ class _PreregistrationFlowState extends State<PreregistrationFlow> {
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 40.0),
child: ElevatedButton(
- onPressed: () {
- cubit.onContinueClicked(context);
- },
+ onPressed: cubit.canContinue
+ ? () {
+ cubit.onContinueClicked(context);
+ }
+ : null,
style: ElevatedButton.styleFrom(foregroundColor: colorBackground),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
diff --git a/comwell_key_app/lib/presentation/screens/profile_settings/bloc/profile_settings_cubit.dart b/comwell_key_app/lib/presentation/screens/profile_settings/bloc/profile_settings_cubit.dart
index 4444e7e9..6406770b 100644
--- a/comwell_key_app/lib/presentation/screens/profile_settings/bloc/profile_settings_cubit.dart
+++ b/comwell_key_app/lib/presentation/screens/profile_settings/bloc/profile_settings_cubit.dart
@@ -74,7 +74,7 @@ class ProfileSettingsCubit extends BaseCubit<ProfileSettingsState> {
}
}
- void updateBirthDate(DateTime birthDate) {
+ Future<void> updateBirthDate(DateTime birthDate) async {
final updatedUser = user.copyWith(birthDate: birthDate);
_profileCubit.updateUser(updatedUser);
}
diff --git a/comwell_key_app/lib/presentation/screens/profile_settings/components/date_time_picker.dart b/comwell_key_app/lib/presentation/screens/profile_settings/components/date_time_picker.dart
index c30f547d..dc0a5755 100644
--- a/comwell_key_app/lib/presentation/screens/profile_settings/components/date_time_picker.dart
+++ b/comwell_key_app/lib/presentation/screens/profile_settings/components/date_time_picker.dart
@@ -1,5 +1,6 @@
import 'package:comwell_key_app/presentation/screens/profile_settings/bloc/profile_settings_cubit.dart';
-import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:comwell_key_app/themes/comwell_colors.dart';
+import 'package:comwell_key_app/themes/light_theme.dart' hide colorDivider, sandColor;
import 'package:comwell_key_app/utils/l10n_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -10,8 +11,15 @@ import 'package:intl/intl.dart';
class DateTimePicker extends StatefulWidget {
final String title;
final DateTime initialValue;
- const DateTimePicker(
- {required this.title, required this.initialValue, super.key});
+ final Future<void> Function(DateTime) onDateSelected;
+ final String? errorMessage;
+ const DateTimePicker({
+ required this.title,
+ required this.initialValue,
+ required this.onDateSelected,
+ this.errorMessage,
+ super.key,
+ });
@override
State<DateTimePicker> createState() => _DatePickerState();
@@ -48,7 +56,6 @@ class _DatePickerState extends State<DateTimePicker> {
if (context.mounted) {
final defaultBirthday = maxDate;
setState(() => _selectedDate = null);
- context.read<ProfileSettingsCubit>().updateBirthDate(defaultBirthday);
// Open the date picker after dialog is closed
await Future<void>.delayed(const Duration(milliseconds: 100));
if (context.mounted) {
@@ -61,7 +68,10 @@ class _DatePickerState extends State<DateTimePicker> {
}
Future<void> _showValidDatePicker(
- BuildContext context, DateTime initial, DateTime maxDate) async {
+ BuildContext context,
+ DateTime initial,
+ DateTime maxDate,
+ ) async {
await showDatePicker(
builder: (context, child) {
final theme = Theme.of(context);
@@ -93,7 +103,7 @@ class _DatePickerState extends State<DateTimePicker> {
if (selected != null && selected != _selectedDate) {
setState(() => _selectedDate = selected);
if (context.mounted) {
- context.read<ProfileSettingsCubit>().updateBirthDate(selected);
+ widget.onDateSelected(selected);
}
}
});
@@ -104,43 +114,57 @@ class _DatePickerState extends State<DateTimePicker> {
final theme = Theme.of(context);
final dateFormat = DateFormat('dd/MM/yyyy');
+ final errorMessage = widget.errorMessage;
+
return GestureDetector(
onTap: () => _selectDate(context),
- child: Container(
- height: 62,
- padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
- decoration: BoxDecoration(
- border: Border.all(color: colorDivider),
- borderRadius: BorderRadius.circular(8.0),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ height: 62,
+ padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
+ decoration: BoxDecoration(
+ border: Border.all(color: errorMessage != null ? colorError : colorDivider),
+ borderRadius: BorderRadius.circular(8.0),
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Text(
- widget.title,
- textAlign: TextAlign.start,
- style: theme.textTheme.bodySmall?.copyWith(
- color: colorHeadlineText,
- ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ widget.title,
+ textAlign: TextAlign.start,
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: errorMessage != null ? colorError : colorHeadlineText,
+ ),
+ ),
+ const SizedBox(height: 0.0),
+ Text(
+ _selectedDate != null
+ ? dateFormat.format(_selectedDate!)
+ : dateFormat.format(widget.initialValue),
+ style: theme.textTheme.headlineSmall?.copyWith(
+ color: errorMessage != null ? colorError : colorHeadlineText,
+ ),
+ ),
+ ],
+ ),
+ SvgPicture.asset(
+ "assets/icons/ic_calendar.svg",
+ height: 24.0,
),
- const SizedBox(height: 0.0),
- Text(
- _selectedDate != null
- ? dateFormat.format(_selectedDate!)
- : dateFormat.format(widget.initialValue),
- style: theme.textTheme.headlineSmall),
],
),
- SvgPicture.asset(
- "assets/icons/ic_calendar.svg",
- height: 24.0,
- ),
+ ),
+ if (errorMessage != null) ...[
+ const SizedBox(height: 4),
+ Text(errorMessage, style: theme.textTheme.bodySmall?.copyWith(color: colorError)),
],
- ),
+ ],
),
);
}
diff --git a/comwell_key_app/lib/presentation/screens/profile_settings/components/intl_phone_field.dart b/comwell_key_app/lib/presentation/screens/profile_settings/components/intl_phone_field.dart
index b27ada09..8979c230 100644
--- a/comwell_key_app/lib/presentation/screens/profile_settings/components/intl_phone_field.dart
+++ b/comwell_key_app/lib/presentation/screens/profile_settings/components/intl_phone_field.dart
@@ -51,7 +51,7 @@ class IntlPhoneFieldState extends State<IntlPhoneField> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
-
+
return Form(
key: formKey,
child: Container(
@@ -82,10 +82,7 @@ class IntlPhoneFieldState extends State<IntlPhoneField> {
height: 40,
color: colorDivider,
),
- const SizedBox(
- width: 20,
- ),
- const SizedBox(height: 0.0),
+ const SizedBox(width: 10),
Expanded(
child: TextField(
focusNode: _focusNode,
@@ -102,18 +99,16 @@ class IntlPhoneFieldState extends State<IntlPhoneField> {
],
decoration: InputDecoration(
errorText: widget.errorMessage,
- errorStyle: Theme.of(context)
- .textTheme
- .bodySmall
- ?.copyWith(color: const Color(0xFFEB0026)),
+ errorStyle: Theme.of(
+ context,
+ ).textTheme.bodySmall?.copyWith(color: const Color(0xFFEB0026)),
border: InputBorder.none,
- label: Text(widget.title,
- style: _isFocused
- ? theme.textTheme.bodySmall?.copyWith(
- color:
- colorHeadlineText)
- : theme.textTheme.headlineSmall
- ?.copyWith(color: colorTertiary)),
+ label: Text(
+ widget.title,
+ style: _isFocused
+ ? theme.textTheme.bodySmall?.copyWith(color: colorHeadlineText)
+ : theme.textTheme.headlineSmall?.copyWith(color: colorTertiary),
+ ),
),
),
/* InternationalPhoneNumberInput(
@@ -145,7 +140,7 @@ class IntlPhoneFieldState extends State<IntlPhoneField> {
print('On Saved: $number');
},
), */
- )
+ ),
],
),
),
diff --git a/comwell_key_app/lib/presentation/screens/profile_settings/profile_settings_screen.dart b/comwell_key_app/lib/presentation/screens/profile_settings/profile_settings_screen.dart
index 2f599b84..5555f393 100644
--- a/comwell_key_app/lib/presentation/screens/profile_settings/profile_settings_screen.dart
+++ b/comwell_key_app/lib/presentation/screens/profile_settings/profile_settings_screen.dart
@@ -140,6 +140,9 @@ class ProfileSettingsScreen extends StatelessWidget {
DateTimePicker(
title: context.strings.profile_settings_birthday,
initialValue: user.birthDate ?? DateTime(1990, 1, 1),
+ onDateSelected: (date) async {
+ await cubit.updateBirthDate(date);
+ },
),
const SizedBox(height: 20),
Center(
diff --git a/comwell_key_app/lib/services/api.dart b/comwell_key_app/lib/services/api.dart
index ca0e3175..6d17eed6 100644
--- a/comwell_key_app/lib/services/api.dart
+++ b/comwell_key_app/lib/services/api.dart
@@ -87,10 +87,10 @@ class Api {
return response;
}
- Future<Response<dynamic>> preRegistration(PreregRequestDto request) async {
+ Future<Response<dynamic>> preArrival(PreregRequestDto request) async {
final json = jsonEncode(request);
debugPrint("json: $json");
- final response = await dio.post<dynamic>(ApiEndpoints.preRegistration, data: json);
+ final response = await dio.post<dynamic>(ApiEndpoints.preArrivalByToken, data: json);
return response;
}
diff --git a/comwell_key_app/lib/services/mappers/user_mapper.dart b/comwell_key_app/lib/services/mappers/user_mapper.dart
index 52e2c91c..95f41aeb 100644
--- a/comwell_key_app/lib/services/mappers/user_mapper.dart
+++ b/comwell_key_app/lib/services/mappers/user_mapper.dart
@@ -32,7 +32,7 @@ extension UserMapper on UserDto {
signUpDate: signUpDate,
signUpCampaign: signUpCampaign ?? "",
signUpSource: signUpSource ?? "",
- locale: "",
+ locale: locale ?? "",
wasRecentlyCreated: wasRecentlyCreated,
nationality: nationality ?? "",
);
@@ -86,8 +86,8 @@ extension SimpleUserDtoMapper on User {
addressZip: address.zipCode,
addressCity: address.city,
addressCountry: addressCountry,
- locale: locale,
+ locale: locale.isNotEmpty ? locale : null,
permissions: {}, // Permissions are not stored in User model
);
}
-}
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/services/utils/api_endpoints.dart b/comwell_key_app/lib/services/utils/api_endpoints.dart
index 59154815..0be4f893 100644
--- a/comwell_key_app/lib/services/utils/api_endpoints.dart
+++ b/comwell_key_app/lib/services/utils/api_endpoints.dart
@@ -6,7 +6,7 @@ class ApiEndpoints {
static const String getCurrentBookings = '/booking/v1/GetCurrentBookings';
static const String getPastBookings = '/booking/v1/GetPastBookings';
static const String getCancelledBookings = '/booking/v1/GetCancelledBookings';
- static const String preRegistration = '/booking/v1/PreArrivalByToken';
+ static const String preArrivalByToken = '/booking/v1/PreArrivalByToken';
static const String checkIn = '/booking/v1/CheckIn';
static const String checkOut = '/booking/v1/CheckOut';
static const String getBookingDetails =
diff --git a/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart b/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
index ce4c8571..349003c7 100644
--- a/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
+++ b/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
@@ -108,4 +108,4 @@ class UpSalesCubit extends Cubit<UpSalesState> {
emit(state.processingStateUpdated(UpSalesProcessingStateError()));
}
}
-}
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart b/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
index 1c13e81e..262f9247 100644
--- a/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
+++ b/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
@@ -80,7 +80,11 @@ class UpSalesState extends Equatable {
UpSalesState updateUpgrade(AddOnUpgrade upgrade) {
final updatedAddOnUpgrades = addOnUpgrades.toList();
final index = updatedAddOnUpgrades.indexWhere((e) => e.id == upgrade.id);
- updatedAddOnUpgrades[index] = upgrade;
+ if (index == -1) {
+ updatedAddOnUpgrades.add(upgrade);
+ } else {
+ updatedAddOnUpgrades[index] = upgrade;
+ }
return copyWith(addOnUpgrades: updatedAddOnUpgrades);
}
diff --git a/comwell_key_app/lib/up_sales/models/dto/addon_upgrade_dto.dart b/comwell_key_app/lib/up_sales/models/dto/addon_upgrade_dto.dart
index e016baa2..180ab75b 100644
--- a/comwell_key_app/lib/up_sales/models/dto/addon_upgrade_dto.dart
+++ b/comwell_key_app/lib/up_sales/models/dto/addon_upgrade_dto.dart
@@ -10,29 +10,31 @@ class AddOnUpgradeDTO {
final int price;
final String currency;
final bool isSelected;
- final Iterable<String> images;
+ @JsonKey(fromJson: _imagesFromJson)
+ final List<String> images;
final String description;
final int quantity;
final bool isService;
final bool isPopular;
final bool onlyAvailableBeforeCheckin;
- AddOnUpgradeDTO(
- {required this.id,
- required this.name,
- required this.price,
- required this.currency,
- required this.isSelected,
- required this.images,
- required this.description,
- this.quantity = 0,
- this.isService = false,
- this.isPopular = false,
- this.onlyAvailableBeforeCheckin = false});
+ AddOnUpgradeDTO({
+ required this.id,
+ required this.name,
+ required this.price,
+ required this.currency,
+ required this.isSelected,
+ required this.images,
+ required this.description,
+ this.quantity = 0,
+ this.isService = false,
+ this.isPopular = false,
+ this.onlyAvailableBeforeCheckin = false,
+ });
Json toJson() => _$AddOnUpgradeDTOToJson(this);
- factory AddOnUpgradeDTO.fromJson(Map<String, dynamic> json) =>
- _$AddOnUpgradeDTOFromJson(json);
-
+ factory AddOnUpgradeDTO.fromJson(Map<String, dynamic> json) => _$AddOnUpgradeDTOFromJson(json);
+ static List<String> _imagesFromJson(List<dynamic>? images) =>
+ images?.whereType<String>().toList() ?? [];
}
diff --git a/comwell_key_app/lib/up_sales/pages/services_upgrade_page.dart b/comwell_key_app/lib/up_sales/pages/services_upgrade_page.dart
index 76bdbf18..36888f29 100644
--- a/comwell_key_app/lib/up_sales/pages/services_upgrade_page.dart
+++ b/comwell_key_app/lib/up_sales/pages/services_upgrade_page.dart
@@ -108,11 +108,11 @@ class ServicesUpgradePage extends StatelessWidget {
const Divider(color: colorDivider),
UpSalesBottomButton(
isSinglePurchase: roomUpgradeList.isSinglePurchase,
- onSinglePurchaseContinue: () {
+ onSinglePurchaseContinue: () async {
if (roomUpgradeList.isSinglePurchase) {
cubit.toggleSelectedUpgrade(roomUpgradeList.addOnUpgrade!);
- context.push(
+ final result = await context.push(
AppRoutes.upSaleConfirmation,
extra: [
cubit.selectedAddOnUpgrades,
@@ -120,6 +120,12 @@ class ServicesUpgradePage extends StatelessWidget {
roomUpgradeList.roomUpgrade,
],
);
+
+ if (result == true) {
+ if (context.mounted) {
+ context.pop();
+ }
+ }
}
},
onContinue: () {
diff --git a/comwell_key_app/lib/up_sales/up_sales_repository.dart b/comwell_key_app/lib/up_sales/up_sales_repository.dart
index 600efef6..967b432a 100644
--- a/comwell_key_app/lib/up_sales/up_sales_repository.dart
+++ b/comwell_key_app/lib/up_sales/up_sales_repository.dart
@@ -19,7 +19,9 @@ class UpSalesRepository {
Future<UpSales> getUpSales(String confirmationId, String hotelCode) async {
final upsales = await _checkIfUpSalesExists(confirmationId, hotelCode);
- if (upsales != null) {
+ if (upsales != null &&
+ (upsales.roomUpgrades.isNotEmpty ||
+ upsales.addOnUpgrades.isNotEmpty)) {
return upsales;
}
final newUpsales =
diff --git a/comwell_key_app/lib/up_sales/up_sales_route.dart b/comwell_key_app/lib/up_sales/up_sales_route.dart
index 8e4f593f..225fd150 100644
--- a/comwell_key_app/lib/up_sales/up_sales_route.dart
+++ b/comwell_key_app/lib/up_sales/up_sales_route.dart
@@ -23,10 +23,18 @@ final upSalesRoute = ShellRoute(
key: state.pageKey,
child: BlocProvider(
create: (_) {
- final extras = state.extra as List<dynamic>;
+ final extra = state.extra;
+ final Booking booking;
+ if (extra is List<dynamic>) {
+ booking = extra[0] as Booking;
+ } else if (extra is RoomUpgradeList) {
+ booking = extra.booking;
+ } else {
+ throw StateError('Unexpected extras type: ${extra.runtimeType}');
+ }
return UpSalesCubit(
upSaleRepository: locator(),
- booking: extras[0] as Booking,
+ booking: booking,
);
},
child: child,