6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit e88b840e
Changed files
comwell_key_app/analysis_options.yaml | 3 + comwell_key_app/assets/icons/bell_circled.svg | 4 + comwell_key_app/assets/icons/bluetooth_circled.svg | 4 + comwell_key_app/assets/icons/globe.svg | 4 + comwell_key_app/assets/icons/no_connection.svg | 3 + comwell_key_app/build.yaml | 5 + .../lib/.generated/assets/assets.gen.dart | 643 +++++++++++ .../lib/.generated/assets/fonts.gen.dart | 16 + .../connection_state_cubit.freezed.dart | 277 +++++ .../lib/.generated/database/comwell_db.g.dart | 1153 ++++++++++++-------- .../hotel_information/models/addon_upgrade.g.dart | 17 +- .../hotel_information/models/call_to_action.g.dart | 8 +- .../hotel_information/models/facilities.g.dart | 39 +- .../hotel_information/models/hotel.g.dart | 61 +- .../hotel_information/models/room_facility.g.dart | 8 +- .../hotel_information/models/room_type.g.dart | 34 +- .../models/structured_text.g.dart | 208 ++-- .../housekeeping/models/housekeeping.g.dart | 16 +- .../models/notification_permission.g.dart | 16 +- .../overview/cubit/overview_state.freezed.dart | 277 +++++ .../overview/models/payment_details.g.dart | 14 +- .../bluetooth_permission_cubit.freezed.dart | 283 +++++ .../notification_permission_cubit.freezed.dart | 274 +++++ .../usage_tracking_permission_cubit.freezed.dart | 274 +++++ .../.generated/services/models/booking_dto.g.dart | 85 +- .../.generated/services/models/bookings_dto.g.dart | 17 +- .../lib/.generated/services/models/room_dto.g.dart | 35 +- .../lib/.generated/services/models/user_dto.g.dart | 131 +-- .../services/models/user_permissions.g.dart | 10 +- .../tracking/models/analytics_event_item.g.dart | 20 +- .../.generated/up_sales/models/addon_list.g.dart | 12 +- .../up_sales/models/dto/addon_upgrade_dto.g.dart | 26 +- .../up_sales/models/dto/room_upgrade_dto.g.dart | 25 +- .../up_sales/models/dto/up_sales_dto.g.dart | 31 +- .../up_sales/models/facility_type.g.dart | 8 +- .../authentication/authentication_repository.dart | 73 +- comwell_key_app/lib/base/base_cubit.dart | 18 + .../lib/common/components/comwell_app_bar.dart | 4 +- comwell_key_app/lib/comwell_app.dart | 119 +- .../connection_state/connection_state_cubit.dart | 63 ++ .../connection_state_listener.dart | 56 + .../domain/repositories/bluetooth_repository.dart | 29 + .../repositories/internet_status_repository.dart | 13 + comwell_key_app/lib/find_booking/loading_page.dart | 2 +- comwell_key_app/lib/login/cubit/login_cubit.dart | 5 +- comwell_key_app/lib/login/login_page.dart | 72 +- comwell_key_app/lib/login/login_route.dart | 22 + comwell_key_app/lib/main.dart | 27 +- .../notifications/notifications_repository.dart | 6 +- .../components/current_bookings_tab_view.dart | 3 +- .../lib/overview/cubit/overview_cubit.dart | 130 +-- .../lib/overview/cubit/overview_state.dart | 48 +- comwell_key_app/lib/overview/models/bookings.dart | 12 +- comwell_key_app/lib/overview/overview_page.dart | 227 ++-- comwell_key_app/lib/overview/overview_route.dart | 112 ++ .../overview/repository/overview_repository.dart | 2 - .../bluetooth/bluetooth_permission_cubit.dart | 73 ++ .../bluetooth/bluetooth_permission_screen.dart | 53 + .../internet/bluetooth_permission_screen.dart | 39 + .../notification_permission_cubit.dart | 42 + .../notification_permission_screen.dart | 37 + .../screens/onboarding/onboarding_routes.dart | 52 + .../onboarding/permission_screen_template.dart | 90 ++ .../usage_tracking_permission_cubit.dart | 29 + .../usage_tracking_permission_screen.dart | 27 + .../received_shared_booking_page.dart | 4 +- .../received_shared_room_page.dart | 2 +- comwell_key_app/lib/routing/app_router.dart | 972 ++++++++--------- comwell_key_app/lib/routing/app_routes.dart | 14 +- .../interceptors/response_handle_interceptor.dart | 99 +- comwell_key_app/lib/themes/app_button_styles.dart | 53 + comwell_key_app/lib/themes/app_spaces.dart | 17 + comwell_key_app/lib/themes/app_textstyles.dart | 12 + comwell_key_app/lib/utils/context_utils.dart | 17 + comwell_key_app/lib/utils/env_utils.dart | 15 + comwell_key_app/lib/utils/locator.dart | 44 +- comwell_key_app/lib/utils/secure_storage.dart | 37 + comwell_key_app/lib/utils/text_style_utils.dart | 6 + comwell_key_app/pubspec.yaml | 53 +- comwell_key_app/scripts/gen.sh | 2 + .../test/overview_test/overview_cubic_test.dart | 172 +-- payment_plugin/lib/themes/comwell_colors.dart | 2 - 82 files changed, 5036 insertions(+), 2011 deletions(-)
Diff
diff --git a/comwell_key_app/analysis_options.yaml b/comwell_key_app/analysis_options.yaml
index 3f60dd77..be67e61f 100644
--- a/comwell_key_app/analysis_options.yaml
+++ b/comwell_key_app/analysis_options.yaml
@@ -30,6 +30,9 @@ analyzer:
strict-casts: true
strict-raw-types: true
strict-inference: true
+formatter:
+ trailing_commas: preserve
+ page_width: 100
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
diff --git a/comwell_key_app/assets/icons/bell_circled.svg b/comwell_key_app/assets/icons/bell_circled.svg
new file mode 100644
index 00000000..a52d2485
--- /dev/null
+++ b/comwell_key_app/assets/icons/bell_circled.svg
@@ -0,0 +1,4 @@
+<svg width="104" height="104" viewBox="0 0 104 104" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="2" y="2" width="100" height="100" rx="50" stroke="white" stroke-width="4"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M77.3992 60.6L71.9992 55.2V46C71.986 35.7153 64.2257 27.0928 53.9992 26V22H49.9992V26C39.8081 27.1618 32.0848 35.7432 31.9992 46V55.2L26.5992 60.6C26.2042 60.9565 25.9849 61.4681 25.9992 62V68C25.9635 68.5406 26.1627 69.0704 26.5458 69.4535C26.9289 69.8366 27.4586 70.0358 27.9992 70H41.9992C41.9992 75.5229 46.4764 80 51.9992 80C57.5221 80 61.9992 75.5229 61.9992 70H75.9992C76.5398 70.0358 77.0696 69.8366 77.4527 69.4535C77.8358 69.0704 78.035 68.5406 77.9992 68V62C78.0135 61.4681 77.7943 60.9565 77.3992 60.6ZM51.9992 76C48.6855 76 45.9992 73.3137 45.9992 70H57.9992C57.9992 73.3137 55.3129 76 51.9992 76ZM73.9992 66H29.9992V62.8L35.3992 57.4C35.7943 57.0435 36.0135 56.5319 35.9992 56V46C35.9992 37.1634 43.1627 30 51.9992 30C60.8358 30 67.9992 37.1634 67.9992 46V56C67.9849 56.5319 68.2042 57.0435 68.5992 57.4L73.9992 62.8V66Z" fill="white"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/bluetooth_circled.svg b/comwell_key_app/assets/icons/bluetooth_circled.svg
new file mode 100644
index 00000000..20648f33
--- /dev/null
+++ b/comwell_key_app/assets/icons/bluetooth_circled.svg
@@ -0,0 +1,4 @@
+<svg width="104" height="104" viewBox="0 0 104 104" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="2" y="2" width="100" height="100" rx="50" stroke="white" stroke-width="4"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M52 80.0033C51.7107 80.0013 51.4248 79.94 51.16 79.8233C50.4511 79.4952 49.9981 78.7844 50 78.0033V56.8233L36.82 70.0033L34 67.1833L49.18 52.0033L34 36.8233L36.82 34.0033L50 47.1833V26.0033C49.9981 25.2222 50.4511 24.5114 51.16 24.1833C51.8706 23.8562 52.7067 23.9734 53.3 24.4833L67.3 36.4833C67.7443 36.8633 68 37.4187 68 38.0033C68.0251 38.5624 67.8147 39.1065 67.42 39.5033L54.82 52.0033L67.42 64.5833C67.7944 64.9607 68.0031 65.4717 68 66.0033C67.9774 66.5598 67.7237 67.0817 67.3 67.4433L53.3 79.4433C52.9494 79.7822 52.4871 79.9813 52 80.0033ZM54 56.8233V73.6633L63.06 65.8833L54 56.8233ZM54 30.3433V47.1833L63.06 38.1233L54 30.3433Z" fill="white"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/globe.svg b/comwell_key_app/assets/icons/globe.svg
new file mode 100644
index 00000000..4817fa01
--- /dev/null
+++ b/comwell_key_app/assets/icons/globe.svg
@@ -0,0 +1,4 @@
+<svg width="104" height="104" viewBox="0 0 104 104" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="2" y="2" width="100" height="100" rx="50" stroke="white" stroke-width="4"/>
+<path d="M52 24C46.4621 24 41.0486 25.6422 36.444 28.7189C31.8395 31.7955 28.2506 36.1685 26.1314 41.2849C24.0121 46.4012 23.4576 52.0311 24.538 57.4625C25.6184 62.894 28.2852 67.8831 32.201 71.799C36.1169 75.7149 41.106 78.3816 46.5375 79.462C51.969 80.5424 57.5988 79.9879 62.7151 77.8686C67.8315 75.7494 72.2045 72.1605 75.2812 67.556C78.3578 62.9514 80 57.5379 80 52C80 44.5739 77.05 37.452 71.799 32.201C66.548 26.95 59.4261 24 52 24ZM76 50H64C63.7665 42.6342 61.8583 35.4183 58.42 28.9C63.1571 30.1958 67.3827 32.9137 70.5264 36.6868C73.6701 40.46 75.5806 45.1068 76 50ZM52 76C51.5538 76.03 51.1062 76.03 50.66 76C46.5166 69.3924 44.217 61.7963 44 54H60C59.801 61.7906 57.5223 69.3864 53.4 76C52.9339 76.0327 52.4661 76.0327 52 76ZM44 50C44.199 42.2094 46.4777 34.6136 50.6 28C51.4905 27.8999 52.3895 27.8999 53.28 28C57.4446 34.6016 59.765 42.1981 60 50H44ZM45.52 28.9C42.1026 35.4233 40.2149 42.6389 40 50H28C28.4194 45.1068 30.3299 40.46 33.4736 36.6868C36.6173 32.9137 40.8429 30.1958 45.58 28.9H45.52ZM28.1 54H40.1C40.3087 61.3595 42.1896 68.575 45.6 75.1C40.8777 73.7903 36.6696 71.0664 33.5411 67.2943C30.4127 63.5223 28.5139 58.883 28.1 54ZM58.42 75.1C61.8583 68.5817 63.7665 61.3658 64 54H76C75.5806 58.8932 73.6701 63.54 70.5264 67.3132C67.3827 71.0863 63.1571 73.8042 58.42 75.1Z" fill="white"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/no_connection.svg b/comwell_key_app/assets/icons/no_connection.svg
new file mode 100644
index 00000000..73cba155
--- /dev/null
+++ b/comwell_key_app/assets/icons/no_connection.svg
@@ -0,0 +1,3 @@
+<svg width="104" height="104" viewBox="0 0 104 104" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="2" y="2" width="100" height="100" rx="50" stroke="white" stroke-width="4"/>
+</svg>
diff --git a/comwell_key_app/build.yaml b/comwell_key_app/build.yaml
index bff57302..bc67b51d 100644
--- a/comwell_key_app/build.yaml
+++ b/comwell_key_app/build.yaml
@@ -12,6 +12,11 @@ targets:
generate_for:
exclude:
- 'lib/database/**'
+ freezed|freezed:
+ enabled: true
+ options:
+ build_extensions:
+ '^lib/{{}}.dart': 'lib/.generated/{{}}.freezed.dart'
drift_dev:
generate_for:
include:
diff --git a/comwell_key_app/lib/.generated/assets/assets.gen.dart b/comwell_key_app/lib/.generated/assets/assets.gen.dart
new file mode 100644
index 00000000..baf03c86
--- /dev/null
+++ b/comwell_key_app/lib/.generated/assets/assets.gen.dart
@@ -0,0 +1,643 @@
+// dart format width=100
+
+/// GENERATED CODE - DO NOT MODIFY BY HAND
+/// *****************************************************
+/// FlutterGen
+/// *****************************************************
+
+// coverage:ignore-file
+// ignore_for_file: type=lint
+// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import
+
+import 'package:flutter/services.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
+
+class $EnvGen {
+ const $EnvGen();
+
+ /// File path: env/.env.dev
+ String get aEnvDev => 'env/.env.dev';
+
+ /// File path: env/.env.prod
+ String get aEnvProd => 'env/.env.prod';
+
+ /// File path: env/.env.stage
+ String get aEnvStage => 'env/.env.stage';
+
+ /// List of all assets
+ List<String> get values => [aEnvDev, aEnvProd, aEnvStage];
+}
+
+class $AssetsAnimationsGen {
+ const $AssetsAnimationsGen();
+
+ /// File path: assets/animations/load_animation.json
+ String get loadAnimation => 'assets/animations/load_animation.json';
+
+ /// File path: assets/animations/loading_key.json
+ String get loadingKey => 'assets/animations/loading_key.json';
+
+ /// File path: assets/animations/scan.json
+ String get scan => 'assets/animations/scan.json';
+
+ /// List of all assets
+ List<String> get values => [loadAnimation, loadingKey, scan];
+}
+
+class $AssetsIconsGen {
+ const $AssetsIconsGen();
+
+ /// File path: assets/icons/Union.svg
+ SvgGenImage get union => const SvgGenImage('assets/icons/Union.svg');
+
+ /// File path: assets/icons/account.png
+ AssetGenImage get accountPng => const AssetGenImage('assets/icons/account.png');
+
+ /// File path: assets/icons/account.svg
+ SvgGenImage get accountSvg => const SvgGenImage('assets/icons/account.svg');
+
+ /// File path: assets/icons/app_icon.png
+ AssetGenImage get appIcon => const AssetGenImage('assets/icons/app_icon.png');
+
+ /// File path: assets/icons/app_icon_non_opaque.png
+ AssetGenImage get appIconNonOpaque => const AssetGenImage('assets/icons/app_icon_non_opaque.png');
+
+ /// File path: assets/icons/arrow-left.svg
+ SvgGenImage get arrowLeft => const SvgGenImage('assets/icons/arrow-left.svg');
+
+ /// File path: assets/icons/arrow-right.svg
+ SvgGenImage get arrowRight => const SvgGenImage('assets/icons/arrow-right.svg');
+
+ /// File path: assets/icons/bell.png
+ AssetGenImage get bell => const AssetGenImage('assets/icons/bell.png');
+
+ /// File path: assets/icons/bell_circled.svg
+ SvgGenImage get bellCircled => const SvgGenImage('assets/icons/bell_circled.svg');
+
+ /// File path: assets/icons/bluetooth_circled.svg
+ SvgGenImage get bluetoothCircled => const SvgGenImage('assets/icons/bluetooth_circled.svg');
+
+ /// File path: assets/icons/c_logo.svg
+ SvgGenImage get cLogo => const SvgGenImage('assets/icons/c_logo.svg');
+
+ /// File path: assets/icons/calendar.png
+ AssetGenImage get calendarPng => const AssetGenImage('assets/icons/calendar.png');
+
+ /// File path: assets/icons/calendar.svg
+ SvgGenImage get calendarSvg => const SvgGenImage('assets/icons/calendar.svg');
+
+ /// File path: assets/icons/card.png
+ AssetGenImage get card => const AssetGenImage('assets/icons/card.png');
+
+ /// File path: assets/icons/check-in.svg
+ SvgGenImage get checkIn => const SvgGenImage('assets/icons/check-in.svg');
+
+ /// File path: assets/icons/close-icon.svg
+ SvgGenImage get closeIcon => const SvgGenImage('assets/icons/close-icon.svg');
+
+ /// File path: assets/icons/download_bill.svg
+ SvgGenImage get downloadBill => const SvgGenImage('assets/icons/download_bill.svg');
+
+ /// File path: assets/icons/edit-alt.svg
+ SvgGenImage get editAlt => const SvgGenImage('assets/icons/edit-alt.svg');
+
+ /// File path: assets/icons/globe.svg
+ SvgGenImage get globe => const SvgGenImage('assets/icons/globe.svg');
+
+ /// File path: assets/icons/ic_apple_pay.svg
+ SvgGenImage get icApplePay => const SvgGenImage('assets/icons/ic_apple_pay.svg');
+
+ /// File path: assets/icons/ic_balcony.svg
+ SvgGenImage get icBalcony => const SvgGenImage('assets/icons/ic_balcony.svg');
+
+ /// File path: assets/icons/ic_bathtub.svg
+ SvgGenImage get icBathtub => const SvgGenImage('assets/icons/ic_bathtub.svg');
+
+ /// File path: assets/icons/ic_bed.svg
+ SvgGenImage get icBed => const SvgGenImage('assets/icons/ic_bed.svg');
+
+ /// File path: assets/icons/ic_bed_old.svg
+ SvgGenImage get icBedOld => const SvgGenImage('assets/icons/ic_bed_old.svg');
+
+ /// File path: assets/icons/ic_calendar.svg
+ SvgGenImage get icCalendar => const SvgGenImage('assets/icons/ic_calendar.svg');
+
+ /// File path: assets/icons/ic_car.svg
+ SvgGenImage get icCar => const SvgGenImage('assets/icons/ic_car.svg');
+
+ /// File path: assets/icons/ic_card.svg
+ SvgGenImage get icCard => const SvgGenImage('assets/icons/ic_card.svg');
+
+ /// File path: assets/icons/ic_checkmark.svg
+ SvgGenImage get icCheckmark => const SvgGenImage('assets/icons/ic_checkmark.svg');
+
+ /// File path: assets/icons/ic_chefs_hat.svg
+ SvgGenImage get icChefsHat => const SvgGenImage('assets/icons/ic_chefs_hat.svg');
+
+ /// File path: assets/icons/ic_desk.svg
+ SvgGenImage get icDesk => const SvgGenImage('assets/icons/ic_desk.svg');
+
+ /// File path: assets/icons/ic_double_bed.svg
+ SvgGenImage get icDoubleBed => const SvgGenImage('assets/icons/ic_double_bed.svg');
+
+ /// File path: assets/icons/ic_error.svg
+ SvgGenImage get icError => const SvgGenImage('assets/icons/ic_error.svg');
+
+ /// File path: assets/icons/ic_exit.svg
+ SvgGenImage get icExit => const SvgGenImage('assets/icons/ic_exit.svg');
+
+ /// File path: assets/icons/ic_google.svg
+ SvgGenImage get icGoogle => const SvgGenImage('assets/icons/ic_google.svg');
+
+ /// File path: assets/icons/ic_hairdryer.svg
+ SvgGenImage get icHairdryer => const SvgGenImage('assets/icons/ic_hairdryer.svg');
+
+ /// File path: assets/icons/ic_info.svg
+ SvgGenImage get icInfo => const SvgGenImage('assets/icons/ic_info.svg');
+
+ /// File path: assets/icons/ic_iron.svg
+ SvgGenImage get icIron => const SvgGenImage('assets/icons/ic_iron.svg');
+
+ /// File path: assets/icons/ic_kettle.svg
+ SvgGenImage get icKettle => const SvgGenImage('assets/icons/ic_kettle.svg');
+
+ /// File path: assets/icons/ic_leather_chair.svg
+ SvgGenImage get icLeatherChair => const SvgGenImage('assets/icons/ic_leather_chair.svg');
+
+ /// File path: assets/icons/ic_locked.svg
+ SvgGenImage get icLocked => const SvgGenImage('assets/icons/ic_locked.svg');
+
+ /// File path: assets/icons/ic_minibar.svg
+ SvgGenImage get icMinibar => const SvgGenImage('assets/icons/ic_minibar.svg');
+
+ /// File path: assets/icons/ic_plus.svg
+ SvgGenImage get icPlus => const SvgGenImage('assets/icons/ic_plus.svg');
+
+ /// File path: assets/icons/ic_send.svg
+ SvgGenImage get icSend => const SvgGenImage('assets/icons/ic_send.svg');
+
+ /// File path: assets/icons/ic_service_bowl.svg
+ SvgGenImage get icServiceBowl => const SvgGenImage('assets/icons/ic_service_bowl.svg');
+
+ /// File path: assets/icons/ic_single_bed.svg
+ SvgGenImage get icSingleBed => const SvgGenImage('assets/icons/ic_single_bed.svg');
+
+ /// File path: assets/icons/ic_spa.svg
+ SvgGenImage get icSpa => const SvgGenImage('assets/icons/ic_spa.svg');
+
+ /// File path: assets/icons/ic_telephone.svg
+ SvgGenImage get icTelephone => const SvgGenImage('assets/icons/ic_telephone.svg');
+
+ /// File path: assets/icons/ic_telephone_old.svg
+ SvgGenImage get icTelephoneOld => const SvgGenImage('assets/icons/ic_telephone_old.svg');
+
+ /// File path: assets/icons/ic_tv.svg
+ SvgGenImage get icTv => const SvgGenImage('assets/icons/ic_tv.svg');
+
+ /// File path: assets/icons/ic_unlocked.svg
+ SvgGenImage get icUnlocked => const SvgGenImage('assets/icons/ic_unlocked.svg');
+
+ /// File path: assets/icons/ic_user_circle.svg
+ SvgGenImage get icUserCircle => const SvgGenImage('assets/icons/ic_user_circle.svg');
+
+ /// File path: assets/icons/ic_wifi.svg
+ SvgGenImage get icWifi => const SvgGenImage('assets/icons/ic_wifi.svg');
+
+ /// File path: assets/icons/icon_housekeeping_cleaning.svg
+ SvgGenImage get iconHousekeepingCleaning =>
+ const SvgGenImage('assets/icons/icon_housekeeping_cleaning.svg');
+
+ /// File path: assets/icons/icon_housekeeping_coffee.svg
+ SvgGenImage get iconHousekeepingCoffee =>
+ const SvgGenImage('assets/icons/icon_housekeeping_coffee.svg');
+
+ /// File path: assets/icons/icon_housekeeping_soap.svg
+ SvgGenImage get iconHousekeepingSoap =>
+ const SvgGenImage('assets/icons/icon_housekeeping_soap.svg');
+
+ /// File path: assets/icons/icon_housekeeping_towels.svg
+ SvgGenImage get iconHousekeepingTowels =>
+ const SvgGenImage('assets/icons/icon_housekeeping_towels.svg');
+
+ /// File path: assets/icons/icon_housekeeping_trash.svg
+ SvgGenImage get iconHousekeepingTrash =>
+ const SvgGenImage('assets/icons/icon_housekeeping_trash.svg');
+
+ /// File path: assets/icons/loop.svg
+ SvgGenImage get loop => const SvgGenImage('assets/icons/loop.svg');
+
+ /// File path: assets/icons/maestro.svg
+ SvgGenImage get maestro => const SvgGenImage('assets/icons/maestro.svg');
+
+ /// File path: assets/icons/mastercard.svg
+ SvgGenImage get mastercard => const SvgGenImage('assets/icons/mastercard.svg');
+
+ /// File path: assets/icons/no_connection.svg
+ SvgGenImage get noConnection => const SvgGenImage('assets/icons/no_connection.svg');
+
+ /// File path: assets/icons/phone_icon.svg
+ SvgGenImage get phoneIcon => const SvgGenImage('assets/icons/phone_icon.svg');
+
+ /// File path: assets/icons/thumbs-up.svg
+ SvgGenImage get thumbsUp => const SvgGenImage('assets/icons/thumbs-up.svg');
+
+ /// File path: assets/icons/trash-can.svg
+ SvgGenImage get trashCan => const SvgGenImage('assets/icons/trash-can.svg');
+
+ /// File path: assets/icons/user-circle.png
+ AssetGenImage get userCirclePng => const AssetGenImage('assets/icons/user-circle.png');
+
+ /// File path: assets/icons/user-circle.svg
+ SvgGenImage get userCircleSvg => const SvgGenImage('assets/icons/user-circle.svg');
+
+ /// File path: assets/icons/user-open.svg
+ SvgGenImage get userOpen => const SvgGenImage('assets/icons/user-open.svg');
+
+ /// File path: assets/icons/visa.svg
+ SvgGenImage get visa => const SvgGenImage('assets/icons/visa.svg');
+
+ /// List of all assets
+ List<dynamic> get values => [
+ union,
+ accountPng,
+ accountSvg,
+ appIcon,
+ appIconNonOpaque,
+ arrowLeft,
+ arrowRight,
+ bell,
+ bellCircled,
+ bluetoothCircled,
+ cLogo,
+ calendarPng,
+ calendarSvg,
+ card,
+ checkIn,
+ closeIcon,
+ downloadBill,
+ editAlt,
+ globe,
+ icApplePay,
+ icBalcony,
+ icBathtub,
+ icBed,
+ icBedOld,
+ icCalendar,
+ icCar,
+ icCard,
+ icCheckmark,
+ icChefsHat,
+ icDesk,
+ icDoubleBed,
+ icError,
+ icExit,
+ icGoogle,
+ icHairdryer,
+ icInfo,
+ icIron,
+ icKettle,
+ icLeatherChair,
+ icLocked,
+ icMinibar,
+ icPlus,
+ icSend,
+ icServiceBowl,
+ icSingleBed,
+ icSpa,
+ icTelephone,
+ icTelephoneOld,
+ icTv,
+ icUnlocked,
+ icUserCircle,
+ icWifi,
+ iconHousekeepingCleaning,
+ iconHousekeepingCoffee,
+ iconHousekeepingSoap,
+ iconHousekeepingTowels,
+ iconHousekeepingTrash,
+ loop,
+ maestro,
+ mastercard,
+ noConnection,
+ phoneIcon,
+ thumbsUp,
+ trashCan,
+ userCirclePng,
+ userCircleSvg,
+ userOpen,
+ visa,
+ ];
+}
+
+class $AssetsImagesGen {
+ const $AssetsImagesGen();
+
+ /// File path: assets/images/Logo.png
+ AssetGenImage get logo => const AssetGenImage('assets/images/Logo.png');
+
+ /// File path: assets/images/assa_seoslogo_white.png
+ AssetGenImage get assaSeoslogoWhite =>
+ const AssetGenImage('assets/images/assa_seoslogo_white.png');
+
+ /// File path: assets/images/booking_background.png
+ AssetGenImage get bookingBackground =>
+ const AssetGenImage('assets/images/booking_background.png');
+
+ /// File path: assets/images/borupgaard.png
+ AssetGenImage get borupgaard => const AssetGenImage('assets/images/borupgaard.png');
+
+ /// File path: assets/images/bygholmpark.png
+ AssetGenImage get bygholmpark => const AssetGenImage('assets/images/bygholmpark.png');
+
+ /// File path: assets/images/card_bkg.png
+ AssetGenImage get cardBkg => const AssetGenImage('assets/images/card_bkg.png');
+
+ /// File path: assets/images/catalog_image.png
+ AssetGenImage get catalogImage => const AssetGenImage('assets/images/catalog_image.png');
+
+ /// File path: assets/images/cc_inactive.png
+ AssetGenImage get ccInactive => const AssetGenImage('assets/images/cc_inactive.png');
+
+ /// File path: assets/images/co.svg
+ SvgGenImage get co => const SvgGenImage('assets/images/co.svg');
+
+ /// File path: assets/images/current_room.png
+ AssetGenImage get currentRoom => const AssetGenImage('assets/images/current_room.png');
+
+ /// File path: assets/images/key.png
+ AssetGenImage get key => const AssetGenImage('assets/images/key.png');
+
+ /// File path: assets/images/koegestrand.png
+ AssetGenImage get koegestrand => const AssetGenImage('assets/images/koegestrand.png');
+
+ /// File path: assets/images/login_screen_background.png
+ AssetGenImage get loginScreenBackground =>
+ const AssetGenImage('assets/images/login_screen_background.png');
+
+ /// File path: assets/images/maestro.svg
+ SvgGenImage get maestro => const SvgGenImage('assets/images/maestro.svg');
+
+ /// File path: assets/images/master.svg
+ SvgGenImage get master => const SvgGenImage('assets/images/master.svg');
+
+ /// File path: assets/images/no_current_bookings_background.jpeg
+ AssetGenImage get noCurrentBookingsBackground =>
+ const AssetGenImage('assets/images/no_current_bookings_background.jpeg');
+
+ /// File path: assets/images/parking.png
+ AssetGenImage get parking => const AssetGenImage('assets/images/parking.png');
+
+ /// File path: assets/images/portside.png
+ AssetGenImage get portside => const AssetGenImage('assets/images/portside.png');
+
+ /// File path: assets/images/restaurant_cover.png
+ AssetGenImage get restaurantCover => const AssetGenImage('assets/images/restaurant_cover.png');
+
+ /// File path: assets/images/room_key.jpeg
+ AssetGenImage get roomKeyJpeg => const AssetGenImage('assets/images/room_key.jpeg');
+
+ /// File path: assets/images/room_key.png
+ AssetGenImage get roomKeyPng => const AssetGenImage('assets/images/room_key.png');
+
+ /// File path: assets/images/room_key_with_number.png
+ AssetGenImage get roomKeyWithNumber =>
+ const AssetGenImage('assets/images/room_key_with_number.png');
+
+ /// File path: assets/images/seos_by_assa_logo.png
+ AssetGenImage get seosByAssaLogo => const AssetGenImage('assets/images/seos_by_assa_logo.png');
+
+ /// File path: assets/images/seos_key_logo.png
+ AssetGenImage get seosKeyLogo => const AssetGenImage('assets/images/seos_key_logo.png');
+
+ /// File path: assets/images/v.svg
+ SvgGenImage get v => const SvgGenImage('assets/images/v.svg');
+
+ /// File path: assets/images/visa.svg
+ SvgGenImage get visa => const SvgGenImage('assets/images/visa.svg');
+
+ /// File path: assets/images/welcome_image.jpeg
+ AssetGenImage get welcomeImage => const AssetGenImage('assets/images/welcome_image.jpeg');
+
+ /// List of all assets
+ List<dynamic> get values => [
+ logo,
+ assaSeoslogoWhite,
+ bookingBackground,
+ borupgaard,
+ bygholmpark,
+ cardBkg,
+ catalogImage,
+ ccInactive,
+ co,
+ currentRoom,
+ key,
+ koegestrand,
+ loginScreenBackground,
+ maestro,
+ master,
+ noCurrentBookingsBackground,
+ parking,
+ portside,
+ restaurantCover,
+ roomKeyJpeg,
+ roomKeyPng,
+ roomKeyWithNumber,
+ seosByAssaLogo,
+ seosKeyLogo,
+ v,
+ visa,
+ welcomeImage,
+ ];
+}
+
+class $AssetsMsalGen {
+ const $AssetsMsalGen();
+
+ /// File path: assets/msal/msal_config_dev.json
+ String get msalConfigDev => 'assets/msal/msal_config_dev.json';
+
+ /// File path: assets/msal/msal_config_prod.json
+ String get msalConfigProd => 'assets/msal/msal_config_prod.json';
+
+ /// File path: assets/msal/msal_config_stage.json
+ String get msalConfigStage => 'assets/msal/msal_config_stage.json';
+
+ /// List of all assets
+ List<String> get values => [msalConfigDev, msalConfigProd, msalConfigStage];
+}
+
+class $AssetsTranslationsGen {
+ const $AssetsTranslationsGen();
+
+ /// File path: assets/translations/da-DK.json
+ String get daDK => 'assets/translations/da-DK.json';
+
+ /// File path: assets/translations/en-US.json
+ String get enUS => 'assets/translations/en-US.json';
+
+ /// List of all assets
+ List<String> get values => [daDK, enUS];
+}
+
+class Assets {
+ const Assets._();
+
+ static const $AssetsAnimationsGen animations = $AssetsAnimationsGen();
+ static const $AssetsIconsGen icons = $AssetsIconsGen();
+ static const $AssetsImagesGen images = $AssetsImagesGen();
+ static const $AssetsMsalGen msal = $AssetsMsalGen();
+ static const $AssetsTranslationsGen translations = $AssetsTranslationsGen();
+ static const $EnvGen env = $EnvGen();
+}
+
+class AssetGenImage {
+ const AssetGenImage(this._assetName, {this.size, this.flavors = const {}, this.animation});
+
+ final String _assetName;
+
+ final Size? size;
+ final Set<String> flavors;
+ final AssetGenImageAnimation? animation;
+
+ Image image({
+ Key? key,
+ AssetBundle? bundle,
+ ImageFrameBuilder? frameBuilder,
+ ImageErrorWidgetBuilder? errorBuilder,
+ String? semanticLabel,
+ bool excludeFromSemantics = false,
+ double? scale,
+ double? width,
+ double? height,
+ Color? color,
+ Animation<double>? opacity,
+ BlendMode? colorBlendMode,
+ BoxFit? fit,
+ AlignmentGeometry alignment = Alignment.center,
+ ImageRepeat repeat = ImageRepeat.noRepeat,
+ Rect? centerSlice,
+ bool matchTextDirection = false,
+ bool gaplessPlayback = true,
+ bool isAntiAlias = false,
+ String? package,
+ FilterQuality filterQuality = FilterQuality.medium,
+ int? cacheWidth,
+ int? cacheHeight,
+ }) {
+ return Image.asset(
+ _assetName,
+ key: key,
+ bundle: bundle,
+ frameBuilder: frameBuilder,
+ errorBuilder: errorBuilder,
+ semanticLabel: semanticLabel,
+ excludeFromSemantics: excludeFromSemantics,
+ scale: scale,
+ width: width,
+ height: height,
+ color: color,
+ opacity: opacity,
+ colorBlendMode: colorBlendMode,
+ fit: fit,
+ alignment: alignment,
+ repeat: repeat,
+ centerSlice: centerSlice,
+ matchTextDirection: matchTextDirection,
+ gaplessPlayback: gaplessPlayback,
+ isAntiAlias: isAntiAlias,
+ package: package,
+ filterQuality: filterQuality,
+ cacheWidth: cacheWidth,
+ cacheHeight: cacheHeight,
+ );
+ }
+
+ ImageProvider provider({AssetBundle? bundle, String? package}) {
+ return AssetImage(_assetName, bundle: bundle, package: package);
+ }
+
+ String get path => _assetName;
+
+ String get keyName => _assetName;
+}
+
+class AssetGenImageAnimation {
+ const AssetGenImageAnimation({
+ required this.isAnimation,
+ required this.duration,
+ required this.frames,
+ });
+
+ final bool isAnimation;
+ final Duration duration;
+ final int frames;
+}
+
+class SvgGenImage {
+ const SvgGenImage(this._assetName, {this.size, this.flavors = const {}}) : _isVecFormat = false;
+
+ const SvgGenImage.vec(this._assetName, {this.size, this.flavors = const {}})
+ : _isVecFormat = true;
+
+ final String _assetName;
+ final Size? size;
+ final Set<String> flavors;
+ final bool _isVecFormat;
+
+ _svg.SvgPicture svg({
+ Key? key,
+ bool matchTextDirection = false,
+ AssetBundle? bundle,
+ String? package,
+ double? width,
+ double? height,
+ BoxFit fit = BoxFit.contain,
+ AlignmentGeometry alignment = Alignment.center,
+ bool allowDrawingOutsideViewBox = false,
+ WidgetBuilder? placeholderBuilder,
+ String? semanticsLabel,
+ bool excludeFromSemantics = false,
+ _svg.SvgTheme? theme,
+ _svg.ColorMapper? colorMapper,
+ ColorFilter? colorFilter,
+ Clip clipBehavior = Clip.hardEdge,
+ @deprecated Color? color,
+ @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
+ @deprecated bool cacheColorFilter = false,
+ }) {
+ final _svg.BytesLoader loader;
+ if (_isVecFormat) {
+ loader = _vg.AssetBytesLoader(_assetName, assetBundle: bundle, packageName: package);
+ } else {
+ loader = _svg.SvgAssetLoader(
+ _assetName,
+ assetBundle: bundle,
+ packageName: package,
+ theme: theme,
+ colorMapper: colorMapper,
+ );
+ }
+ return _svg.SvgPicture(
+ loader,
+ key: key,
+ matchTextDirection: matchTextDirection,
+ width: width,
+ height: height,
+ fit: fit,
+ alignment: alignment,
+ allowDrawingOutsideViewBox: allowDrawingOutsideViewBox,
+ placeholderBuilder: placeholderBuilder,
+ semanticsLabel: semanticsLabel,
+ excludeFromSemantics: excludeFromSemantics,
+ colorFilter: colorFilter ?? (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
+ clipBehavior: clipBehavior,
+ cacheColorFilter: cacheColorFilter,
+ );
+ }
+
+ String get path => _assetName;
+
+ String get keyName => _assetName;
+}
diff --git a/comwell_key_app/lib/.generated/assets/fonts.gen.dart b/comwell_key_app/lib/.generated/assets/fonts.gen.dart
new file mode 100644
index 00000000..0335bf68
--- /dev/null
+++ b/comwell_key_app/lib/.generated/assets/fonts.gen.dart
@@ -0,0 +1,16 @@
+// dart format width=100
+/// GENERATED CODE - DO NOT MODIFY BY HAND
+/// *****************************************************
+/// FlutterGen
+/// *****************************************************
+
+// coverage:ignore-file
+// ignore_for_file: type=lint
+// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import
+
+class FontFamily {
+ FontFamily._();
+
+ /// Font family: Fellix
+ static const String fellix = 'Fellix';
+}
diff --git a/comwell_key_app/lib/.generated/connection_state/connection_state_cubit.freezed.dart b/comwell_key_app/lib/.generated/connection_state/connection_state_cubit.freezed.dart
new file mode 100644
index 00000000..17c32fa2
--- /dev/null
+++ b/comwell_key_app/lib/.generated/connection_state/connection_state_cubit.freezed.dart
@@ -0,0 +1,277 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of '../../connection_state/connection_state_cubit.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$AppConnectionState {
+
+ bool get isLoading; bool get isBluetoothEnabled; bool get isInternetConnected;
+/// Create a copy of AppConnectionState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$AppConnectionStateCopyWith<AppConnectionState> get copyWith => _$AppConnectionStateCopyWithImpl<AppConnectionState>(this as AppConnectionState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is AppConnectionState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isBluetoothEnabled, isBluetoothEnabled) || other.isBluetoothEnabled == isBluetoothEnabled)&&(identical(other.isInternetConnected, isInternetConnected) || other.isInternetConnected == isInternetConnected));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,isBluetoothEnabled,isInternetConnected);
+
+@override
+String toString() {
+ return 'AppConnectionState(isLoading: $isLoading, isBluetoothEnabled: $isBluetoothEnabled, isInternetConnected: $isInternetConnected)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $AppConnectionStateCopyWith<$Res> {
+ factory $AppConnectionStateCopyWith(AppConnectionState value, $Res Function(AppConnectionState) _then) = _$AppConnectionStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, bool isBluetoothEnabled, bool isInternetConnected
+});
+
+
+
+
+}
+/// @nodoc
+class _$AppConnectionStateCopyWithImpl<$Res>
+ implements $AppConnectionStateCopyWith<$Res> {
+ _$AppConnectionStateCopyWithImpl(this._self, this._then);
+
+ final AppConnectionState _self;
+ final $Res Function(AppConnectionState) _then;
+
+/// Create a copy of AppConnectionState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? isBluetoothEnabled = null,Object? isInternetConnected = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,isBluetoothEnabled: null == isBluetoothEnabled ? _self.isBluetoothEnabled : isBluetoothEnabled // ignore: cast_nullable_to_non_nullable
+as bool,isInternetConnected: null == isInternetConnected ? _self.isInternetConnected : isInternetConnected // ignore: cast_nullable_to_non_nullable
+as bool,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [AppConnectionState].
+extension AppConnectionStatePatterns on AppConnectionState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AppConnectionState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _AppConnectionState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AppConnectionState value) $default,){
+final _that = this;
+switch (_that) {
+case _AppConnectionState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AppConnectionState value)? $default,){
+final _that = this;
+switch (_that) {
+case _AppConnectionState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, bool isBluetoothEnabled, bool isInternetConnected)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _AppConnectionState() when $default != null:
+return $default(_that.isLoading,_that.isBluetoothEnabled,_that.isInternetConnected);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, bool isBluetoothEnabled, bool isInternetConnected) $default,) {final _that = this;
+switch (_that) {
+case _AppConnectionState():
+return $default(_that.isLoading,_that.isBluetoothEnabled,_that.isInternetConnected);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, bool isBluetoothEnabled, bool isInternetConnected)? $default,) {final _that = this;
+switch (_that) {
+case _AppConnectionState() when $default != null:
+return $default(_that.isLoading,_that.isBluetoothEnabled,_that.isInternetConnected);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _AppConnectionState implements AppConnectionState {
+ const _AppConnectionState({this.isLoading = false, this.isBluetoothEnabled = true, this.isInternetConnected = true});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final bool isBluetoothEnabled;
+@override@JsonKey() final bool isInternetConnected;
+
+/// Create a copy of AppConnectionState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$AppConnectionStateCopyWith<_AppConnectionState> get copyWith => __$AppConnectionStateCopyWithImpl<_AppConnectionState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppConnectionState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isBluetoothEnabled, isBluetoothEnabled) || other.isBluetoothEnabled == isBluetoothEnabled)&&(identical(other.isInternetConnected, isInternetConnected) || other.isInternetConnected == isInternetConnected));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,isBluetoothEnabled,isInternetConnected);
+
+@override
+String toString() {
+ return 'AppConnectionState(isLoading: $isLoading, isBluetoothEnabled: $isBluetoothEnabled, isInternetConnected: $isInternetConnected)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$AppConnectionStateCopyWith<$Res> implements $AppConnectionStateCopyWith<$Res> {
+ factory _$AppConnectionStateCopyWith(_AppConnectionState value, $Res Function(_AppConnectionState) _then) = __$AppConnectionStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, bool isBluetoothEnabled, bool isInternetConnected
+});
+
+
+
+
+}
+/// @nodoc
+class __$AppConnectionStateCopyWithImpl<$Res>
+ implements _$AppConnectionStateCopyWith<$Res> {
+ __$AppConnectionStateCopyWithImpl(this._self, this._then);
+
+ final _AppConnectionState _self;
+ final $Res Function(_AppConnectionState) _then;
+
+/// Create a copy of AppConnectionState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? isBluetoothEnabled = null,Object? isInternetConnected = null,}) {
+ return _then(_AppConnectionState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,isBluetoothEnabled: null == isBluetoothEnabled ? _self.isBluetoothEnabled : isBluetoothEnabled // ignore: cast_nullable_to_non_nullable
+as bool,isInternetConnected: null == isInternetConnected ? _self.isInternetConnected : isInternetConnected // ignore: cast_nullable_to_non_nullable
+as bool,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/comwell_key_app/lib/.generated/database/comwell_db.g.dart b/comwell_key_app/lib/.generated/database/comwell_db.g.dart
index e63ec01a..616dd686 100644
--- a/comwell_key_app/lib/.generated/database/comwell_db.g.dart
+++ b/comwell_key_app/lib/.generated/database/comwell_db.g.dart
@@ -12,15 +12,22 @@ class $BookingEntityTable extends BookingEntity
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
- 'id', aliasedName, false,
- type: DriftSqlType.string,
- requiredDuringInsert: true,
- defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'));
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
+ );
static const VerificationMeta _jsonMeta = const VerificationMeta('json');
@override
late final GeneratedColumn<String> json = GeneratedColumn<String>(
- 'json', aliasedName, false,
- type: DriftSqlType.string, requiredDuringInsert: true);
+ 'json',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
@override
List<GeneratedColumn> get $columns => [id, json];
@override
@@ -29,8 +36,10 @@ class $BookingEntityTable extends BookingEntity
String get actualTableName => $name;
static const String $name = 'booking_entity';
@override
- VerificationContext validateIntegrity(Insertable<BookingDb> instance,
- {bool isInserting = false}) {
+ VerificationContext validateIntegrity(
+ Insertable<BookingDb> instance, {
+ bool isInserting = false,
+ }) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
@@ -40,7 +49,9 @@ class $BookingEntityTable extends BookingEntity
}
if (data.containsKey('json')) {
context.handle(
- _jsonMeta, json.isAcceptableOrUnknown(data['json']!, _jsonMeta));
+ _jsonMeta,
+ json.isAcceptableOrUnknown(data['json']!, _jsonMeta),
+ );
} else if (isInserting) {
context.missing(_jsonMeta);
}
@@ -53,10 +64,14 @@ class $BookingEntityTable extends BookingEntity
BookingDb map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return BookingDb(
- id: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}id'])!,
- json: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}json'])!,
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ json: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}json'],
+ )!,
);
}
@@ -79,14 +94,13 @@ class BookingDb extends DataClass implements Insertable<BookingDb> {
}
BookingEntityCompanion toCompanion(bool nullToAbsent) {
- return BookingEntityCompanion(
- id: Value(id),
- json: Value(json),
- );
+ return BookingEntityCompanion(id: Value(id), json: Value(json));
}
- factory BookingDb.fromJson(Map<String, dynamic> json,
- {ValueSerializer? serializer}) {
+ factory BookingDb.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return BookingDb(
id: serializer.fromJson<String>(json['id']),
@@ -102,10 +116,8 @@ class BookingDb extends DataClass implements Insertable<BookingDb> {
};
}
- BookingDb copyWith({String? id, String? json}) => BookingDb(
- id: id ?? this.id,
- json: json ?? this.json,
- );
+ BookingDb copyWith({String? id, String? json}) =>
+ BookingDb(id: id ?? this.id, json: json ?? this.json);
BookingDb copyWithCompanion(BookingEntityCompanion data) {
return BookingDb(
id: data.id.present ? data.id.value : this.id,
@@ -143,8 +155,8 @@ class BookingEntityCompanion extends UpdateCompanion<BookingDb> {
required String id,
required String json,
this.rowid = const Value.absent(),
- }) : id = Value(id),
- json = Value(json);
+ }) : id = Value(id),
+ json = Value(json);
static Insertable<BookingDb> custom({
Expression<String>? id,
Expression<String>? json,
@@ -157,8 +169,11 @@ class BookingEntityCompanion extends UpdateCompanion<BookingDb> {
});
}
- BookingEntityCompanion copyWith(
- {Value<String>? id, Value<String>? json, Value<int>? rowid}) {
+ BookingEntityCompanion copyWith({
+ Value<String>? id,
+ Value<String>? json,
+ Value<int>? rowid,
+ }) {
return BookingEntityCompanion(
id: id ?? this.id,
json: json ?? this.json,
@@ -201,15 +216,22 @@ class $UserEntityTable extends UserEntity
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<int> id = GeneratedColumn<int>(
- 'id', aliasedName, false,
- type: DriftSqlType.int,
- requiredDuringInsert: true,
- defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'));
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
+ );
static const VerificationMeta _jsonMeta = const VerificationMeta('json');
@override
late final GeneratedColumn<String> json = GeneratedColumn<String>(
- 'json', aliasedName, false,
- type: DriftSqlType.string, requiredDuringInsert: true);
+ 'json',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
@override
List<GeneratedColumn> get $columns => [id, json];
@override
@@ -218,8 +240,10 @@ class $UserEntityTable extends UserEntity
String get actualTableName => $name;
static const String $name = 'user_entity';
@override
- VerificationContext validateIntegrity(Insertable<UserDb> instance,
- {bool isInserting = false}) {
+ VerificationContext validateIntegrity(
+ Insertable<UserDb> instance, {
+ bool isInserting = false,
+ }) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
@@ -229,7 +253,9 @@ class $UserEntityTable extends UserEntity
}
if (data.containsKey('json')) {
context.handle(
- _jsonMeta, json.isAcceptableOrUnknown(data['json']!, _jsonMeta));
+ _jsonMeta,
+ json.isAcceptableOrUnknown(data['json']!, _jsonMeta),
+ );
} else if (isInserting) {
context.missing(_jsonMeta);
}
@@ -242,10 +268,14 @@ class $UserEntityTable extends UserEntity
UserDb map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return UserDb(
- id: attachedDatabase.typeMapping
- .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
- json: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}json'])!,
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}id'],
+ )!,
+ json: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}json'],
+ )!,
);
}
@@ -268,14 +298,13 @@ class UserDb extends DataClass implements Insertable<UserDb> {
}
UserEntityCompanion toCompanion(bool nullToAbsent) {
- return UserEntityCompanion(
- id: Value(id),
- json: Value(json),
- );
+ return UserEntityCompanion(id: Value(id), json: Value(json));
}
- factory UserDb.fromJson(Map<String, dynamic> json,
- {ValueSerializer? serializer}) {
+ factory UserDb.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return UserDb(
id: serializer.fromJson<int>(json['id']),
@@ -291,10 +320,8 @@ class UserDb extends DataClass implements Insertable<UserDb> {
};
}
- UserDb copyWith({int? id, String? json}) => UserDb(
- id: id ?? this.id,
- json: json ?? this.json,
- );
+ UserDb copyWith({int? id, String? json}) =>
+ UserDb(id: id ?? this.id, json: json ?? this.json);
UserDb copyWithCompanion(UserEntityCompanion data) {
return UserDb(
id: data.id.present ? data.id.value : this.id,
@@ -332,8 +359,8 @@ class UserEntityCompanion extends UpdateCompanion<UserDb> {
required int id,
required String json,
this.rowid = const Value.absent(),
- }) : id = Value(id),
- json = Value(json);
+ }) : id = Value(id),
+ json = Value(json);
static Insertable<UserDb> custom({
Expression<int>? id,
Expression<String>? json,
@@ -346,8 +373,11 @@ class UserEntityCompanion extends UpdateCompanion<UserDb> {
});
}
- UserEntityCompanion copyWith(
- {Value<int>? id, Value<String>? json, Value<int>? rowid}) {
+ UserEntityCompanion copyWith({
+ Value<int>? id,
+ Value<String>? json,
+ Value<int>? rowid,
+ }) {
return UserEntityCompanion(
id: id ?? this.id,
json: json ?? this.json,
@@ -383,8 +413,10 @@ class UserEntityCompanion extends UpdateCompanion<UserDb> {
class $NotificationPermissionEntityTable extends NotificationPermissionEntity
with
- TableInfo<$NotificationPermissionEntityTable,
- NotificationPermissionDb> {
+ TableInfo<
+ $NotificationPermissionEntityTable,
+ NotificationPermissionDb
+ > {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
@@ -392,15 +424,22 @@ class $NotificationPermissionEntityTable extends NotificationPermissionEntity
static const VerificationMeta _codeMeta = const VerificationMeta('code');
@override
late final GeneratedColumn<String> code = GeneratedColumn<String>(
- 'code', aliasedName, false,
- type: DriftSqlType.string,
- requiredDuringInsert: true,
- defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'));
+ 'code',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
+ );
static const VerificationMeta _jsonMeta = const VerificationMeta('json');
@override
late final GeneratedColumn<String> json = GeneratedColumn<String>(
- 'json', aliasedName, false,
- type: DriftSqlType.string, requiredDuringInsert: true);
+ 'json',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
@override
List<GeneratedColumn> get $columns => [code, json];
@override
@@ -410,19 +449,24 @@ class $NotificationPermissionEntityTable extends NotificationPermissionEntity
static const String $name = 'notification_permission_entity';
@override
VerificationContext validateIntegrity(
- Insertable<NotificationPermissionDb> instance,
- {bool isInserting = false}) {
+ Insertable<NotificationPermissionDb> instance, {
+ bool isInserting = false,
+ }) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('code')) {
context.handle(
- _codeMeta, code.isAcceptableOrUnknown(data['code']!, _codeMeta));
+ _codeMeta,
+ code.isAcceptableOrUnknown(data['code']!, _codeMeta),
+ );
} else if (isInserting) {
context.missing(_codeMeta);
}
if (data.containsKey('json')) {
context.handle(
- _jsonMeta, json.isAcceptableOrUnknown(data['json']!, _jsonMeta));
+ _jsonMeta,
+ json.isAcceptableOrUnknown(data['json']!, _jsonMeta),
+ );
} else if (isInserting) {
context.missing(_jsonMeta);
}
@@ -432,14 +476,20 @@ class $NotificationPermissionEntityTable extends NotificationPermissionEntity
@override
Set<GeneratedColumn> get $primaryKey => const {};
@override
- NotificationPermissionDb map(Map<String, dynamic> data,
- {String? tablePrefix}) {
+ NotificationPermissionDb map(
+ Map<String, dynamic> data, {
+ String? tablePrefix,
+ }) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return NotificationPermissionDb(
- code: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}code'])!,
- json: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}json'])!,
+ code: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}code'],
+ )!,
+ json: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}json'],
+ )!,
);
}
@@ -469,8 +519,10 @@ class NotificationPermissionDb extends DataClass
);
}
- factory NotificationPermissionDb.fromJson(Map<String, dynamic> json,
- {ValueSerializer? serializer}) {
+ factory NotificationPermissionDb.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return NotificationPermissionDb(
code: serializer.fromJson<String>(json['code']),
@@ -492,7 +544,8 @@ class NotificationPermissionDb extends DataClass
json: json ?? this.json,
);
NotificationPermissionDb copyWithCompanion(
- NotificationPermissionEntityCompanion data) {
+ NotificationPermissionEntityCompanion data,
+ ) {
return NotificationPermissionDb(
code: data.code.present ? data.code.value : this.code,
json: data.json.present ? data.json.value : this.json,
@@ -532,8 +585,8 @@ class NotificationPermissionEntityCompanion
required String code,
required String json,
this.rowid = const Value.absent(),
- }) : code = Value(code),
- json = Value(json);
+ }) : code = Value(code),
+ json = Value(json);
static Insertable<NotificationPermissionDb> custom({
Expression<String>? code,
Expression<String>? json,
@@ -546,8 +599,11 @@ class NotificationPermissionEntityCompanion
});
}
- NotificationPermissionEntityCompanion copyWith(
- {Value<String>? code, Value<String>? json, Value<int>? rowid}) {
+ NotificationPermissionEntityCompanion copyWith({
+ Value<String>? code,
+ Value<String>? json,
+ Value<int>? rowid,
+ }) {
return NotificationPermissionEntityCompanion(
code: code ?? this.code,
json: json ?? this.json,
@@ -590,15 +646,22 @@ class $UpsaleEntityTable extends UpsaleEntity
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
- 'id', aliasedName, false,
- type: DriftSqlType.string,
- requiredDuringInsert: true,
- defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'));
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
+ );
static const VerificationMeta _jsonMeta = const VerificationMeta('json');
@override
late final GeneratedColumn<String> json = GeneratedColumn<String>(
- 'json', aliasedName, false,
- type: DriftSqlType.string, requiredDuringInsert: true);
+ 'json',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
@override
List<GeneratedColumn> get $columns => [id, json];
@override
@@ -607,8 +670,10 @@ class $UpsaleEntityTable extends UpsaleEntity
String get actualTableName => $name;
static const String $name = 'upsale_entity';
@override
- VerificationContext validateIntegrity(Insertable<UpsaleDb> instance,
- {bool isInserting = false}) {
+ VerificationContext validateIntegrity(
+ Insertable<UpsaleDb> instance, {
+ bool isInserting = false,
+ }) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
@@ -618,7 +683,9 @@ class $UpsaleEntityTable extends UpsaleEntity
}
if (data.containsKey('json')) {
context.handle(
- _jsonMeta, json.isAcceptableOrUnknown(data['json']!, _jsonMeta));
+ _jsonMeta,
+ json.isAcceptableOrUnknown(data['json']!, _jsonMeta),
+ );
} else if (isInserting) {
context.missing(_jsonMeta);
}
@@ -631,10 +698,14 @@ class $UpsaleEntityTable extends UpsaleEntity
UpsaleDb map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return UpsaleDb(
- id: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}id'])!,
- json: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}json'])!,
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ json: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}json'],
+ )!,
);
}
@@ -657,14 +728,13 @@ class UpsaleDb extends DataClass implements Insertable<UpsaleDb> {
}
UpsaleEntityCompanion toCompanion(bool nullToAbsent) {
- return UpsaleEntityCompanion(
- id: Value(id),
- json: Value(json),
- );
+ return UpsaleEntityCompanion(id: Value(id), json: Value(json));
}
- factory UpsaleDb.fromJson(Map<String, dynamic> json,
- {ValueSerializer? serializer}) {
+ factory UpsaleDb.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return UpsaleDb(
id: serializer.fromJson<String>(json['id']),
@@ -680,10 +750,8 @@ class UpsaleDb extends DataClass implements Insertable<UpsaleDb> {
};
}
- UpsaleDb copyWith({String? id, String? json}) => UpsaleDb(
- id: id ?? this.id,
- json: json ?? this.json,
- );
+ UpsaleDb copyWith({String? id, String? json}) =>
+ UpsaleDb(id: id ?? this.id, json: json ?? this.json);
UpsaleDb copyWithCompanion(UpsaleEntityCompanion data) {
return UpsaleDb(
id: data.id.present ? data.id.value : this.id,
@@ -721,8 +789,8 @@ class UpsaleEntityCompanion extends UpdateCompanion<UpsaleDb> {
required String id,
required String json,
this.rowid = const Value.absent(),
- }) : id = Value(id),
- json = Value(json);
+ }) : id = Value(id),
+ json = Value(json);
static Insertable<UpsaleDb> custom({
Expression<String>? id,
Expression<String>? json,
@@ -735,8 +803,11 @@ class UpsaleEntityCompanion extends UpdateCompanion<UpsaleDb> {
});
}
- UpsaleEntityCompanion copyWith(
- {Value<String>? id, Value<String>? json, Value<int>? rowid}) {
+ UpsaleEntityCompanion copyWith({
+ Value<String>? id,
+ Value<String>? json,
+ Value<int>? rowid,
+ }) {
return UpsaleEntityCompanion(
id: id ?? this.id,
json: json ?? this.json,
@@ -776,19 +847,27 @@ class $HotelInformationEntityTable extends HotelInformationEntity
final GeneratedDatabase attachedDatabase;
final String? _alias;
$HotelInformationEntityTable(this.attachedDatabase, [this._alias]);
- static const VerificationMeta _hotelCodeMeta =
- const VerificationMeta('hotelCode');
+ static const VerificationMeta _hotelCodeMeta = const VerificationMeta(
+ 'hotelCode',
+ );
@override
late final GeneratedColumn<String> hotelCode = GeneratedColumn<String>(
- 'hotel_code', aliasedName, false,
- type: DriftSqlType.string,
- requiredDuringInsert: true,
- defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'));
+ 'hotel_code',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
+ );
static const VerificationMeta _jsonMeta = const VerificationMeta('json');
@override
late final GeneratedColumn<String> json = GeneratedColumn<String>(
- 'json', aliasedName, false,
- type: DriftSqlType.string, requiredDuringInsert: true);
+ 'json',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
@override
List<GeneratedColumn> get $columns => [hotelCode, json];
@override
@@ -797,19 +876,25 @@ class $HotelInformationEntityTable extends HotelInformationEntity
String get actualTableName => $name;
static const String $name = 'hotel_information_entity';
@override
- VerificationContext validateIntegrity(Insertable<HotelInformationDb> instance,
- {bool isInserting = false}) {
+ VerificationContext validateIntegrity(
+ Insertable<HotelInformationDb> instance, {
+ bool isInserting = false,
+ }) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('hotel_code')) {
- context.handle(_hotelCodeMeta,
- hotelCode.isAcceptableOrUnknown(data['hotel_code']!, _hotelCodeMeta));
+ context.handle(
+ _hotelCodeMeta,
+ hotelCode.isAcceptableOrUnknown(data['hotel_code']!, _hotelCodeMeta),
+ );
} else if (isInserting) {
context.missing(_hotelCodeMeta);
}
if (data.containsKey('json')) {
context.handle(
- _jsonMeta, json.isAcceptableOrUnknown(data['json']!, _jsonMeta));
+ _jsonMeta,
+ json.isAcceptableOrUnknown(data['json']!, _jsonMeta),
+ );
} else if (isInserting) {
context.missing(_jsonMeta);
}
@@ -822,10 +907,14 @@ class $HotelInformationEntityTable extends HotelInformationEntity
HotelInformationDb map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return HotelInformationDb(
- hotelCode: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}hotel_code'])!,
- json: attachedDatabase.typeMapping
- .read(DriftSqlType.string, data['${effectivePrefix}json'])!,
+ hotelCode: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}hotel_code'],
+ )!,
+ json: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}json'],
+ )!,
);
}
@@ -855,8 +944,10 @@ class HotelInformationDb extends DataClass
);
}
- factory HotelInformationDb.fromJson(Map<String, dynamic> json,
- {ValueSerializer? serializer}) {
+ factory HotelInformationDb.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return HotelInformationDb(
hotelCode: serializer.fromJson<String>(json['hotelCode']),
@@ -917,8 +1008,8 @@ class HotelInformationEntityCompanion
required String hotelCode,
required String json,
this.rowid = const Value.absent(),
- }) : hotelCode = Value(hotelCode),
- json = Value(json);
+ }) : hotelCode = Value(hotelCode),
+ json = Value(json);
static Insertable<HotelInformationDb> custom({
Expression<String>? hotelCode,
Expression<String>? json,
@@ -931,8 +1022,11 @@ class HotelInformationEntityCompanion
});
}
- HotelInformationEntityCompanion copyWith(
- {Value<String>? hotelCode, Value<String>? json, Value<int>? rowid}) {
+ HotelInformationEntityCompanion copyWith({
+ Value<String>? hotelCode,
+ Value<String>? json,
+ Value<int>? rowid,
+ }) {
return HotelInformationEntityCompanion(
hotelCode: hotelCode ?? this.hotelCode,
json: json ?? this.json,
@@ -981,33 +1075,34 @@ abstract class _$ComwellDatabase extends GeneratedDatabase {
late final NotificationPermissionDAO notificationPermissionDAO =
NotificationPermissionDAO(this as ComwellDatabase);
late final UpsalesDAO upsalesDAO = UpsalesDAO(this as ComwellDatabase);
- late final HotelInformationDAO hotelInformationDAO =
- HotelInformationDAO(this as ComwellDatabase);
+ late final HotelInformationDAO hotelInformationDAO = HotelInformationDAO(
+ this as ComwellDatabase,
+ );
@override
Iterable<TableInfo<Table, Object?>> get allTables =>
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
@override
List<DatabaseSchemaEntity> get allSchemaEntities => [
- bookingEntity,
- userEntity,
- notificationPermissionEntity,
- upsaleEntity,
- hotelInformationEntity
- ];
+ bookingEntity,
+ userEntity,
+ notificationPermissionEntity,
+ upsaleEntity,
+ hotelInformationEntity,
+ ];
}
-typedef $$BookingEntityTableCreateCompanionBuilder = BookingEntityCompanion
- Function({
- required String id,
- required String json,
- Value<int> rowid,
-});
-typedef $$BookingEntityTableUpdateCompanionBuilder = BookingEntityCompanion
- Function({
- Value<String> id,
- Value<String> json,
- Value<int> rowid,
-});
+typedef $$BookingEntityTableCreateCompanionBuilder =
+ BookingEntityCompanion Function({
+ required String id,
+ required String json,
+ Value<int> rowid,
+ });
+typedef $$BookingEntityTableUpdateCompanionBuilder =
+ BookingEntityCompanion Function({
+ Value<String> id,
+ Value<String> json,
+ Value<int> rowid,
+ });
class $$BookingEntityTableFilterComposer
extends Composer<_$ComwellDatabase, $BookingEntityTable> {
@@ -1019,10 +1114,14 @@ class $$BookingEntityTableFilterComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
- column: $table.id, builder: (column) => ColumnFilters(column));
+ column: $table.id,
+ builder: (column) => ColumnFilters(column),
+ );
ColumnFilters<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnFilters(column));
+ column: $table.json,
+ builder: (column) => ColumnFilters(column),
+ );
}
class $$BookingEntityTableOrderingComposer
@@ -1035,10 +1134,14 @@ class $$BookingEntityTableOrderingComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
- column: $table.id, builder: (column) => ColumnOrderings(column));
+ column: $table.id,
+ builder: (column) => ColumnOrderings(column),
+ );
ColumnOrderings<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnOrderings(column));
+ column: $table.json,
+ builder: (column) => ColumnOrderings(column),
+ );
}
class $$BookingEntityTableAnnotationComposer
@@ -1057,24 +1160,29 @@ class $$BookingEntityTableAnnotationComposer
$composableBuilder(column: $table.json, builder: (column) => column);
}
-class $$BookingEntityTableTableManager extends RootTableManager<
- _$ComwellDatabase,
- $BookingEntityTable,
- BookingDb,
- $$BookingEntityTableFilterComposer,
- $$BookingEntityTableOrderingComposer,
- $$BookingEntityTableAnnotationComposer,
- $$BookingEntityTableCreateCompanionBuilder,
- $$BookingEntityTableUpdateCompanionBuilder,
- (
- BookingDb,
- BaseReferences<_$ComwellDatabase, $BookingEntityTable, BookingDb>
- ),
- BookingDb,
- PrefetchHooks Function()> {
+class $$BookingEntityTableTableManager
+ extends
+ RootTableManager<
+ _$ComwellDatabase,
+ $BookingEntityTable,
+ BookingDb,
+ $$BookingEntityTableFilterComposer,
+ $$BookingEntityTableOrderingComposer,
+ $$BookingEntityTableAnnotationComposer,
+ $$BookingEntityTableCreateCompanionBuilder,
+ $$BookingEntityTableUpdateCompanionBuilder,
+ (
+ BookingDb,
+ BaseReferences<_$ComwellDatabase, $BookingEntityTable, BookingDb>,
+ ),
+ BookingDb,
+ PrefetchHooks Function()
+ > {
$$BookingEntityTableTableManager(
- _$ComwellDatabase db, $BookingEntityTable table)
- : super(TableManagerState(
+ _$ComwellDatabase db,
+ $BookingEntityTable table,
+ ) : super(
+ TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
@@ -1083,58 +1191,59 @@ class $$BookingEntityTableTableManager extends RootTableManager<
$$BookingEntityTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$BookingEntityTableAnnotationComposer($db: db, $table: table),
- updateCompanionCallback: ({
- Value<String> id = const Value.absent(),
- Value<String> json = const Value.absent(),
- Value<int> rowid = const Value.absent(),
- }) =>
- BookingEntityCompanion(
- id: id,
- json: json,
- rowid: rowid,
- ),
- createCompanionCallback: ({
- required String id,
- required String json,
- Value<int> rowid = const Value.absent(),
- }) =>
- BookingEntityCompanion.insert(
- id: id,
- json: json,
- rowid: rowid,
- ),
+ updateCompanionCallback:
+ ({
+ Value<String> id = const Value.absent(),
+ Value<String> json = const Value.absent(),
+ Value<int> rowid = const Value.absent(),
+ }) => BookingEntityCompanion(id: id, json: json, rowid: rowid),
+ createCompanionCallback:
+ ({
+ required String id,
+ required String json,
+ Value<int> rowid = const Value.absent(),
+ }) => BookingEntityCompanion.insert(
+ id: id,
+ json: json,
+ rowid: rowid,
+ ),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
- ));
+ ),
+ );
}
-typedef $$BookingEntityTableProcessedTableManager = ProcessedTableManager<
- _$ComwellDatabase,
- $BookingEntityTable,
- BookingDb,
- $$BookingEntityTableFilterComposer,
- $$BookingEntityTableOrderingComposer,
- $$BookingEntityTableAnnotationComposer,
- $$BookingEntityTableCreateCompanionBuilder,
- $$BookingEntityTableUpdateCompanionBuilder,
- (
+typedef $$BookingEntityTableProcessedTableManager =
+ ProcessedTableManager<
+ _$ComwellDatabase,
+ $BookingEntityTable,
+ BookingDb,
+ $$BookingEntityTableFilterComposer,
+ $$BookingEntityTableOrderingComposer,
+ $$BookingEntityTableAnnotationComposer,
+ $$BookingEntityTableCreateCompanionBuilder,
+ $$BookingEntityTableUpdateCompanionBuilder,
+ (
+ BookingDb,
+ BaseReferences<_$ComwellDatabase, $BookingEntityTable, BookingDb>,
+ ),
BookingDb,
- BaseReferences<_$ComwellDatabase, $BookingEntityTable, BookingDb>
- ),
- BookingDb,
- PrefetchHooks Function()>;
-typedef $$UserEntityTableCreateCompanionBuilder = UserEntityCompanion Function({
- required int id,
- required String json,
- Value<int> rowid,
-});
-typedef $$UserEntityTableUpdateCompanionBuilder = UserEntityCompanion Function({
- Value<int> id,
- Value<String> json,
- Value<int> rowid,
-});
+ PrefetchHooks Function()
+ >;
+typedef $$UserEntityTableCreateCompanionBuilder =
+ UserEntityCompanion Function({
+ required int id,
+ required String json,
+ Value<int> rowid,
+ });
+typedef $$UserEntityTableUpdateCompanionBuilder =
+ UserEntityCompanion Function({
+ Value<int> id,
+ Value<String> json,
+ Value<int> rowid,
+ });
class $$UserEntityTableFilterComposer
extends Composer<_$ComwellDatabase, $UserEntityTable> {
@@ -1146,10 +1255,14 @@ class $$UserEntityTableFilterComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<int> get id => $composableBuilder(
- column: $table.id, builder: (column) => ColumnFilters(column));
+ column: $table.id,
+ builder: (column) => ColumnFilters(column),
+ );
ColumnFilters<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnFilters(column));
+ column: $table.json,
+ builder: (column) => ColumnFilters(column),
+ );
}
class $$UserEntityTableOrderingComposer
@@ -1162,10 +1275,14 @@ class $$UserEntityTableOrderingComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<int> get id => $composableBuilder(
- column: $table.id, builder: (column) => ColumnOrderings(column));
+ column: $table.id,
+ builder: (column) => ColumnOrderings(column),
+ );
ColumnOrderings<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnOrderings(column));
+ column: $table.json,
+ builder: (column) => ColumnOrderings(column),
+ );
}
class $$UserEntityTableAnnotationComposer
@@ -1184,20 +1301,24 @@ class $$UserEntityTableAnnotationComposer
$composableBuilder(column: $table.json, builder: (column) => column);
}
-class $$UserEntityTableTableManager extends RootTableManager<
- _$ComwellDatabase,
- $UserEntityTable,
- UserDb,
- $$UserEntityTableFilterComposer,
- $$UserEntityTableOrderingComposer,
- $$UserEntityTableAnnotationComposer,
- $$UserEntityTableCreateCompanionBuilder,
- $$UserEntityTableUpdateCompanionBuilder,
- (UserDb, BaseReferences<_$ComwellDatabase, $UserEntityTable, UserDb>),
- UserDb,
- PrefetchHooks Function()> {
+class $$UserEntityTableTableManager
+ extends
+ RootTableManager<
+ _$ComwellDatabase,
+ $UserEntityTable,
+ UserDb,
+ $$UserEntityTableFilterComposer,
+ $$UserEntityTableOrderingComposer,
+ $$UserEntityTableAnnotationComposer,
+ $$UserEntityTableCreateCompanionBuilder,
+ $$UserEntityTableUpdateCompanionBuilder,
+ (UserDb, BaseReferences<_$ComwellDatabase, $UserEntityTable, UserDb>),
+ UserDb,
+ PrefetchHooks Function()
+ > {
$$UserEntityTableTableManager(_$ComwellDatabase db, $UserEntityTable table)
- : super(TableManagerState(
+ : super(
+ TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
@@ -1206,57 +1327,53 @@ class $$UserEntityTableTableManager extends RootTableManager<
$$UserEntityTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$UserEntityTableAnnotationComposer($db: db, $table: table),
- updateCompanionCallback: ({
- Value<int> id = const Value.absent(),
- Value<String> json = const Value.absent(),
- Value<int> rowid = const Value.absent(),
- }) =>
- UserEntityCompanion(
- id: id,
- json: json,
- rowid: rowid,
- ),
- createCompanionCallback: ({
- required int id,
- required String json,
- Value<int> rowid = const Value.absent(),
- }) =>
- UserEntityCompanion.insert(
- id: id,
- json: json,
- rowid: rowid,
- ),
+ updateCompanionCallback:
+ ({
+ Value<int> id = const Value.absent(),
+ Value<String> json = const Value.absent(),
+ Value<int> rowid = const Value.absent(),
+ }) => UserEntityCompanion(id: id, json: json, rowid: rowid),
+ createCompanionCallback:
+ ({
+ required int id,
+ required String json,
+ Value<int> rowid = const Value.absent(),
+ }) =>
+ UserEntityCompanion.insert(id: id, json: json, rowid: rowid),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
- ));
+ ),
+ );
}
-typedef $$UserEntityTableProcessedTableManager = ProcessedTableManager<
- _$ComwellDatabase,
- $UserEntityTable,
- UserDb,
- $$UserEntityTableFilterComposer,
- $$UserEntityTableOrderingComposer,
- $$UserEntityTableAnnotationComposer,
- $$UserEntityTableCreateCompanionBuilder,
- $$UserEntityTableUpdateCompanionBuilder,
- (UserDb, BaseReferences<_$ComwellDatabase, $UserEntityTable, UserDb>),
- UserDb,
- PrefetchHooks Function()>;
-typedef $$NotificationPermissionEntityTableCreateCompanionBuilder
- = NotificationPermissionEntityCompanion Function({
- required String code,
- required String json,
- Value<int> rowid,
-});
-typedef $$NotificationPermissionEntityTableUpdateCompanionBuilder
- = NotificationPermissionEntityCompanion Function({
- Value<String> code,
- Value<String> json,
- Value<int> rowid,
-});
+typedef $$UserEntityTableProcessedTableManager =
+ ProcessedTableManager<
+ _$ComwellDatabase,
+ $UserEntityTable,
+ UserDb,
+ $$UserEntityTableFilterComposer,
+ $$UserEntityTableOrderingComposer,
+ $$UserEntityTableAnnotationComposer,
+ $$UserEntityTableCreateCompanionBuilder,
+ $$UserEntityTableUpdateCompanionBuilder,
+ (UserDb, BaseReferences<_$ComwellDatabase, $UserEntityTable, UserDb>),
+ UserDb,
+ PrefetchHooks Function()
+ >;
+typedef $$NotificationPermissionEntityTableCreateCompanionBuilder =
+ NotificationPermissionEntityCompanion Function({
+ required String code,
+ required String json,
+ Value<int> rowid,
+ });
+typedef $$NotificationPermissionEntityTableUpdateCompanionBuilder =
+ NotificationPermissionEntityCompanion Function({
+ Value<String> code,
+ Value<String> json,
+ Value<int> rowid,
+ });
class $$NotificationPermissionEntityTableFilterComposer
extends Composer<_$ComwellDatabase, $NotificationPermissionEntityTable> {
@@ -1268,10 +1385,14 @@ class $$NotificationPermissionEntityTableFilterComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get code => $composableBuilder(
- column: $table.code, builder: (column) => ColumnFilters(column));
+ column: $table.code,
+ builder: (column) => ColumnFilters(column),
+ );
ColumnFilters<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnFilters(column));
+ column: $table.json,
+ builder: (column) => ColumnFilters(column),
+ );
}
class $$NotificationPermissionEntityTableOrderingComposer
@@ -1284,10 +1405,14 @@ class $$NotificationPermissionEntityTableOrderingComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get code => $composableBuilder(
- column: $table.code, builder: (column) => ColumnOrderings(column));
+ column: $table.code,
+ builder: (column) => ColumnOrderings(column),
+ );
ColumnOrderings<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnOrderings(column));
+ column: $table.json,
+ builder: (column) => ColumnOrderings(column),
+ );
}
class $$NotificationPermissionEntityTableAnnotationComposer
@@ -1306,92 +1431,111 @@ class $$NotificationPermissionEntityTableAnnotationComposer
$composableBuilder(column: $table.json, builder: (column) => column);
}
-class $$NotificationPermissionEntityTableTableManager extends RootTableManager<
- _$ComwellDatabase,
- $NotificationPermissionEntityTable,
- NotificationPermissionDb,
- $$NotificationPermissionEntityTableFilterComposer,
- $$NotificationPermissionEntityTableOrderingComposer,
- $$NotificationPermissionEntityTableAnnotationComposer,
- $$NotificationPermissionEntityTableCreateCompanionBuilder,
- $$NotificationPermissionEntityTableUpdateCompanionBuilder,
- (
- NotificationPermissionDb,
- BaseReferences<_$ComwellDatabase, $NotificationPermissionEntityTable,
- NotificationPermissionDb>
- ),
- NotificationPermissionDb,
- PrefetchHooks Function()> {
+class $$NotificationPermissionEntityTableTableManager
+ extends
+ RootTableManager<
+ _$ComwellDatabase,
+ $NotificationPermissionEntityTable,
+ NotificationPermissionDb,
+ $$NotificationPermissionEntityTableFilterComposer,
+ $$NotificationPermissionEntityTableOrderingComposer,
+ $$NotificationPermissionEntityTableAnnotationComposer,
+ $$NotificationPermissionEntityTableCreateCompanionBuilder,
+ $$NotificationPermissionEntityTableUpdateCompanionBuilder,
+ (
+ NotificationPermissionDb,
+ BaseReferences<
+ _$ComwellDatabase,
+ $NotificationPermissionEntityTable,
+ NotificationPermissionDb
+ >,
+ ),
+ NotificationPermissionDb,
+ PrefetchHooks Function()
+ > {
$$NotificationPermissionEntityTableTableManager(
- _$ComwellDatabase db, $NotificationPermissionEntityTable table)
- : super(TableManagerState(
+ _$ComwellDatabase db,
+ $NotificationPermissionEntityTable table,
+ ) : super(
+ TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$NotificationPermissionEntityTableFilterComposer(
- $db: db, $table: table),
+ $db: db,
+ $table: table,
+ ),
createOrderingComposer: () =>
$$NotificationPermissionEntityTableOrderingComposer(
- $db: db, $table: table),
+ $db: db,
+ $table: table,
+ ),
createComputedFieldComposer: () =>
$$NotificationPermissionEntityTableAnnotationComposer(
- $db: db, $table: table),
- updateCompanionCallback: ({
- Value<String> code = const Value.absent(),
- Value<String> json = const Value.absent(),
- Value<int> rowid = const Value.absent(),
- }) =>
- NotificationPermissionEntityCompanion(
- code: code,
- json: json,
- rowid: rowid,
- ),
- createCompanionCallback: ({
- required String code,
- required String json,
- Value<int> rowid = const Value.absent(),
- }) =>
- NotificationPermissionEntityCompanion.insert(
- code: code,
- json: json,
- rowid: rowid,
- ),
+ $db: db,
+ $table: table,
+ ),
+ updateCompanionCallback:
+ ({
+ Value<String> code = const Value.absent(),
+ Value<String> json = const Value.absent(),
+ Value<int> rowid = const Value.absent(),
+ }) => NotificationPermissionEntityCompanion(
+ code: code,
+ json: json,
+ rowid: rowid,
+ ),
+ createCompanionCallback:
+ ({
+ required String code,
+ required String json,
+ Value<int> rowid = const Value.absent(),
+ }) => NotificationPermissionEntityCompanion.insert(
+ code: code,
+ json: json,
+ rowid: rowid,
+ ),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
- ));
+ ),
+ );
}
-typedef $$NotificationPermissionEntityTableProcessedTableManager
- = ProcessedTableManager<
- _$ComwellDatabase,
- $NotificationPermissionEntityTable,
- NotificationPermissionDb,
- $$NotificationPermissionEntityTableFilterComposer,
- $$NotificationPermissionEntityTableOrderingComposer,
- $$NotificationPermissionEntityTableAnnotationComposer,
- $$NotificationPermissionEntityTableCreateCompanionBuilder,
- $$NotificationPermissionEntityTableUpdateCompanionBuilder,
- (
- NotificationPermissionDb,
- BaseReferences<_$ComwellDatabase, $NotificationPermissionEntityTable,
- NotificationPermissionDb>
- ),
+typedef $$NotificationPermissionEntityTableProcessedTableManager =
+ ProcessedTableManager<
+ _$ComwellDatabase,
+ $NotificationPermissionEntityTable,
+ NotificationPermissionDb,
+ $$NotificationPermissionEntityTableFilterComposer,
+ $$NotificationPermissionEntityTableOrderingComposer,
+ $$NotificationPermissionEntityTableAnnotationComposer,
+ $$NotificationPermissionEntityTableCreateCompanionBuilder,
+ $$NotificationPermissionEntityTableUpdateCompanionBuilder,
+ (
NotificationPermissionDb,
- PrefetchHooks Function()>;
-typedef $$UpsaleEntityTableCreateCompanionBuilder = UpsaleEntityCompanion
- Function({
- required String id,
- required String json,
- Value<int> rowid,
-});
-typedef $$UpsaleEntityTableUpdateCompanionBuilder = UpsaleEntityCompanion
- Function({
- Value<String> id,
- Value<String> json,
- Value<int> rowid,
-});
+ BaseReferences<
+ _$ComwellDatabase,
+ $NotificationPermissionEntityTable,
+ NotificationPermissionDb
+ >,
+ ),
+ NotificationPermissionDb,
+ PrefetchHooks Function()
+ >;
+typedef $$UpsaleEntityTableCreateCompanionBuilder =
+ UpsaleEntityCompanion Function({
+ required String id,
+ required String json,
+ Value<int> rowid,
+ });
+typedef $$UpsaleEntityTableUpdateCompanionBuilder =
+ UpsaleEntityCompanion Function({
+ Value<String> id,
+ Value<String> json,
+ Value<int> rowid,
+ });
class $$UpsaleEntityTableFilterComposer
extends Composer<_$ComwellDatabase, $UpsaleEntityTable> {
@@ -1403,10 +1547,14 @@ class $$UpsaleEntityTableFilterComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
- column: $table.id, builder: (column) => ColumnFilters(column));
+ column: $table.id,
+ builder: (column) => ColumnFilters(column),
+ );
ColumnFilters<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnFilters(column));
+ column: $table.json,
+ builder: (column) => ColumnFilters(column),
+ );
}
class $$UpsaleEntityTableOrderingComposer
@@ -1419,10 +1567,14 @@ class $$UpsaleEntityTableOrderingComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
- column: $table.id, builder: (column) => ColumnOrderings(column));
+ column: $table.id,
+ builder: (column) => ColumnOrderings(column),
+ );
ColumnOrderings<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnOrderings(column));
+ column: $table.json,
+ builder: (column) => ColumnOrderings(column),
+ );
}
class $$UpsaleEntityTableAnnotationComposer
@@ -1441,21 +1593,29 @@ class $$UpsaleEntityTableAnnotationComposer
$composableBuilder(column: $table.json, builder: (column) => column);
}
-class $$UpsaleEntityTableTableManager extends RootTableManager<
- _$ComwellDatabase,
- $UpsaleEntityTable,
- UpsaleDb,
- $$UpsaleEntityTableFilterComposer,
- $$UpsaleEntityTableOrderingComposer,
- $$UpsaleEntityTableAnnotationComposer,
- $$UpsaleEntityTableCreateCompanionBuilder,
- $$UpsaleEntityTableUpdateCompanionBuilder,
- (UpsaleDb, BaseReferences<_$ComwellDatabase, $UpsaleEntityTable, UpsaleDb>),
- UpsaleDb,
- PrefetchHooks Function()> {
+class $$UpsaleEntityTableTableManager
+ extends
+ RootTableManager<
+ _$ComwellDatabase,
+ $UpsaleEntityTable,
+ UpsaleDb,
+ $$UpsaleEntityTableFilterComposer,
+ $$UpsaleEntityTableOrderingComposer,
+ $$UpsaleEntityTableAnnotationComposer,
+ $$UpsaleEntityTableCreateCompanionBuilder,
+ $$UpsaleEntityTableUpdateCompanionBuilder,
+ (
+ UpsaleDb,
+ BaseReferences<_$ComwellDatabase, $UpsaleEntityTable, UpsaleDb>,
+ ),
+ UpsaleDb,
+ PrefetchHooks Function()
+ > {
$$UpsaleEntityTableTableManager(
- _$ComwellDatabase db, $UpsaleEntityTable table)
- : super(TableManagerState(
+ _$ComwellDatabase db,
+ $UpsaleEntityTable table,
+ ) : super(
+ TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
@@ -1464,57 +1624,59 @@ class $$UpsaleEntityTableTableManager extends RootTableManager<
$$UpsaleEntityTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$UpsaleEntityTableAnnotationComposer($db: db, $table: table),
- updateCompanionCallback: ({
- Value<String> id = const Value.absent(),
- Value<String> json = const Value.absent(),
- Value<int> rowid = const Value.absent(),
- }) =>
- UpsaleEntityCompanion(
- id: id,
- json: json,
- rowid: rowid,
- ),
- createCompanionCallback: ({
- required String id,
- required String json,
- Value<int> rowid = const Value.absent(),
- }) =>
- UpsaleEntityCompanion.insert(
- id: id,
- json: json,
- rowid: rowid,
- ),
+ updateCompanionCallback:
+ ({
+ Value<String> id = const Value.absent(),
+ Value<String> json = const Value.absent(),
+ Value<int> rowid = const Value.absent(),
+ }) => UpsaleEntityCompanion(id: id, json: json, rowid: rowid),
+ createCompanionCallback:
+ ({
+ required String id,
+ required String json,
+ Value<int> rowid = const Value.absent(),
+ }) => UpsaleEntityCompanion.insert(
+ id: id,
+ json: json,
+ rowid: rowid,
+ ),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
- ));
+ ),
+ );
}
-typedef $$UpsaleEntityTableProcessedTableManager = ProcessedTableManager<
- _$ComwellDatabase,
- $UpsaleEntityTable,
- UpsaleDb,
- $$UpsaleEntityTableFilterComposer,
- $$UpsaleEntityTableOrderingComposer,
- $$UpsaleEntityTableAnnotationComposer,
- $$UpsaleEntityTableCreateCompanionBuilder,
- $$UpsaleEntityTableUpdateCompanionBuilder,
- (UpsaleDb, BaseReferences<_$ComwellDatabase, $UpsaleEntityTable, UpsaleDb>),
- UpsaleDb,
- PrefetchHooks Function()>;
-typedef $$HotelInformationEntityTableCreateCompanionBuilder
- = HotelInformationEntityCompanion Function({
- required String hotelCode,
- required String json,
- Value<int> rowid,
-});
-typedef $$HotelInformationEntityTableUpdateCompanionBuilder
- = HotelInformationEntityCompanion Function({
- Value<String> hotelCode,
- Value<String> json,
- Value<int> rowid,
-});
+typedef $$UpsaleEntityTableProcessedTableManager =
+ ProcessedTableManager<
+ _$ComwellDatabase,
+ $UpsaleEntityTable,
+ UpsaleDb,
+ $$UpsaleEntityTableFilterComposer,
+ $$UpsaleEntityTableOrderingComposer,
+ $$UpsaleEntityTableAnnotationComposer,
+ $$UpsaleEntityTableCreateCompanionBuilder,
+ $$UpsaleEntityTableUpdateCompanionBuilder,
+ (
+ UpsaleDb,
+ BaseReferences<_$ComwellDatabase, $UpsaleEntityTable, UpsaleDb>,
+ ),
+ UpsaleDb,
+ PrefetchHooks Function()
+ >;
+typedef $$HotelInformationEntityTableCreateCompanionBuilder =
+ HotelInformationEntityCompanion Function({
+ required String hotelCode,
+ required String json,
+ Value<int> rowid,
+ });
+typedef $$HotelInformationEntityTableUpdateCompanionBuilder =
+ HotelInformationEntityCompanion Function({
+ Value<String> hotelCode,
+ Value<String> json,
+ Value<int> rowid,
+ });
class $$HotelInformationEntityTableFilterComposer
extends Composer<_$ComwellDatabase, $HotelInformationEntityTable> {
@@ -1526,10 +1688,14 @@ class $$HotelInformationEntityTableFilterComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get hotelCode => $composableBuilder(
- column: $table.hotelCode, builder: (column) => ColumnFilters(column));
+ column: $table.hotelCode,
+ builder: (column) => ColumnFilters(column),
+ );
ColumnFilters<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnFilters(column));
+ column: $table.json,
+ builder: (column) => ColumnFilters(column),
+ );
}
class $$HotelInformationEntityTableOrderingComposer
@@ -1542,10 +1708,14 @@ class $$HotelInformationEntityTableOrderingComposer
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get hotelCode => $composableBuilder(
- column: $table.hotelCode, builder: (column) => ColumnOrderings(column));
+ column: $table.hotelCode,
+ builder: (column) => ColumnOrderings(column),
+ );
ColumnOrderings<String> get json => $composableBuilder(
- column: $table.json, builder: (column) => ColumnOrderings(column));
+ column: $table.json,
+ builder: (column) => ColumnOrderings(column),
+ );
}
class $$HotelInformationEntityTableAnnotationComposer
@@ -1564,80 +1734,99 @@ class $$HotelInformationEntityTableAnnotationComposer
$composableBuilder(column: $table.json, builder: (column) => column);
}
-class $$HotelInformationEntityTableTableManager extends RootTableManager<
- _$ComwellDatabase,
- $HotelInformationEntityTable,
- HotelInformationDb,
- $$HotelInformationEntityTableFilterComposer,
- $$HotelInformationEntityTableOrderingComposer,
- $$HotelInformationEntityTableAnnotationComposer,
- $$HotelInformationEntityTableCreateCompanionBuilder,
- $$HotelInformationEntityTableUpdateCompanionBuilder,
- (
- HotelInformationDb,
- BaseReferences<_$ComwellDatabase, $HotelInformationEntityTable,
- HotelInformationDb>
- ),
- HotelInformationDb,
- PrefetchHooks Function()> {
+class $$HotelInformationEntityTableTableManager
+ extends
+ RootTableManager<
+ _$ComwellDatabase,
+ $HotelInformationEntityTable,
+ HotelInformationDb,
+ $$HotelInformationEntityTableFilterComposer,
+ $$HotelInformationEntityTableOrderingComposer,
+ $$HotelInformationEntityTableAnnotationComposer,
+ $$HotelInformationEntityTableCreateCompanionBuilder,
+ $$HotelInformationEntityTableUpdateCompanionBuilder,
+ (
+ HotelInformationDb,
+ BaseReferences<
+ _$ComwellDatabase,
+ $HotelInformationEntityTable,
+ HotelInformationDb
+ >,
+ ),
+ HotelInformationDb,
+ PrefetchHooks Function()
+ > {
$$HotelInformationEntityTableTableManager(
- _$ComwellDatabase db, $HotelInformationEntityTable table)
- : super(TableManagerState(
+ _$ComwellDatabase db,
+ $HotelInformationEntityTable table,
+ ) : super(
+ TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$HotelInformationEntityTableFilterComposer(
- $db: db, $table: table),
+ $db: db,
+ $table: table,
+ ),
createOrderingComposer: () =>
$$HotelInformationEntityTableOrderingComposer(
- $db: db, $table: table),
+ $db: db,
+ $table: table,
+ ),
createComputedFieldComposer: () =>
$$HotelInformationEntityTableAnnotationComposer(
- $db: db, $table: table),
- updateCompanionCallback: ({
- Value<String> hotelCode = const Value.absent(),
- Value<String> json = const Value.absent(),
- Value<int> rowid = const Value.absent(),
- }) =>
- HotelInformationEntityCompanion(
- hotelCode: hotelCode,
- json: json,
- rowid: rowid,
- ),
- createCompanionCallback: ({
- required String hotelCode,
- required String json,
- Value<int> rowid = const Value.absent(),
- }) =>
- HotelInformationEntityCompanion.insert(
- hotelCode: hotelCode,
- json: json,
- rowid: rowid,
- ),
+ $db: db,
+ $table: table,
+ ),
+ updateCompanionCallback:
+ ({
+ Value<String> hotelCode = const Value.absent(),
+ Value<String> json = const Value.absent(),
+ Value<int> rowid = const Value.absent(),
+ }) => HotelInformationEntityCompanion(
+ hotelCode: hotelCode,
+ json: json,
+ rowid: rowid,
+ ),
+ createCompanionCallback:
+ ({
+ required String hotelCode,
+ required String json,
+ Value<int> rowid = const Value.absent(),
+ }) => HotelInformationEntityCompanion.insert(
+ hotelCode: hotelCode,
+ json: json,
+ rowid: rowid,
+ ),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
- ));
+ ),
+ );
}
-typedef $$HotelInformationEntityTableProcessedTableManager
- = ProcessedTableManager<
- _$ComwellDatabase,
- $HotelInformationEntityTable,
- HotelInformationDb,
- $$HotelInformationEntityTableFilterComposer,
- $$HotelInformationEntityTableOrderingComposer,
- $$HotelInformationEntityTableAnnotationComposer,
- $$HotelInformationEntityTableCreateCompanionBuilder,
- $$HotelInformationEntityTableUpdateCompanionBuilder,
- (
- HotelInformationDb,
- BaseReferences<_$ComwellDatabase, $HotelInformationEntityTable,
- HotelInformationDb>
- ),
+typedef $$HotelInformationEntityTableProcessedTableManager =
+ ProcessedTableManager<
+ _$ComwellDatabase,
+ $HotelInformationEntityTable,
+ HotelInformationDb,
+ $$HotelInformationEntityTableFilterComposer,
+ $$HotelInformationEntityTableOrderingComposer,
+ $$HotelInformationEntityTableAnnotationComposer,
+ $$HotelInformationEntityTableCreateCompanionBuilder,
+ $$HotelInformationEntityTableUpdateCompanionBuilder,
+ (
HotelInformationDb,
- PrefetchHooks Function()>;
+ BaseReferences<
+ _$ComwellDatabase,
+ $HotelInformationEntityTable,
+ HotelInformationDb
+ >,
+ ),
+ HotelInformationDb,
+ PrefetchHooks Function()
+ >;
class $ComwellDatabaseManager {
final _$ComwellDatabase _db;
@@ -1647,12 +1836,16 @@ class $ComwellDatabaseManager {
$$UserEntityTableTableManager get userEntity =>
$$UserEntityTableTableManager(_db, _db.userEntity);
$$NotificationPermissionEntityTableTableManager
- get notificationPermissionEntity =>
- $$NotificationPermissionEntityTableTableManager(
- _db, _db.notificationPermissionEntity);
+ get notificationPermissionEntity =>
+ $$NotificationPermissionEntityTableTableManager(
+ _db,
+ _db.notificationPermissionEntity,
+ );
$$UpsaleEntityTableTableManager get upsaleEntity =>
$$UpsaleEntityTableTableManager(_db, _db.upsaleEntity);
$$HotelInformationEntityTableTableManager get hotelInformationEntity =>
$$HotelInformationEntityTableTableManager(
- _db, _db.hotelInformationEntity);
+ _db,
+ _db.hotelInformationEntity,
+ );
}
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 c5e12da3..fae7255f 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
@@ -7,15 +7,14 @@ part of '../../../hotel_information/models/addon_upgrade.dart';
// **************************************************************************
AddonUpgrade _$AddonUpgradeFromJson(Map json) => AddonUpgrade(
- id: json['id'] as String,
- name: json['name'] as String,
- images:
- (json['images'] as List<dynamic>).map((e) => e as String).toList(),
- description: json['description'] as String,
- isService: json['isService'] as bool,
- onlyAvailableBeforeCheckin: json['onlyAvailableBeforeCheckin'] as bool,
- isPopular: json['isPopular'] as bool,
- );
+ id: json['id'] as String,
+ name: json['name'] as String,
+ images: (json['images'] as List<dynamic>).map((e) => e as String).toList(),
+ description: json['description'] as String,
+ isService: json['isService'] as bool,
+ onlyAvailableBeforeCheckin: json['onlyAvailableBeforeCheckin'] as bool,
+ isPopular: json['isPopular'] as bool,
+);
Map<String, dynamic> _$AddonUpgradeToJson(AddonUpgrade instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/hotel_information/models/call_to_action.g.dart b/comwell_key_app/lib/.generated/hotel_information/models/call_to_action.g.dart
index 9bc35220..fbfde25c 100644
--- a/comwell_key_app/lib/.generated/hotel_information/models/call_to_action.g.dart
+++ b/comwell_key_app/lib/.generated/hotel_information/models/call_to_action.g.dart
@@ -7,10 +7,10 @@ part of '../../../hotel_information/models/call_to_action.dart';
// **************************************************************************
CallToAction _$CallToActionFromJson(Map json) => CallToAction(
- name: json['name'] as String,
- url: json['url'] as String,
- target: json['target'] as String?,
- );
+ name: json['name'] as String,
+ url: json['url'] as String,
+ target: json['target'] as String?,
+);
Map<String, dynamic> _$CallToActionToJson(CallToAction instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/hotel_information/models/facilities.g.dart b/comwell_key_app/lib/.generated/hotel_information/models/facilities.g.dart
index 62b3ba87..cb3abf3a 100644
--- a/comwell_key_app/lib/.generated/hotel_information/models/facilities.g.dart
+++ b/comwell_key_app/lib/.generated/hotel_information/models/facilities.g.dart
@@ -7,23 +7,26 @@ part of '../../../hotel_information/models/facilities.dart';
// **************************************************************************
Facility _$FacilityFromJson(Map json) => Facility(
- title: json['title'] as String,
- headerImage: json['headerImage'] as String?,
- structuredText: (json['structuredText'] as List<dynamic>)
- .map((e) =>
- StructuredTextBlock.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList(),
- callToAction: json['callToAction'] == null
- ? null
- : CallToAction.fromJson(
- Map<String, dynamic>.from(json['callToAction'] as Map)),
- icon: json['icon'] as String,
- );
+ title: json['title'] as String,
+ headerImage: json['headerImage'] as String?,
+ structuredText: (json['structuredText'] as List<dynamic>)
+ .map(
+ (e) =>
+ StructuredTextBlock.fromJson(Map<String, dynamic>.from(e as Map)),
+ )
+ .toList(),
+ callToAction: json['callToAction'] == null
+ ? null
+ : CallToAction.fromJson(
+ Map<String, dynamic>.from(json['callToAction'] as Map),
+ ),
+ icon: json['icon'] as String,
+);
Map<String, dynamic> _$FacilityToJson(Facility instance) => <String, dynamic>{
- 'title': instance.title,
- 'headerImage': instance.headerImage,
- 'structuredText': instance.structuredText.map((e) => e.toJson()).toList(),
- 'callToAction': instance.callToAction?.toJson(),
- 'icon': instance.icon,
- };
+ 'title': instance.title,
+ 'headerImage': instance.headerImage,
+ 'structuredText': instance.structuredText.map((e) => e.toJson()).toList(),
+ 'callToAction': instance.callToAction?.toJson(),
+ 'icon': instance.icon,
+};
diff --git a/comwell_key_app/lib/.generated/hotel_information/models/hotel.g.dart b/comwell_key_app/lib/.generated/hotel_information/models/hotel.g.dart
index 79d101fc..1e3b81c4 100644
--- a/comwell_key_app/lib/.generated/hotel_information/models/hotel.g.dart
+++ b/comwell_key_app/lib/.generated/hotel_information/models/hotel.g.dart
@@ -7,36 +7,35 @@ part of '../../../hotel_information/models/hotel.dart';
// **************************************************************************
Hotel _$HotelFromJson(Map json) => Hotel(
- updateDate: json['updateDate'] as String,
- hotelCode: json['hotelCode'] as String,
- hotelName: json['hotelName'] as String,
- address: json['address'] as String,
- city: json['city'] as String,
- country: json['country'] as String,
- image: json['image'] as String,
- digitalCheckIn: json['digitalCheckIn'] as bool,
- facilities: (json['facilities'] as List<dynamic>)
- .map((e) => Facility.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList(),
- roomTypes: (json['roomTypes'] as List<dynamic>)
- .map((e) => RoomType.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList(),
- addonUpgrades: (json['addonUpgrades'] as List<dynamic>)
- .map(
- (e) => AddonUpgrade.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList(),
- );
+ updateDate: json['updateDate'] as String,
+ hotelCode: json['hotelCode'] as String,
+ hotelName: json['hotelName'] as String,
+ address: json['address'] as String,
+ city: json['city'] as String,
+ country: json['country'] as String,
+ image: json['image'] as String,
+ digitalCheckIn: json['digitalCheckIn'] as bool,
+ facilities: (json['facilities'] as List<dynamic>)
+ .map((e) => Facility.fromJson(Map<String, dynamic>.from(e as Map)))
+ .toList(),
+ roomTypes: (json['roomTypes'] as List<dynamic>)
+ .map((e) => RoomType.fromJson(Map<String, dynamic>.from(e as Map)))
+ .toList(),
+ addonUpgrades: (json['addonUpgrades'] as List<dynamic>)
+ .map((e) => AddonUpgrade.fromJson(Map<String, dynamic>.from(e as Map)))
+ .toList(),
+);
Map<String, dynamic> _$HotelToJson(Hotel instance) => <String, dynamic>{
- 'updateDate': instance.updateDate,
- 'hotelCode': instance.hotelCode,
- 'hotelName': instance.hotelName,
- 'address': instance.address,
- 'city': instance.city,
- 'country': instance.country,
- 'image': instance.image,
- 'digitalCheckIn': instance.digitalCheckIn,
- 'facilities': instance.facilities.map((e) => e.toJson()).toList(),
- 'roomTypes': instance.roomTypes.map((e) => e.toJson()).toList(),
- 'addonUpgrades': instance.addonUpgrades.map((e) => e.toJson()).toList(),
- };
+ 'updateDate': instance.updateDate,
+ 'hotelCode': instance.hotelCode,
+ 'hotelName': instance.hotelName,
+ 'address': instance.address,
+ 'city': instance.city,
+ 'country': instance.country,
+ 'image': instance.image,
+ 'digitalCheckIn': instance.digitalCheckIn,
+ 'facilities': instance.facilities.map((e) => e.toJson()).toList(),
+ 'roomTypes': instance.roomTypes.map((e) => e.toJson()).toList(),
+ 'addonUpgrades': instance.addonUpgrades.map((e) => e.toJson()).toList(),
+};
diff --git a/comwell_key_app/lib/.generated/hotel_information/models/room_facility.g.dart b/comwell_key_app/lib/.generated/hotel_information/models/room_facility.g.dart
index 79e6382d..3f4e714d 100644
--- a/comwell_key_app/lib/.generated/hotel_information/models/room_facility.g.dart
+++ b/comwell_key_app/lib/.generated/hotel_information/models/room_facility.g.dart
@@ -7,10 +7,10 @@ part of '../../../hotel_information/models/room_facility.dart';
// **************************************************************************
RoomFacility _$RoomFacilityFromJson(Map json) => RoomFacility(
- name: json['name'] as String,
- icon: json['icon'] as String,
- groupName: json['groupName'] as String,
- );
+ name: json['name'] as String,
+ icon: json['icon'] as String,
+ groupName: json['groupName'] as String,
+);
Map<String, dynamic> _$RoomFacilityToJson(RoomFacility instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/hotel_information/models/room_type.g.dart b/comwell_key_app/lib/.generated/hotel_information/models/room_type.g.dart
index 5a0184d7..9ad63b04 100644
--- a/comwell_key_app/lib/.generated/hotel_information/models/room_type.g.dart
+++ b/comwell_key_app/lib/.generated/hotel_information/models/room_type.g.dart
@@ -7,23 +7,21 @@ part of '../../../hotel_information/models/room_type.dart';
// **************************************************************************
RoomType _$RoomTypeFromJson(Map json) => RoomType(
- id: json['id'] as String,
- name: json['name'] as String,
- description: json['description'] as String,
- images:
- (json['images'] as List<dynamic>).map((e) => e as String).toList(),
- facilities: (json['facilities'] as List<dynamic>)
- .map(
- (e) => RoomFacility.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList(),
- roomTypeSize: (json['roomTypeSize'] as num).toInt(),
- );
+ id: json['id'] as String,
+ name: json['name'] as String,
+ description: json['description'] as String,
+ images: (json['images'] as List<dynamic>).map((e) => e as String).toList(),
+ facilities: (json['facilities'] as List<dynamic>)
+ .map((e) => RoomFacility.fromJson(Map<String, dynamic>.from(e as Map)))
+ .toList(),
+ roomTypeSize: (json['roomTypeSize'] as num).toInt(),
+);
Map<String, dynamic> _$RoomTypeToJson(RoomType instance) => <String, dynamic>{
- 'id': instance.id,
- 'name': instance.name,
- 'description': instance.description,
- 'images': instance.images,
- 'facilities': instance.facilities.map((e) => e.toJson()).toList(),
- 'roomTypeSize': instance.roomTypeSize,
- };
+ 'id': instance.id,
+ 'name': instance.name,
+ 'description': instance.description,
+ 'images': instance.images,
+ 'facilities': instance.facilities.map((e) => e.toJson()).toList(),
+ 'roomTypeSize': instance.roomTypeSize,
+};
diff --git a/comwell_key_app/lib/.generated/hotel_information/models/structured_text.g.dart b/comwell_key_app/lib/.generated/hotel_information/models/structured_text.g.dart
index e3363f4f..ca5cd491 100644
--- a/comwell_key_app/lib/.generated/hotel_information/models/structured_text.g.dart
+++ b/comwell_key_app/lib/.generated/hotel_information/models/structured_text.g.dart
@@ -13,11 +13,8 @@ HeaderStructuredTextModel _$HeaderStructuredTextModelFromJson(Map json) =>
);
Map<String, dynamic> _$HeaderStructuredTextModelToJson(
- HeaderStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'header': instance.header,
- };
+ HeaderStructuredTextModel instance,
+) => <String, dynamic>{'type': instance.type, 'header': instance.header};
TextModelStructuredTextModel _$TextModelStructuredTextModelFromJson(Map json) =>
TextModelStructuredTextModel(
@@ -26,11 +23,8 @@ TextModelStructuredTextModel _$TextModelStructuredTextModelFromJson(Map json) =>
);
Map<String, dynamic> _$TextModelStructuredTextModelToJson(
- TextModelStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'text': instance.text,
- };
+ TextModelStructuredTextModel instance,
+) => <String, dynamic>{'type': instance.type, 'text': instance.text};
AddressStructuredTextModel _$AddressStructuredTextModelFromJson(Map json) =>
AddressStructuredTextModel(
@@ -40,117 +34,109 @@ AddressStructuredTextModel _$AddressStructuredTextModelFromJson(Map json) =>
);
Map<String, dynamic> _$AddressStructuredTextModelToJson(
- AddressStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'headline': instance.headline,
- 'address': instance.address,
- };
+ AddressStructuredTextModel instance,
+) => <String, dynamic>{
+ 'type': instance.type,
+ 'headline': instance.headline,
+ 'address': instance.address,
+};
EmailContactStructuredTextModel _$EmailContactStructuredTextModelFromJson(
- Map json) =>
- EmailContactStructuredTextModel(
- type: json['type'] as String? ?? 'EmailContactStructuredTextModel',
- headline: json['headline'] as String,
- email: json['email'] as String,
- );
+ Map json,
+) => EmailContactStructuredTextModel(
+ type: json['type'] as String? ?? 'EmailContactStructuredTextModel',
+ headline: json['headline'] as String,
+ email: json['email'] as String,
+);
Map<String, dynamic> _$EmailContactStructuredTextModelToJson(
- EmailContactStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'headline': instance.headline,
- 'email': instance.email,
- };
+ EmailContactStructuredTextModel instance,
+) => <String, dynamic>{
+ 'type': instance.type,
+ 'headline': instance.headline,
+ 'email': instance.email,
+};
PhoneContactStructuredTextModel _$PhoneContactStructuredTextModelFromJson(
- Map json) =>
- PhoneContactStructuredTextModel(
- type: json['type'] as String? ?? 'PhoneContactStructuredTextModel',
- headline: json['headline'] as String,
- phoneNumber: json['phoneNumber'] as String,
- );
+ Map json,
+) => PhoneContactStructuredTextModel(
+ type: json['type'] as String? ?? 'PhoneContactStructuredTextModel',
+ headline: json['headline'] as String,
+ phoneNumber: json['phoneNumber'] as String,
+);
Map<String, dynamic> _$PhoneContactStructuredTextModelToJson(
- PhoneContactStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'headline': instance.headline,
- 'phoneNumber': instance.phoneNumber,
- };
+ PhoneContactStructuredTextModel instance,
+) => <String, dynamic>{
+ 'type': instance.type,
+ 'headline': instance.headline,
+ 'phoneNumber': instance.phoneNumber,
+};
ImageWidgetStructuredTextModel _$ImageWidgetStructuredTextModelFromJson(
- Map json) =>
- ImageWidgetStructuredTextModel(
- type: json['type'] as String? ?? 'ImageWidgetStructuredTextModel',
- image: json['image'] as String,
- );
+ Map json,
+) => ImageWidgetStructuredTextModel(
+ type: json['type'] as String? ?? 'ImageWidgetStructuredTextModel',
+ image: json['image'] as String,
+);
Map<String, dynamic> _$ImageWidgetStructuredTextModelToJson(
- ImageWidgetStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'image': instance.image,
- };
+ ImageWidgetStructuredTextModel instance,
+) => <String, dynamic>{'type': instance.type, 'image': instance.image};
SpaBookingLinkStructuredTextModel _$SpaBookingLinkStructuredTextModelFromJson(
- Map json) =>
- SpaBookingLinkStructuredTextModel(
- type: json['type'] as String? ?? 'SpaBookingLinkStructuredTextModel',
- link: json['link'] as String,
- );
+ Map json,
+) => SpaBookingLinkStructuredTextModel(
+ type: json['type'] as String? ?? 'SpaBookingLinkStructuredTextModel',
+ link: json['link'] as String,
+);
Map<String, dynamic> _$SpaBookingLinkStructuredTextModelToJson(
- SpaBookingLinkStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'link': instance.link,
- };
+ SpaBookingLinkStructuredTextModel instance,
+) => <String, dynamic>{'type': instance.type, 'link': instance.link};
HotelInformationListTileStructuredTextModel
- _$HotelInformationListTileStructuredTextModelFromJson(Map json) =>
- HotelInformationListTileStructuredTextModel(
- type: json['type'] as String? ??
- 'HotelInformationListTileStructuredTextModel',
- iconPath: json['iconPath'] as String,
- title: json['title'] as String,
- );
+_$HotelInformationListTileStructuredTextModelFromJson(Map json) =>
+ HotelInformationListTileStructuredTextModel(
+ type:
+ json['type'] as String? ??
+ 'HotelInformationListTileStructuredTextModel',
+ iconPath: json['iconPath'] as String,
+ title: json['title'] as String,
+ );
Map<String, dynamic> _$HotelInformationListTileStructuredTextModelToJson(
- HotelInformationListTileStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'iconPath': instance.iconPath,
- 'title': instance.title,
- };
+ HotelInformationListTileStructuredTextModel instance,
+) => <String, dynamic>{
+ 'type': instance.type,
+ 'iconPath': instance.iconPath,
+ 'title': instance.title,
+};
MapsBottomModalStructuredTextModel _$MapsBottomModalStructuredTextModelFromJson(
- Map json) =>
- MapsBottomModalStructuredTextModel(
- type: json['type'] as String? ?? 'MapsBottomModalStructuredTextModel',
- address: json['address'] as String,
- );
+ Map json,
+) => MapsBottomModalStructuredTextModel(
+ type: json['type'] as String? ?? 'MapsBottomModalStructuredTextModel',
+ address: json['address'] as String,
+);
Map<String, dynamic> _$MapsBottomModalStructuredTextModelToJson(
- MapsBottomModalStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'address': instance.address,
- };
+ MapsBottomModalStructuredTextModel instance,
+) => <String, dynamic>{'type': instance.type, 'address': instance.address};
OpeningHoursStructuredTextModel _$OpeningHoursStructuredTextModelFromJson(
- Map json) =>
- OpeningHoursStructuredTextModel(
- type: json['type'] as String? ?? 'OpeningHoursStructuredTextModel',
- openingHours: json['openingHours'] as String,
- );
+ Map json,
+) => OpeningHoursStructuredTextModel(
+ type: json['type'] as String? ?? 'OpeningHoursStructuredTextModel',
+ openingHours: json['openingHours'] as String,
+);
Map<String, dynamic> _$OpeningHoursStructuredTextModelToJson(
- OpeningHoursStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'openingHours': instance.openingHours,
- };
+ OpeningHoursStructuredTextModel instance,
+) => <String, dynamic>{
+ 'type': instance.type,
+ 'openingHours': instance.openingHours,
+};
PageTitleStructuredTextModel _$PageTitleStructuredTextModelFromJson(Map json) =>
PageTitleStructuredTextModel(
@@ -159,26 +145,23 @@ PageTitleStructuredTextModel _$PageTitleStructuredTextModelFromJson(Map json) =>
);
Map<String, dynamic> _$PageTitleStructuredTextModelToJson(
- PageTitleStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'title': instance.title,
- };
+ PageTitleStructuredTextModel instance,
+) => <String, dynamic>{'type': instance.type, 'title': instance.title};
PracticalInformationStructuredTextModel
- _$PracticalInformationStructuredTextModelFromJson(Map json) =>
- PracticalInformationStructuredTextModel(
- type: json['type'] as String? ??
- 'PracticalInformationStructuredTextModel',
- restaurantId: json['restaurantId'] as String,
- );
+_$PracticalInformationStructuredTextModelFromJson(Map json) =>
+ PracticalInformationStructuredTextModel(
+ type:
+ json['type'] as String? ?? 'PracticalInformationStructuredTextModel',
+ restaurantId: json['restaurantId'] as String,
+ );
Map<String, dynamic> _$PracticalInformationStructuredTextModelToJson(
- PracticalInformationStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'restaurantId': instance.restaurantId,
- };
+ PracticalInformationStructuredTextModel instance,
+) => <String, dynamic>{
+ 'type': instance.type,
+ 'restaurantId': instance.restaurantId,
+};
EmailStructuredTextModel _$EmailStructuredTextModelFromJson(Map json) =>
EmailStructuredTextModel(
@@ -187,8 +170,5 @@ EmailStructuredTextModel _$EmailStructuredTextModelFromJson(Map json) =>
);
Map<String, dynamic> _$EmailStructuredTextModelToJson(
- EmailStructuredTextModel instance) =>
- <String, dynamic>{
- 'type': instance.type,
- 'email': instance.email,
- };
+ EmailStructuredTextModel instance,
+) => <String, dynamic>{'type': instance.type, 'email': instance.email};
diff --git a/comwell_key_app/lib/.generated/housekeeping/models/housekeeping.g.dart b/comwell_key_app/lib/.generated/housekeeping/models/housekeeping.g.dart
index 3149ee29..645c2917 100644
--- a/comwell_key_app/lib/.generated/housekeeping/models/housekeeping.g.dart
+++ b/comwell_key_app/lib/.generated/housekeeping/models/housekeeping.g.dart
@@ -7,14 +7,14 @@ part of '../../../housekeeping/models/housekeeping.dart';
// **************************************************************************
Housekeeping _$HousekeepingFromJson(Map json) => Housekeeping(
- hotelCode: json['hotelCode'] as String,
- roomNumber: json['roomNumber'] as String,
- cleaning: json['cleaning'] as bool,
- soap: json['soap'] as bool,
- towels: json['towels'] as bool,
- trash: json['trash'] as bool,
- refill: json['refill'] as bool,
- );
+ hotelCode: json['hotelCode'] as String,
+ roomNumber: json['roomNumber'] as String,
+ cleaning: json['cleaning'] as bool,
+ soap: json['soap'] as bool,
+ towels: json['towels'] as bool,
+ trash: json['trash'] as bool,
+ refill: json['refill'] as bool,
+);
Map<String, dynamic> _$HousekeepingToJson(Housekeeping instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/notifications/models/notification_permission.g.dart b/comwell_key_app/lib/.generated/notifications/models/notification_permission.g.dart
index 42020cb3..2e67b24d 100644
--- a/comwell_key_app/lib/.generated/notifications/models/notification_permission.g.dart
+++ b/comwell_key_app/lib/.generated/notifications/models/notification_permission.g.dart
@@ -16,11 +16,11 @@ NotificationPermission _$NotificationPermissionFromJson(Map json) =>
);
Map<String, dynamic> _$NotificationPermissionToJson(
- NotificationPermission instance) =>
- <String, dynamic>{
- 'code': instance.code,
- 'displayName': instance.displayName,
- 'notificationPermissionDescription':
- instance.notificationPermissionDescription,
- 'given': instance.given,
- };
+ NotificationPermission instance,
+) => <String, dynamic>{
+ 'code': instance.code,
+ 'displayName': instance.displayName,
+ 'notificationPermissionDescription':
+ instance.notificationPermissionDescription,
+ 'given': instance.given,
+};
diff --git a/comwell_key_app/lib/.generated/overview/cubit/overview_state.freezed.dart b/comwell_key_app/lib/.generated/overview/cubit/overview_state.freezed.dart
new file mode 100644
index 00000000..83bcf0dc
--- /dev/null
+++ b/comwell_key_app/lib/.generated/overview/cubit/overview_state.freezed.dart
@@ -0,0 +1,277 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of '../../../overview/cubit/overview_state.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$OverviewState {
+
+ bool get isLoading; Bookings get bookings; OverviewStateError get errorType;
+/// Create a copy of OverviewState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$OverviewStateCopyWith<OverviewState> get copyWith => _$OverviewStateCopyWithImpl<OverviewState>(this as OverviewState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is OverviewState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.bookings, bookings) || other.bookings == bookings)&&(identical(other.errorType, errorType) || other.errorType == errorType));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,bookings,errorType);
+
+@override
+String toString() {
+ return 'OverviewState(isLoading: $isLoading, bookings: $bookings, errorType: $errorType)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $OverviewStateCopyWith<$Res> {
+ factory $OverviewStateCopyWith(OverviewState value, $Res Function(OverviewState) _then) = _$OverviewStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, Bookings bookings, OverviewStateError errorType
+});
+
+
+
+
+}
+/// @nodoc
+class _$OverviewStateCopyWithImpl<$Res>
+ implements $OverviewStateCopyWith<$Res> {
+ _$OverviewStateCopyWithImpl(this._self, this._then);
+
+ final OverviewState _self;
+ final $Res Function(OverviewState) _then;
+
+/// Create a copy of OverviewState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? bookings = null,Object? errorType = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,bookings: null == bookings ? _self.bookings : bookings // ignore: cast_nullable_to_non_nullable
+as Bookings,errorType: null == errorType ? _self.errorType : errorType // ignore: cast_nullable_to_non_nullable
+as OverviewStateError,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [OverviewState].
+extension OverviewStatePatterns on OverviewState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _OverviewState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _OverviewState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _OverviewState value) $default,){
+final _that = this;
+switch (_that) {
+case _OverviewState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _OverviewState value)? $default,){
+final _that = this;
+switch (_that) {
+case _OverviewState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, Bookings bookings, OverviewStateError errorType)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _OverviewState() when $default != null:
+return $default(_that.isLoading,_that.bookings,_that.errorType);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, Bookings bookings, OverviewStateError errorType) $default,) {final _that = this;
+switch (_that) {
+case _OverviewState():
+return $default(_that.isLoading,_that.bookings,_that.errorType);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, Bookings bookings, OverviewStateError errorType)? $default,) {final _that = this;
+switch (_that) {
+case _OverviewState() when $default != null:
+return $default(_that.isLoading,_that.bookings,_that.errorType);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _OverviewState implements OverviewState {
+ const _OverviewState({this.isLoading = false, this.bookings = Bookings.emptyValue, this.errorType = OverviewStateError.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final Bookings bookings;
+@override@JsonKey() final OverviewStateError errorType;
+
+/// Create a copy of OverviewState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$OverviewStateCopyWith<_OverviewState> get copyWith => __$OverviewStateCopyWithImpl<_OverviewState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _OverviewState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.bookings, bookings) || other.bookings == bookings)&&(identical(other.errorType, errorType) || other.errorType == errorType));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,bookings,errorType);
+
+@override
+String toString() {
+ return 'OverviewState(isLoading: $isLoading, bookings: $bookings, errorType: $errorType)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$OverviewStateCopyWith<$Res> implements $OverviewStateCopyWith<$Res> {
+ factory _$OverviewStateCopyWith(_OverviewState value, $Res Function(_OverviewState) _then) = __$OverviewStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, Bookings bookings, OverviewStateError errorType
+});
+
+
+
+
+}
+/// @nodoc
+class __$OverviewStateCopyWithImpl<$Res>
+ implements _$OverviewStateCopyWith<$Res> {
+ __$OverviewStateCopyWithImpl(this._self, this._then);
+
+ final _OverviewState _self;
+ final $Res Function(_OverviewState) _then;
+
+/// Create a copy of OverviewState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? bookings = null,Object? errorType = null,}) {
+ return _then(_OverviewState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,bookings: null == bookings ? _self.bookings : bookings // ignore: cast_nullable_to_non_nullable
+as Bookings,errorType: null == errorType ? _self.errorType : errorType // ignore: cast_nullable_to_non_nullable
+as OverviewStateError,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/comwell_key_app/lib/.generated/overview/models/payment_details.g.dart b/comwell_key_app/lib/.generated/overview/models/payment_details.g.dart
index de5fed15..e862ef68 100644
--- a/comwell_key_app/lib/.generated/overview/models/payment_details.g.dart
+++ b/comwell_key_app/lib/.generated/overview/models/payment_details.g.dart
@@ -7,13 +7,13 @@ part of '../../../overview/models/payment_details.dart';
// **************************************************************************
PaymentDetails _$PaymentDetailsFromJson(Map json) => PaymentDetails(
- cardNumber: json['cardNumber'] as String,
- cardHolder: json['cardHolder'] as String,
- expiryDate: json['expiryDate'] as String?,
- cvc: json['cvc'] as String?,
- cardType: $enumDecode(_$CardTypeEnumMap, json['cardType']),
- cardName: json['cardName'] as String?,
- );
+ cardNumber: json['cardNumber'] as String,
+ cardHolder: json['cardHolder'] as String,
+ expiryDate: json['expiryDate'] as String?,
+ cvc: json['cvc'] as String?,
+ cardType: $enumDecode(_$CardTypeEnumMap, json['cardType']),
+ cardName: json['cardName'] as String?,
+);
Map<String, dynamic> _$PaymentDetailsToJson(PaymentDetails instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/presentation/screens/onboarding/bluetooth/bluetooth_permission_cubit.freezed.dart b/comwell_key_app/lib/.generated/presentation/screens/onboarding/bluetooth/bluetooth_permission_cubit.freezed.dart
new file mode 100644
index 00000000..92867976
--- /dev/null
+++ b/comwell_key_app/lib/.generated/presentation/screens/onboarding/bluetooth/bluetooth_permission_cubit.freezed.dart
@@ -0,0 +1,283 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of '../../../../../presentation/screens/onboarding/bluetooth/bluetooth_permission_cubit.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$BluetoothPermissionState {
+
+ bool get isLoading; bool get isEnabled; bool get isSupported; bool get isPermissionGranted; ErrorType get errorType;
+/// Create a copy of BluetoothPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$BluetoothPermissionStateCopyWith<BluetoothPermissionState> get copyWith => _$BluetoothPermissionStateCopyWithImpl<BluetoothPermissionState>(this as BluetoothPermissionState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is BluetoothPermissionState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isEnabled, isEnabled) || other.isEnabled == isEnabled)&&(identical(other.isSupported, isSupported) || other.isSupported == isSupported)&&(identical(other.isPermissionGranted, isPermissionGranted) || other.isPermissionGranted == isPermissionGranted)&&(identical(other.errorType, errorType) || other.errorType == errorType));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,isEnabled,isSupported,isPermissionGranted,errorType);
+
+@override
+String toString() {
+ return 'BluetoothPermissionState(isLoading: $isLoading, isEnabled: $isEnabled, isSupported: $isSupported, isPermissionGranted: $isPermissionGranted, errorType: $errorType)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $BluetoothPermissionStateCopyWith<$Res> {
+ factory $BluetoothPermissionStateCopyWith(BluetoothPermissionState value, $Res Function(BluetoothPermissionState) _then) = _$BluetoothPermissionStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, bool isEnabled, bool isSupported, bool isPermissionGranted, ErrorType errorType
+});
+
+
+
+
+}
+/// @nodoc
+class _$BluetoothPermissionStateCopyWithImpl<$Res>
+ implements $BluetoothPermissionStateCopyWith<$Res> {
+ _$BluetoothPermissionStateCopyWithImpl(this._self, this._then);
+
+ final BluetoothPermissionState _self;
+ final $Res Function(BluetoothPermissionState) _then;
+
+/// Create a copy of BluetoothPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? isEnabled = null,Object? isSupported = null,Object? isPermissionGranted = null,Object? errorType = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,isEnabled: null == isEnabled ? _self.isEnabled : isEnabled // ignore: cast_nullable_to_non_nullable
+as bool,isSupported: null == isSupported ? _self.isSupported : isSupported // ignore: cast_nullable_to_non_nullable
+as bool,isPermissionGranted: null == isPermissionGranted ? _self.isPermissionGranted : isPermissionGranted // ignore: cast_nullable_to_non_nullable
+as bool,errorType: null == errorType ? _self.errorType : errorType // ignore: cast_nullable_to_non_nullable
+as ErrorType,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [BluetoothPermissionState].
+extension BluetoothPermissionStatePatterns on BluetoothPermissionState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _BluetoothPermissionState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _BluetoothPermissionState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _BluetoothPermissionState value) $default,){
+final _that = this;
+switch (_that) {
+case _BluetoothPermissionState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _BluetoothPermissionState value)? $default,){
+final _that = this;
+switch (_that) {
+case _BluetoothPermissionState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, bool isEnabled, bool isSupported, bool isPermissionGranted, ErrorType errorType)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _BluetoothPermissionState() when $default != null:
+return $default(_that.isLoading,_that.isEnabled,_that.isSupported,_that.isPermissionGranted,_that.errorType);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, bool isEnabled, bool isSupported, bool isPermissionGranted, ErrorType errorType) $default,) {final _that = this;
+switch (_that) {
+case _BluetoothPermissionState():
+return $default(_that.isLoading,_that.isEnabled,_that.isSupported,_that.isPermissionGranted,_that.errorType);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, bool isEnabled, bool isSupported, bool isPermissionGranted, ErrorType errorType)? $default,) {final _that = this;
+switch (_that) {
+case _BluetoothPermissionState() when $default != null:
+return $default(_that.isLoading,_that.isEnabled,_that.isSupported,_that.isPermissionGranted,_that.errorType);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _BluetoothPermissionState implements BluetoothPermissionState {
+ const _BluetoothPermissionState({this.isLoading = false, this.isEnabled = false, this.isSupported = false, this.isPermissionGranted = false, this.errorType = ErrorType.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final bool isEnabled;
+@override@JsonKey() final bool isSupported;
+@override@JsonKey() final bool isPermissionGranted;
+@override@JsonKey() final ErrorType errorType;
+
+/// Create a copy of BluetoothPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$BluetoothPermissionStateCopyWith<_BluetoothPermissionState> get copyWith => __$BluetoothPermissionStateCopyWithImpl<_BluetoothPermissionState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _BluetoothPermissionState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isEnabled, isEnabled) || other.isEnabled == isEnabled)&&(identical(other.isSupported, isSupported) || other.isSupported == isSupported)&&(identical(other.isPermissionGranted, isPermissionGranted) || other.isPermissionGranted == isPermissionGranted)&&(identical(other.errorType, errorType) || other.errorType == errorType));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,isEnabled,isSupported,isPermissionGranted,errorType);
+
+@override
+String toString() {
+ return 'BluetoothPermissionState(isLoading: $isLoading, isEnabled: $isEnabled, isSupported: $isSupported, isPermissionGranted: $isPermissionGranted, errorType: $errorType)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$BluetoothPermissionStateCopyWith<$Res> implements $BluetoothPermissionStateCopyWith<$Res> {
+ factory _$BluetoothPermissionStateCopyWith(_BluetoothPermissionState value, $Res Function(_BluetoothPermissionState) _then) = __$BluetoothPermissionStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, bool isEnabled, bool isSupported, bool isPermissionGranted, ErrorType errorType
+});
+
+
+
+
+}
+/// @nodoc
+class __$BluetoothPermissionStateCopyWithImpl<$Res>
+ implements _$BluetoothPermissionStateCopyWith<$Res> {
+ __$BluetoothPermissionStateCopyWithImpl(this._self, this._then);
+
+ final _BluetoothPermissionState _self;
+ final $Res Function(_BluetoothPermissionState) _then;
+
+/// Create a copy of BluetoothPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? isEnabled = null,Object? isSupported = null,Object? isPermissionGranted = null,Object? errorType = null,}) {
+ return _then(_BluetoothPermissionState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,isEnabled: null == isEnabled ? _self.isEnabled : isEnabled // ignore: cast_nullable_to_non_nullable
+as bool,isSupported: null == isSupported ? _self.isSupported : isSupported // ignore: cast_nullable_to_non_nullable
+as bool,isPermissionGranted: null == isPermissionGranted ? _self.isPermissionGranted : isPermissionGranted // ignore: cast_nullable_to_non_nullable
+as bool,errorType: null == errorType ? _self.errorType : errorType // ignore: cast_nullable_to_non_nullable
+as ErrorType,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/comwell_key_app/lib/.generated/presentation/screens/onboarding/notifications/notification_permission_cubit.freezed.dart b/comwell_key_app/lib/.generated/presentation/screens/onboarding/notifications/notification_permission_cubit.freezed.dart
new file mode 100644
index 00000000..093bbc3f
--- /dev/null
+++ b/comwell_key_app/lib/.generated/presentation/screens/onboarding/notifications/notification_permission_cubit.freezed.dart
@@ -0,0 +1,274 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of '../../../../../presentation/screens/onboarding/notifications/notification_permission_cubit.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$NotificationPermissionState {
+
+ bool get isLoading; ErrorType get errorType;
+/// Create a copy of NotificationPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$NotificationPermissionStateCopyWith<NotificationPermissionState> get copyWith => _$NotificationPermissionStateCopyWithImpl<NotificationPermissionState>(this as NotificationPermissionState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is NotificationPermissionState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorType, errorType) || other.errorType == errorType));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,errorType);
+
+@override
+String toString() {
+ return 'NotificationPermissionState(isLoading: $isLoading, errorType: $errorType)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $NotificationPermissionStateCopyWith<$Res> {
+ factory $NotificationPermissionStateCopyWith(NotificationPermissionState value, $Res Function(NotificationPermissionState) _then) = _$NotificationPermissionStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, ErrorType errorType
+});
+
+
+
+
+}
+/// @nodoc
+class _$NotificationPermissionStateCopyWithImpl<$Res>
+ implements $NotificationPermissionStateCopyWith<$Res> {
+ _$NotificationPermissionStateCopyWithImpl(this._self, this._then);
+
+ final NotificationPermissionState _self;
+ final $Res Function(NotificationPermissionState) _then;
+
+/// Create a copy of NotificationPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? errorType = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,errorType: null == errorType ? _self.errorType : errorType // ignore: cast_nullable_to_non_nullable
+as ErrorType,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [NotificationPermissionState].
+extension NotificationPermissionStatePatterns on NotificationPermissionState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _NotificationPermissionState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _NotificationPermissionState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _NotificationPermissionState value) $default,){
+final _that = this;
+switch (_that) {
+case _NotificationPermissionState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _NotificationPermissionState value)? $default,){
+final _that = this;
+switch (_that) {
+case _NotificationPermissionState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, ErrorType errorType)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _NotificationPermissionState() when $default != null:
+return $default(_that.isLoading,_that.errorType);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, ErrorType errorType) $default,) {final _that = this;
+switch (_that) {
+case _NotificationPermissionState():
+return $default(_that.isLoading,_that.errorType);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, ErrorType errorType)? $default,) {final _that = this;
+switch (_that) {
+case _NotificationPermissionState() when $default != null:
+return $default(_that.isLoading,_that.errorType);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _NotificationPermissionState implements NotificationPermissionState {
+ const _NotificationPermissionState({this.isLoading = false, this.errorType = ErrorType.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final ErrorType errorType;
+
+/// Create a copy of NotificationPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$NotificationPermissionStateCopyWith<_NotificationPermissionState> get copyWith => __$NotificationPermissionStateCopyWithImpl<_NotificationPermissionState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _NotificationPermissionState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorType, errorType) || other.errorType == errorType));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,errorType);
+
+@override
+String toString() {
+ return 'NotificationPermissionState(isLoading: $isLoading, errorType: $errorType)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$NotificationPermissionStateCopyWith<$Res> implements $NotificationPermissionStateCopyWith<$Res> {
+ factory _$NotificationPermissionStateCopyWith(_NotificationPermissionState value, $Res Function(_NotificationPermissionState) _then) = __$NotificationPermissionStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, ErrorType errorType
+});
+
+
+
+
+}
+/// @nodoc
+class __$NotificationPermissionStateCopyWithImpl<$Res>
+ implements _$NotificationPermissionStateCopyWith<$Res> {
+ __$NotificationPermissionStateCopyWithImpl(this._self, this._then);
+
+ final _NotificationPermissionState _self;
+ final $Res Function(_NotificationPermissionState) _then;
+
+/// Create a copy of NotificationPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? errorType = null,}) {
+ return _then(_NotificationPermissionState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,errorType: null == errorType ? _self.errorType : errorType // ignore: cast_nullable_to_non_nullable
+as ErrorType,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/comwell_key_app/lib/.generated/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.freezed.dart b/comwell_key_app/lib/.generated/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.freezed.dart
new file mode 100644
index 00000000..75486383
--- /dev/null
+++ b/comwell_key_app/lib/.generated/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.freezed.dart
@@ -0,0 +1,274 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// coverage:ignore-file
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of '../../../../../presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+// dart format off
+T _$identity<T>(T value) => value;
+/// @nodoc
+mixin _$UsageTrackingPermissionState {
+
+ bool get isLoading; UsageTrackingError get errorType;
+/// Create a copy of UsageTrackingPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+$UsageTrackingPermissionStateCopyWith<UsageTrackingPermissionState> get copyWith => _$UsageTrackingPermissionStateCopyWithImpl<UsageTrackingPermissionState>(this as UsageTrackingPermissionState, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is UsageTrackingPermissionState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorType, errorType) || other.errorType == errorType));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,errorType);
+
+@override
+String toString() {
+ return 'UsageTrackingPermissionState(isLoading: $isLoading, errorType: $errorType)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class $UsageTrackingPermissionStateCopyWith<$Res> {
+ factory $UsageTrackingPermissionStateCopyWith(UsageTrackingPermissionState value, $Res Function(UsageTrackingPermissionState) _then) = _$UsageTrackingPermissionStateCopyWithImpl;
+@useResult
+$Res call({
+ bool isLoading, UsageTrackingError errorType
+});
+
+
+
+
+}
+/// @nodoc
+class _$UsageTrackingPermissionStateCopyWithImpl<$Res>
+ implements $UsageTrackingPermissionStateCopyWith<$Res> {
+ _$UsageTrackingPermissionStateCopyWithImpl(this._self, this._then);
+
+ final UsageTrackingPermissionState _self;
+ final $Res Function(UsageTrackingPermissionState) _then;
+
+/// Create a copy of UsageTrackingPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? errorType = null,}) {
+ return _then(_self.copyWith(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,errorType: null == errorType ? _self.errorType : errorType // ignore: cast_nullable_to_non_nullable
+as UsageTrackingError,
+ ));
+}
+
+}
+
+
+/// Adds pattern-matching-related methods to [UsageTrackingPermissionState].
+extension UsageTrackingPermissionStatePatterns on UsageTrackingPermissionState {
+/// A variant of `map` that fallback to returning `orElse`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _UsageTrackingPermissionState value)? $default,{required TResult orElse(),}){
+final _that = this;
+switch (_that) {
+case _UsageTrackingPermissionState() when $default != null:
+return $default(_that);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// Callbacks receives the raw object, upcasted.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case final Subclass2 value:
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _UsageTrackingPermissionState value) $default,){
+final _that = this;
+switch (_that) {
+case _UsageTrackingPermissionState():
+return $default(_that);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `map` that fallback to returning `null`.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case final Subclass value:
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _UsageTrackingPermissionState value)? $default,){
+final _that = this;
+switch (_that) {
+case _UsageTrackingPermissionState() when $default != null:
+return $default(_that);case _:
+ return null;
+
+}
+}
+/// A variant of `when` that fallback to an `orElse` callback.
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return orElse();
+/// }
+/// ```
+
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, UsageTrackingError errorType)? $default,{required TResult orElse(),}) {final _that = this;
+switch (_that) {
+case _UsageTrackingPermissionState() when $default != null:
+return $default(_that.isLoading,_that.errorType);case _:
+ return orElse();
+
+}
+}
+/// A `switch`-like method, using callbacks.
+///
+/// As opposed to `map`, this offers destructuring.
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case Subclass2(:final field2):
+/// return ...;
+/// }
+/// ```
+
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, UsageTrackingError errorType) $default,) {final _that = this;
+switch (_that) {
+case _UsageTrackingPermissionState():
+return $default(_that.isLoading,_that.errorType);case _:
+ throw StateError('Unexpected subclass');
+
+}
+}
+/// A variant of `when` that fallback to returning `null`
+///
+/// It is equivalent to doing:
+/// ```dart
+/// switch (sealedClass) {
+/// case Subclass(:final field):
+/// return ...;
+/// case _:
+/// return null;
+/// }
+/// ```
+
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, UsageTrackingError errorType)? $default,) {final _that = this;
+switch (_that) {
+case _UsageTrackingPermissionState() when $default != null:
+return $default(_that.isLoading,_that.errorType);case _:
+ return null;
+
+}
+}
+
+}
+
+/// @nodoc
+
+
+class _UsageTrackingPermissionState implements UsageTrackingPermissionState {
+ const _UsageTrackingPermissionState({this.isLoading = false, this.errorType = UsageTrackingError.none});
+
+
+@override@JsonKey() final bool isLoading;
+@override@JsonKey() final UsageTrackingError errorType;
+
+/// Create a copy of UsageTrackingPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@override @JsonKey(includeFromJson: false, includeToJson: false)
+@pragma('vm:prefer-inline')
+_$UsageTrackingPermissionStateCopyWith<_UsageTrackingPermissionState> get copyWith => __$UsageTrackingPermissionStateCopyWithImpl<_UsageTrackingPermissionState>(this, _$identity);
+
+
+
+@override
+bool operator ==(Object other) {
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _UsageTrackingPermissionState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorType, errorType) || other.errorType == errorType));
+}
+
+
+@override
+int get hashCode => Object.hash(runtimeType,isLoading,errorType);
+
+@override
+String toString() {
+ return 'UsageTrackingPermissionState(isLoading: $isLoading, errorType: $errorType)';
+}
+
+
+}
+
+/// @nodoc
+abstract mixin class _$UsageTrackingPermissionStateCopyWith<$Res> implements $UsageTrackingPermissionStateCopyWith<$Res> {
+ factory _$UsageTrackingPermissionStateCopyWith(_UsageTrackingPermissionState value, $Res Function(_UsageTrackingPermissionState) _then) = __$UsageTrackingPermissionStateCopyWithImpl;
+@override @useResult
+$Res call({
+ bool isLoading, UsageTrackingError errorType
+});
+
+
+
+
+}
+/// @nodoc
+class __$UsageTrackingPermissionStateCopyWithImpl<$Res>
+ implements _$UsageTrackingPermissionStateCopyWith<$Res> {
+ __$UsageTrackingPermissionStateCopyWithImpl(this._self, this._then);
+
+ final _UsageTrackingPermissionState _self;
+ final $Res Function(_UsageTrackingPermissionState) _then;
+
+/// Create a copy of UsageTrackingPermissionState
+/// with the given fields replaced by the non-null parameter values.
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? errorType = null,}) {
+ return _then(_UsageTrackingPermissionState(
+isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
+as bool,errorType: null == errorType ? _self.errorType : errorType // ignore: cast_nullable_to_non_nullable
+as UsageTrackingError,
+ ));
+}
+
+
+}
+
+// dart format on
diff --git a/comwell_key_app/lib/.generated/services/models/booking_dto.g.dart b/comwell_key_app/lib/.generated/services/models/booking_dto.g.dart
index aa55aa6a..af22c29a 100644
--- a/comwell_key_app/lib/.generated/services/models/booking_dto.g.dart
+++ b/comwell_key_app/lib/.generated/services/models/booking_dto.g.dart
@@ -7,35 +7,36 @@ part of '../../../services/models/booking_dto.dart';
// **************************************************************************
BookingDTO _$BookingDTOFromJson(Map json) => BookingDTO(
- roomNumber: json['roomNumber'] as String?,
- hotelCode: json['hotelCode'] as String,
- firstName: json['firstName'] as String,
- lastName: json['lastName'] as String,
- bookerFirstName: json['bookerFirstName'] as String? ?? '',
- bookerLastName: json['bookerLastName'] as String? ?? '',
- guests: (json['guests'] as List<dynamic>?)
- ?.map(
- (e) => GuestDTO.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList() ??
- const [],
- confirmationNumber: json['confirmationNumber'] as String,
- dayIn: json['dayIn'] as String,
- dayOut: json['dayOut'] as String,
- cancelTime: json['cancelTime'] as String?,
- status: json['status'] as String,
- isCancelled: json['isCancelled'] as bool?,
- bookTime: json['bookTime'] as String?,
- roomType: json['roomType'] as String?,
- adults: (json['adults'] as num).toInt(),
- children: (json['children'] as num).toInt(),
- balance: json['balance'] as num?,
- isPrimaryGuest: json['isPrimaryGuest'] as bool,
- addOnItems: (json['addOnItems'] as List<dynamic>?)
- ?.map((e) =>
- BookingAddonItem.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList(),
- maskedCardNumber: json['maskedCardNumber'] as String?,
- );
+ roomNumber: json['roomNumber'] as String?,
+ hotelCode: json['hotelCode'] as String,
+ firstName: json['firstName'] as String,
+ lastName: json['lastName'] as String,
+ bookerFirstName: json['bookerFirstName'] as String? ?? '',
+ bookerLastName: json['bookerLastName'] as String? ?? '',
+ guests:
+ (json['guests'] as List<dynamic>?)
+ ?.map((e) => GuestDTO.fromJson(Map<String, dynamic>.from(e as Map)))
+ .toList() ??
+ const [],
+ confirmationNumber: json['confirmationNumber'] as String,
+ dayIn: json['dayIn'] as String,
+ dayOut: json['dayOut'] as String,
+ cancelTime: json['cancelTime'] as String?,
+ status: json['status'] as String,
+ isCancelled: json['isCancelled'] as bool?,
+ bookTime: json['bookTime'] as String?,
+ roomType: json['roomType'] as String?,
+ adults: (json['adults'] as num).toInt(),
+ children: (json['children'] as num).toInt(),
+ balance: json['balance'] as num?,
+ isPrimaryGuest: json['isPrimaryGuest'] as bool,
+ addOnItems: (json['addOnItems'] as List<dynamic>?)
+ ?.map(
+ (e) => BookingAddonItem.fromJson(Map<String, dynamic>.from(e as Map)),
+ )
+ .toList(),
+ maskedCardNumber: json['maskedCardNumber'] as String?,
+);
Map<String, dynamic> _$BookingDTOToJson(BookingDTO instance) =>
<String, dynamic>{
@@ -63,23 +64,23 @@ Map<String, dynamic> _$BookingDTOToJson(BookingDTO instance) =>
};
GuestDTO _$GuestDTOFromJson(Map json) => GuestDTO(
- id: (json['id'] as num).toInt(),
- firstName: json['firstName'] as String,
- lastName: json['lastName'] as String,
- );
+ id: (json['id'] as num).toInt(),
+ firstName: json['firstName'] as String,
+ lastName: json['lastName'] as String,
+);
Map<String, dynamic> _$GuestDTOToJson(GuestDTO instance) => <String, dynamic>{
- 'id': instance.id,
- 'firstName': instance.firstName,
- 'lastName': instance.lastName,
- };
+ 'id': instance.id,
+ 'firstName': instance.firstName,
+ 'lastName': instance.lastName,
+};
BookingAddonItem _$BookingAddonItemFromJson(Map json) => BookingAddonItem(
- json['code'] as String,
- json['description'] as String,
- (json['quantity'] as num).toInt(),
- (json['price'] as num).toInt(),
- );
+ json['code'] as String,
+ json['description'] as String,
+ (json['quantity'] as num).toInt(),
+ (json['price'] as num).toInt(),
+);
Map<String, dynamic> _$BookingAddonItemToJson(BookingAddonItem instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/services/models/bookings_dto.g.dart b/comwell_key_app/lib/.generated/services/models/bookings_dto.g.dart
index 68206099..a3e163a5 100644
--- a/comwell_key_app/lib/.generated/services/models/bookings_dto.g.dart
+++ b/comwell_key_app/lib/.generated/services/models/bookings_dto.g.dart
@@ -7,13 +7,16 @@ part of '../../../services/models/bookings_dto.dart';
// **************************************************************************
BookingsDTO _$BookingsDTOFromJson(Map json) => BookingsDTO(
- current: (json['current'] as List<dynamic>)
- .map((e) => BookingDTO.fromJson(Map<String, dynamic>.from(e as Map))),
- past: (json['past'] as List<dynamic>)
- .map((e) => BookingDTO.fromJson(Map<String, dynamic>.from(e as Map))),
- cancelled: (json['cancelled'] as List<dynamic>)
- .map((e) => BookingDTO.fromJson(Map<String, dynamic>.from(e as Map))),
- );
+ current: (json['current'] as List<dynamic>).map(
+ (e) => BookingDTO.fromJson(Map<String, dynamic>.from(e as Map)),
+ ),
+ past: (json['past'] as List<dynamic>).map(
+ (e) => BookingDTO.fromJson(Map<String, dynamic>.from(e as Map)),
+ ),
+ cancelled: (json['cancelled'] as List<dynamic>).map(
+ (e) => BookingDTO.fromJson(Map<String, dynamic>.from(e as Map)),
+ ),
+);
Map<String, dynamic> _$BookingsDTOToJson(BookingsDTO instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/services/models/room_dto.g.dart b/comwell_key_app/lib/.generated/services/models/room_dto.g.dart
index b24e1378..d0d69cec 100644
--- a/comwell_key_app/lib/.generated/services/models/room_dto.g.dart
+++ b/comwell_key_app/lib/.generated/services/models/room_dto.g.dart
@@ -7,23 +7,22 @@ part of '../../../services/models/room_dto.dart';
// **************************************************************************
RoomDto _$RoomDtoFromJson(Map json) => RoomDto(
- confirmationNumber: json['confirmationNumber'] as String,
- assignedTo: json['assignedTo'] as String?,
- name: json['name'] as String,
- description: json['description'] as String,
- guests: (json['guests'] as num).toInt(),
- imageAssets:
- (json['imageAssets'] as List<dynamic>?)?.map((e) => e as String) ??
- [],
- tags: (json['tags'] as List<dynamic>?)?.map((e) => e as String) ?? [],
- );
+ confirmationNumber: json['confirmationNumber'] as String,
+ assignedTo: json['assignedTo'] as String?,
+ name: json['name'] as String,
+ description: json['description'] as String,
+ guests: (json['guests'] as num).toInt(),
+ imageAssets:
+ (json['imageAssets'] as List<dynamic>?)?.map((e) => e as String) ?? [],
+ tags: (json['tags'] as List<dynamic>?)?.map((e) => e as String) ?? [],
+);
Map<String, dynamic> _$RoomDtoToJson(RoomDto instance) => <String, dynamic>{
- 'confirmationNumber': instance.confirmationNumber,
- 'assignedTo': instance.assignedTo,
- 'name': instance.name,
- 'description': instance.description,
- 'guests': instance.guests,
- 'imageAssets': instance.imageAssets.toList(),
- 'tags': instance.tags.toList(),
- };
+ 'confirmationNumber': instance.confirmationNumber,
+ 'assignedTo': instance.assignedTo,
+ 'name': instance.name,
+ 'description': instance.description,
+ 'guests': instance.guests,
+ 'imageAssets': instance.imageAssets.toList(),
+ 'tags': instance.tags.toList(),
+};
diff --git a/comwell_key_app/lib/.generated/services/models/user_dto.g.dart b/comwell_key_app/lib/.generated/services/models/user_dto.g.dart
index 35682a59..336320f7 100644
--- a/comwell_key_app/lib/.generated/services/models/user_dto.g.dart
+++ b/comwell_key_app/lib/.generated/services/models/user_dto.g.dart
@@ -7,70 +7,71 @@ part of '../../../services/models/user_dto.dart';
// **************************************************************************
UserDto _$UserDtoFromJson(Map json) => UserDto(
- id: (json['id'] as num).toInt(),
- userId: json['userId'] as String? ?? '',
- hmsId: json['hmsId'] as String?,
- firstName: json['firstName'] as String,
- lastName: json['lastName'] as String,
- email: json['email'] as String,
- emailVerified: json['emailVerified'] as bool,
- isClubMember: json['isClubMember'] as bool,
- birthDate: json['birthDate'] == null
- ? null
- : DateTime.parse(json['birthDate'] as String),
- createDate: json['createDate'] == null
- ? null
- : DateTime.parse(json['createDate'] as String),
- companyId: json['companyId'] as String?,
- companyName: json['companyName'] as String?,
- symplifyId: json['symplifyId'] as String?,
- phoneNumber: json['phoneNumber'] as String? ?? '',
- gender: json['gender'] as String?,
- addressStreet: json['addressStreet'] as String? ?? '',
- addressZip: json['addressZip'] as String? ?? '',
- addressCity: json['addressCity'] as String? ?? '',
- addressCountry: json['addressCountry'] as String? ?? '',
- points: (json['points'] as num).toInt(),
- signUpDate: json['signUpDate'] == null
- ? null
- : DateTime.parse(json['signUpDate'] as String),
- signUpCampaign: json['signUpCampaign'] as String?,
- signUpSource: json['signUpSource'] as String?,
- locale: json['locale'] as String? ?? '',
- wasRecentlyCreated: json['wasRecentlyCreated'] as bool,
- permissions: json['permissions'] == null
- ? null
- : UserPermissions.fromJson(
- Map<String, dynamic>.from(json['permissions'] as Map)),
- nationality: json['nationality'] as String?,
- );
+ id: (json['id'] as num).toInt(),
+ userId: json['userId'] as String? ?? '',
+ hmsId: json['hmsId'] as String?,
+ firstName: json['firstName'] as String,
+ lastName: json['lastName'] as String,
+ email: json['email'] as String,
+ emailVerified: json['emailVerified'] as bool,
+ isClubMember: json['isClubMember'] as bool,
+ birthDate: json['birthDate'] == null
+ ? null
+ : DateTime.parse(json['birthDate'] as String),
+ createDate: json['createDate'] == null
+ ? null
+ : DateTime.parse(json['createDate'] as String),
+ companyId: json['companyId'] as String?,
+ companyName: json['companyName'] as String?,
+ symplifyId: json['symplifyId'] as String?,
+ phoneNumber: json['phoneNumber'] as String? ?? '',
+ gender: json['gender'] as String?,
+ addressStreet: json['addressStreet'] as String? ?? '',
+ addressZip: json['addressZip'] as String? ?? '',
+ addressCity: json['addressCity'] as String? ?? '',
+ addressCountry: json['addressCountry'] as String? ?? '',
+ points: (json['points'] as num).toInt(),
+ signUpDate: json['signUpDate'] == null
+ ? null
+ : DateTime.parse(json['signUpDate'] as String),
+ signUpCampaign: json['signUpCampaign'] as String?,
+ signUpSource: json['signUpSource'] as String?,
+ locale: json['locale'] as String? ?? '',
+ wasRecentlyCreated: json['wasRecentlyCreated'] as bool,
+ permissions: json['permissions'] == null
+ ? null
+ : UserPermissions.fromJson(
+ Map<String, dynamic>.from(json['permissions'] as Map),
+ ),
+ nationality: json['nationality'] as String?,
+);
Map<String, dynamic> _$UserDtoToJson(UserDto instance) => <String, dynamic>{
- 'id': instance.id,
- 'userId': instance.userId,
- 'hmsId': instance.hmsId,
- 'firstName': instance.firstName,
- 'lastName': instance.lastName,
- 'email': instance.email,
- 'emailVerified': instance.emailVerified,
- 'isClubMember': instance.isClubMember,
- 'birthDate': instance.birthDate?.toIso8601String(),
- 'createDate': instance.createDate?.toIso8601String(),
- 'companyId': instance.companyId,
- 'companyName': instance.companyName,
- 'symplifyId': instance.symplifyId,
- 'phoneNumber': instance.phoneNumber,
- 'gender': instance.gender,
- 'addressStreet': instance.addressStreet,
- 'addressZip': instance.addressZip,
- 'addressCity': instance.addressCity,
- 'addressCountry': instance.addressCountry,
- 'points': instance.points,
- 'signUpDate': instance.signUpDate?.toIso8601String(),
- 'signUpCampaign': instance.signUpCampaign,
- 'signUpSource': instance.signUpSource,
- 'locale': instance.locale,
- 'wasRecentlyCreated': instance.wasRecentlyCreated,
- 'permissions': instance.permissions?.toJson(),
- 'nationality': instance.nationality,
- };
+ 'id': instance.id,
+ 'userId': instance.userId,
+ 'hmsId': instance.hmsId,
+ 'firstName': instance.firstName,
+ 'lastName': instance.lastName,
+ 'email': instance.email,
+ 'emailVerified': instance.emailVerified,
+ 'isClubMember': instance.isClubMember,
+ 'birthDate': instance.birthDate?.toIso8601String(),
+ 'createDate': instance.createDate?.toIso8601String(),
+ 'companyId': instance.companyId,
+ 'companyName': instance.companyName,
+ 'symplifyId': instance.symplifyId,
+ 'phoneNumber': instance.phoneNumber,
+ 'gender': instance.gender,
+ 'addressStreet': instance.addressStreet,
+ 'addressZip': instance.addressZip,
+ 'addressCity': instance.addressCity,
+ 'addressCountry': instance.addressCountry,
+ 'points': instance.points,
+ 'signUpDate': instance.signUpDate?.toIso8601String(),
+ 'signUpCampaign': instance.signUpCampaign,
+ 'signUpSource': instance.signUpSource,
+ 'locale': instance.locale,
+ 'wasRecentlyCreated': instance.wasRecentlyCreated,
+ 'permissions': instance.permissions?.toJson(),
+ 'nationality': instance.nationality,
+};
diff --git a/comwell_key_app/lib/.generated/services/models/user_permissions.g.dart b/comwell_key_app/lib/.generated/services/models/user_permissions.g.dart
index b54d001c..052eefed 100644
--- a/comwell_key_app/lib/.generated/services/models/user_permissions.g.dart
+++ b/comwell_key_app/lib/.generated/services/models/user_permissions.g.dart
@@ -7,11 +7,11 @@ part of '../../../services/models/user_permissions.dart';
// **************************************************************************
UserPermissions _$UserPermissionsFromJson(Map json) => UserPermissions(
- guestOptIn1: json['GuestOptIn1'] as bool? ?? false,
- guestOptIn2: json['GuestOptIn2'] as bool? ?? false,
- guestOptIn3: json['GuestOptIn3'] as bool? ?? false,
- guestOptIn4: json['GuestOptIn4'] as bool? ?? false,
- );
+ guestOptIn1: json['GuestOptIn1'] as bool? ?? false,
+ guestOptIn2: json['GuestOptIn2'] as bool? ?? false,
+ guestOptIn3: json['GuestOptIn3'] as bool? ?? false,
+ guestOptIn4: json['GuestOptIn4'] as bool? ?? false,
+);
Map<String, dynamic> _$UserPermissionsToJson(UserPermissions instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/tracking/models/analytics_event_item.g.dart b/comwell_key_app/lib/.generated/tracking/models/analytics_event_item.g.dart
index 77ecfb12..58643703 100644
--- a/comwell_key_app/lib/.generated/tracking/models/analytics_event_item.g.dart
+++ b/comwell_key_app/lib/.generated/tracking/models/analytics_event_item.g.dart
@@ -7,16 +7,16 @@ part of '../../../tracking/models/analytics_event_item.dart';
// **************************************************************************
AnalyticsEventItem _$AnalyticsEventItemFromJson(Map json) => AnalyticsEventItem(
- hotelName: json['hotelName'] as String,
- currency: json['currency'] as String,
- value: json['value'] as num,
- placement: json['placement'] as String,
- items: (json['items'] as List<dynamic>).map((e) => e as String),
- itemId: json['itemId'] as String,
- itemName: json['itemName'] as String,
- price: json['price'] as num,
- quantity: json['quantity'] as num,
- );
+ hotelName: json['hotelName'] as String,
+ currency: json['currency'] as String,
+ value: json['value'] as num,
+ placement: json['placement'] as String,
+ items: (json['items'] as List<dynamic>).map((e) => e as String),
+ itemId: json['itemId'] as String,
+ itemName: json['itemName'] as String,
+ price: json['price'] as num,
+ quantity: json['quantity'] as num,
+);
Map<String, dynamic> _$AnalyticsEventItemToJson(AnalyticsEventItem instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/up_sales/models/addon_list.g.dart b/comwell_key_app/lib/.generated/up_sales/models/addon_list.g.dart
index ee7b0f8f..0c211899 100644
--- a/comwell_key_app/lib/.generated/up_sales/models/addon_list.g.dart
+++ b/comwell_key_app/lib/.generated/up_sales/models/addon_list.g.dart
@@ -7,11 +7,11 @@ part of '../../../up_sales/models/addon_list.dart';
// **************************************************************************
AddOnList _$AddOnListFromJson(Map json) => AddOnList(
- itemCode: json['itemCode'] as String,
- quantity: (json['quantity'] as num).toInt(),
- );
+ itemCode: json['itemCode'] as String,
+ quantity: (json['quantity'] as num).toInt(),
+);
Map<String, dynamic> _$AddOnListToJson(AddOnList instance) => <String, dynamic>{
- 'itemCode': instance.itemCode,
- 'quantity': instance.quantity,
- };
+ 'itemCode': instance.itemCode,
+ 'quantity': instance.quantity,
+};
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 ce02291d..34a4cb40 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
@@ -7,19 +7,19 @@ part of '../../../../up_sales/models/dto/addon_upgrade_dto.dart';
// **************************************************************************
AddOnUpgradeDTO _$AddOnUpgradeDTOFromJson(Map json) => AddOnUpgradeDTO(
- id: json['id'] as String,
- name: json['name'] as String,
- 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),
- description: json['description'] as String,
- quantity: (json['quantity'] as num?)?.toInt() ?? 0,
- isService: json['isService'] as bool? ?? false,
- isPopular: json['isPopular'] as bool? ?? false,
- onlyAvailableBeforeCheckin:
- json['onlyAvailableBeforeCheckin'] as bool? ?? false,
- );
+ id: json['id'] as String,
+ name: json['name'] as String,
+ 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),
+ description: json['description'] as String,
+ quantity: (json['quantity'] as num?)?.toInt() ?? 0,
+ isService: json['isService'] as bool? ?? false,
+ isPopular: json['isPopular'] as bool? ?? false,
+ onlyAvailableBeforeCheckin:
+ json['onlyAvailableBeforeCheckin'] as bool? ?? false,
+);
Map<String, dynamic> _$AddOnUpgradeDTOToJson(AddOnUpgradeDTO instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/up_sales/models/dto/room_upgrade_dto.g.dart b/comwell_key_app/lib/.generated/up_sales/models/dto/room_upgrade_dto.g.dart
index 7eba7335..85841276 100644
--- a/comwell_key_app/lib/.generated/up_sales/models/dto/room_upgrade_dto.g.dart
+++ b/comwell_key_app/lib/.generated/up_sales/models/dto/room_upgrade_dto.g.dart
@@ -7,19 +7,18 @@ part of '../../../../up_sales/models/dto/room_upgrade_dto.dart';
// **************************************************************************
RoomUpgradeDTO _$RoomUpgradeDTOFromJson(Map json) => RoomUpgradeDTO(
- id: json['id'] as String,
- name: json['name'] as String,
- price: (json['price'] as num).toInt(),
- images: (json['images'] as List<dynamic>).map((e) => e as String),
- description: json['description'] as String,
- currency: json['currency'] as String,
- quantity: (json['quantity'] as num?)?.toInt(),
- facilityTypes: (json['facilityTypes'] as List<dynamic>)
- .map(
- (e) => FacilityType.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList(),
- roomSize: (json['roomSize'] as num).toInt(),
- );
+ id: json['id'] as String,
+ name: json['name'] as String,
+ price: (json['price'] as num).toInt(),
+ images: (json['images'] as List<dynamic>).map((e) => e as String),
+ description: json['description'] as String,
+ currency: json['currency'] as String,
+ quantity: (json['quantity'] as num?)?.toInt(),
+ facilityTypes: (json['facilityTypes'] as List<dynamic>)
+ .map((e) => FacilityType.fromJson(Map<String, dynamic>.from(e as Map)))
+ .toList(),
+ roomSize: (json['roomSize'] as num).toInt(),
+);
Map<String, dynamic> _$RoomUpgradeDTOToJson(RoomUpgradeDTO instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/up_sales/models/dto/up_sales_dto.g.dart b/comwell_key_app/lib/.generated/up_sales/models/dto/up_sales_dto.g.dart
index d5b89870..99e9f5b8 100644
--- a/comwell_key_app/lib/.generated/up_sales/models/dto/up_sales_dto.g.dart
+++ b/comwell_key_app/lib/.generated/up_sales/models/dto/up_sales_dto.g.dart
@@ -7,19 +7,24 @@ part of '../../../../up_sales/models/dto/up_sales_dto.dart';
// **************************************************************************
UpSalesDTO _$UpSalesDTOFromJson(Map json) => UpSalesDTO(
- property: json['property'] as String,
- confirmationNumber: json['confirmationNumber'] as String,
- roomUpgrades: (json['roomUpgrades'] as List<dynamic>?)
- ?.map((e) =>
- RoomUpgradeDTO.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList() ??
- [],
- addOnUpgrades: (json['addonUpgrades'] as List<dynamic>?)
- ?.map((e) =>
- AddOnUpgradeDTO.fromJson(Map<String, dynamic>.from(e as Map)))
- .toList() ??
- [],
- );
+ property: json['property'] as String,
+ confirmationNumber: json['confirmationNumber'] as String,
+ roomUpgrades:
+ (json['roomUpgrades'] as List<dynamic>?)
+ ?.map(
+ (e) => RoomUpgradeDTO.fromJson(Map<String, dynamic>.from(e as Map)),
+ )
+ .toList() ??
+ [],
+ addOnUpgrades:
+ (json['addonUpgrades'] as List<dynamic>?)
+ ?.map(
+ (e) =>
+ AddOnUpgradeDTO.fromJson(Map<String, dynamic>.from(e as Map)),
+ )
+ .toList() ??
+ [],
+);
Map<String, dynamic> _$UpSalesDTOToJson(UpSalesDTO instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/.generated/up_sales/models/facility_type.g.dart b/comwell_key_app/lib/.generated/up_sales/models/facility_type.g.dart
index e1fd0e6b..24ec311a 100644
--- a/comwell_key_app/lib/.generated/up_sales/models/facility_type.g.dart
+++ b/comwell_key_app/lib/.generated/up_sales/models/facility_type.g.dart
@@ -7,10 +7,10 @@ part of '../../../up_sales/models/facility_type.dart';
// **************************************************************************
FacilityType _$FacilityTypeFromJson(Map json) => FacilityType(
- name: json['name'] as String,
- icon: json['icon'] as String,
- groupName: json['groupName'] as String,
- );
+ name: json['name'] as String,
+ icon: json['icon'] as String,
+ groupName: json['groupName'] as String,
+);
Map<String, dynamic> _$FacilityTypeToJson(FacilityType instance) =>
<String, dynamic>{
diff --git a/comwell_key_app/lib/authentication/authentication_repository.dart b/comwell_key_app/lib/authentication/authentication_repository.dart
index f2ad620d..63a69092 100644
--- a/comwell_key_app/lib/authentication/authentication_repository.dart
+++ b/comwell_key_app/lib/authentication/authentication_repository.dart
@@ -1,9 +1,11 @@
import 'dart:async';
+import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
import 'package:comwell_key_app/authentication/enum/authentication_status.dart';
import 'package:comwell_key_app/database/comwell_db.dart';
import 'package:comwell_key_app/services/api.dart';
import 'package:comwell_key_app/tracking/comwell_tracking.dart';
+import 'package:comwell_key_app/utils/env_utils.dart';
import 'package:comwell_key_app/utils/secure_storage.dart';
import 'package:comwell_key_app/common/const.dart' as constants;
import 'package:firebase_analytics/firebase_analytics.dart';
@@ -26,36 +28,37 @@ class AuthenticationRepository {
late final String configFilePath;
late final String authorityUrl;
late final MultipleAccountPca msAuth;
- final scopes = dotenv.env['ENTRA_API_URL']!.split(',');
+ final scopes = dotenv.ENTRA_API_URL.split(',');
Future<void> init() async {
- final clientId = dotenv.env["ENTRA_ID_CLIENT_ID"]!;
- final redirect = dotenv.env["ENTRA_ID_REDIRECT_URL"]!;
+ final clientId = dotenv.ENTRA_ID_CLIENT_ID;
+ final redirect = dotenv.ENTRA_ID_REDIRECT_URL;
switch (appFlavor?.toLowerCase()) {
case "develop":
- configFilePath = 'assets/msal/msal_config_dev.json';
- authorityUrl = dotenv.env["ENTRA_ID_AUTHORITY_URL"]!;
+ configFilePath = Assets.msal.msalConfigDev;
+ authorityUrl = dotenv.ENTRA_ID_AUTHORITY_URL;
case "stage":
- configFilePath = 'assets/msal/msal_config_stage.json';
- authorityUrl = dotenv.env["ENTRA_ID_AUTHORITY_URL"]!;
+ configFilePath = Assets.msal.msalConfigStage;
+ authorityUrl = dotenv.ENTRA_ID_AUTHORITY_URL;
case "prod":
- configFilePath = 'assets/msal/msal_config_prod.json';
- authorityUrl = dotenv.env["ENTRA_ID_AUTHORITY_URL"]!;
+ configFilePath = Assets.msal.msalConfigProd;
+ authorityUrl = dotenv.ENTRA_ID_AUTHORITY_URL;
default:
throw Exception("Missing config file for flavor $appFlavor");
}
msAuth = await MultipleAccountPca.create(
- clientId: clientId,
- androidConfig: AndroidConfig(
- configFilePath: configFilePath,
- redirectUri: redirect,
- ),
- appleConfig: AppleConfig(
- authorityType: AuthorityType.b2c,
- broker: Broker.webView,
- authority: authorityUrl,
- ));
+ clientId: clientId,
+ androidConfig: AndroidConfig(
+ configFilePath: configFilePath,
+ redirectUri: redirect,
+ ),
+ appleConfig: AppleConfig(
+ authorityType: AuthorityType.b2c,
+ broker: Broker.webView,
+ authority: authorityUrl,
+ ),
+ );
}
AuthenticationRepository() {
@@ -85,6 +88,12 @@ class AuthenticationRepository {
}
}
+ Future<bool> isLoggedIn() async {
+ final token = await secureStorage.read(constants.accessToken);
+ if (token == null) return false;
+ return token.isNotEmpty;
+ }
+
Future<void> logIn() async {
await FirebaseAnalytics.instance.logLogin();
await FirebaseAnalytics.instance.setUserProperty(
@@ -97,11 +106,11 @@ class AuthenticationRepository {
} catch (e) {
// no op
}
-
+
// Emit status and trigger side effects
_emitStatus(AuthenticationStatus.authenticated);
}
-
+
void _emitStatus(AuthenticationStatus status) {
_controller.sink.add(status);
_onAuthResult(status);
@@ -121,7 +130,7 @@ class AuthenticationRepository {
// Clear local storage (including cipher key) after database is deleted
await secureStorage.deleteAll();
-
+
// await msAuth.removeAccount();
// Track the logout event
@@ -132,9 +141,9 @@ class AuthenticationRepository {
);
// Update authentication status
- _emitStatus(forced
- ? AuthenticationStatus.forcedUnauthenticated
- : AuthenticationStatus.unauthenticated);
+ _emitStatus(
+ forced ? AuthenticationStatus.forcedUnauthenticated : AuthenticationStatus.unauthenticated,
+ );
} catch (e) {
debugPrint("Error during logout: $e");
// Even if logout fails, still clear local data and update status
@@ -145,9 +154,9 @@ class AuthenticationRepository {
}
await secureStorage.deleteAll();
- _emitStatus(forced
- ? AuthenticationStatus.forcedUnauthenticated
- : AuthenticationStatus.unauthenticated);
+ _emitStatus(
+ forced ? AuthenticationStatus.forcedUnauthenticated : AuthenticationStatus.unauthenticated,
+ );
}
}
@@ -156,7 +165,6 @@ class AuthenticationRepository {
Future<void> openAuth(Prompt prompt) async {
try {
final token = await msAuth.acquireToken(scopes: scopes, prompt: prompt);
-
await loginWithCode(token);
} catch (e) {
debugPrint("qqq e=$e");
@@ -183,8 +191,7 @@ class AuthenticationRepository {
Future<void> loginWithCode(AuthenticationResult code) async {
await secureStorage.write(constants.accessToken, code.accessToken);
await secureStorage.write(constants.identifier, code.account.id);
- await secureStorage.write(
- constants.correlationId, code.correlationId ?? '');
+ await secureStorage.write(constants.correlationId, code.correlationId ?? '');
await logIn();
}
@@ -197,9 +204,7 @@ class AuthenticationRepository {
}
// If no stored token, try to get a fresh one silently
- return (await msAuth.acquireTokenSilent(
- scopes: scopes, authority: authorityUrl))
- .accessToken;
+ return (await msAuth.acquireTokenSilent(scopes: scopes, authority: authorityUrl)).accessToken;
} catch (e) {
throw Exception('No valid access token available');
}
diff --git a/comwell_key_app/lib/base/base_cubit.dart b/comwell_key_app/lib/base/base_cubit.dart
new file mode 100644
index 00000000..62ee6d2f
--- /dev/null
+++ b/comwell_key_app/lib/base/base_cubit.dart
@@ -0,0 +1,18 @@
+import 'package:bloc/bloc.dart';
+import 'package:flutter/foundation.dart';
+
+abstract class BaseCubit<T> extends Cubit<T> {
+ BaseCubit(super.initialState);
+
+ void safeEmit(T state) {
+ if (isClosed) return;
+ emit(state);
+ }
+
+ void logError(Object err, StackTrace st) {
+ if (kDebugMode) {
+ print("qqq err=$err");
+ print("qqq st=$st");
+ }
+ }
+}
diff --git a/comwell_key_app/lib/common/components/comwell_app_bar.dart b/comwell_key_app/lib/common/components/comwell_app_bar.dart
index 6e8d6201..570ce46a 100644
--- a/comwell_key_app/lib/common/components/comwell_app_bar.dart
+++ b/comwell_key_app/lib/common/components/comwell_app_bar.dart
@@ -51,13 +51,13 @@ class ComwellAppBar extends StatelessWidget implements PreferredSizeWidget {
if (goRouter.canPop()) {
context.pop();
} else {
- context.goNamed(AppRoutes.overview.name);
+ context.go(AppRoutes.overview);
}
}
} catch (e) {
// Fallback to navigation to overview if pop fails
if (context.mounted) {
- context.goNamed(AppRoutes.overview.name);
+ context.go(AppRoutes.overview);
}
}
}
diff --git a/comwell_key_app/lib/comwell_app.dart b/comwell_key_app/lib/comwell_app.dart
index 15c31936..00177b4d 100644
--- a/comwell_key_app/lib/comwell_app.dart
+++ b/comwell_key_app/lib/comwell_app.dart
@@ -1,14 +1,16 @@
import 'package:comwell_key_app/authentication/authentication_repository.dart';
import 'package:comwell_key_app/booking_details/booking_details_repository.dart';
+import 'package:comwell_key_app/connection_state/connection_state_cubit.dart';
import 'package:comwell_key_app/key/bloc/key_bloc.dart';
import 'package:comwell_key_app/key/repository/key_repository.dart';
import 'package:comwell_key_app/overview/cubit/overview_cubit.dart';
-import 'package:comwell_key_app/overview/repository/overview_repository.dart';
import 'package:comwell_key_app/profile/cubit/profile_cubit.dart';
import 'package:comwell_key_app/profile/profile_repository.dart';
import 'package:comwell_key_app/profile_settings/cubit/profile_settings_cubit.dart';
import 'package:comwell_key_app/profile_settings/repostiory/profile_settings_repository.dart';
import 'package:comwell_key_app/routing/app_router.dart';
+import 'package:comwell_key_app/themes/app_button_styles.dart';
+import 'package:comwell_key_app/themes/app_textstyles.dart';
import 'package:comwell_key_app/themes/dark_theme.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:comwell_key_app/utils/locator.dart';
@@ -25,54 +27,75 @@ class ComwellApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return MultiBlocProvider(
- providers: blocProviderList,
- child: MaterialApp.router(
- title: 'Comwell Key App',
- routerConfig: router,
- localizationsDelegates: context.localizationDelegates,
- supportedLocales: context.supportedLocales,
- locale: context.locale,
- theme: lightTheme,
- darkTheme: darkTheme,
- themeMode: ThemeMode.system,
+ return MultiRepositoryProvider(
+ providers: [
+ RepositoryProvider(create: (context) => lightTheme),
+ RepositoryProvider(create: (context) => AppTextStyles()),
+ RepositoryProvider(
+ create: (context) {
+ final theme = Theme.of(context);
+ return AppButtonStyles(theme.colorScheme, context.read());
+ },
+ ),
+ ],
+ child: MultiBlocProvider(
+ providers: [
+ BlocProvider(
+ create: (context) => ConnectionStateCubit(
+ locator.get(),
+ locator.get(),
+ ),
+ ),
+ BlocProvider<KeyBloc>(
+ lazy: true,
+ create: (BuildContext context) => KeyBloc(
+ keyRepository: locator<KeyRepository>(),
+ seosRepository: locator<SeosRepository>(),
+ bookingDetailsRepository: locator<BookingDetailsRepository>(),
+ ),
+ ),
+ BlocProvider<OverviewCubit>(
+ lazy: true,
+ create: (BuildContext context) => OverviewCubit(
+ locator.get(),
+ locator.get(),
+ ),
+ ),
+ BlocProvider<ProfileCubit>(
+ lazy: false,
+ create: (BuildContext context) => ProfileCubit(
+ profileRepository: locator<ProfileRepository>(),
+ authenticationRepository: locator<AuthenticationRepository>(),
+ ),
+ ),
+ BlocProvider<ProfileSettingsCubit>(
+ lazy: false,
+ create: (BuildContext context) => ProfileSettingsCubit(
+ profileRepository: locator<ProfileRepository>(),
+ profileSettingsRepository: locator<ProfileSettingsRepository>(),
+ authenticationRepository: locator<AuthenticationRepository>(),
+ ),
+ ),
+ BlocProvider<PaymentCubit>(
+ lazy: false,
+ create: (context) => PaymentCubit(adyenRepository: locator<AdyenRepository>()),
+ ),
+ BlocProvider<PaymentCardsCubit>(
+ lazy: false,
+ create: (context) => PaymentCardsCubit(adyenRepository: locator<AdyenRepository>()),
+ ),
+ ],
+ child: MaterialApp.router(
+ title: 'Comwell Key App',
+ routerConfig: router,
+ localizationsDelegates: context.localizationDelegates,
+ supportedLocales: context.supportedLocales,
+ locale: context.locale,
+ theme: lightTheme,
+ darkTheme: darkTheme,
+ themeMode: ThemeMode.system,
+ ),
),
);
}
}
-
-final List<BlocProvider> blocProviderList = [
- BlocProvider<KeyBloc>(
- lazy: true,
- create: (BuildContext context) => KeyBloc(
- keyRepository: locator<KeyRepository>(),
- seosRepository: locator<SeosRepository>(),
- bookingDetailsRepository: locator<BookingDetailsRepository>()),
- ),
- BlocProvider<OverviewCubit>(
- lazy: true,
- create: (BuildContext context) =>
- OverviewCubit(locator<OverviewRepository>()),
- ),
- BlocProvider<ProfileCubit>(
- lazy: false,
- create: (BuildContext context) => ProfileCubit(
- profileRepository: locator<ProfileRepository>(),
- authenticationRepository: locator<AuthenticationRepository>()),
- ),
- BlocProvider<ProfileSettingsCubit>(
- lazy: false,
- create: (BuildContext context) => ProfileSettingsCubit(
- profileRepository: locator<ProfileRepository>(),
- profileSettingsRepository: locator<ProfileSettingsRepository>(),
- authenticationRepository: locator<AuthenticationRepository>()),
- ),
- BlocProvider<PaymentCubit>(
- lazy: false,
- create: (context) => PaymentCubit(
- adyenRepository: locator<AdyenRepository>())),
- BlocProvider<PaymentCardsCubit>(
- lazy: false,
- create: (context) => PaymentCardsCubit(
- adyenRepository: locator<AdyenRepository>()))
-];
diff --git a/comwell_key_app/lib/connection_state/connection_state_cubit.dart b/comwell_key_app/lib/connection_state/connection_state_cubit.dart
new file mode 100644
index 00000000..4cfe717c
--- /dev/null
+++ b/comwell_key_app/lib/connection_state/connection_state_cubit.dart
@@ -0,0 +1,63 @@
+import 'dart:async';
+
+import 'package:comwell_key_app/base/base_cubit.dart';
+import 'package:comwell_key_app/domain/repositories/bluetooth_repository.dart';
+import 'package:comwell_key_app/domain/repositories/internet_status_repository.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part '../.generated/connection_state/connection_state_cubit.freezed.dart';
+
+class ConnectionStateCubit extends BaseCubit<AppConnectionState> {
+ ConnectionStateCubit(this._bluetoothRepository, this._internetStatusRepository)
+ : super(const AppConnectionState()) {
+ init();
+ }
+
+ final BluetoothRepository _bluetoothRepository;
+ final InternetStatusRepository _internetStatusRepository;
+ late final StreamSubscription<bool> _internetStatusSubscription;
+ late final StreamSubscription<bool> _bluetoothStatusSubscription;
+
+ Future<void> init() async {
+ _bluetoothStatusSubscription = _bluetoothRepository.isEnabledStream().listen((value) {
+ safeEmit(state.copyWith(isBluetoothEnabled: value));
+ });
+ _internetStatusSubscription = _internetStatusRepository.isConnectedStream().listen((value) {
+ safeEmit(state.copyWith(isInternetConnected: value));
+ });
+ try {
+ safeEmit(state.copyWith(isLoading: true));
+ await Future.wait([_checkBluetooth(), _checkInternet()]);
+ } catch (e, st) {
+ logError(e, st);
+ } finally {
+ safeEmit(state.copyWith(isLoading: false));
+ }
+ }
+
+ Future<void> _checkBluetooth() async {
+ final isEnabled = await _bluetoothRepository.isEnabled();
+ safeEmit(state.copyWith(isBluetoothEnabled: isEnabled));
+ }
+
+ Future<void> _checkInternet() async {
+ final isConnected = await _internetStatusRepository.isConnected();
+ safeEmit(state.copyWith(isInternetConnected: isConnected));
+ }
+
+ @override
+ Future<void> close() async {
+ await _bluetoothStatusSubscription.cancel();
+ await _internetStatusSubscription.cancel();
+ return super.close();
+ }
+}
+
+@freezed
+abstract class AppConnectionState with _$AppConnectionState {
+ const factory AppConnectionState({
+ @Default(false) bool isLoading,
+ @Default(true) bool isBluetoothEnabled,
+ @Default(true) bool isInternetConnected,
+ }) = _AppConnectionState;
+}
diff --git a/comwell_key_app/lib/connection_state/connection_state_listener.dart b/comwell_key_app/lib/connection_state/connection_state_listener.dart
new file mode 100644
index 00000000..000761c5
--- /dev/null
+++ b/comwell_key_app/lib/connection_state/connection_state_listener.dart
@@ -0,0 +1,56 @@
+import 'package:comwell_key_app/connection_state/connection_state_cubit.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+class ConnectionStateListener extends StatefulWidget {
+ const ConnectionStateListener({super.key, required this.child});
+
+ final Widget child;
+
+ @override
+ State<ConnectionStateListener> createState() => _ConnectionStateListenerState();
+}
+
+class _ConnectionStateListenerState extends State<ConnectionStateListener> {
+ late final AppLifecycleListener _lifecycleListener;
+
+ @override
+ void initState() {
+ super.initState();
+ _lifecycleListener = AppLifecycleListener(
+ // when app comes back from notifications settings, update state
+ onResume: () {
+ // context.read<ConnectionStateCubit>().init();
+ },
+ );
+ }
+
+ @override
+ void dispose() {
+ _lifecycleListener.dispose();
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<ConnectionStateCubit, AppConnectionState>(
+ listenWhen: (prev, curr) => prev.isBluetoothEnabled && !curr.isBluetoothEnabled,
+ listener: (context, state) {
+ context.push(AppRoutes.onboardingBluetooth);
+ },
+ ),
+ BlocListener<ConnectionStateCubit, AppConnectionState>(
+ listenWhen: (prev, curr) => prev.isInternetConnected && !curr.isInternetConnected,
+ listener: (context, state) {
+ print("qqq internet disabled!");
+ },
+ ),
+ ],
+ child: widget.child,
+ );
+ }
+}
diff --git a/comwell_key_app/lib/domain/repositories/bluetooth_repository.dart b/comwell_key_app/lib/domain/repositories/bluetooth_repository.dart
new file mode 100644
index 00000000..77a68c9b
--- /dev/null
+++ b/comwell_key_app/lib/domain/repositories/bluetooth_repository.dart
@@ -0,0 +1,29 @@
+import 'package:flutter_blue_plus/flutter_blue_plus.dart';
+import 'package:permission_handler/permission_handler.dart';
+
+class BluetoothRepository {
+ Future<bool> isSupported() {
+ return FlutterBluePlus.isSupported;
+ }
+
+ Future<bool> isEnabled() async {
+ final adapterState = await FlutterBluePlus.adapterState.first;
+ return adapterState == BluetoothAdapterState.on;
+ }
+
+ Future<bool> isPermissionGranted() async {
+ final status = await Permission.bluetooth.status;
+ return status == PermissionStatus.granted;
+ }
+
+ Future<bool> request() async {
+ final status = await Permission.bluetooth.request();
+ return status == PermissionStatus.granted;
+ }
+
+ Stream<bool> isEnabledStream() {
+ return FlutterBluePlus.adapterState.map((state) {
+ return state == BluetoothAdapterState.on;
+ });
+ }
+}
diff --git a/comwell_key_app/lib/domain/repositories/internet_status_repository.dart b/comwell_key_app/lib/domain/repositories/internet_status_repository.dart
new file mode 100644
index 00000000..335a42cd
--- /dev/null
+++ b/comwell_key_app/lib/domain/repositories/internet_status_repository.dart
@@ -0,0 +1,13 @@
+import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart';
+
+class InternetStatusRepository {
+ Future<bool> isConnected() {
+ return InternetConnection().hasInternetAccess;
+ }
+
+ Stream<bool> isConnectedStream() {
+ return InternetConnection().onStatusChange.map((status) {
+ return status == InternetStatus.connected;
+ });
+ }
+}
diff --git a/comwell_key_app/lib/find_booking/loading_page.dart b/comwell_key_app/lib/find_booking/loading_page.dart
index f1f7f3b7..47f3523c 100644
--- a/comwell_key_app/lib/find_booking/loading_page.dart
+++ b/comwell_key_app/lib/find_booking/loading_page.dart
@@ -30,7 +30,7 @@ class LoadingPageState extends State<LoadingPage> {
cubit.confirmationIdController.text, cubit.lastNameController.text);
if (mounted && response is Booking) {
- context.pushNamed(AppRoutes.overview.name);
+ context.go(AppRoutes.overview);
}
}
diff --git a/comwell_key_app/lib/login/cubit/login_cubit.dart b/comwell_key_app/lib/login/cubit/login_cubit.dart
index 6d6988dc..5f07b93f 100644
--- a/comwell_key_app/lib/login/cubit/login_cubit.dart
+++ b/comwell_key_app/lib/login/cubit/login_cubit.dart
@@ -6,8 +6,7 @@ import 'package:msal_auth/msal_auth.dart';
part 'login_state.dart';
class LoginCubit extends Cubit<LoginState> {
- LoginCubit({required this.forced, required this.authRepository})
- : super(LoginState());
+ LoginCubit({required this.forced, required this.authRepository}) : super(LoginState());
final bool forced;
final AuthenticationRepository authRepository;
@@ -18,6 +17,4 @@ class LoginCubit extends Cubit<LoginState> {
Future<void> createAccount() async {
await authRepository.openAuth(Prompt.create);
}
-
-
}
diff --git a/comwell_key_app/lib/login/login_page.dart b/comwell_key_app/lib/login/login_page.dart
index 06c233b0..b6aac67f 100644
--- a/comwell_key_app/lib/login/login_page.dart
+++ b/comwell_key_app/lib/login/login_page.dart
@@ -1,7 +1,10 @@
+import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
import 'package:comwell_key_app/login/components/forced_logout_banner.dart';
import 'package:comwell_key_app/login/components/login_button.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
import 'cubit/login_cubit.dart';
@@ -10,43 +13,44 @@ class LoginPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return BlocBuilder<LoginCubit, LoginState>(builder: (context, state) {
- final cubit = context.read<LoginCubit>();
- return Scaffold(
- body: Container(
- constraints: const BoxConstraints.expand(),
- decoration: const BoxDecoration(
- image: DecorationImage(
- image: AssetImage('assets/images/login_screen_background.png'),
- fit: BoxFit.cover,
+ return BlocBuilder<LoginCubit, LoginState>(
+ builder: (context, state) {
+ final cubit = context.read<LoginCubit>();
+ return Scaffold(
+ body: Container(
+ constraints: const BoxConstraints.expand(),
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage(Assets.images.loginScreenBackground.path),
+ fit: BoxFit.cover,
+ ),
),
- ),
- child: SafeArea(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- if (cubit.forced) const ForcedLogoutBanner(),
- // Logo
- Expanded(
- flex: 3,
- child: Image.asset(
- 'assets/images/Logo.png',
- width: 175,
- height: 50,
+ child: SafeArea(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ if (cubit.forced) const ForcedLogoutBanner(),
+ // Logo
+ Expanded(
+ flex: 3,
+ child: Assets.images.logo.image(width: 175, height: 50),
+ ),
+ const SizedBox(height: 32),
+ LoginButton(
+ onPressed: () async {
+ await cubit.login();
+ if(context.mounted) {
+ context.go(AppRoutes.overview);
+ }
+ },
),
- ),
- const SizedBox(height: 32),
- LoginButton(
- onPressed: () {
- cubit.login();
- },
- ),
- const SizedBox(height: 20),
- ],
+ const SizedBox(height: 20),
+ ],
+ ),
),
),
- ),
- );
- });
+ );
+ },
+ );
}
}
diff --git a/comwell_key_app/lib/login/login_route.dart b/comwell_key_app/lib/login/login_route.dart
new file mode 100644
index 00000000..871d8522
--- /dev/null
+++ b/comwell_key_app/lib/login/login_route.dart
@@ -0,0 +1,22 @@
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+import '../routing/app_routes.dart';
+import '../utils/locator.dart';
+import 'cubit/login_cubit.dart';
+import 'login_page.dart';
+
+RouteBase get loginRoute => GoRoute(
+ path: AppRoutes.login,
+ builder: (context, state) {
+ final queryForced = state.uri.queryParameters['forced'] ?? false.toString();
+ final forced = bool.tryParse(queryForced) ?? false;
+ return BlocProvider(
+ create: (context) => LoginCubit(
+ authRepository: locator.get(),
+ forced: forced,
+ ),
+ child: const LoginPage(),
+ );
+ },
+);
diff --git a/comwell_key_app/lib/main.dart b/comwell_key_app/lib/main.dart
index 37341e52..652bf74e 100644
--- a/comwell_key_app/lib/main.dart
+++ b/comwell_key_app/lib/main.dart
@@ -1,7 +1,9 @@
import 'package:comwell_key_app/authentication/authentication_repository.dart';
+import 'package:comwell_key_app/utils/env_utils.dart';
import 'package:comwell_key_app/utils/firebase.dart';
import 'package:comwell_key_app/utils/locator.dart';
import 'package:comwell_key_app/services/http_client.dart';
+import 'package:comwell_key_app/utils/secure_storage.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
@@ -61,12 +63,13 @@ class _BootstrapApp extends StatelessWidget {
setupLocator();
await SentryFlutter.init((options) {
- options.dsn = dotenv.env['SENTRY_DSN']!;
+ options.dsn = dotenv.SENTRY_DSN;
options.tracesSampleRate = 1.0;
options.profilesSampleRate = 1.0;
options.environment = appFlavor;
});
+ await locator<ComwellPreferences>().init();
await locator<AuthenticationRepository>().init();
await PaymentPlugin.initialize(
@@ -76,16 +79,18 @@ class _BootstrapApp extends StatelessWidget {
);
// Setting System UI overlay
- SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
- statusBarColor: Colors.transparent,
- statusBarBrightness: Brightness.dark,
- systemStatusBarContrastEnforced: false,
- systemNavigationBarColor: Colors.transparent,
- systemNavigationBarDividerColor: Colors.transparent,
- systemNavigationBarContrastEnforced: false,
- systemNavigationBarIconBrightness: Brightness.dark,
- statusBarIconBrightness: Brightness.dark,
- ));
+ SystemChrome.setSystemUIOverlayStyle(
+ const SystemUiOverlayStyle(
+ statusBarColor: Colors.transparent,
+ statusBarBrightness: Brightness.dark,
+ systemStatusBarContrastEnforced: false,
+ systemNavigationBarColor: Colors.transparent,
+ systemNavigationBarDividerColor: Colors.transparent,
+ systemNavigationBarContrastEnforced: false,
+ systemNavigationBarIconBrightness: Brightness.dark,
+ statusBarIconBrightness: Brightness.dark,
+ ),
+ );
}
@override
diff --git a/comwell_key_app/lib/notifications/notifications_repository.dart b/comwell_key_app/lib/notifications/notifications_repository.dart
index 974bd6c2..5778e11d 100644
--- a/comwell_key_app/lib/notifications/notifications_repository.dart
+++ b/comwell_key_app/lib/notifications/notifications_repository.dart
@@ -22,7 +22,7 @@ class NotificationsRepository {
return api.updateNotificationPreferences(notificationPermissions);
}
- Future<Iterable<NotificationPermission>> fetchNotificationPermissions() async {
+ Future<List<NotificationPermission>> fetchNotificationPermissions() async {
notificationPermissions =
await locator<ComwellDatabase>().notificationPermissionDAO.getNotificationPermissions();
@@ -40,12 +40,12 @@ class NotificationsRepository {
await locator<ComwellDatabase>().notificationPermissionDAO
.saveNotificationPermission(notificationPermissions);
- return notificationPermissions;
+ return notificationPermissions.toList();
} else {
notificationPermissions =
addDescriptionsToPermissions(notificationPermissions);
- return notificationPermissions;
+ return notificationPermissions.toList();
}
}
diff --git a/comwell_key_app/lib/overview/components/current_bookings_tab_view.dart b/comwell_key_app/lib/overview/components/current_bookings_tab_view.dart
index fe1addd4..425d0538 100644
--- a/comwell_key_app/lib/overview/components/current_bookings_tab_view.dart
+++ b/comwell_key_app/lib/overview/components/current_bookings_tab_view.dart
@@ -2,6 +2,7 @@ import 'package:comwell_key_app/overview/components/current_booking_list_item_vi
import 'package:comwell_key_app/overview/components/find_booking_button.dart';
import 'package:comwell_key_app/overview/components/room_selection_widget.dart';
import 'package:comwell_key_app/overview/cubit/overview_cubit.dart';
+import 'package:comwell_key_app/overview/cubit/overview_state.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
@@ -29,7 +30,7 @@ class CurrentBookingsTabView extends StatelessWidget {
return BlocBuilder<OverviewCubit, OverviewState>(
builder: (context, state) {
- if (state is OverviewLoading) {
+ if (state.isLoading) {
return ListView(
children: const [
SizedBox(height: 20),
diff --git a/comwell_key_app/lib/overview/cubit/overview_cubit.dart b/comwell_key_app/lib/overview/cubit/overview_cubit.dart
index 52017b25..d1dd9048 100644
--- a/comwell_key_app/lib/overview/cubit/overview_cubit.dart
+++ b/comwell_key_app/lib/overview/cubit/overview_cubit.dart
@@ -1,102 +1,108 @@
-import 'package:bloc/bloc.dart';
+import 'package:aad_b2c_webview/aad_b2c_webview.dart';
+import 'package:comwell_key_app/base/base_cubit.dart';
+import 'package:comwell_key_app/overview/cubit/overview_state.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
import 'package:comwell_key_app/overview/models/bookings.dart';
import 'package:comwell_key_app/overview/repository/overview_repository.dart';
-import 'package:collection/collection.dart';
import 'package:comwell_key_app/share/share_booking_repository.dart';
-import 'package:comwell_key_app/utils/locator.dart';
-import 'package:equatable/equatable.dart';
-import 'package:flutter/foundation.dart';
-part 'overview_state.dart';
+class OverviewCubit extends BaseCubit<OverviewState> {
+ final OverviewRepository _overviewRepository;
+ final ShareBookingRepository _shareBookingRepository;
-class OverviewCubit extends Cubit<OverviewState> {
- final OverviewRepository overviewRepository;
- final ShareBookingRepository shareBookingRepository =
- locator<ShareBookingRepository>();
- OverviewCubit(this.overviewRepository) : super(OverviewInitial());
+ bool _bookingsLoaded = false;
- Future<void> fetchBookings() async {
- emit(OverviewLoading());
+ OverviewCubit(
+ this._overviewRepository,
+ this._shareBookingRepository,
+ ) : super(const OverviewState());
+ Future<void> fetchBookings() async {
try {
- final bookings = await overviewRepository.fetchAllBookingsForUser();
-
- emit(OverviewLoaded(bookings: bookings));
+ safeEmit(state.copyWith(isLoading: true));
+ final bookings = await _overviewRepository.fetchAllBookingsForUser();
+ safeEmit(state.copyWith(bookings: bookings));
+ _bookingsLoaded = true;
} catch (e, st) {
- if (kDebugMode) print("err=$e, $st");
- emit(OverviewError(error: e.toString()));
+ logError(e, st);
+ safeEmit(state.copyWith(errorType: OverviewStateError.error));
+ } finally {
+ safeEmit(state.copyWith(isLoading: false));
}
}
Future<void> addBooking(Booking newBooking) async {
- if (state is OverviewLoaded) {
- final currentState = state as OverviewLoaded;
- final updatedBookings = List<Booking>.from(currentState.bookings.current);
- updatedBookings.add(newBooking);
-
- final updatedBookingsObject = Bookings(
- current: updatedBookings, past: const [], cancelled: const []);
-
- emit(OverviewLoaded(bookings: updatedBookingsObject));
- } else {
- final bookings =
- Bookings(current: [newBooking], past: const [], cancelled: const []);
- emit(OverviewLoaded(bookings: bookings));
- }
+ final updatedBookingsObject = Bookings(
+ current: [...state.bookings.current, newBooking],
+ past: state.bookings.past,
+ cancelled: state.bookings.cancelled,
+ );
+ safeEmit(state.copyWith(bookings: updatedBookingsObject));
}
Booking? getCheckedInBooking() {
- if (state is OverviewLoaded) {
- final currentState = state as OverviewLoaded;
- return currentState.bookings.current.firstWhereOrNull((booking) =>
- booking.reservationStatus == ReservationStatus.checkedin);
- }
- return null;
+ return state.bookings.current.firstWhereOrNull(
+ (booking) => booking.reservationStatus == ReservationStatus.checkedin,
+ );
}
Future<Booking?> findBooking(String bookingReference, String lastName) async {
try {
- final booking =
- await overviewRepository.findBooking(bookingReference, lastName);
+ final booking = await _overviewRepository.findBooking(bookingReference, lastName);
if (booking != null) {
addBooking(booking); // Add the found booking to the current list
return booking;
- } else if (state is OverviewLoaded) {
- final currentState = state as OverviewLoaded;
- emit(OverviewNoBookingFound(bookings: currentState.bookings));
+ } else if (_bookingsLoaded) {
+ safeEmit(state.copyWith(errorType: OverviewStateError.noBookingsFound));
} else {
- emit(const OverviewNoBookingFound(
- bookings: Bookings(current: [], past: [], cancelled: [])));
+ safeEmit(
+ state.copyWith(
+ bookings: Bookings.emptyValue,
+ errorType: OverviewStateError.noBookingsFound,
+ ),
+ );
}
- } catch (e) {
- emit(OverviewError(error: e.toString()));
+ } catch (e, st) {
+ logError(e, st);
+ safeEmit(state.copyWith(errorType: OverviewStateError.error));
+ } finally {
+ safeEmit(state.copyWith(isLoading: false));
}
return null;
}
Future<void> findBookingById(String bookingId) async {
- emit(OverviewLoading());
try {
- final bookings = await overviewRepository.fetchAllBookingsForUser();
-
- emit(OverviewLoaded(bookings: bookings));
- } catch (e) {
- emit(OverviewError(error: e.toString()));
+ safeEmit(state.copyWith(isLoading: true));
+ final bookings = await _overviewRepository.fetchAllBookingsForUser();
+ safeEmit(state.copyWith(bookings: bookings));
+ } catch (e, st) {
+ logError(e, st);
+ safeEmit(state.copyWith(errorType: OverviewStateError.error));
+ } finally {
+ safeEmit(state.copyWith(isLoading: false));
}
}
Future<void> removeGuestsFromBooking(
- String hmsConfirmationNumber, String hotelCode, int guestId) async {
- emit(OverviewLoading());
+ String hmsConfirmationNumber,
+ String hotelCode,
+ int guestId,
+ ) async {
try {
- await shareBookingRepository.removeGuestsFromBooking(
- hmsConfirmationNumber, hotelCode, guestId);
- final bookings = await overviewRepository.fetchAllBookingsForUser();
- emit(OverviewLoaded(bookings: bookings));
- } catch (e) {
- if (kDebugMode) print("err=$e");
- emit(OverviewError(error: e.toString()));
+ safeEmit(state.copyWith(isLoading: true));
+ await _shareBookingRepository.removeGuestsFromBooking(
+ hmsConfirmationNumber,
+ hotelCode,
+ guestId,
+ );
+ final bookings = await _overviewRepository.fetchAllBookingsForUser();
+ safeEmit(state.copyWith(bookings: bookings));
+ } catch (e, st) {
+ logError(e, st);
+ safeEmit(state.copyWith(errorType: OverviewStateError.error));
+ } finally {
+ safeEmit(state.copyWith(isLoading: false));
}
}
}
diff --git a/comwell_key_app/lib/overview/cubit/overview_state.dart b/comwell_key_app/lib/overview/cubit/overview_state.dart
index ac4c9245..4f2d617a 100644
--- a/comwell_key_app/lib/overview/cubit/overview_state.dart
+++ b/comwell_key_app/lib/overview/cubit/overview_state.dart
@@ -1,37 +1,15 @@
-part of 'overview_cubit.dart';
-
-sealed class OverviewState extends Equatable {
- const OverviewState();
-
- @override
- List<Object> get props => [];
-}
-
-final class OverviewInitial extends OverviewState {}
-
-final class OverviewLoading extends OverviewState {}
-
-final class OverviewError extends OverviewState {
- final String error;
- const OverviewError({required this.error});
-
- @override
- List<Object> get props => [error];
-}
-
-final class OverviewLoaded extends OverviewState {
- final Bookings bookings;
-
- const OverviewLoaded({required this.bookings});
-
- @override
- List<Object> get props => [bookings];
+import 'package:comwell_key_app/overview/models/bookings.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part '../../.generated/overview/cubit/overview_state.freezed.dart';
+
+@freezed
+abstract class OverviewState with _$OverviewState {
+ const factory OverviewState({
+ @Default(false) bool isLoading,
+ @Default(Bookings.emptyValue) Bookings bookings,
+ @Default(OverviewStateError.none) OverviewStateError errorType,
+ }) = _OverviewState;
}
-final class OverviewNoBookingFound extends OverviewState {
- final Bookings bookings;
- const OverviewNoBookingFound({required this.bookings});
-
- @override
- List<Object> get props => [bookings];
-}
\ No newline at end of file
+enum OverviewStateError { none, error, noBookingsFound }
diff --git a/comwell_key_app/lib/overview/models/bookings.dart b/comwell_key_app/lib/overview/models/bookings.dart
index a37b05aa..3aca0f96 100644
--- a/comwell_key_app/lib/overview/models/bookings.dart
+++ b/comwell_key_app/lib/overview/models/bookings.dart
@@ -2,9 +2,9 @@ import 'package:comwell_key_app/overview/models/booking.dart';
import 'package:equatable/equatable.dart';
class Bookings extends Equatable {
- final Iterable<Booking> current;
- final Iterable<Booking> past;
- final Iterable<Booking> cancelled;
+ final List<Booking> current;
+ final List<Booking> past;
+ final List<Booking> cancelled;
const Bookings({
required this.current,
@@ -14,4 +14,8 @@ class Bookings extends Equatable {
@override
List<Object> get props => [current, past, cancelled];
-}
\ No newline at end of file
+
+ static const emptyValue = Bookings(current: [], past: [], cancelled: []);
+
+ bool get isEmpty => current.isEmpty && past.isEmpty && cancelled.isEmpty;
+}
diff --git a/comwell_key_app/lib/overview/overview_page.dart b/comwell_key_app/lib/overview/overview_page.dart
index 30c79e2a..dae29246 100644
--- a/comwell_key_app/lib/overview/overview_page.dart
+++ b/comwell_key_app/lib/overview/overview_page.dart
@@ -5,10 +5,12 @@ import 'package:comwell_key_app/overview/components/bookings_tab_view.dart';
import 'package:comwell_key_app/overview/components/current_bookings_tab_view.dart';
import 'package:comwell_key_app/overview/components/find_booking_button.dart';
import 'package:comwell_key_app/overview/cubit/overview_cubit.dart';
+import 'package:comwell_key_app/overview/cubit/overview_state.dart';
import 'package:comwell_key_app/overview/models/bookings.dart';
import 'package:comwell_key_app/profile/utils/urls.dart';
import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:comwell_key_app/utils/context_utils.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -22,7 +24,8 @@ class OverviewPage extends StatefulWidget {
OverviewTabViewState createState() => OverviewTabViewState();
}
-class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserver, SingleTickerProviderStateMixin {
+class OverviewTabViewState extends State<OverviewPage>
+ with WidgetsBindingObserver, SingleTickerProviderStateMixin {
late TabController _tabController;
@override
@@ -51,21 +54,21 @@ class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserv
void _checkAndNavigateToBookingDetails() {
if (!mounted) return;
-
+
// Only check if the overview state is loaded
final overviewCubit = context.read<OverviewCubit>();
- if (overviewCubit.state is! OverviewLoaded) {
+ if (overviewCubit.state.isLoading) {
return; // Don't check if bookings aren't loaded yet
}
-
+
// Only execute if the user is on the overview page
final router = GoRouter.of(context);
final currentLocation = router.routerDelegate.currentConfiguration.last.matchedLocation;
-
+
// Check if the current location is the overview page
// The matchedLocation format for overview is "overview"
- final isOnOverviewPage = currentLocation == AppRoutes.overview.name ||
- currentLocation == '/${AppRoutes.overview.name}';
+ final isOnOverviewPage =
+ currentLocation == AppRoutes.overview || currentLocation == AppRoutes.overview;
if (!isOnOverviewPage) {
return; // Only execute if user is on the overview page
@@ -74,33 +77,48 @@ class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserv
final checkedInBooking = overviewCubit.getCheckedInBooking();
if (checkedInBooking != null) {
- context.pushNamed(AppRoutes.bookingDetails.name,
- extra: checkedInBooking);
+ context.pushNamed(AppRoutes.bookingDetails.name, extra: checkedInBooking);
}
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
- return BlocListener<OverviewCubit, OverviewState>(
- listener: (context, state) {
- if (state is OverviewNoBookingFound) {
- Future.delayed(const Duration(seconds: 4), () {
- if (context.mounted) {
- showNotFoundDialog(context);
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<OverviewCubit, OverviewState>(
+ listener: (context, state) {
+ if (state.errorType == OverviewStateError.noBookingsFound) {
+ Future.delayed(const Duration(seconds: 4), () {
+ if (context.mounted) {
+ showNotFoundDialog(context);
+ }
+ });
}
- });
- }
- // Check for checked-in booking when overview is loaded
- if (state is OverviewLoaded) {
- WidgetsBinding.instance.addPostFrameCallback((_) {
- _checkAndNavigateToBookingDetails();
- });
- }
- },
+ },
+ ),
+ BlocListener<OverviewCubit, OverviewState>(
+ listener: (context, state) {
+ if (state.errorType == OverviewStateError.noBookingsFound) {
+ Future.delayed(const Duration(seconds: 4), () {
+ if (context.mounted) {
+ showNotFoundDialog(context);
+ }
+ });
+ }
+ },
+ ),
+ BlocListener<OverviewCubit, OverviewState>(
+ listenWhen: (prev, curr) => !curr.isLoading && !curr.bookings.isEmpty,
+ listener: (context, state) {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ _checkAndNavigateToBookingDetails();
+ });
+ },
+ ),
+ ],
child: BlocBuilder<OverviewCubit, OverviewState>(
builder: (context, state) {
-
return Scaffold(
backgroundColor: colorBackground,
appBar: const ComwellAppBar(
@@ -111,8 +129,7 @@ class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserv
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
- padding:
- const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: Container(
height: 39,
decoration: BoxDecoration(
@@ -141,50 +158,36 @@ class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserv
),
),
),
- if (state is OverviewError) ...[
- Column(
- children: [
- ComwellErrorWidget(
- title: 'overview_error_title'.tr(),
- subtitle: 'overview_error_subtitle'.tr(),
- border: true,
- ),
- IconButton(
- onPressed: () {
- context.read<OverviewCubit>().fetchBookings();
- },
- icon: const Icon(
- Icons.refresh,
- color: colorTertiary,
- ),
- tooltip: 'refresh_bookings'.tr(),
- ),
- const FindBookingButton()
- ],
- ),
- ] else if (state is OverviewLoaded) ...[
- OverviewTabView(
- tabController: _tabController,
- bookings: Bookings(
- current: state.bookings.current,
- past: state.bookings.past,
- cancelled: state.bookings.cancelled)),
- ] else if (state is OverviewError) ...[
- OverviewTabView(
- tabController: _tabController,
- bookings:
- const Bookings(current: [], past: [], cancelled: [])),
- ] else if (state is OverviewNoBookingFound) ...[
- OverviewTabView(
- tabController: _tabController,
- bookings:
- const Bookings(current: [], past: [], cancelled: [])),
- ] else ...[
- OverviewTabView(
+ Builder(
+ builder: (context) {
+ if (state.errorType == OverviewStateError.error) {
+ return Column(
+ children: [
+ ComwellErrorWidget(
+ title: 'overview_error_title'.tr(),
+ subtitle: 'overview_error_subtitle'.tr(),
+ border: true,
+ ),
+ IconButton(
+ onPressed: () {
+ context.read<OverviewCubit>().fetchBookings();
+ },
+ icon: const Icon(
+ Icons.refresh,
+ color: colorTertiary,
+ ),
+ tooltip: 'refresh_bookings'.tr(),
+ ),
+ const FindBookingButton(),
+ ],
+ );
+ }
+ return OverviewTabView(
tabController: _tabController,
- bookings:
- const Bookings(current: [], past: [], cancelled: [])),
- ],
+ bookings: state.bookings,
+ );
+ },
+ ),
Column(
children: [
Divider(
@@ -194,11 +197,14 @@ class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserv
),
Padding(
padding: const EdgeInsets.only(
- left: 18.0, right: 18.0, bottom: 32.0, top: 16.0),
+ left: 18.0,
+ right: 18.0,
+ bottom: 32.0,
+ top: 16.0,
+ ),
child: ElevatedButton(
onPressed: () async {
- bool success = await launchUrl(
- Uri.parse(ComwellUrls.comwellWebsite));
+ bool success = await launchUrl(Uri.parse(ComwellUrls.comwellWebsite));
if (!success) {
if (context.mounted) {
showDialog<void>(
@@ -208,12 +214,15 @@ class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserv
backgroundColor: colorBackground,
contentPadding: const EdgeInsets.all(24),
title: Text(
- 'error_opening_website_title'.tr(),
- style: theme.textTheme.headlineMedium,
- textAlign: TextAlign.center),
- content: Text('error_opening_website'.tr(),
- style: theme.textTheme.bodySmall,
- textAlign: TextAlign.center),
+ 'error_opening_website_title'.tr(),
+ style: context.textStyles.headingMedium,
+ textAlign: TextAlign.center,
+ ),
+ content: Text(
+ 'error_opening_website'.tr(),
+ style: context.textStyles.body,
+ textAlign: TextAlign.center,
+ ),
actions: [
Center(
child: ElevatedButton(
@@ -221,7 +230,8 @@ class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserv
Navigator.of(context).pop();
},
style: ElevatedButton.styleFrom(
- foregroundColor: colorBackground),
+ foregroundColor: colorBackground,
+ ),
child: Text('generic_ok'.tr()),
),
),
@@ -232,21 +242,18 @@ class OverviewTabViewState extends State<OverviewPage> with WidgetsBindingObserv
}
}
},
- style: Theme.of(context)
- .elevatedButtonTheme
- .style
- ?.copyWith(
- minimumSize: const WidgetStatePropertyAll(
- Size(double.infinity, 50)),
- shape: WidgetStatePropertyAll(
- RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(25),
- ),
- ),
+ style: Theme.of(context).elevatedButtonTheme.style?.copyWith(
+ minimumSize: const WidgetStatePropertyAll(Size(double.infinity, 50)),
+ shape: WidgetStatePropertyAll(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(25),
),
- child: Text('new_booking'.tr(),
- style: theme.textTheme.bodyMedium
- ?.copyWith(color: colorBackground)),
+ ),
+ ),
+ child: Text(
+ 'new_booking'.tr(),
+ style: theme.textTheme.bodyMedium?.copyWith(color: colorBackground),
+ ),
),
),
],
@@ -299,23 +306,25 @@ class OverviewTabView extends StatelessWidget {
controller: _tabController,
children: [
CurrentBookingsTabView(
- bookings: bookings.current,
- bookingsTitle: 'no_current_bookings'.tr(),
- bookingsSubtitle: 'no_current_bookings_subtitle'.tr(),
- bookingsImage:
- 'assets/images/no_current_bookings_background.jpeg'),
+ bookings: bookings.current,
+ bookingsTitle: 'no_current_bookings'.tr(),
+ bookingsSubtitle: 'no_current_bookings_subtitle'.tr(),
+ bookingsImage: 'assets/images/no_current_bookings_background.jpeg',
+ ),
BookingsTabView(
- bookings: bookings.past,
- bookingsTitle: 'no_past_bookings_title'.tr(),
- bookingsSubtitle: 'no_past_bookings_subtitle'.tr(),
- bookingsIcon: 'assets/icons/account.svg',
- isCancelled: false),
+ bookings: bookings.past,
+ bookingsTitle: 'no_past_bookings_title'.tr(),
+ bookingsSubtitle: 'no_past_bookings_subtitle'.tr(),
+ bookingsIcon: 'assets/icons/account.svg',
+ isCancelled: false,
+ ),
BookingsTabView(
- bookings: bookings.cancelled,
- bookingsTitle: 'no_cancelled_booking_title'.tr(),
- bookingsSubtitle: 'no_cancelled_booking_subtitle'.tr(),
- bookingsIcon: 'assets/icons/thumbs-up.svg',
- isCancelled: true),
+ bookings: bookings.cancelled,
+ bookingsTitle: 'no_cancelled_booking_title'.tr(),
+ bookingsSubtitle: 'no_cancelled_booking_subtitle'.tr(),
+ bookingsIcon: 'assets/icons/thumbs-up.svg',
+ isCancelled: true,
+ ),
],
),
);
diff --git a/comwell_key_app/lib/overview/overview_route.dart b/comwell_key_app/lib/overview/overview_route.dart
new file mode 100644
index 00000000..bbf04d50
--- /dev/null
+++ b/comwell_key_app/lib/overview/overview_route.dart
@@ -0,0 +1,112 @@
+import 'package:comwell_key_app/booking_details/bloc/booking_details_bloc.dart';
+import 'package:comwell_key_app/booking_details/booking_details_page.dart';
+import 'package:comwell_key_app/booking_details/booking_details_repository.dart';
+import 'package:comwell_key_app/connection_state/connection_state_listener.dart';
+import 'package:comwell_key_app/housekeeping/housekeeping_repository.dart';
+import 'package:comwell_key_app/key/key_page.dart';
+import 'package:comwell_key_app/overview/models/booking.dart';
+import 'package:comwell_key_app/overview/past_cancelled_booking_detail_page.dart';
+import 'package:comwell_key_app/profile_settings/cubit/profile_settings_cubit.dart';
+import 'package:comwell_key_app/up_sales/up_sales_repository.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+import '../authentication/authentication_repository.dart';
+import '../profile/cubit/profile_cubit.dart';
+import '../profile/profile_page.dart';
+import '../profile/profile_repository.dart';
+import '../profile_settings/components/change_password_modal.dart';
+import '../profile_settings/profile_settings_page.dart';
+import '../profile_settings/repostiory/profile_settings_repository.dart';
+import '../routing/app_routes.dart';
+import '../utils/locator.dart';
+import 'overview_page.dart';
+
+RouteBase get overviewRoute => GoRoute(
+ path: AppRoutes.overview,
+ pageBuilder: (context, state) {
+ return const NoTransitionPage(
+ child: ConnectionStateListener(
+ child: OverviewPage(),
+ ),
+ );
+ },
+ routes: [
+ GoRoute(
+ path: "profile",
+ name: AppRoutes.profile.name,
+ builder: (context, state) {
+ return BlocProvider<ProfileCubit>(
+ create: (BuildContext context) => ProfileCubit(
+ profileRepository: locator<ProfileRepository>(),
+ authenticationRepository: locator<AuthenticationRepository>(),
+ )..init(),
+ child: const ProfilePage(), //mobileKey: key);
+ );
+ },
+ routes: [
+ GoRoute(
+ path: "profile_settings",
+ name: AppRoutes.profileSettings.name,
+ builder: (context, state) {
+ return BlocProvider<ProfileSettingsCubit>(
+ create: (BuildContext context) => ProfileSettingsCubit(
+ profileRepository: locator<ProfileRepository>(),
+ profileSettingsRepository: locator<ProfileSettingsRepository>(),
+ authenticationRepository: locator<AuthenticationRepository>(),
+ )..init(),
+ child: const ProfileSettingsPage(),
+ );
+ },
+ routes: [
+ GoRoute(
+ path: 'change_password',
+ name: AppRoutes.changePassword.name,
+ builder: (context, state) {
+ return const ChangePasswordModal();
+ },
+ ),
+ ],
+ ),
+ ],
+ ),
+ GoRoute(
+ path: AppRoutes.pastCancelledBookings.name,
+ name: AppRoutes.pastCancelledBookings.name,
+ builder: (context, state) {
+ final extras = state.extra as List<dynamic>;
+ Booking booking = extras[0] as Booking;
+ bool isCancelled = extras[1] as bool;
+ return PastCancelledBookingDetailPage(booking: booking, isCancelled: isCancelled);
+ },
+ ),
+ GoRoute(
+ path: AppRoutes.bookingDetails.name,
+ name: AppRoutes.bookingDetails.name,
+ builder: (context, state) {
+ final booking = state.extra as Booking;
+ return BlocProvider<BookingDetailsBloc>(
+ create: (BuildContext context) => BookingDetailsBloc(
+ booking,
+ bookingDetailsRepository: locator<BookingDetailsRepository>(),
+ profileRepository: locator<ProfileRepository>(),
+ upSaleRepository: locator<UpSalesRepository>(),
+ houseKeepingRepository: locator<HouseKeepingRepository>(),
+ ),
+ child: const BookingDetailsPage(),
+ );
+ },
+ routes: [
+ GoRoute(
+ path: "key",
+ name: AppRoutes.key.name,
+ builder: (context, state) {
+ final roomNumber = state.extra as String? ?? '';
+ return KeyPage(roomNumber: roomNumber);
+ },
+ ),
+ ],
+ ),
+ ],
+);
diff --git a/comwell_key_app/lib/overview/repository/overview_repository.dart b/comwell_key_app/lib/overview/repository/overview_repository.dart
index e90f72cf..68bf2279 100644
--- a/comwell_key_app/lib/overview/repository/overview_repository.dart
+++ b/comwell_key_app/lib/overview/repository/overview_repository.dart
@@ -18,10 +18,8 @@ class OverviewRepository {
Future<Bookings> fetchAllBookingsForUser() async {
try {
final currentBookings = await api.fetchCurrentBookingsForUser();
-
final pastBookings = await api.fetchPastBookingsForUser();
final cancelledBookings = await api.fetchCancelledBookingsForUser();
-
final database = locator<ComwellDatabase>();
try {
await database.bookingsDao.insert(currentBookings);
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/bluetooth/bluetooth_permission_cubit.dart b/comwell_key_app/lib/presentation/screens/onboarding/bluetooth/bluetooth_permission_cubit.dart
new file mode 100644
index 00000000..dbd8b434
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/bluetooth/bluetooth_permission_cubit.dart
@@ -0,0 +1,73 @@
+import 'dart:async';
+
+import 'package:app_settings/app_settings.dart';
+import 'package:bloc/bloc.dart';
+import 'package:comwell_key_app/domain/repositories/bluetooth_repository.dart';
+import 'package:comwell_key_app/utils/secure_storage.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part "../../../../.generated/presentation/screens/onboarding/bluetooth/bluetooth_permission_cubit.freezed.dart";
+
+class BluetoothPermissionCubit extends Cubit<BluetoothPermissionState> {
+ BluetoothPermissionCubit(this._bluetoothRepository, this._preferences) : super(const BluetoothPermissionState()) {
+ init();
+ }
+
+ final ComwellPreferences _preferences;
+ final BluetoothRepository _bluetoothRepository;
+ late final StreamSubscription<bool> _bluetoothStatusStream;
+ int _clickCount = 0;
+
+ Future<void> init() async {
+ await _preferences.setOnboardingHasSeenBluetooth();
+ _bluetoothStatusStream = _bluetoothRepository.isEnabledStream().listen((isEnabled) {
+ emit(state.copyWith(isEnabled: isEnabled));
+ });
+
+ try {
+ emit(state.copyWith(isLoading: true));
+ await checkBluetoothStatus();
+ } catch (e, st) {
+ emit(state.copyWith(errorType: ErrorType.error));
+ } finally {
+ emit(state.copyWith(isLoading: false));
+ }
+ }
+
+ Future<void> checkBluetoothStatus() async {
+ final isSupported = await _bluetoothRepository.isSupported();
+ if (!isSupported) return;
+ emit(state.copyWith(isSupported: true));
+ final isEnabled = await _bluetoothRepository.isEnabled();
+ if (!isEnabled) return;
+ }
+
+ Future<void> onAcceptClicked() async {
+ _clickCount++;
+ final shouldRedirectToSettings = _clickCount >= 3;
+ if (shouldRedirectToSettings) {
+ await AppSettings.openAppSettings(type: AppSettingsType.bluetooth);
+ } else {
+ await _bluetoothRepository.request();
+ }
+ }
+
+ @override
+ Future<void> close() async {
+ await _bluetoothStatusStream.cancel();
+ return super.close();
+ }
+}
+
+@freezed
+abstract class BluetoothPermissionState with _$BluetoothPermissionState {
+ const factory BluetoothPermissionState({
+ @Default(false) bool isLoading,
+ @Default(false) bool isEnabled,
+ @Default(false) bool isSupported,
+ @Default(false) bool isPermissionGranted,
+ @Default(ErrorType.none) ErrorType errorType,
+ }) = _BluetoothPermissionState;
+}
+
+enum ErrorType { none, error }
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/bluetooth/bluetooth_permission_screen.dart b/comwell_key_app/lib/presentation/screens/onboarding/bluetooth/bluetooth_permission_screen.dart
new file mode 100644
index 00000000..f799d962
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/bluetooth/bluetooth_permission_screen.dart
@@ -0,0 +1,53 @@
+import 'package:app_settings/app_settings.dart';
+import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
+import 'package:comwell_key_app/connection_state/connection_state_cubit.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:comwell_key_app/themes/comwell_colors.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+import '../permission_screen_template.dart';
+import 'bluetooth_permission_cubit.dart';
+
+class BluetoothPermissionScreen extends StatelessWidget {
+ const BluetoothPermissionScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<ConnectionStateCubit, AppConnectionState>(
+ listenWhen: (prev, curr) => !prev.isBluetoothEnabled && curr.isBluetoothEnabled,
+ listener: (context, state) {
+ context.pop();
+ },
+ ),
+ ],
+ child: BlocBuilder<BluetoothPermissionCubit, BluetoothPermissionState>(
+ builder: (context, state) {
+ if (state.isLoading) {
+ return const Scaffold(
+ backgroundColor: sandColor,
+ body: Center(
+ child: CircularProgressIndicator(
+ color: Colors.white,
+ ),
+ ),
+ );
+ }
+ return PermissionScreenTemplate(
+ title: "Dit Bluetooth er ikke tændt",
+ subtitle:
+ "For at kunne åbne din dør til dit værelse, skal du tænde for dit Bluetooth på din telefon.",
+ primaryButtonText: "OK",
+ primaryButtonOnClick: () async {
+ context.pop();
+ },
+ image: Assets.icons.bluetoothCircled,
+ );
+ },
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/internet/bluetooth_permission_screen.dart b/comwell_key_app/lib/presentation/screens/onboarding/internet/bluetooth_permission_screen.dart
new file mode 100644
index 00000000..2be8502c
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/internet/bluetooth_permission_screen.dart
@@ -0,0 +1,39 @@
+import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
+import 'package:comwell_key_app/connection_state/connection_state_cubit.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+import '../permission_screen_template.dart';
+
+class InternetStatusScreen extends StatelessWidget {
+ const InternetStatusScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return MultiBlocListener(
+ listeners: [
+ BlocListener<ConnectionStateCubit, AppConnectionState>(
+ listenWhen: (prev, curr) => !prev.isInternetConnected && curr.isInternetConnected,
+ listener: (context, state) {
+ context.pop();
+ },
+ ),
+ ],
+ child: Builder(
+ builder: (context) {
+ return PermissionScreenTemplate(
+ title: "Du er ikke forbundet til internettet",
+ subtitle:
+ "Indtil du har her forbundet til internet, er der begrænset funktionalitet i appen.",
+ primaryButtonText: "OK",
+ primaryButtonOnClick: () async {
+ context.pop();
+ },
+ image: Assets.icons.noConnection,
+ );
+ },
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/notifications/notification_permission_cubit.dart b/comwell_key_app/lib/presentation/screens/onboarding/notifications/notification_permission_cubit.dart
new file mode 100644
index 00000000..f5e26838
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/notifications/notification_permission_cubit.dart
@@ -0,0 +1,42 @@
+import 'package:app_settings/app_settings.dart';
+import 'package:bloc/bloc.dart';
+import 'package:comwell_key_app/utils/secure_storage.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:permission_handler/permission_handler.dart';
+
+part '../../../../.generated/presentation/screens/onboarding/notifications/notification_permission_cubit.freezed.dart';
+
+class NotificationPermissionCubit extends Cubit<NotificationPermissionState> {
+ NotificationPermissionCubit(
+ this._preferences,
+ ) : super(const NotificationPermissionState()) {
+ init();
+ }
+
+ final ComwellPreferences _preferences;
+ int _clickCount = 0;
+
+ Future<void> init() async {
+ await _preferences.setOnboardingHasSeenNotification();
+ }
+
+ Future<void> onAcceptClicked() async {
+ _clickCount++;
+ final shouldRedirectToSettings = _clickCount >= 3;
+ if (shouldRedirectToSettings) {
+ await AppSettings.openAppSettings(type: AppSettingsType.notification);
+ } else {
+ await Permission.notification.request();
+ }
+ }
+}
+
+@freezed
+abstract class NotificationPermissionState with _$NotificationPermissionState {
+ const factory NotificationPermissionState({
+ @Default(false) bool isLoading,
+ @Default(ErrorType.none) ErrorType errorType,
+ }) = _NotificationPermissionState;
+}
+
+enum ErrorType { none }
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/notifications/notification_permission_screen.dart b/comwell_key_app/lib/presentation/screens/onboarding/notifications/notification_permission_screen.dart
new file mode 100644
index 00000000..efe897f6
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/notifications/notification_permission_screen.dart
@@ -0,0 +1,37 @@
+import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+import '../permission_screen_template.dart';
+import 'notification_permission_cubit.dart';
+
+class NotificationPermissionScreen extends StatelessWidget {
+ const NotificationPermissionScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final cubit = context.watch<NotificationPermissionCubit>();
+ final state = cubit.state;
+ return PermissionScreenTemplate(
+ title: "Tillad notifikationer",
+ subtitle:
+ "Exercitation tempor consequat in voluptate nisi id et in sunt incididunt occaecat ad minim ut magna elit deserunt irure duis.",
+ image: Assets.icons.bellCircled,
+ primaryButtonText: "Tillad notifikationer",
+ secondaryButtonText: "Spring over",
+ primaryButtonOnClick: () async {
+ await cubit.onAcceptClicked();
+ if (context.mounted) {
+ context.go(AppRoutes.overview);
+ }
+ },
+ secondaryButtonOnClick: () {
+ context.go(AppRoutes.overview);
+ },
+ primaryButtonIsLoading: false,
+ showCloseButton: true,
+ );
+ }
+}
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/onboarding_routes.dart b/comwell_key_app/lib/presentation/screens/onboarding/onboarding_routes.dart
new file mode 100644
index 00000000..03ef3fba
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/onboarding_routes.dart
@@ -0,0 +1,52 @@
+import 'package:comwell_key_app/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.dart';
+import 'package:comwell_key_app/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_screen.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:comwell_key_app/utils/locator.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+import 'bluetooth/bluetooth_permission_cubit.dart';
+import 'bluetooth/bluetooth_permission_screen.dart';
+import 'notifications/notification_permission_cubit.dart';
+import 'notifications/notification_permission_screen.dart';
+
+RouteBase get bluetoothPermissionRoute => GoRoute(
+ path: AppRoutes.onboardingBluetooth,
+ pageBuilder: (context, state) {
+ return MaterialPage(
+ child: BlocProvider(
+ lazy: false,
+ create: (context) => BluetoothPermissionCubit(
+ locator.get(),
+ locator.get(),
+ ),
+ child: const BluetoothPermissionScreen(),
+ ),
+ );
+ },
+);
+
+RouteBase get notificationsPermissionRoute => GoRoute(
+ path: AppRoutes.onboardingNotification,
+ builder: (context, state) {
+ return BlocProvider(
+ lazy: false,
+ create: (context) => NotificationPermissionCubit(
+ locator.get(),
+ ),
+ child: const NotificationPermissionScreen(),
+ );
+ },
+);
+
+RouteBase get usageTrackingPermissionRoute => GoRoute(
+ path: AppRoutes.onboardingUsageTracking,
+ builder: (context, state) {
+ return BlocProvider(
+ lazy: false,
+ create: (context) => UsageTrackingPermissionCubit(locator.get()),
+ child: const UsageTrackingPermissionScreen(),
+ );
+ },
+);
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/permission_screen_template.dart b/comwell_key_app/lib/presentation/screens/onboarding/permission_screen_template.dart
new file mode 100644
index 00000000..e287eb49
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/permission_screen_template.dart
@@ -0,0 +1,90 @@
+import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
+import 'package:comwell_key_app/themes/app_spaces.dart';
+import 'package:comwell_key_app/themes/comwell_colors.dart';
+import 'package:comwell_key_app/utils/context_utils.dart';
+import 'package:comwell_key_app/utils/text_style_utils.dart';
+import 'package:flutter/material.dart';
+
+class PermissionScreenTemplate extends StatelessWidget {
+ const PermissionScreenTemplate({
+ super.key,
+ required this.title,
+ required this.primaryButtonText,
+ required this.image,
+ this.subtitle = "",
+ this.secondaryButtonText = "",
+ this.primaryButtonOnClick,
+ this.secondaryButtonOnClick,
+ this.primaryButtonIsLoading = false,
+ this.showCloseButton = false,
+ });
+
+ final SvgGenImage image;
+ final String title;
+ final String subtitle;
+ final String primaryButtonText;
+ final String secondaryButtonText;
+ final VoidCallback? primaryButtonOnClick;
+ final VoidCallback? secondaryButtonOnClick;
+ final bool primaryButtonIsLoading;
+ final bool showCloseButton;
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ backgroundColor: sandColor,
+ appBar: AppBar(
+ backgroundColor: sandColor,
+ automaticallyImplyLeading: false,
+ actions: [if (showCloseButton) const CloseButton()],
+ ),
+ body: Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ AppSpaces.gap80,
+ image.svg(),
+ AppSpaces.gap120,
+ Text(title, style: context.textStyles.headingMedium.white),
+ AppSpaces.gap12,
+ Text(
+ subtitle,
+ style: context.textStyles.body.white,
+ textAlign: TextAlign.center,
+ ),
+ const Spacer(),
+ SafeArea(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ TextButton(
+ onPressed: primaryButtonOnClick,
+ style: context.buttonStyles.primaryMainDefault,
+ child: Center(
+ child: Text(primaryButtonText, style: context.textStyles.headingSmall),
+ ),
+ ),
+ if (secondaryButtonOnClick != null) AppSpaces.gap08,
+ if (secondaryButtonOnClick != null)
+ TextButton(
+ onPressed: secondaryButtonOnClick,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ secondaryButtonText,
+ style: context.textStyles.body.white,
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.dart b/comwell_key_app/lib/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.dart
new file mode 100644
index 00000000..b3edda72
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.dart
@@ -0,0 +1,29 @@
+import 'package:comwell_key_app/base/base_cubit.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+import '../../../../utils/secure_storage.dart';
+
+part '../../../../.generated/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_cubit.freezed.dart';
+
+class UsageTrackingPermissionCubit extends BaseCubit<UsageTrackingPermissionState> {
+ UsageTrackingPermissionCubit(this._preferences) : super(const UsageTrackingPermissionState()) {
+ init();
+ }
+
+ final ComwellPreferences _preferences;
+
+ void init() async {
+ await _preferences.setOnboardingHasSeenUsageTracking();
+ print("qqq setOnboardingHasSeenUsageTracking=${_preferences.onboardingHasSeenUsageTracking}");
+ }
+}
+
+@freezed
+abstract class UsageTrackingPermissionState with _$UsageTrackingPermissionState {
+ const factory UsageTrackingPermissionState({
+ @Default(false) bool isLoading,
+ @Default(UsageTrackingError.none) UsageTrackingError errorType,
+ }) = _UsageTrackingPermissionState;
+}
+
+enum UsageTrackingError { none }
diff --git a/comwell_key_app/lib/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_screen.dart b/comwell_key_app/lib/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_screen.dart
new file mode 100644
index 00000000..6b883d76
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/onboarding/usage_tracking/usage_tracking_permission_screen.dart
@@ -0,0 +1,27 @@
+import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
+import 'package:comwell_key_app/presentation/screens/onboarding/permission_screen_template.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:flutter/material.dart';
+import 'package:go_router/go_router.dart';
+
+class UsageTrackingPermissionScreen extends StatelessWidget {
+ const UsageTrackingPermissionScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return PermissionScreenTemplate(
+ title: "Må vi tracke din aktivitet for at forbredre din app oplevelse?",
+ subtitle:
+ "Exercitation tempor consequat in voluptate nisi id et in sunt incididunt occaecat ad minim ut magna elit deserunt irure duis.",
+ primaryButtonText: "Tillad tracking",
+ primaryButtonOnClick: () {
+ // TODO handle
+ },
+ secondaryButtonText: "Spring over",
+ secondaryButtonOnClick: () {
+ context.go(AppRoutes.overview);
+ },
+ image: Assets.icons.globe,
+ );
+ }
+}
diff --git a/comwell_key_app/lib/received_shared_booking/received_shared_booking_page.dart b/comwell_key_app/lib/received_shared_booking/received_shared_booking_page.dart
index 042b7c43..c6f3f6fd 100644
--- a/comwell_key_app/lib/received_shared_booking/received_shared_booking_page.dart
+++ b/comwell_key_app/lib/received_shared_booking/received_shared_booking_page.dart
@@ -34,7 +34,7 @@ class ReceivedSharedBookingPage extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 32.0),
child: ElevatedButton(
onPressed: () {
- context.goNamed(AppRoutes.overview.name);
+ context.go(AppRoutes.overview);
},
child: Text("home_page".tr(),
style: Theme.of(context)
@@ -49,7 +49,7 @@ class ReceivedSharedBookingPage extends StatelessWidget {
return ShareBookingBaseTemplate(
booking: cubit.booking,
onClicked: () {
- context.goNamed(AppRoutes.overview.name);
+ context.go(AppRoutes.overview);
},
isShared: true,
isLoading: state.isLoading,
diff --git a/comwell_key_app/lib/received_shared_room/received_shared_room_page.dart b/comwell_key_app/lib/received_shared_room/received_shared_room_page.dart
index ff56ed4f..f77c6262 100644
--- a/comwell_key_app/lib/received_shared_room/received_shared_room_page.dart
+++ b/comwell_key_app/lib/received_shared_room/received_shared_room_page.dart
@@ -25,7 +25,7 @@ class ReceivedSharedRoomPage extends StatelessWidget {
return ShareRoomBasePageTemplate(
booking: cubit.booking,
onClicked: () {
- context.goNamed(AppRoutes.overview.name);
+ context.go(AppRoutes.overview);
},
isShared: true);
});
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index 735e24c8..cd8a3163 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -28,10 +28,7 @@ import 'package:comwell_key_app/hotel_information/pages/hotel_information_menu.d
import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
import 'package:comwell_key_app/hotel_information/hotel_information_page.dart';
import 'package:comwell_key_app/housekeeping/housekeeping_page.dart';
-import 'package:comwell_key_app/housekeeping/housekeeping_repository.dart';
-import 'package:comwell_key_app/key/key_page.dart';
-import 'package:comwell_key_app/login/cubit/login_cubit.dart';
-import 'package:comwell_key_app/login/login_page.dart';
+import 'package:comwell_key_app/login/login_route.dart';
import 'package:comwell_key_app/my_booking/cubit/my_booking_cubit.dart';
import 'package:comwell_key_app/my_booking/my_booking_page.dart';
import 'package:comwell_key_app/my_booking/my_booking_repository.dart';
@@ -40,19 +37,12 @@ import 'package:comwell_key_app/notifications/cubit/notifications_cubit.dart';
import 'package:comwell_key_app/notifications/notifications_page.dart';
import 'package:comwell_key_app/notifications/notifications_repository.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
-import 'package:comwell_key_app/overview/overview_page.dart';
-import 'package:comwell_key_app/overview/past_cancelled_booking_detail_page.dart';
+import 'package:comwell_key_app/overview/overview_route.dart';
import 'package:comwell_key_app/overview/cubit/overview_cubit.dart';
import 'package:comwell_key_app/overview/repository/overview_repository.dart';
import 'package:comwell_key_app/pregistration/cubit/preregistration_cubit.dart';
import 'package:comwell_key_app/pregistration/preregistration_flow.dart';
-import 'package:comwell_key_app/profile/cubit/profile_cubit.dart';
-import 'package:comwell_key_app/profile/profile_page.dart';
import 'package:comwell_key_app/profile/profile_repository.dart';
-import 'package:comwell_key_app/profile_settings/components/change_password_modal.dart';
-import 'package:comwell_key_app/profile_settings/cubit/profile_settings_cubit.dart';
-import 'package:comwell_key_app/profile_settings/profile_settings_page.dart';
-import 'package:comwell_key_app/profile_settings/repostiory/profile_settings_repository.dart';
import 'package:comwell_key_app/received_shared_booking/cubit/received_shared_booking_cubit.dart';
import 'package:comwell_key_app/received_shared_booking/received_shared_booking_page.dart';
import 'package:comwell_key_app/received_shared_room/cubit/received_shared_room_cubit.dart';
@@ -75,6 +65,7 @@ import 'package:comwell_key_app/up_sales/pages/up_sale_confirmation_page.dart';
import 'package:comwell_key_app/up_sales/pages/processing/up_sales_processing_page.dart';
import 'package:comwell_key_app/up_sales/up_sales_repository.dart';
import 'package:comwell_key_app/up_sales/up_sales_catalog.dart';
+import 'package:comwell_key_app/utils/context_utils.dart';
import 'package:comwell_key_app/utils/stream_to_listenable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
@@ -86,563 +77,467 @@ import 'package:payment_plugin/presentation/app/bloc/payment_cubit.dart';
import 'package:payment_plugin/presentation/screens/payment_cards_page.dart';
import 'package:payment_plugin/presentation/screens/payment_processing_page.dart';
import '../hotel_information/repository/hotel_information_repository.dart';
+import '../presentation/screens/onboarding/onboarding_routes.dart';
import '../utils/locator.dart';
-import '../booking_details/bloc/booking_details_bloc.dart';
-import '../booking_details/booking_details_page.dart';
-import '../booking_details/booking_details_repository.dart';
-
final _rootNavigatorKey = GlobalKey<NavigatorState>();
final rootNavigatorKey = _rootNavigatorKey;
final _shellNavigatorKey = GlobalKey<NavigatorState>();
final router = GoRouter(
- initialLocation: '/login',
- navigatorKey: _rootNavigatorKey,
- debugLogDiagnostics: true,
- observers: [GoRouterObserver()],
- refreshListenable:
- StreamToListenable([locator<AuthenticationRepository>().broadcast]),
- redirect: (context, state) async {
- final authRepo = locator<AuthenticationRepository>();
- final status = authRepo.statusBuffer;
- final isAuthenticated = status == AuthenticationStatus.authenticated;
- final isUnAuthenticated =
- status == AuthenticationStatus.unauthenticated ||
- status == AuthenticationStatus.forcedUnauthenticated;
+ initialLocation: AppRoutes.overview,
+ navigatorKey: _rootNavigatorKey,
+ debugLogDiagnostics: true,
+ observers: [GoRouterObserver()],
+ refreshListenable: StreamToListenable([locator<AuthenticationRepository>().broadcast]),
+ redirect: (context, state) async {
+ final authRepo = locator<AuthenticationRepository>();
+ final status = authRepo.statusBuffer;
+ final isLoggedIn = await authRepo.isLoggedIn();
- if (status == AuthenticationStatus.unknown) {
- bool doesTokenExist = await authRepo.doesTokenExist();
- if (doesTokenExist) {
- authRepo.logIn();
- }
+ if (state.uri.host == 'share-room') {
+ final sharingType = state.uri.queryParameters['sharingType'];
+ final Uri uri;
+ if (sharingType == 'RoomDistribution') {
+ uri = Uri(path: AppRoutes.receivedSharedRoom, queryParameters: state.uri.queryParameters);
+ } else {
+ uri = Uri(
+ path: AppRoutes.receivedSharedBooking,
+ queryParameters: state.uri.queryParameters,
+ );
}
+ return uri.toString();
+ }
- if (state.uri.host == 'share-room') {
- final sharingType = state.uri.queryParameters['sharingType'];
- if (sharingType == 'RoomDistribution') {
- return "/${AppRoutes.receivedSharedRoom.name}?sharingId=${state.uri.queryParameters['sharingId']}&hotelCode=${state.uri.queryParameters['hotelCode']}";
- } else {
- return "/${AppRoutes.receivedSharedBooking.name}?sharingId=${state.uri.queryParameters['sharingId']}&hotelCode=${state.uri.queryParameters['hotelCode']}";
- }
- }
+ if (!isLoggedIn) {
+ final forced = status == AuthenticationStatus.forcedUnauthenticated;
+ return "${AppRoutes.login}?forced=$forced";
+ }
- // Redirect to the login page if the user is not authenticated, and if authenticated, do not show the login page
- if (isUnAuthenticated && !state.matchedLocation.contains("/login")) {
- final forced = status == AuthenticationStatus.forcedUnauthenticated;
+ if (context.mounted && !context.prefs.onboardingHasSeenUsageTracking) {
+ return AppRoutes.onboardingUsageTracking;
+ }
- return "/login?forced=$forced";
- }
- // Redirect to the overview page if the user is authenticated
- else if (isAuthenticated && state.matchedLocation.contains("/login")) {
- return "/${AppRoutes.overview.name}";
- }
- return null;
- },
- routes: <RouteBase>[
- ShellRoute(
- navigatorKey: _shellNavigatorKey,
- parentNavigatorKey: _rootNavigatorKey,
- pageBuilder: (context, state, child) {
- return NoTransitionPage(
- child: BlocProvider(
- create: (_) => HotelInformationCubit(
- hotelInformationRepository:
- locator<HotelInformationRepository>(),
- booking: state.extra as Booking,
- )..init(),
- child: HotelInformationPage(child: child),
- ),
- );
+ if (context.mounted && !context.prefs.onboardingHasSeenNotification) {
+ return AppRoutes.onboardingNotification;
+ }
+
+ return null;
+ },
+ routes: <RouteBase>[
+ loginRoute,
+ bluetoothPermissionRoute,
+ notificationsPermissionRoute,
+ usageTrackingPermissionRoute,
+ overviewRoute,
+ ShellRoute(
+ navigatorKey: _shellNavigatorKey,
+ parentNavigatorKey: _rootNavigatorKey,
+ pageBuilder: (context, state, child) {
+ return NoTransitionPage(
+ child: BlocProvider(
+ create: (_) => HotelInformationCubit(
+ hotelInformationRepository: locator<HotelInformationRepository>(),
+ booking: state.extra as Booking,
+ )..init(),
+ child: HotelInformationPage(child: child),
+ ),
+ );
+ },
+ routes: [
+ GoRoute(
+ path: "/${AppRoutes.hotelInformation.name}",
+ name: AppRoutes.hotelInformation.name,
+ builder: (context, state) {
+ return const HotelInformationMenu();
},
- routes: [
- GoRoute(
- path: "/${AppRoutes.hotelInformation.name}",
- name: AppRoutes.hotelInformation.name,
- builder: (context, state) {
- return const HotelInformationMenu();
- }),
- GoRoute(
- path:
- "/${AppRoutes.hotelInformation.name}/${AppRoutes.facility.name}",
- name:
- "${AppRoutes.hotelInformation.name}/${AppRoutes.facility.name}",
- builder: (context, state) {
- return FacilityPage(facility: state.extra as Facility);
- }),
- ]),
- GoRoute(
- path: '/${AppRoutes.contact.name}',
- name: AppRoutes.contact.name,
+ ),
+ GoRoute(
+ path: "/${AppRoutes.hotelInformation.name}/${AppRoutes.facility.name}",
+ name: "${AppRoutes.hotelInformation.name}/${AppRoutes.facility.name}",
builder: (context, state) {
- final booking = state.extra as Booking;
- return BlocProvider<ContactCubit>(
- create: (BuildContext context) => ContactCubit(
- contactRepository: locator<ContactRepository>(),
- overviewRepository: locator<OverviewRepository>(),
- profileRepository: locator<ProfileRepository>())
- ..init(),
- child: ContactPage(hotelCode: booking.hotelCode),
+ return FacilityPage(facility: state.extra as Facility);
+ },
+ ),
+ ],
+ ),
+ GoRoute(
+ path: '/${AppRoutes.contact.name}',
+ name: AppRoutes.contact.name,
+ builder: (context, state) {
+ final booking = state.extra as Booking;
+ return BlocProvider<ContactCubit>(
+ create: (BuildContext context) => ContactCubit(
+ contactRepository: locator<ContactRepository>(),
+ overviewRepository: locator<OverviewRepository>(),
+ profileRepository: locator<ProfileRepository>(),
+ )..init(),
+ child: ContactPage(hotelCode: booking.hotelCode),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.findBooking.name}",
+ name: AppRoutes.findBooking.name,
+ builder: (context, state) {
+ return BlocProvider(
+ create: (context) => FindBookingCubit(),
+ child: const FindBookingPage(),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.shareBooking.name}",
+ name: AppRoutes.shareBooking.name,
+ builder: (context, state) {
+ final booking = state.extra as Booking;
+ return BlocProvider(
+ create: (context) => ShareBookingCubit(),
+ child: ShareBookingPage(booking: booking),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.bookingDetails.name}/:id",
+ name: "booking_deep_link",
+ builder: (context, state) {
+ final bookingId = state.pathParameters['id']!;
+ context.read<OverviewCubit>().findBookingById(bookingId);
+ return const LoadingPage();
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.loadingPage.name}",
+ name: AppRoutes.loadingPage.name,
+ builder: (context, state) {
+ return BlocProvider(
+ create: (context) => FindBookingCubit(),
+ child: const LoadingPage(),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.checkIn.name}",
+ name: AppRoutes.checkIn.name,
+ builder: (context, state) {
+ return BlocProvider(
+ create: (context) {
+ final extras = state.extra as List<dynamic>;
+ final booking = extras[0] as Booking;
+ final onlyKeys = extras[1] as bool;
+ if (onlyKeys) {
+ return CheckInCubit.initialOnlyKeys(booking);
+ }
+ return CheckInCubit(booking);
+ },
+ child: const CheckInPage(),
+ );
+ },
+ ),
+ ShellRoute(
+ pageBuilder: (context, state, child) {
+ return CustomTransitionPage(
+ transitionsBuilder: (context, animation, secondaryAnimation, child) {
+ return SlideTransition(
+ position:
+ Tween<Offset>(
+ begin: const Offset(1.0, 0.0),
+ end: Offset.zero,
+ ).animate(
+ CurvedAnimation(
+ parent: animation,
+ curve: Curves.easeInOut,
+ ),
+ ),
+ child: child,
);
- }),
-
- GoRoute(
- path: "/${AppRoutes.findBooking.name}",
- name: AppRoutes.findBooking.name,
- builder: (context, state) {
- return BlocProvider(
- create: (context) => FindBookingCubit(),
- child: const FindBookingPage(),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.shareBooking.name}",
- name: AppRoutes.shareBooking.name,
- builder: (context, state) {
- final booking = state.extra as Booking;
- return BlocProvider(
- create: (context) => ShareBookingCubit(),
- child: ShareBookingPage(booking: booking),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.bookingDetails.name}/:id",
- name: "booking_deep_link",
- builder: (context, state) {
- final bookingId = state.pathParameters['id']!;
- return BlocProvider<OverviewCubit>(
- create: (context) => OverviewCubit(locator<OverviewRepository>())
- ..findBookingById(bookingId),
- child: BlocListener<OverviewCubit, OverviewState>(
- listener: (context, state) {},
- child: const LoadingPage(),
- ),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.loadingPage.name}",
- name: AppRoutes.loadingPage.name,
- builder: (context, state) {
- return BlocProvider(
- create: (context) => FindBookingCubit(),
- child: const LoadingPage(),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.checkIn.name}",
- name: AppRoutes.checkIn.name,
+ },
+ child: BlocProvider(
+ create: (context) => MyBookingCubit(
+ locator<MyBookingRepository>(),
+ context.read<PaymentCubit>(),
+ initialBooking: state.extra as Booking,
+ )..init(),
+ child: child,
+ ),
+ );
+ },
+ routes: [
+ GoRoute(
+ path: "/${AppRoutes.myBooking.name}",
+ name: AppRoutes.myBooking.name,
builder: (context, state) {
- return BlocProvider(
- create: (context) {
- final extras = state.extra as List<dynamic>;
- final booking = extras[0] as Booking;
- final onlyKeys = extras[1] as bool;
- if (onlyKeys) {
- return CheckInCubit.initialOnlyKeys(booking);
- }
- return CheckInCubit(booking);
- },
- child: const CheckInPage(),
- );
- }),
- GoRoute(
- path: "/${AppRoutes.overview.name}",
- name: AppRoutes.overview.name,
- builder: (context, state) {
- return const OverviewPage();
- },
- routes: [
- GoRoute(
- path: "profile",
- name: AppRoutes.profile.name,
- builder: (context, state) {
- return BlocProvider<ProfileCubit>(
- create: (BuildContext context) => ProfileCubit(
- profileRepository: locator<ProfileRepository>(),
- authenticationRepository:
- locator<AuthenticationRepository>())
- ..init(),
- child: const ProfilePage(), //mobileKey: key);
+ return MyBookingPage(booking: state.extra as Booking);
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.payMyBooking.name}",
+ name: AppRoutes.payMyBooking.name,
+ builder: (context, state) {
+ return const MyBookingPaymentPage();
+ },
+ ),
+ ],
+ ),
+ GoRoute(
+ path: "/${AppRoutes.paymentCards.name}",
+ name: AppRoutes.paymentCards.name,
+ builder: (context, state) {
+ return BlocProvider(
+ create: (context) => PaymentCardsCubit(adyenRepository: locator<AdyenRepository>()),
+ child: Builder(
+ builder: (context) {
+ final scaffold = state.uri.queryParameters[needsScaffold] == 'true';
+ return PaymentCardsPage(
+ needScaffold: scaffold,
+ appBar: const ComwellAppBar(shouldShowProfileButton: false),
);
},
- routes: [
- GoRoute(
- path: "profile_settings",
- name: AppRoutes.profileSettings.name,
- builder: (context, state) {
- return BlocProvider<ProfileSettingsCubit>(
- create: (BuildContext context) => ProfileSettingsCubit(
- profileRepository: locator<ProfileRepository>(),
- profileSettingsRepository:
- locator<ProfileSettingsRepository>(),
- authenticationRepository:
- locator<AuthenticationRepository>())
- ..init(),
- child: const ProfileSettingsPage(),
- );
- },
- routes: [
- GoRoute(
- path: 'change_password',
- name: AppRoutes.changePassword.name,
- builder: (context, state) {
- return const ChangePasswordModal();
- })
- ]),
- ],
),
- GoRoute(
- path: AppRoutes.pastCancelledBookings.name,
- name: AppRoutes.pastCancelledBookings.name,
- builder: (context, state) {
- final extras = state.extra as List<dynamic>;
- Booking booking = extras[0] as Booking;
- bool isCancelled = extras[1] as bool;
- return PastCancelledBookingDetailPage(
- booking: booking, isCancelled: isCancelled);
- }),
- GoRoute(
- path: AppRoutes.bookingDetails.name,
- name: AppRoutes.bookingDetails.name,
+ );
+ },
+ ),
+ GoRoute(
+ path: "/redeem",
+ name: AppRoutes.redeem.name,
+ builder: (context, state) => const RedeemPage(),
+ ),
+ GoRoute(
+ path: "/${AppRoutes.preregistration.name}",
+ name: AppRoutes.preregistration.name,
+ builder: (context, state) {
+ final extras = state.extra as List<dynamic>;
+ final booking = extras[0] as Booking;
+ return BlocProvider(
+ create: (context) => PreregistrationCubit(booking: booking)..init(),
+ child: const PreregistrationFlow(),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.houseKeeping.name}",
+ name: AppRoutes.houseKeeping.name,
+ builder: (context, state) {
+ final booking = state.extra as Booking;
+ return HousekeepingPage(booking: booking);
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.checkOut.name}",
+ name: AppRoutes.checkOut.name,
+ builder: (context, state) {
+ final booking = state.extra as Booking;
+ return BlocProvider(
+ create: (context) =>
+ CheckoutCubit(booking, locator<CheckOutRepository>(), context.read<PaymentCubit>())
+ ..init(),
+ child: BlocBuilder<CheckoutCubit, CheckoutState>(
builder: (context, state) {
- final booking = state.extra as Booking;
- return BlocProvider<BookingDetailsBloc>(
- create: (BuildContext context) => BookingDetailsBloc(booking,
- bookingDetailsRepository:
- locator<BookingDetailsRepository>(),
- profileRepository: locator<ProfileRepository>(),
- upSaleRepository: locator<UpSalesRepository>(),
- houseKeepingRepository: locator<HouseKeepingRepository>()),
- child: const BookingDetailsPage(),
- );
+ return CheckOutFlow(key: ValueKey(state));
},
- routes: [
- GoRoute(
- path: "key",
- name: AppRoutes.key.name,
- builder: (context, state) {
- final roomNumber = state.extra as String? ?? '';
- return KeyPage(roomNumber: roomNumber);
- },
- ),
- ],
),
- ],
- ),
- ShellRoute(
- pageBuilder: (context, state, child) {
- return CustomTransitionPage(
- transitionsBuilder:
- (context, animation, secondaryAnimation, child) {
- return SlideTransition(
- position: Tween<Offset>(
- begin: const Offset(1.0, 0.0),
- end: Offset.zero,
- ).animate(CurvedAnimation(
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.paymentProcessing.name}",
+ name: AppRoutes.paymentProcessing.name,
+ builder: (context, state) => const PaymentProcessingPage(),
+ ),
+ GoRoute(
+ path: "/${AppRoutes.notifications.name}",
+ name: AppRoutes.notifications.name,
+ builder: (context, state) {
+ return BlocProvider(
+ create: (context) => NotificationsCubit(locator<NotificationsRepository>())..init(),
+ child: const NotificationsPage(
+ notificationPermissions: [],
+ ),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.checkOutSuccess.name}",
+ name: AppRoutes.checkOutSuccess.name,
+ builder: (context, state) {
+ final digitalCard = state.extra as bool;
+ return CheckOutSuccessPage(digitalCard: digitalCard);
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.checkOutError.name}",
+ name: AppRoutes.checkOutError.name,
+ builder: (context, state) => const CheckOutErrorPage(),
+ ),
+ ShellRoute(
+ pageBuilder: (context, state, child) {
+ return CustomTransitionPage<void>(
+ key: state.pageKey,
+ child: BlocProvider(
+ create: (_) {
+ final extras = state.extra as List<dynamic>;
+
+ return UpSalesCubit(
+ upSaleRepository: locator<UpSalesRepository>(),
+ booking: extras[0] as Booking,
+ )..init();
+ },
+ child: child,
+ ),
+ transitionsBuilder: (context, animation, secondaryAnimation, child) {
+ return SlideTransition(
+ position:
+ Tween<Offset>(
+ begin: const Offset(1.0, 0.0),
+ end: Offset.zero,
+ ).animate(
+ CurvedAnimation(
parent: animation,
curve: Curves.easeInOut,
- )),
- child: child,
- );
- },
- child: BlocProvider(
- create: (context) => MyBookingCubit(
- locator<MyBookingRepository>(),
- context.read<PaymentCubit>(),
- initialBooking: state.extra as Booking)
- ..init(),
- child: child));
+ ),
+ ),
+ child: child,
+ );
},
- routes: [
- GoRoute(
- path: "/${AppRoutes.myBooking.name}",
- name: AppRoutes.myBooking.name,
- builder: (context, state) {
- return MyBookingPage(booking: state.extra as Booking);
- }),
- GoRoute(
- path: "/${AppRoutes.payMyBooking.name}",
- name: AppRoutes.payMyBooking.name,
- builder: (context, state) {
- return const MyBookingPaymentPage();
- }),
- ]),
- GoRoute(
- path: "/${AppRoutes.paymentCards.name}",
- name: AppRoutes.paymentCards.name,
+ transitionDuration: const Duration(milliseconds: 250),
+ );
+ },
+ routes: [
+ GoRoute(
+ path: "/${AppRoutes.upSalesCatalog.name}",
+ name: AppRoutes.upSalesCatalog.name,
builder: (context, state) {
- return BlocProvider(
- create: (context) => PaymentCardsCubit(adyenRepository: locator<AdyenRepository>()),
- child: Builder(builder: (context) {
- final scaffold =
- state.uri.queryParameters[needsScaffold] == 'true';
- return PaymentCardsPage(needScaffold: scaffold, appBar: const ComwellAppBar(shouldShowProfileButton: false));
- }));
- }),
- GoRoute(
- path: "/login",
- name: AppRoutes.login.name,
- builder: (context, state) {
- final queryForced = state.uri.queryParameters['forced'] ?? 'false';
- final forced = bool.parse(queryForced);
- return BlocProvider(
- create: (context) => LoginCubit(
- authRepository: locator.get(),
- forced: forced,
- ),
- child: const LoginPage());
- },
- ),
- GoRoute(
- path: "/redeem",
- name: AppRoutes.redeem.name,
- builder: (context, state) => const RedeemPage(),
- ),
- GoRoute(
- path: "/${AppRoutes.preregistration.name}",
- name: AppRoutes.preregistration.name,
+ return const UpSalesCatalog();
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.roomUpgrade.name}",
+ name: AppRoutes.roomUpgrade.name,
+ builder: (context, state) {
+ return RoomUpgradePage(roomUpgradeList: state.extra as RoomUpgradeList);
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.addonUpgrade.name}",
+ name: AppRoutes.addonUpgrade.name,
builder: (context, state) {
final extras = state.extra as List<dynamic>;
- final booking = extras[0] as Booking;
- return BlocProvider(
- create: (context) =>
- PreregistrationCubit(booking: booking)..init(),
- child: const PreregistrationFlow(),
+ return AddonUpgradePage(
+ addonUpgrade: extras[0] as AddOnUpgrade,
+ extrasTotalPrice: extras[1] as int,
+ selectedRoomUpgrade: extras[2] as String,
);
- }),
- GoRoute(
- path: "/${AppRoutes.houseKeeping.name}",
- name: AppRoutes.houseKeeping.name,
- builder: (context, state) {
- final booking = state.extra as Booking;
- return HousekeepingPage(booking: booking);
- },
- ),
- GoRoute(
- path: "/${AppRoutes.checkOut.name}",
- name: AppRoutes.checkOut.name,
- builder: (context, state) {
- final booking = state.extra as Booking;
- return BlocProvider(
- create: (context) => CheckoutCubit(booking,
- locator<CheckOutRepository>(), context.read<PaymentCubit>())
- ..init(),
- child: BlocBuilder<CheckoutCubit, CheckoutState>(
- builder: (context, state) {
- return CheckOutFlow(key: ValueKey(state));
- }));
- },
- ),
- GoRoute(
- path: "/${AppRoutes.paymentProcessing.name}",
- name: AppRoutes.paymentProcessing.name,
- builder: (context, state) => const PaymentProcessingPage(),
- ),
- GoRoute(
- path: "/${AppRoutes.notifications.name}",
- name: AppRoutes.notifications.name,
- builder: (context, state) {
- return BlocProvider(
- create: (context) =>
- NotificationsCubit(locator<NotificationsRepository>())..init(),
- child: const NotificationsPage(
- notificationPermissions: [],
- ),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.checkOutSuccess.name}",
- name: AppRoutes.checkOutSuccess.name,
- builder: (context, state) {
- final digitalCard = state.extra as bool;
- return CheckOutSuccessPage(digitalCard: digitalCard);
- },
- ),
- GoRoute(
- path: "/${AppRoutes.checkOutError.name}",
- name: AppRoutes.checkOutError.name,
- builder: (context, state) => const CheckOutErrorPage(),
- ),
- ShellRoute(
- pageBuilder: (context, state, child) {
- return CustomTransitionPage<void>(
- key: state.pageKey,
- child: BlocProvider(
- create: (_) {
- final extras = state.extra as List<dynamic>;
-
- return UpSalesCubit(
- upSaleRepository: locator<UpSalesRepository>(),
- booking: extras[0] as Booking,
- )..init();
- },
- child: child,
- ),
- transitionsBuilder:
- (context, animation, secondaryAnimation, child) {
- return SlideTransition(
- position: Tween<Offset>(
- begin: const Offset(1.0, 0.0),
- end: Offset.zero,
- ).animate(CurvedAnimation(
- parent: animation,
- curve: Curves.easeInOut,
- )),
- child: child,
- );
- },
- transitionDuration: const Duration(milliseconds: 250),
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.servicesUpgrade.name}",
+ name: AppRoutes.servicesUpgrade.name,
+ builder: (context, state) {
+ return ServicesUpgradePage(roomUpgradeList: state.extra as RoomUpgradeList);
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.upSaleConfirmation.name}",
+ name: AppRoutes.upSaleConfirmation.name,
+ builder: (context, state) {
+ final extras = state.extra as List<dynamic>;
+ final selectedUpSales = extras[0] as List<AddOnUpgrade?>;
+ final extrasTotalPrice = extras[1] as int;
+ final selectedRoomUpgrade = extras[2] as RoomUpgrade?;
+ return UpSaleConfirmationPage(
+ selectedUpSales: selectedUpSales.whereType<AddOnUpgrade>().toList(),
+ extrasTotalPrice: extrasTotalPrice,
+ selectedRoomUpgrade: selectedRoomUpgrade,
);
},
- routes: [
- GoRoute(
- path: "/${AppRoutes.upSalesCatalog.name}",
- name: AppRoutes.upSalesCatalog.name,
- builder: (context, state) {
- return const UpSalesCatalog();
- },
- ),
- GoRoute(
- path: "/${AppRoutes.roomUpgrade.name}",
- name: AppRoutes.roomUpgrade.name,
- builder: (context, state) {
- return RoomUpgradePage(
- roomUpgradeList: state.extra as RoomUpgradeList);
- },
- ),
- GoRoute(
- path: "/${AppRoutes.addonUpgrade.name}",
- name: AppRoutes.addonUpgrade.name,
- builder: (context, state) {
- final extras = state.extra as List<dynamic>;
- return AddonUpgradePage(
- addonUpgrade: extras[0] as AddOnUpgrade,
- extrasTotalPrice: extras[1] as int,
- selectedRoomUpgrade: extras[2] as String,
- );
- }),
- GoRoute(
- path: "/${AppRoutes.servicesUpgrade.name}",
- name: AppRoutes.servicesUpgrade.name,
- builder: (context, state) {
- return ServicesUpgradePage(
- roomUpgradeList: state.extra as RoomUpgradeList);
- },
- ),
- GoRoute(
- path: "/${AppRoutes.upSaleConfirmation.name}",
- name: AppRoutes.upSaleConfirmation.name,
- builder: (context, state) {
- final extras = state.extra as List<dynamic>;
- final selectedUpSales = extras[0] as List<AddOnUpgrade?>;
- final extrasTotalPrice = extras[1] as int;
- final selectedRoomUpgrade = extras[2] as RoomUpgrade?;
- return UpSaleConfirmationPage(
- selectedUpSales:
- selectedUpSales.whereType<AddOnUpgrade>().toList(),
- extrasTotalPrice: extrasTotalPrice,
- selectedRoomUpgrade: selectedRoomUpgrade);
- },
- ),
- GoRoute(
- path: "/${AppRoutes.upSalesProcessing.name}",
- name: AppRoutes.upSalesProcessing.name,
- builder: (context, state) {
- final cubit = context.read<UpSalesCubit>();
- cubit.addUpSalesToBooking();
+ ),
+ GoRoute(
+ path: "/${AppRoutes.upSalesProcessing.name}",
+ name: AppRoutes.upSalesProcessing.name,
+ builder: (context, state) {
+ final cubit = context.read<UpSalesCubit>();
+ cubit.addUpSalesToBooking();
- return BlocBuilder<UpSalesCubit, UpSalesState>(
- builder: (context, state) {
- return UpSalesProcessingPage(key: ValueKey(state));
- });
+ return BlocBuilder<UpSalesCubit, UpSalesState>(
+ builder: (context, state) {
+ return UpSalesProcessingPage(key: ValueKey(state));
},
- ),
- GoRoute(
- path: "/${AppRoutes.upSalesError.name}",
- name: AppRoutes.upSalesError.name,
- builder: (context, state) => const UpSalesErrorPage(),
- ),
- ]),
- GoRoute(
- path: "/${AppRoutes.chooseShareRoom.name}",
- name: AppRoutes.chooseShareRoom.name,
- builder: (context, state) {
- final booking = state.extra as Booking;
- return BlocProvider(
- create: (context) =>
- ChooseShareRoomCubit(locator<ChooseShareRoomRepository>())
- ..init(),
- child: ChooseShareRoomPage(booking: booking),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.roomInfo.name}",
- name: AppRoutes.roomInfo.name,
- builder: (context, state) {
- final extras = state.extra as List<dynamic>;
- final booking = extras[0] as Booking;
- final isAssigned = extras[1] as bool;
- return BlocProvider(
- create: (context) =>
- ChooseShareRoomCubit(locator<ChooseShareRoomRepository>()),
- child: RoomInfoPage(booking: booking, isAssigned: isAssigned),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.shareRoom.name}",
- builder: (context, state) {
- final booking = state.extra as Booking;
- return BlocProvider(
- create: (context) =>
- ChooseShareRoomCubit(locator<ChooseShareRoomRepository>()),
- child: ShareRoomPage(booking: booking),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.receivedSharedRoom.name}",
- name: AppRoutes.receivedSharedRoom.name,
- builder: (context, state) {
- final sharingId = state.uri.queryParameters['sharingId'];
- final hotelCode = state.uri.queryParameters['hotelCode'];
- debugPrint("Received shared room: $sharingId $hotelCode ${state.uri}");
- return BlocProvider(
- create: (context) =>
- ReceivedSharedRoomCubit(sharingId ?? '', hotelCode ?? '')
- ..init(),
- child: const ReceivedSharedRoomPage(),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.receivedSharedBooking.name}",
- name: AppRoutes.receivedSharedBooking.name,
- builder: (context, state) {
- final sharingId = state.uri.queryParameters['sharingId'];
- final hotelCode = state.uri.queryParameters['hotelCode'];
- debugPrint("Received shared booking: $sharingId $hotelCode ${state.uri}");
- return BlocProvider(
- create: (context) =>
- ReceivedSharedBookingCubit(sharingId ?? '', hotelCode ?? '')
- ..init(),
- child: const ReceivedSharedBookingPage(),
- );
- },
- ),
- GoRoute(
- path: "/${AppRoutes.forceUpdate.name}",
- name: AppRoutes.forceUpdate.name,
- builder: (context, state) {
- return const ForceUpdatePage();
- }),
- /* GoRoute(
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.upSalesError.name}",
+ name: AppRoutes.upSalesError.name,
+ builder: (context, state) => const UpSalesErrorPage(),
+ ),
+ ],
+ ),
+ GoRoute(
+ path: "/${AppRoutes.chooseShareRoom.name}",
+ name: AppRoutes.chooseShareRoom.name,
+ builder: (context, state) {
+ final booking = state.extra as Booking;
+ return BlocProvider(
+ create: (context) => ChooseShareRoomCubit(locator<ChooseShareRoomRepository>())..init(),
+ child: ChooseShareRoomPage(booking: booking),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.roomInfo.name}",
+ name: AppRoutes.roomInfo.name,
+ builder: (context, state) {
+ final extras = state.extra as List<dynamic>;
+ final booking = extras[0] as Booking;
+ final isAssigned = extras[1] as bool;
+ return BlocProvider(
+ create: (context) => ChooseShareRoomCubit(locator<ChooseShareRoomRepository>()),
+ child: RoomInfoPage(booking: booking, isAssigned: isAssigned),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.shareRoom.name}",
+ builder: (context, state) {
+ final booking = state.extra as Booking;
+ return BlocProvider(
+ create: (context) => ChooseShareRoomCubit(locator<ChooseShareRoomRepository>()),
+ child: ShareRoomPage(booking: booking),
+ );
+ },
+ ),
+ GoRoute(
+ path: AppRoutes.receivedSharedRoom,
+ builder: (context, state) {
+ final sharingId = state.uri.queryParameters['sharingId'];
+ final hotelCode = state.uri.queryParameters['hotelCode'];
+ debugPrint("Received shared room: $sharingId $hotelCode ${state.uri}");
+ return BlocProvider(
+ create: (context) => ReceivedSharedRoomCubit(sharingId ?? '', hotelCode ?? '')..init(),
+ child: const ReceivedSharedRoomPage(),
+ );
+ },
+ ),
+ GoRoute(
+ path: AppRoutes.receivedSharedBooking,
+ builder: (context, state) {
+ final sharingId = state.uri.queryParameters['sharingId'];
+ final hotelCode = state.uri.queryParameters['hotelCode'];
+ debugPrint("Received shared booking: $sharingId $hotelCode ${state.uri}");
+ return BlocProvider(
+ create: (context) => ReceivedSharedBookingCubit(sharingId ?? '', hotelCode ?? '')..init(),
+ child: const ReceivedSharedBookingPage(),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/${AppRoutes.forceUpdate.name}",
+ name: AppRoutes.forceUpdate.name,
+ builder: (context, state) {
+ return const ForceUpdatePage();
+ },
+ ),
+ /* GoRoute(
path: "/keys",
name: AppRoutes.keys.name,
builder: (context, state) {
@@ -650,7 +545,7 @@ final router = GoRouter(
return KeyPage(List<mobileKey>: keys);
},
) */
- /*
+ /*
GoRoute(
path: "/login",
name: AppRoutes.login.name,
@@ -683,4 +578,5 @@ final router = GoRouter(
transitionDuration: const Duration(milliseconds: 1000),
);
}) */
- ]);
+ ],
+);
diff --git a/comwell_key_app/lib/routing/app_routes.dart b/comwell_key_app/lib/routing/app_routes.dart
index dcb2cd90..07c0ab13 100644
--- a/comwell_key_app/lib/routing/app_routes.dart
+++ b/comwell_key_app/lib/routing/app_routes.dart
@@ -1,16 +1,12 @@
enum AppRoutes {
- receivedSharedRoom,
- receivedSharedBooking,
welcome,
initial,
redeem,
key,
keys,
settings,
- login,
sheet,
profile,
- overview,
profileSettings,
bookingDetails,
pastCancelledBookings,
@@ -44,4 +40,14 @@ enum AppRoutes {
paymentProcessing,
checkOutSuccess,
checkOutError,
+ onboarding;
+
+ static const splash = "/";
+ static const login = "/login";
+ static const overview = "/overview";
+ static const onboardingBluetooth = "/onboarding/bluetooth";
+ static const onboardingNotification = "/onboarding/notification";
+ static const onboardingUsageTracking = "/onboarding/usage-tracking";
+ static const receivedSharedRoom = "/received-shared-room";
+ static const receivedSharedBooking = "/received-shared-booking";
}
diff --git a/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart b/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
index 99fa300f..91ecd215 100644
--- a/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
+++ b/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
@@ -1,5 +1,5 @@
import 'package:comwell_key_app/authentication/authentication_repository.dart';
-import 'package:comwell_key_app/services/token_error_type.dart';
+import 'package:comwell_key_app/utils/env_utils.dart';
import 'package:comwell_key_app/utils/locator.dart';
import 'package:dio/dio.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
@@ -10,37 +10,27 @@ import 'package:flutter/material.dart';
class ResponseHandleInterceptor extends Interceptor {
final Dio _dio;
- final FlutterSecureStorage _secureStorageService =
- const FlutterSecureStorage();
+ final FlutterSecureStorage _secureStorageService = const FlutterSecureStorage();
- final AuthenticationRepository _authenticationRepository =
- locator<AuthenticationRepository>();
+ final AuthenticationRepository _authenticationRepository = locator<AuthenticationRepository>();
int retryCount = 0;
ResponseHandleInterceptor(this._dio);
+ Future<void> checkAuth(RequestOptions requestOptions) async {
+ final accessToken = await _secureStorageService.read(key: constants.accessToken);
+ if (accessToken != null) {
+ requestOptions.headers['Authorization'] = accessToken;
+ }
+ }
+
@override
Future<dynamic> onRequest(
RequestOptions options,
RequestInterceptorHandler handler,
) async {
- final String? accessToken =
- await _secureStorageService.read(key: constants.accessToken);
- debugPrint('accessToken: $accessToken');
- if (accessToken == null) {
- //logout user
- options.extra["tokenErrorType"] = TokenErrorType.tokenNotFound;
- final error = DioException(
- requestOptions: options,
- type: DioExceptionType.unknown,
- error: 'Token not found');
- return handler.reject(error);
- }
-
- options.headers.addAll({
- 'Authorization':accessToken,
- 'Ocp-Apim-Subscription-Key': dotenv.env['OCP_APIM_SUBSCRIPTION_KEY']!,
- });
+ await checkAuth(options);
+ options.headers['Ocp-Apim-Subscription-Key'] = dotenv.OCP_APIM_SUBSCRIPTION_KEY;
return handler.next(options);
}
@@ -53,12 +43,14 @@ class ResponseHandleInterceptor extends Interceptor {
if (response == null) {
debugPrint('Error: No response received - ${err.message}');
- return handler.next(DioException(
- message: "No response received: ${err.message}",
- requestOptions: err.requestOptions,
- type: err.type,
- error: err.error,
- ));
+ return handler.next(
+ DioException(
+ message: "No response received: ${err.message}",
+ requestOptions: err.requestOptions,
+ type: err.type,
+ error: err.error,
+ ),
+ );
}
final statusCode = response.statusCode;
@@ -68,9 +60,10 @@ class ResponseHandleInterceptor extends Interceptor {
switch (statusCode) {
case 404:
final error = DioException(
- requestOptions: response.requestOptions,
- response: response,
- error: 'Not found: ${response.requestOptions.path}');
+ requestOptions: response.requestOptions,
+ response: response,
+ error: 'Not found: ${response.requestOptions.path}',
+ );
handler.next(error);
break;
@@ -81,9 +74,10 @@ class ResponseHandleInterceptor extends Interceptor {
case 500:
final errorMessage = _extractErrorMessage(response.data, 'Internal server error');
final error = DioException(
- requestOptions: response.requestOptions,
- response: response,
- error: errorMessage);
+ requestOptions: response.requestOptions,
+ response: response,
+ error: errorMessage,
+ );
handler.next(error);
break;
@@ -95,18 +89,20 @@ class ResponseHandleInterceptor extends Interceptor {
GoRouter.of(context).go('/forceUpdate');
}
final error = DioException(
- requestOptions: response.requestOptions,
- response: response,
- error: 'Update required');
+ requestOptions: response.requestOptions,
+ response: response,
+ error: 'Update required',
+ );
handler.next(error);
break;
default:
final errorMessage = _extractErrorMessage(response.data, 'Unknown error');
final error = DioException(
- requestOptions: response.requestOptions,
- response: response,
- error: 'HTTP $statusCode: $errorMessage');
+ requestOptions: response.requestOptions,
+ response: response,
+ error: 'HTTP $statusCode: $errorMessage',
+ );
handler.next(error);
break;
}
@@ -114,9 +110,10 @@ class ResponseHandleInterceptor extends Interceptor {
debugPrint('Error handling HTTP response: $e');
debugPrintStack(stackTrace: stackTrace);
final error = DioException(
- requestOptions: response.requestOptions,
- response: response,
- error: 'Failed to handle response (HTTP $statusCode): $e');
+ requestOptions: response.requestOptions,
+ response: response,
+ error: 'Failed to handle response (HTTP $statusCode): $e',
+ );
handler.next(error);
}
}
@@ -138,7 +135,7 @@ class ResponseHandleInterceptor extends Interceptor {
try {
final identifier = await _secureStorageService.read(key: constants.identifier);
-
+
if (identifier == null || identifier.isEmpty) {
debugPrint('No identifier found. Cannot refresh token. Forcing logout.');
retryCount = 0;
@@ -148,7 +145,7 @@ class ResponseHandleInterceptor extends Interceptor {
debugPrint('Attempting silent token acquisition...');
final authResult = await _authenticationRepository.acquireTokenSilent(identifier);
-
+
if (authResult.accessToken.isEmpty) {
debugPrint('Received empty token. Forcing logout.');
retryCount = 0;
@@ -167,7 +164,7 @@ class ResponseHandleInterceptor extends Interceptor {
'Authorization': authResult.accessToken,
},
);
-
+
final retryRequest = await _dio.request<dynamic>(
response.requestOptions.path,
options: opts,
@@ -189,10 +186,10 @@ class ResponseHandleInterceptor extends Interceptor {
if (data == null) return fallback;
if (data is String) return data;
if (data is Map) {
- return data['detail']?.toString() ??
- data['message']?.toString() ??
- data['error']?.toString() ??
- fallback;
+ return data['detail']?.toString() ??
+ data['message']?.toString() ??
+ data['error']?.toString() ??
+ fallback;
}
return fallback;
}
@@ -205,4 +202,4 @@ class ResponseHandleInterceptor extends Interceptor {
retryCount = 0;
return handler.next(response);
}
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/lib/themes/app_button_styles.dart b/comwell_key_app/lib/themes/app_button_styles.dart
new file mode 100644
index 00000000..6f81b14d
--- /dev/null
+++ b/comwell_key_app/lib/themes/app_button_styles.dart
@@ -0,0 +1,53 @@
+import 'package:comwell_key_app/themes/app_textstyles.dart';
+import 'package:comwell_key_app/themes/comwell_colors.dart';
+import 'package:flutter/material.dart';
+
+class AppButtonStyles {
+ final ColorScheme _colorScheme;
+ final AppTextStyles _textTheme;
+
+ AppButtonStyles(this._colorScheme, this._textTheme);
+
+ late final defaultShape = WidgetStatePropertyAll(
+ RoundedRectangleBorder(borderRadius: BorderRadiusGeometry.circular(32)),
+ );
+ late final smallShape = WidgetStatePropertyAll(
+ RoundedRectangleBorder(borderRadius: BorderRadiusGeometry.circular(8)),
+ );
+ late final squareShape = WidgetStatePropertyAll(
+ RoundedRectangleBorder(borderRadius: BorderRadiusGeometry.circular(4)),
+ );
+ late final linkShape = WidgetStatePropertyAll(
+ RoundedRectangleBorder(borderRadius: BorderRadiusGeometry.circular(2)),
+ );
+ late final defaultMinSize = const WidgetStatePropertyAll(Size(0, 48));
+ late final defaultMinSizeLarge = const WidgetStatePropertyAll(Size(240, 48));
+ late final smallMinSize = const WidgetStatePropertyAll(Size(32, 32));
+ late final squareMinSize = const WidgetStatePropertyAll(Size(36, 36));
+ late final squareMinSizeLarge = const WidgetStatePropertyAll(Size(0, 48));
+ late final defaultPadding = const WidgetStatePropertyAll(EdgeInsets.symmetric(horizontal: 16));
+ late final smallPadding = const WidgetStatePropertyAll(EdgeInsets.symmetric(horizontal: 12));
+ final squarePadding = const WidgetStatePropertyAll(EdgeInsets.all(4));
+
+ late final defaultTextStyle = WidgetStatePropertyAll(
+ _textTheme.body.copyWith(fontWeight: FontWeight.w500),
+ );
+
+ late final primaryMainDefault = ButtonStyle(
+ backgroundColor: WidgetStateProperty.fromMap({
+ WidgetState.disabled: _colorScheme.disabledText,
+ WidgetState.any: Colors.white,
+ }),
+ foregroundColor: WidgetStateProperty.fromMap({
+ WidgetState.disabled: Colors.black,
+ WidgetState.any: _colorScheme.primary,
+ }),
+ textStyle: defaultTextStyle,
+ minimumSize: defaultMinSize,
+ padding: defaultPadding,
+ shape: WidgetStateProperty.fromMap({
+ WidgetState.disabled: defaultShape.value,
+ WidgetState.any: defaultShape.value,
+ }),
+ );
+}
diff --git a/comwell_key_app/lib/themes/app_spaces.dart b/comwell_key_app/lib/themes/app_spaces.dart
new file mode 100644
index 00000000..150194ca
--- /dev/null
+++ b/comwell_key_app/lib/themes/app_spaces.dart
@@ -0,0 +1,17 @@
+import 'package:gap/gap.dart';
+
+abstract class AppSpaces {
+ static const gap02 = Gap(02);
+ static const gap04 = Gap(04);
+ static const gap08 = Gap(08);
+ static const gap12 = Gap(12);
+ static const gap16 = Gap(16);
+ static const gap24 = Gap(24);
+ static const gap32 = Gap(32);
+ static const gap40 = Gap(40);
+ static const gap48 = Gap(48);
+ static const gap56 = Gap(56);
+ static const gap60 = Gap(60);
+ static const gap80 = Gap(80);
+ static const gap120 = Gap(120);
+}
diff --git a/comwell_key_app/lib/themes/app_textstyles.dart b/comwell_key_app/lib/themes/app_textstyles.dart
new file mode 100644
index 00000000..058f39b1
--- /dev/null
+++ b/comwell_key_app/lib/themes/app_textstyles.dart
@@ -0,0 +1,12 @@
+import 'package:flutter/cupertino.dart';
+
+class AppTextStyles {
+ final fontFamilyFellix = 'Fellix';
+
+ late final _heading = TextStyle(letterSpacing: 0, fontFamily: fontFamilyFellix);
+
+ late final headingMedium = _heading.copyWith(fontSize: 18, fontWeight: FontWeight.w600);
+ late final headingSmall = _heading.copyWith(fontSize: 16, fontWeight: FontWeight.w600);
+ late final body = _heading.copyWith(fontSize: 14, fontWeight: FontWeight.w500);
+ late final bodySmall = _heading.copyWith(fontSize: 12, fontWeight: FontWeight.w500);
+}
diff --git a/comwell_key_app/lib/utils/context_utils.dart b/comwell_key_app/lib/utils/context_utils.dart
new file mode 100644
index 00000000..78c5a00e
--- /dev/null
+++ b/comwell_key_app/lib/utils/context_utils.dart
@@ -0,0 +1,17 @@
+import 'package:comwell_key_app/themes/app_textstyles.dart';
+import 'package:comwell_key_app/utils/locator.dart';
+import 'package:comwell_key_app/utils/secure_storage.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+
+import '../themes/app_button_styles.dart';
+
+extension BuildContextExt on BuildContext {
+ AppTextStyles get textStyles => read<AppTextStyles>();
+
+ ColorScheme get colorScheme => Theme.of(this).colorScheme;
+
+ AppButtonStyles get buttonStyles => read<AppButtonStyles>();
+
+ ComwellPreferences get prefs => locator.get<ComwellPreferences>();
+}
diff --git a/comwell_key_app/lib/utils/env_utils.dart b/comwell_key_app/lib/utils/env_utils.dart
new file mode 100644
index 00000000..e844a7da
--- /dev/null
+++ b/comwell_key_app/lib/utils/env_utils.dart
@@ -0,0 +1,15 @@
+import 'package:flutter_dotenv/flutter_dotenv.dart';
+
+extension EnvUtils on DotEnv {
+ String get OCP_APIM_SUBSCRIPTION_KEY => env["OCP_APIM_SUBSCRIPTION_KEY"]!;
+
+ String get ENTRA_ID_CLIENT_ID => env["ENTRA_ID_CLIENT_ID"]!;
+
+ String get ENTRA_ID_REDIRECT_URL => env["ENTRA_ID_REDIRECT_URL"]!;
+
+ String get ENTRA_ID_AUTHORITY_URL => env["ENTRA_ID_AUTHORITY_URL"]!;
+
+ String get ENTRA_API_URL => env["ENTRA_API_URL"]!;
+
+ String get SENTRY_DSN => env["SENTRY_DSN"]!;
+}
diff --git a/comwell_key_app/lib/utils/locator.dart b/comwell_key_app/lib/utils/locator.dart
index 09e62ad4..83c74afb 100644
--- a/comwell_key_app/lib/utils/locator.dart
+++ b/comwell_key_app/lib/utils/locator.dart
@@ -1,8 +1,11 @@
+import 'package:aad_b2c_webview/aad_b2c_webview.dart';
import 'package:comwell_key_app/authentication/authentication_repository.dart';
import 'package:comwell_key_app/check_out/check_out_repository.dart';
import 'package:comwell_key_app/choose_share_room/choose_share_room_repository.dart';
import 'package:comwell_key_app/contact/repository/contact_repository.dart';
import 'package:comwell_key_app/database/comwell_db.dart';
+import 'package:comwell_key_app/domain/repositories/bluetooth_repository.dart';
+import 'package:comwell_key_app/domain/repositories/internet_status_repository.dart';
import 'package:comwell_key_app/find_booking/find_booking_repository.dart';
import 'package:comwell_key_app/hotel_information/repository/hotel_information_repository.dart';
import 'package:comwell_key_app/housekeeping/housekeeping_repository.dart';
@@ -42,36 +45,30 @@ void registerDatabase() {
}
}
-
-
void setupLocator() {
locator.registerFactory<DeviceInfoPlugin>(() => DeviceInfoPlugin());
if (!kIsWeb) {
locator.registerSingleton<ComwellTracking>(ComwellTracking());
registerDatabase();
locator.registerSingleton(SeosMobileKeysPlugin());
- locator.registerFactory<KeyRepository>(() => KeyRepository(
+ locator.registerFactory<KeyRepository>(
+ () => KeyRepository(
deviceInfoPlugin: locator<DeviceInfoPlugin>(),
- seosMobileKeysPlugin: locator<SeosMobileKeysPlugin>()));
+ seosMobileKeysPlugin: locator<SeosMobileKeysPlugin>(),
+ ),
+ );
locator.registerSingleton(SeosRepository());
locator.registerFactory<OverviewRepository>(() => OverviewRepository());
- locator.registerFactory<ProfileSettingsRepository>(
- () => ProfileSettingsRepository());
- locator.registerSingleton<AuthenticationRepository>(
- AuthenticationRepository());
- locator.registerFactory<BookingDetailsRepository>(
- () => BookingDetailsRepository());
+ locator.registerFactory<ProfileSettingsRepository>(() => ProfileSettingsRepository());
+ locator.registerSingleton<AuthenticationRepository>(AuthenticationRepository());
+ locator.registerFactory<BookingDetailsRepository>(() => BookingDetailsRepository());
locator.registerFactory<ProfileRepository>(() => ProfileRepository());
- locator.registerFactory<PreregistrationRepository>(
- () => PreregistrationRepository());
- locator.registerFactory<HotelInformationRepository>(
- () => HotelInformationRepository());
- locator.registerFactory<NotificationsRepository>(
- () => NotificationsRepository());
+ locator.registerFactory<PreregistrationRepository>(() => PreregistrationRepository());
+ locator.registerFactory<HotelInformationRepository>(() => HotelInformationRepository());
+ locator.registerFactory<NotificationsRepository>(() => NotificationsRepository());
locator.registerFactory<ContactRepository>(() => ContactRepository());
locator.registerFactory<UpSalesRepository>(() => UpSalesRepository());
- locator.registerFactory<ChooseShareRoomRepository>(
- () => ChooseShareRoomRepository());
+ locator.registerFactory<ChooseShareRoomRepository>(() => ChooseShareRoomRepository());
locator.registerFactory<FindBookingRepository>(() => FindBookingRepository());
locator.registerSingleton<GlobalKey<NavigatorState>>(rootNavigatorKey);
locator.registerFactory<CheckOutRepository>(() => CheckOutRepository());
@@ -80,6 +77,13 @@ void setupLocator() {
locator.registerSingleton<SecureStorage>(SecureStorage());
locator.registerFactory<HouseKeepingRepository>(() => HouseKeepingRepository());
locator.registerFactory<PushNotificationRepository>(() => PushNotificationRepository());
- locator.registerFactory<AdyenRepository>(() => AdyenRepository(dio: HttpClient().dio,
- ));}
+ locator.registerFactory(() => BluetoothRepository());
+ locator.registerFactory(() => InternetStatusRepository());
+ locator.registerFactory<AdyenRepository>(
+ () => AdyenRepository(
+ dio: HttpClient().dio,
+ ),
+ );
+ locator.registerSingleton(ComwellPreferences());
+ }
}
diff --git a/comwell_key_app/lib/utils/secure_storage.dart b/comwell_key_app/lib/utils/secure_storage.dart
index 7cb8b322..0c35534f 100644
--- a/comwell_key_app/lib/utils/secure_storage.dart
+++ b/comwell_key_app/lib/utils/secure_storage.dart
@@ -35,3 +35,40 @@ class SecureStorage {
await _storage.write(key: key, value: value);
}
}
+
+class ComwellPreferences {
+ late final SharedPreferences _sharedPreferences;
+
+ Future<void> init() async {
+ _sharedPreferences = await SharedPreferences.getInstance();
+ }
+
+ bool get onboardingHasSeenBluetooth =>
+ _sharedPreferences.getBool(_keyOnboardingHasSeenBluetooth) ?? false;
+
+ Future<void> setOnboardingHasSeenBluetooth() async {
+ await _sharedPreferences.setBool(_keyOnboardingHasSeenBluetooth, true);
+ }
+
+ bool get onboardingHasSeenNotification =>
+ _sharedPreferences.getBool(_keyOnboardingHasSeenNotification) ?? false;
+
+ Future<void> setOnboardingHasSeenNotification() async {
+ await _sharedPreferences.setBool(_keyOnboardingHasSeenNotification, true);
+ }
+
+ bool get onboardingHasSeenUsageTracking =>
+ _sharedPreferences.getBool(_keyOnboardingHasSeenUsageTracking) ?? false;
+
+ Future<void> setOnboardingHasSeenUsageTracking() async {
+ await _sharedPreferences.setBool(_keyOnboardingHasSeenUsageTracking, true);
+ }
+
+ Future<void> clear() async {
+ await _sharedPreferences.clear();
+ }
+
+ static const _keyOnboardingHasSeenBluetooth = "_keyOnboardingHasSeenBluetooth";
+ static const _keyOnboardingHasSeenNotification = "_keyOnboardingHasSeenNotification";
+ static const _keyOnboardingHasSeenUsageTracking = "_keyOnboardingHasSeenUsageTracking";
+}
diff --git a/comwell_key_app/lib/utils/text_style_utils.dart b/comwell_key_app/lib/utils/text_style_utils.dart
new file mode 100644
index 00000000..1398c232
--- /dev/null
+++ b/comwell_key_app/lib/utils/text_style_utils.dart
@@ -0,0 +1,6 @@
+import 'package:flutter/material.dart';
+
+extension TextStyleUtils on TextStyle {
+
+ TextStyle get white => copyWith(color: Colors.white);
+}
\ No newline at end of file
diff --git a/comwell_key_app/pubspec.yaml b/comwell_key_app/pubspec.yaml
index 9b528da4..d5720f81 100644
--- a/comwell_key_app/pubspec.yaml
+++ b/comwell_key_app/pubspec.yaml
@@ -4,7 +4,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 0.0.2+21
environment:
- sdk: '>=3.5.0 <4.0.0'
+ sdk: '>=3.8.0 <4.0.0'
dependencies:
flutter:
sdk: flutter
@@ -19,7 +19,6 @@ dependencies:
bloc: ^9.1.0
flutter_bloc: ^9.1.1
easy_localization: ^3.0.7
-
flutter_dotenv: ^6.0.0
equatable: ^2.0.5
flutter_secure_storage: ^9.2.2
@@ -32,7 +31,6 @@ dependencies:
dio: ^5.5.0+1
device_info_plus: ^10.1.2
sheet: ^1.0.0
- wolt_modal_sheet: ^0.9.2
aad_b2c_webview: ^0.1.3
modal_bottom_sheet: ^3.0.0
mocktail: ^1.0.4
@@ -63,7 +61,12 @@ dependencies:
pretty_dio_logger: ^1.4.0
msal_auth: ^3.3.0
cached_network_image: ^3.4.1
-
+ gap: ^3.0.1
+ freezed: ^3.2.3
+ freezed_annotation: ^3.1.0
+ flutter_blue_plus: ^2.1.0
+ app_settings: ^7.0.0
+ internet_connection_checker_plus: ^2.9.1+2
dependency_overrides:
#Remove override when slider button updates
@@ -75,21 +78,14 @@ dev_dependencies:
sdk: flutter
flutter_lints: ^4.0.0
change_app_package_name: ^1.3.0
+ flutter_gen_runner: ^5.11.0
build_runner: ^2.4.13
json_serializable: ^6.9.0
drift_dev: ^2.23.1
-# For information on the generic Dart part of this file, see the
-# following page: https://dart.dev/tools/pub/pubspec
-
-# The following section is specific to Flutter packages.
flutter:
-
- # The following line ensures that the Material Icons font is
- # included with your application, so that you can use the icons in
- # the material Icons class.
+ generate: true
uses-material-design: true
-
assets:
- assets/msal/
- assets/animations/
@@ -98,22 +94,6 @@ flutter:
- assets/icons/
- env/
- # To add assets to your application, add an assets section, like this:
- # assets:
- # - images/a_dot_burr.jpeg
- # - images/a_dot_ham.jpeg
-
- # An image asset can refer to one or more resolution-specific "variants", see
- # https://flutter.dev/assets-and-images/#resolution-aware
-
- # For details regarding adding assets from package dependencies, see
- # https://flutter.dev/assets-and-images/#from-packages
-
- # To add custom fonts to your application, add a fonts section here,
- # in this "flutter" section. Each entry in this list should have a
- # "family" key with the font family name, and a "fonts" key with a
- # list giving the asset and other descriptors for the font. For
- # example:
fonts:
- family: Fellix
fonts:
@@ -126,18 +106,23 @@ flutter:
- asset: assets/fonts/Fellix-Light.ttf
- asset: assets/fonts/Fellix-LightItalic.ttf
- asset: assets/fonts/Fellix-Medium.ttf
+ weight: 500
- asset: assets/fonts/Fellix-MediumItalic.ttf
+ weight: 500
+ style: italic
- asset: assets/fonts/Fellix-Regular.ttf
- asset: assets/fonts/Fellix-RegularItalic.ttf
- asset: assets/fonts/Fellix-SemiBold.ttf
+ weight: 600
- asset: assets/fonts/Fellix-SemiBoldItalic.ttf
+ weight: 600
+ style: italic
- asset: assets/fonts/Fellix-Thin.ttf
- asset: assets/fonts/Fellix-ThinItalic.ttf
-
- #
- # For details regarding fonts from package dependencies,
- # see https://flutter.dev/custom-fonts/#from-packages
-
+flutter_gen:
+ output: lib/.generated/assets/
+ integrations:
+ flutter_svg: true
sentry:
upload_debug_symbols: true
upload_source_maps: true
diff --git a/comwell_key_app/scripts/gen.sh b/comwell_key_app/scripts/gen.sh
new file mode 100644
index 00000000..567555da
--- /dev/null
+++ b/comwell_key_app/scripts/gen.sh
@@ -0,0 +1,2 @@
+fvm dart run build_runner build --delete-conflicting-outputs
+# fvm flutter gen-l10n
\ No newline at end of file
diff --git a/comwell_key_app/test/overview_test/overview_cubic_test.dart b/comwell_key_app/test/overview_test/overview_cubic_test.dart
index 70883b36..2eae30eb 100644
--- a/comwell_key_app/test/overview_test/overview_cubic_test.dart
+++ b/comwell_key_app/test/overview_test/overview_cubic_test.dart
@@ -1,4 +1,6 @@
import 'package:bloc_test/bloc_test.dart';
+import 'package:comwell_key_app/overview/cubit/overview_state.dart';
+import 'package:comwell_key_app/share/share_booking_repository.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:comwell_key_app/overview/cubit/overview_cubit.dart';
@@ -7,86 +9,76 @@ import 'package:comwell_key_app/overview/models/bookings.dart';
import 'package:comwell_key_app/overview/repository/overview_repository.dart';
class MockOverviewRepository extends Mock implements OverviewRepository {}
+class MockShareBookingRepository extends Mock implements ShareBookingRepository {}
void main() {
late OverviewCubit overviewCubit;
late MockOverviewRepository mockOverviewRepository;
+ late ShareBookingRepository shareBookingRepository;
setUp(() {
mockOverviewRepository = MockOverviewRepository();
- overviewCubit = OverviewCubit(mockOverviewRepository);
+ shareBookingRepository = MockShareBookingRepository();
+ overviewCubit = OverviewCubit(mockOverviewRepository, shareBookingRepository);
});
tearDown(() {
overviewCubit.close();
});
+ final mockBooking = Booking(
+ id: '1',
+ reservationStatus: ReservationStatus.newreservation,
+ confirmationNumber: "s",
+ roomNumber: '',
+ startDate: DateTime(2021, 10, 10),
+ endDate: DateTime(2021, 10, 10),
+ image: '',
+ hotelName: '',
+ roomType: '',
+ children: 2,
+ adults: 2,
+ hotelCode: '',
+ firstName: "John",
+ lastName: "Doe",
+ bookerFirstName: "John",
+ bookerLastName: "Doe",
+ isPrimaryGuest: true,
+ bookingDate: DateTime(2021, 10, 10),
+ digitalCard: true,
+ balance: 100,
+ maskedCardNumber: "1234567890",
+ addOnItems: const [],
+ );
+
group('OverviewCubit', () {
blocTest<OverviewCubit, OverviewState>(
'emits [OverviewLoading, OverviewLoaded] when fetchBookings is successful',
build: () {
- when(() => mockOverviewRepository.fetchAllBookingsForUser())
- .thenAnswer((_) async => Bookings(
- current: [
- Booking(
- id: '1',
- reservationStatus: ReservationStatus.newreservation,
- confirmationNumber: "s",
- roomNumber: '',
- startDate: DateTime(2021, 10, 10),
- endDate: DateTime(2021, 10, 10),
- image: '',
- hotelName: '',
- roomType: '',
- children: 2,
- adults: 2,
- hotelCode: '',
- firstName: "John",
- lastName: "Doe",
- bookerFirstName: "John",
- bookerLastName: "Doe",
- isPrimaryGuest: true,
- bookingDate: DateTime(2021, 10, 10),
- digitalCard: true,
- balance: 100,
- maskedCardNumber: "1234567890",
- addOnItems: const [])
- ],
- past: const [],
- cancelled: const [],
- ));
+ when(() => mockOverviewRepository.fetchAllBookingsForUser()).thenAnswer(
+ (_) async => Bookings(
+ current: [mockBooking],
+ past: const [],
+ cancelled: const [],
+ ),
+ );
return overviewCubit;
},
act: (cubit) => cubit.fetchBookings(),
expect: () => [
- OverviewLoading(),
- OverviewLoaded(
+ const OverviewState(isLoading: true),
+ OverviewState(
+ isLoading: true,
+ bookings: Bookings(
+ current: [mockBooking],
+ past: const [],
+ cancelled: const [],
+ ),
+ ),
+ OverviewState(
+ isLoading: false,
bookings: Bookings(
- current: [
- Booking(
- id: '1',
- reservationStatus: ReservationStatus.newreservation,
- roomNumber: '',
- startDate: DateTime(2021, 10, 10),
- endDate: DateTime(2021, 10, 10),
- image: '',
- hotelName: '',
- confirmationNumber: "",
- roomType: '',
- children: 2,
- adults: 2,
- hotelCode: '',
- firstName: "John",
- lastName: "Doe",
- bookerFirstName: "John",
- bookerLastName: "Doe",
- isPrimaryGuest: true,
- bookingDate: DateTime(2021, 10, 10),
- digitalCard: true,
- balance: 100,
- maskedCardNumber: "1234567890",
- addOnItems: const [])
- ],
+ current: [mockBooking],
past: const [],
cancelled: const [],
),
@@ -97,14 +89,16 @@ void main() {
blocTest<OverviewCubit, OverviewState>(
'emits [OverviewLoading, OverviewError] when fetchBookings fails',
build: () {
- when(() => mockOverviewRepository.fetchAllBookingsForUser())
- .thenThrow(Exception('Failed to fetch bookings'));
+ when(
+ () => mockOverviewRepository.fetchAllBookingsForUser(),
+ ).thenThrow(Exception('Failed to fetch bookings'));
return overviewCubit;
},
act: (cubit) => cubit.fetchBookings(),
expect: () => [
- OverviewLoading(),
- const OverviewError(error: 'Exception: Failed to fetch bookings'),
+ const OverviewState(isLoading: true),
+ const OverviewState(isLoading: true, errorType: OverviewStateError.error),
+ const OverviewState(isLoading: false, errorType: OverviewStateError.error),
],
);
@@ -113,64 +107,18 @@ void main() {
build: () {
return overviewCubit;
},
- seed: () => const OverviewLoaded(
+ seed: () => const OverviewState(
bookings: Bookings(
current: [],
past: [],
cancelled: [],
),
),
- act: (cubit) => cubit.addBooking(Booking(
- id: '1',
- roomNumber: '',
- startDate: DateTime(2021, 10, 10),
- endDate: DateTime(2021, 10, 10),
- confirmationNumber: "",
- image: '',
- hotelName: '',
- roomType: "",
- children: 2,
- adults: 2,
- hotelCode: '',
- firstName: "John",
- lastName: "Doe",
- bookerFirstName: "John",
- bookerLastName: "Doe",
- isPrimaryGuest: true,
- bookingDate: DateTime(2021, 10, 10),
- digitalCard: true,
- balance: 100,
- reservationStatus: ReservationStatus.newreservation,
- maskedCardNumber: "1234567890",
- addOnItems: const [])),
+ act: (cubit) => cubit.addBooking(mockBooking),
expect: () => [
- OverviewLoaded(
+ OverviewState(
bookings: Bookings(
- current: [
- Booking(
- id: '1',
- roomNumber: '',
- startDate: DateTime(2021, 10, 10),
- endDate: DateTime(2021, 10, 10),
- image: '',
- hotelName: '',
- roomType: '',
- confirmationNumber: "",
- children: 2,
- adults: 2,
- hotelCode: '',
- firstName: "John",
- lastName: "Doe",
- bookerFirstName: "John",
- bookerLastName: "Doe",
- isPrimaryGuest: true,
- bookingDate: DateTime(2021, 10, 10),
- digitalCard: true,
- balance: 100,
- reservationStatus: ReservationStatus.newreservation,
- maskedCardNumber: "1234567890",
- addOnItems: const [])
- ],
+ current: [mockBooking],
past: const [],
cancelled: const [],
),
diff --git a/payment_plugin/lib/themes/comwell_colors.dart b/payment_plugin/lib/themes/comwell_colors.dart
index f09d20e4..c377a6d7 100644
--- a/payment_plugin/lib/themes/comwell_colors.dart
+++ b/payment_plugin/lib/themes/comwell_colors.dart
@@ -1,5 +1,3 @@
-
-
import 'package:flutter/material.dart';
const colorPrimary = Color(0xFF677169);