6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 2a0da696

AuthorEdmir Suljic<esu@dwarf.dk>
Date2025-06-12 10:01:03 +0200
Made mock upgrades, created generic widget for upgrades-

Changed files

comwell_key_app/assets/icons/ic_balcony.svg        |   3 +
 comwell_key_app/assets/icons/ic_bathtub.svg        |   3 +
 comwell_key_app/assets/icons/ic_desk.svg           |   3 +
 comwell_key_app/assets/icons/ic_double_bed.svg     |   3 +
 comwell_key_app/assets/icons/ic_hairdryer.svg      |   3 +
 comwell_key_app/assets/icons/ic_ironer.svg         |   3 +
 comwell_key_app/assets/icons/ic_kettle.svg         |   3 +
 comwell_key_app/assets/icons/ic_leather_chair.svg  |   3 +
 comwell_key_app/assets/icons/ic_minibar.svg        |   3 +
 comwell_key_app/assets/icons/ic_service_bowl.svg   |   3 +
 comwell_key_app/assets/icons/ic_single_bed.svg     |   3 +
 comwell_key_app/assets/icons/ic_tv.svg             |   3 +
 comwell_key_app/assets/icons/ic_wifi.svg           |   6 +
 comwell_key_app/assets/translations/da-DK.json     |   3 +-
 comwell_key_app/assets/translations/en-US.json     |   3 +-
 .../housekeeping/models/housekeeping.g.dart        |  28 +++
 .../up_sales/models/dto/room_facility_dto.g.dart   |  18 ++
 .../up_sales/models/dto/room_upgrade_dto.g.dart    |  31 +++
 .../lib/housekeeping/models/housekeeping.dart      |   2 +
 comwell_key_app/lib/routing/app_router.dart        |   3 +-
 comwell_key_app/lib/services/api.dart              |   6 +
 comwell_key_app/lib/themes/dark_theme.dart         |   1 +
 comwell_key_app/lib/themes/light_theme.dart        |   1 +
 .../up_sales/components/up_sales_bottom_sheet.dart |  63 ++++++
 .../components/up_sales_services_widget.dart       |   4 +-
 .../components/up_sales_upgrades_widget.dart       | 186 ++++++++---------
 .../lib/up_sales/cubit/up_sales_cubit.dart         |  26 ++-
 .../lib/up_sales/cubit/up_sales_state.dart         |  47 ++++-
 .../lib/up_sales/mappers/room_facility_mapper.dart |  13 ++
 .../lib/up_sales/mappers/room_upgrade_mapper.dart  |  25 +++
 .../lib/up_sales/models/dto/room_facility_dto.dart |  17 ++
 .../lib/up_sales/models/dto/room_upgrade_dto.dart  |  32 +++
 .../lib/up_sales/models/room_facility.dart         |   6 +
 .../lib/up_sales/models/room_upgrade.dart          |  61 ++++++
 .../lib/up_sales/up_sale_repository.dart           | 173 ++++++++++++++++
 comwell_key_app/lib/up_sales/up_sales_catalog.dart | 225 +++++++++------------
 comwell_key_app/lib/utils/locator.dart             |   2 +
 37 files changed, 785 insertions(+), 233 deletions(-)

Diff

diff --git a/comwell_key_app/assets/icons/ic_balcony.svg b/comwell_key_app/assets/icons/ic_balcony.svg
new file mode 100644
index 00000000..2ff00724
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_balcony.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 1.875C6.67157 1.875 6 2.54657 6 3.375V8.625V10.125V13.125H5.25H3.75H2.25V14.625H3.75V20.625H2.25V22.125H3.75H5.25H6.75H8.25H9.75H11.25H12.75H14.25H15.75H17.25H18.75H20.25H21.75V20.625H20.25V14.625H21.75V13.125H20.25H18.75H18V10.125V8.625V3.375C18 2.54657 17.3284 1.875 16.5 1.875H7.5ZM16.5 8.625V3.375H12.75V8.625H16.5ZM11.25 8.625V3.375H7.5V8.625H11.25ZM7.5 10.125H11.25V13.125H9.75H8.25H7.5V10.125ZM12.75 10.125H16.5V13.125H15.75H14.25H12.75V10.125ZM6.75 14.625V20.625H5.25V14.625H6.75ZM9.75 20.625H8.25V14.625H9.75V20.625ZM12.75 20.625H11.25V14.625H12.75V20.625ZM15.75 20.625H14.25V14.625H15.75V20.625ZM18.75 14.625V20.625H17.25V14.625H18.75Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_bathtub.svg b/comwell_key_app/assets/icons/ic_bathtub.svg
new file mode 100644
index 00000000..e45640b4
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_bathtub.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M6 3.75C5.17157 3.75 4.5 4.42157 4.5 5.25V11.25H22.5V12.75H21V17.25C21 18.6479 20.0439 19.8225 18.75 20.1555V21.75H17.25V20.25H6.75V21.75H5.25V20.1555C3.95608 19.8225 3 18.6479 3 17.25V12.75H1.5V11.25H3V5.25C3 3.59315 4.34315 2.25 6 2.25H6.375C8.03185 2.25 9.375 3.59315 9.375 5.25H10.875V6.75H6.75V5.25H7.875C7.875 4.42157 7.20343 3.75 6.375 3.75H6ZM19.5 12.75H4.5V17.25C4.5 18.0784 5.17157 18.75 6 18.75H18C18.8284 18.75 19.5 18.0784 19.5 17.25V12.75Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_desk.svg b/comwell_key_app/assets/icons/ic_desk.svg
new file mode 100644
index 00000000..d740ee54
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_desk.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M18.1866 3L19.258 6.75001H15.2466L16.318 3L18.1866 3ZM19.7552 8.25001C20.5026 8.25001 21.0422 7.53462 20.8369 6.81595L19.5512 2.31594C19.4132 1.83298 18.9717 1.5 18.4695 1.5H16.0352C15.5329 1.5 15.0914 1.83297 14.9535 2.31594L13.6677 6.81595C13.4624 7.53462 14.002 8.25001 14.7495 8.25001H19.7552ZM16.502 8.25012V12.0002H12.002V9.37512C12.002 8.7538 11.4983 8.25012 10.877 8.25012H5.62696C5.00563 8.25012 4.50195 8.7538 4.50195 9.37512L4.50196 12.0001H3.00195V12.0002H1.5V13.5002H3.00195L3.00195 22.5001L4.50196 22.5001L4.50195 17.2501L19.502 17.2501V22.5001L21.002 22.5001V13.5002H22.5V12.0002H21.002V12.0001H19.502V12.0002H18.002V8.25012H16.502ZM19.502 15.7501V13.5002L4.50196 13.5002L4.50195 15.7501L19.502 15.7501ZM6.00196 9.75012V12.0001H10.502V9.75012H6.00196Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_double_bed.svg b/comwell_key_app/assets/icons/ic_double_bed.svg
new file mode 100644
index 00000000..7e365e94
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_double_bed.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4.5C4.5 4.08579 4.83579 3.75 5.25 3.75H18.75C19.1642 3.75 19.5 4.08579 19.5 4.5V9.75H18V6.75C18 5.92157 17.3284 5.25 16.5 5.25H7.5C6.67157 5.25 6 5.92157 6 6.75V9.75H4.5V4.5ZM6 11.25H18H19.9594L20.9594 14.25H3.04057L4.04057 11.25H6ZM16.5 6.75V9.75H12.75V6.75H16.5ZM7.5 6.75H11.25V9.75H7.5V6.75ZM3 18.75V15.75H21V18.75H3ZM3 20.25V21.75H1.5V14.1283L3 9.62829V4.5C3 3.25736 4.00736 2.25 5.25 2.25H18.75C19.9926 2.25 21 3.25736 21 4.5V9.62829L22.5 14.1283V21.75H21V20.25H3Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_hairdryer.svg b/comwell_key_app/assets/icons/ic_hairdryer.svg
new file mode 100644
index 00000000..dd5c8d6e
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_hairdryer.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.875 1.5C4.35593 1.5 1.5 4.35404 1.5 7.875C1.5 10.9302 3.65034 13.4833 6.51839 14.1052L7.74888 18.412C7.93287 19.0559 8.52144 19.4999 9.19117 19.4999H9.75V19.5C9.75 20.3284 9.07843 21 8.25 21H3.75V22.5H8.25C9.90685 22.5 11.25 21.1569 11.25 19.5V19.4999H11.7742C12.7598 19.4999 13.4775 18.5657 13.2236 17.6134L12.1625 13.6342C13.0411 13.4539 13.9674 13.247 14.884 13.0323C17.6157 12.3924 20.2869 11.6771 21.4031 11.373C22.0624 11.1934 22.5 10.5969 22.5 9.93036V5.46416C22.5 4.78011 22.0397 4.17189 21.3568 4.0092C20.2238 3.73928 17.557 3.11498 14.8356 2.55774C12.1489 2.00759 9.30514 1.5 7.875 1.5ZM10.6859 13.9186C9.69643 14.0945 8.7967 14.2196 8.11839 14.2452L9.19117 17.9999H11.7742L10.6859 13.9186ZM3 7.875C3 5.18275 5.18407 3 7.875 3C9.12131 3 11.8016 3.46761 14.5347 4.02725C17.2259 4.57831 19.8679 5.19655 21 5.46619V9.92819C19.8854 10.2318 17.2408 10.9396 14.5419 11.5718C13.1885 11.8889 11.8279 12.1853 10.643 12.4021C9.44302 12.6216 8.47211 12.75 7.875 12.75C5.18407 12.75 3 10.5672 3 7.875ZM9.75 7.875C9.75 8.91053 8.91053 9.75 7.875 9.75C6.83947 9.75 6 8.91053 6 7.875C6 6.83947 6.83947 6 7.875 6C8.91053 6 9.75 6.83947 9.75 7.875ZM11.25 7.875C11.25 9.73896 9.73896 11.25 7.875 11.25C6.01104 11.25 4.5 9.73896 4.5 7.875C4.5 6.01104 6.01104 4.5 7.875 4.5C9.73896 4.5 11.25 6.01104 11.25 7.875Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_ironer.svg b/comwell_key_app/assets/icons/ic_ironer.svg
new file mode 100644
index 00000000..2afe06aa
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_ironer.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 3.75H3V5.25H10.875V6.75001H6.75001C4.67894 6.75001 3 8.42894 3 10.5V15V15.75H3.75H21.75V14.25H4.5L4.5 12.7499L19.5 12.7499V12.7424C19.5 12.7449 19.5 12.7475 19.5 12.75H21C21 7.77945 16.9706 3.75 12 3.75ZM19.35 11.2499C18.6791 7.94522 15.8354 5.42961 12.375 5.25922V7.50001V8.25001H11.625H6.75001C5.50736 8.25001 4.5 9.25737 4.5 10.5L4.5 11.2499L19.35 11.2499ZM10.5008 17.2499C10.0866 17.2499 9.75076 17.5857 9.75076 17.9999C9.75076 18.4141 10.0866 18.7499 10.5008 18.7499C10.915 18.7499 11.2508 18.4141 11.2508 17.9999C11.2508 17.5857 10.915 17.2499 10.5008 17.2499ZM11.9996 19.4998C11.5854 19.4998 11.2496 19.8356 11.2496 20.2498C11.2496 20.664 11.5854 20.9998 11.9996 20.9998C12.4138 20.9998 12.7496 20.664 12.7496 20.2498C12.7496 19.8356 12.4138 19.4998 11.9996 19.4998ZM12.7503 17.9999C12.7503 17.5857 13.0861 17.2499 13.5003 17.2499C13.9146 17.2499 14.2503 17.5857 14.2503 17.9999C14.2503 18.4141 13.9146 18.7499 13.5003 18.7499C13.0861 18.7499 12.7503 18.4141 12.7503 17.9999ZM15.0011 19.4998C14.5869 19.4998 14.2511 19.8356 14.2511 20.2498C14.2511 20.664 14.5869 20.9998 15.0011 20.9998C15.4153 20.9998 15.7511 20.664 15.7511 20.2498C15.7511 19.8356 15.4153 19.4998 15.0011 19.4998ZM8.25 20.2498C8.25 19.8356 8.58579 19.4998 9 19.4998C9.41422 19.4998 9.75001 19.8356 9.75001 20.2498C9.75001 20.664 9.41422 20.9998 9 20.9998C8.58579 20.9998 8.25 20.664 8.25 20.2498Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_kettle.svg b/comwell_key_app/assets/icons/ic_kettle.svg
new file mode 100644
index 00000000..4a4f39bf
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_kettle.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M18.75 19.5L18.0888 11.8959C19.0788 11.638 19.7734 10.9285 20.2181 10.0823C20.7639 9.04369 20.9765 7.7422 20.9981 6.57629C21.008 6.04357 20.576 5.625 20.0625 5.625H17.2225C16.321 3.62307 14.3095 2.25 12 2.25C9.69047 2.25 7.67905 3.62307 6.77747 5.625H4.5C3.25736 5.625 2.25 6.63236 2.25 7.875V14.25H3.75V7.875C3.75 7.46079 4.08579 7.125 4.5 7.125H6.33715C6.31962 7.24223 6.30559 7.36068 6.29519 7.48026L5.25 19.5H18.75ZM18.8903 9.38444C18.644 9.85317 18.3395 10.1823 17.9549 10.3563L17.7048 7.48026C17.6944 7.36068 17.6804 7.24223 17.6628 7.125H19.4696C19.4007 7.96473 19.2131 8.77033 18.8903 9.38444ZM16.2104 7.61021C16.1961 7.44541 16.1725 7.28351 16.14 7.125H7.85998C7.82754 7.28351 7.80389 7.44541 7.78956 7.61021L6.8861 18H17.1139L16.2104 7.61021ZM12 3.75C13.4556 3.75 14.7508 4.48902 15.5124 5.625H8.48758C9.24921 4.48902 10.5444 3.75 12 3.75ZM5.25 20.625V22.125H18.75V20.625H5.25ZM12.3696 10.9177C12.111 11.5734 11.6936 12.3604 11.0564 13.0654C10.5686 13.6052 10.236 14.2245 10.0258 14.7576C9.92132 15.0227 9.84985 15.2594 9.80536 15.4443C9.78311 15.5368 9.76844 15.6128 9.75964 15.6702C9.75219 15.7188 9.7505 15.744 9.75011 15.7498C9.75 15.7514 9.75 15.7514 9.75 15.7501H8.25C8.25 15.4255 8.38182 14.8378 8.63041 14.2074C8.88895 13.5517 9.30635 12.7647 9.94357 12.0597C10.4314 11.52 10.764 10.9006 10.9742 10.3675C11.0787 10.1024 11.1501 9.8657 11.1946 9.6808C11.2169 9.58834 11.2316 9.51228 11.2404 9.45493C11.2478 9.40633 11.2495 9.38108 11.2499 9.37536V9.37535C11.25 9.37375 11.25 9.37368 11.25 9.37505H12.75C12.75 9.69966 12.6182 10.2873 12.3696 10.9177ZM14.0564 13.0654C14.6936 12.3604 15.111 11.5734 15.3696 10.9177C15.6182 10.2873 15.75 9.69966 15.75 9.37505H14.25C14.25 9.37368 14.25 9.37375 14.2499 9.37535V9.37536C14.2495 9.38108 14.2478 9.40633 14.2404 9.45493C14.2316 9.51228 14.2169 9.58834 14.1946 9.6808C14.1501 9.8657 14.0787 10.1024 13.9742 10.3675C13.764 10.9006 13.4314 11.52 12.9436 12.0597C12.3064 12.7647 11.889 13.5517 11.6304 14.2074C11.3818 14.8378 11.25 15.4255 11.25 15.7501H12.75C12.75 15.7514 12.75 15.7514 12.7501 15.7498C12.7505 15.744 12.7522 15.7188 12.7596 15.6702C12.7684 15.6128 12.7831 15.5368 12.8054 15.4443C12.8499 15.2594 12.9213 15.0227 13.0258 14.7576C13.236 14.2245 13.5686 13.6052 14.0564 13.0654Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_leather_chair.svg b/comwell_key_app/assets/icons/ic_leather_chair.svg
new file mode 100644
index 00000000..1dddcf2b
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_leather_chair.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.25 3C5.73122 3 4.5 4.23122 4.5 5.75V10.5H2.25H1.5V11.25V14.25V15H2.25H3V20.25V21H3.75H6.75H7.5V20.25H16.5V21H17.25H20.25H21V20.25V15H21.75H22.5V14.25V11.25V10.5H21.75H19.5V5.75C19.5 4.23122 18.2688 3 16.75 3H7.25ZM18 10.9013V5.75C18 5.05964 17.4404 4.5 16.75 4.5H7.25C6.55964 4.5 6 5.05964 6 5.75V10.9122C6.67182 11.3127 7.17377 11.9731 7.38712 12.75L16.5945 12.75C16.7974 11.9619 17.3124 11.2991 18 10.9013ZM16.5 14.25L7.5 14.25V15.75H16.5V14.25ZM16.5 17.25H7.5V18.75H16.5V17.25ZM3 13.5H3.75H4.5V14.25V19.5H6V13.59C6 12.6839 5.30097 12 4.5 12H3V13.5ZM20.25 13.5H21V12H19.5C18.6716 12 18 12.6716 18 13.5V19.5H19.5V14.25V13.5H20.25Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_minibar.svg b/comwell_key_app/assets/icons/ic_minibar.svg
new file mode 100644
index 00000000..3ca3e430
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_minibar.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 18V19.5H9.75V18H14.25ZM5.25 22.5H18.75C19.5779 22.4988 20.2488 21.8279 20.25 21V3C20.2492 2.17192 19.5781 1.50083 18.75 1.5H5.25C4.42192 1.50083 3.75083 2.17192 3.75 3V21C3.75083 21.8281 4.42192 22.4992 5.25 22.5ZM5.25 21V3H18.75V21H5.25Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_service_bowl.svg b/comwell_key_app/assets/icons/ic_service_bowl.svg
new file mode 100644
index 00000000..8d0a3890
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_service_bowl.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M21 18.0039V16.5039C20.9966 14.2485 20.1471 12.0763 18.6196 10.4169C17.092 8.75754 14.9975 7.73161 12.75 7.54193V6.00391H15V4.50391H9V6.00391H11.25V7.54193C9.00253 7.73161 6.908 8.75754 5.38043 10.4169C3.85285 12.0763 3.00341 14.2485 3 16.5039V18.0039H1.5V19.5039H22.5V18.0039H21ZM12 9.00391C13.7281 9.00618 15.4027 9.60419 16.7413 10.6971C18.08 11.7901 19.0009 13.3111 19.3488 15.0039H4.65112C4.99904 13.3111 5.91994 11.79 7.25861 10.6971C8.59727 9.60413 10.2718 9.00614 12 9.00391ZM4.5 16.5039H19.5V18.0039H4.5V16.5039Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_single_bed.svg b/comwell_key_app/assets/icons/ic_single_bed.svg
new file mode 100644
index 00000000..6b7d09d2
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_single_bed.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M6.75 3.75C6.33579 3.75 6 4.08579 6 4.5V9.75H8.25V6.75C8.25 5.92157 8.92157 5.25 9.75 5.25H14.25C15.0784 5.25 15.75 5.92157 15.75 6.75V9.75H18V4.5C18 4.08579 17.6642 3.75 17.25 3.75H6.75ZM15.75 11.25H8.25H5.54057L4.54057 14.25H19.4594L18.4594 11.25H15.75ZM14.25 9.75V6.75H9.75V9.75H14.25ZM4.5 15.75V18.75H19.5V15.75H4.5ZM4.5 21.75V20.25H19.5V21.75H21V14.1283L19.5 9.62829V4.5C19.5 3.25736 18.4926 2.25 17.25 2.25H6.75C5.50736 2.25 4.5 3.25736 4.5 4.5V9.62829L3 14.1283V21.75H4.5Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_tv.svg b/comwell_key_app/assets/icons/ic_tv.svg
new file mode 100644
index 00000000..5e6132bc
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_tv.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M21 3H3C2.60218 3 2.22064 3.15804 1.93934 3.43934C1.65804 3.72064 1.5 4.10218 1.5 4.5V16.5C1.5 16.8978 1.65804 17.2794 1.93934 17.5607C2.22064 17.842 2.60218 18 3 18H9V21H6V22.5H18V21H15V18H21C21.3978 18 21.7794 17.842 22.0607 17.5607C22.342 17.2794 22.5 16.8978 22.5 16.5V4.5C22.5 4.10218 22.342 3.72064 22.0607 3.43934C21.7794 3.15804 21.3978 3 21 3ZM13.5 21H10.5V18H13.5V21ZM21 16.5H3V4.5H21V16.5Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_wifi.svg b/comwell_key_app/assets/icons/ic_wifi.svg
new file mode 100644
index 00000000..616e916c
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_wifi.svg
@@ -0,0 +1,6 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M12 20.2501C12.8284 20.2501 13.5 19.5785 13.5 18.7501C13.5 17.9216 12.8284 17.2501 12 17.2501C11.1716 17.2501 10.5 17.9216 10.5 18.7501C10.5 19.5785 11.1716 20.2501 12 20.2501Z" fill="black"/>
+<path d="M7.8525 14.4251L8.9127 15.4849C9.74381 14.6934 10.8472 14.2514 11.9949 14.2501C13.1426 14.2488 14.247 14.6883 15.0799 15.478L16.14 14.4178C15.0261 13.3464 13.5402 12.7487 11.9947 12.7501C10.4492 12.7515 8.96448 13.3518 7.8525 14.4251Z" fill="black"/>
+<path d="M4.67175 11.2446L5.73195 12.3047C7.40591 10.6683 9.65349 9.75137 11.9945 9.74996C14.3354 9.74856 16.5841 10.6628 18.26 12.2972L19.32 11.2372C17.3631 9.32118 14.733 8.24875 11.9942 8.25015C9.25549 8.25155 6.62669 9.32653 4.67175 11.2446Z" fill="black"/>
+<path d="M22.5 8.05596C19.7017 5.29682 15.9298 3.75 12 3.75C8.07019 3.75 4.29831 5.29682 1.5 8.05596V8.07284L2.55322 9.12606C5.06893 6.64389 8.46049 5.25158 11.9946 5.25017C15.5287 5.24877 18.9214 6.63839 21.439 9.11856L22.5 8.05746V8.05596Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/translations/da-DK.json b/comwell_key_app/assets/translations/da-DK.json
index 2dbe2f8c..9b2f642c 100644
--- a/comwell_key_app/assets/translations/da-DK.json
+++ b/comwell_key_app/assets/translations/da-DK.json
@@ -265,5 +265,6 @@
"up_sales_catalog_title": "Tilkøbsmuligheder",
"room_upgrades": "Værelsesopgraderinger",
"other_up_sales": "Andre tilkøb",
- "read_more_up_sales": "Læs mere"
+ "read_more_up_sales": "Læs mere",
+ "continue_without_up_sales": "Fortsæt uden tilkøb"
}
\ No newline at end of file
diff --git a/comwell_key_app/assets/translations/en-US.json b/comwell_key_app/assets/translations/en-US.json
index 96ec445a..520853c4 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -264,5 +264,6 @@
"up_sales_catalog_title": "Upgrades & Services",
"room_upgrades": "Room upgrades",
"other_up_sales": "Other upgrades",
- "read_more_up_sales": "Read more"
+ "read_more_up_sales": "Read more",
+ "continue_without_up_sales": "Continue without upgrades"
}
diff --git a/comwell_key_app/lib/.generated/housekeeping/models/housekeeping.g.dart b/comwell_key_app/lib/.generated/housekeeping/models/housekeeping.g.dart
new file mode 100644
index 00000000..3149ee29
--- /dev/null
+++ b/comwell_key_app/lib/.generated/housekeeping/models/housekeeping.g.dart
@@ -0,0 +1,28 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../housekeeping/models/housekeeping.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+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,
+ );
+
+Map<String, dynamic> _$HousekeepingToJson(Housekeeping instance) =>
+ <String, dynamic>{
+ 'hotelCode': instance.hotelCode,
+ 'roomNumber': instance.roomNumber,
+ 'cleaning': instance.cleaning,
+ 'soap': instance.soap,
+ 'towels': instance.towels,
+ 'trash': instance.trash,
+ 'refill': instance.refill,
+ };
diff --git a/comwell_key_app/lib/.generated/up_sales/models/dto/room_facility_dto.g.dart b/comwell_key_app/lib/.generated/up_sales/models/dto/room_facility_dto.g.dart
new file mode 100644
index 00000000..8f4cb7fc
--- /dev/null
+++ b/comwell_key_app/lib/.generated/up_sales/models/dto/room_facility_dto.g.dart
@@ -0,0 +1,18 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../../up_sales/models/dto/room_facility_dto.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+RoomFacilityDTO _$RoomFacilityDTOFromJson(Map json) => RoomFacilityDTO(
+ name: json['name'] as String,
+ icon: json['icon'] as String,
+ );
+
+Map<String, dynamic> _$RoomFacilityDTOToJson(RoomFacilityDTO instance) =>
+ <String, dynamic>{
+ 'name': instance.name,
+ 'icon': instance.icon,
+ };
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
new file mode 100644
index 00000000..0c82106a
--- /dev/null
+++ b/comwell_key_app/lib/.generated/up_sales/models/dto/room_upgrade_dto.g.dart
@@ -0,0 +1,31 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../../up_sales/models/dto/room_upgrade_dto.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+RoomUpgradeDTO _$RoomUpgradeDTOFromJson(Map json) => RoomUpgradeDTO(
+ name: json['name'] as String,
+ price: json['price'] as String,
+ images: (json['images'] as List<dynamic>).map((e) => e as String),
+ description: json['description'] as String,
+ id: json['id'] as String,
+ tags: (json['tags'] as List<dynamic>).map((e) => e as String),
+ facilities: (json['facilities'] as List<dynamic>).map(
+ (e) => RoomFacilityDTO.fromJson(Map<String, dynamic>.from(e as Map))),
+ type: json['type'] as String,
+ );
+
+Map<String, dynamic> _$RoomUpgradeDTOToJson(RoomUpgradeDTO instance) =>
+ <String, dynamic>{
+ 'name': instance.name,
+ 'price': instance.price,
+ 'images': instance.images.toList(),
+ 'description': instance.description,
+ 'id': instance.id,
+ 'tags': instance.tags.toList(),
+ 'facilities': instance.facilities.map((e) => e.toJson()).toList(),
+ 'type': instance.type,
+ };
diff --git a/comwell_key_app/lib/housekeeping/models/housekeeping.dart b/comwell_key_app/lib/housekeeping/models/housekeeping.dart
index 993dec51..20fcbdf7 100644
--- a/comwell_key_app/lib/housekeeping/models/housekeeping.dart
+++ b/comwell_key_app/lib/housekeeping/models/housekeeping.dart
@@ -1,6 +1,8 @@
import 'package:comwell_key_app/housekeeping/components/housekeeping_service.dart';
import 'package:json_annotation/json_annotation.dart';
+part '../../.generated/housekeeping/models/housekeeping.g.dart';
+
@JsonSerializable()
class Housekeeping {
final String hotelCode;
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index b0dea53f..6abdee43 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -46,6 +46,7 @@ import 'package:comwell_key_app/routing/go_router_observer.dart';
import 'package:comwell_key_app/share/cubit/share_booking_cubit.dart';
import 'package:comwell_key_app/share/share_booking_page.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_cubit.dart';
+import 'package:comwell_key_app/up_sales/up_sale_repository.dart';
import 'package:comwell_key_app/up_sales/up_sales_catalog.dart';
import 'package:comwell_key_app/utils/stream_to_listenable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -366,7 +367,7 @@ GoRouter goRouter() {
name: AppRoutes.upSalesCatalog.name,
builder: (context, state) {
return BlocProvider(
- create: (context) => UpSalesCubit(),
+ create: (context) => UpSalesCubit(upSaleRepository: locator<UpSaleRepository>())..init(),
child: const UpSalesCatalog(),
);
},
diff --git a/comwell_key_app/lib/services/api.dart b/comwell_key_app/lib/services/api.dart
index 6349eeb3..03b2823a 100644
--- a/comwell_key_app/lib/services/api.dart
+++ b/comwell_key_app/lib/services/api.dart
@@ -230,4 +230,10 @@ class Api {
return BookingDTO.fromJson(response.data!);
}
+
+ Future<Json> fetchUpSales() async {
+ // final response = await dio.get<Json>(ApiEndpoints.upSales);
+ // return response.data!.map((json) => RoomUpgrade.fromJson(json)).toList();
+ return {};
+ }
}
diff --git a/comwell_key_app/lib/themes/dark_theme.dart b/comwell_key_app/lib/themes/dark_theme.dart
index 84a25860..6195139d 100644
--- a/comwell_key_app/lib/themes/dark_theme.dart
+++ b/comwell_key_app/lib/themes/dark_theme.dart
@@ -38,6 +38,7 @@ ThemeData darkTheme = ThemeData(
surfaceTint: colorHeadlineText),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
+ elevation: 0,
backgroundColor: sandColor[80],
textStyle: const TextStyle(
color: Colors.white,
diff --git a/comwell_key_app/lib/themes/light_theme.dart b/comwell_key_app/lib/themes/light_theme.dart
index dd4b2cb1..6a2edf58 100644
--- a/comwell_key_app/lib/themes/light_theme.dart
+++ b/comwell_key_app/lib/themes/light_theme.dart
@@ -42,6 +42,7 @@ ThemeData lightTheme = ThemeData(
surfaceTint: colorHeadlineText),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
+ elevation: 0,
backgroundColor: sandColor[80],
minimumSize: const Size(100, 52),
textStyle: const TextStyle(
diff --git a/comwell_key_app/lib/up_sales/components/up_sales_bottom_sheet.dart b/comwell_key_app/lib/up_sales/components/up_sales_bottom_sheet.dart
new file mode 100644
index 00000000..216a783e
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/components/up_sales_bottom_sheet.dart
@@ -0,0 +1,63 @@
+import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+
+class UpSalesBottomSheet extends StatelessWidget {
+ final VoidCallback? onContinue;
+
+ const UpSalesBottomSheet({
+ super.key,
+ this.onContinue,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ return Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const Divider(
+ color: colorDivider,
+ height: 0,
+ ),
+ Row(
+ children: [
+ Expanded(
+ child: Container(
+ color: Colors.white,
+ child: Padding(
+ padding: const EdgeInsets.only(
+ left: 16.0,
+ right: 16.0,
+ top: 16.0,
+ bottom: 40,
+ ),
+ child: ElevatedButton(
+ onPressed: onContinue,
+ style: ButtonStyle(
+ elevation: WidgetStateProperty.all(0),
+ backgroundColor: WidgetStateProperty.resolveWith((states) {
+
+ return sandColor[80];
+ }),
+ foregroundColor: const WidgetStatePropertyAll(Colors.white),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 16.0),
+ child: Text(
+ "continue_without_up_sales".tr(),
+ style: theme.textTheme.headlineSmall?.copyWith(
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart b/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
index 9e7f61c3..7376ed0f 100644
--- a/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
+++ b/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
@@ -1,8 +1,10 @@
+import 'package:comwell_key_app/services/api.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:comwell_key_app/up_sales/components/comwell_radio_button.dart';
import 'package:comwell_key_app/up_sales/components/tags.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_cubit.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_state.dart';
+import 'package:comwell_key_app/up_sales/up_sale_repository.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -17,7 +19,7 @@ class UpSalesServicesWidget extends StatelessWidget {
final theme = Theme.of(context);
return BlocProvider(
- create: (context) => UpSalesCubit(),
+ create: (context) => UpSalesCubit(upSaleRepository: UpSaleRepository()),
child: BlocBuilder<UpSalesCubit, UpSalesState>(builder: (context, state) {
final cubit = context.read<UpSalesCubit>();
return Padding(
diff --git a/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart b/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
index b60a9188..a8ab248a 100644
--- a/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
+++ b/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
@@ -1,6 +1,8 @@
import 'package:comwell_key_app/up_sales/components/comwell_radio_button.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_cubit.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_state.dart';
+import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
+import 'package:comwell_key_app/up_sales/up_sale_repository.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
@@ -9,110 +11,108 @@ import 'package:flutter_bloc/flutter_bloc.dart';
class UpSalesUpgradesWidget extends StatelessWidget {
final double width;
final double height;
- const UpSalesUpgradesWidget({super.key, this.width = 328, this.height = 270});
+ final RoomUpgrade roomUpgrade;
+ const UpSalesUpgradesWidget({super.key, this.width = 328, this.height = 268, required this.roomUpgrade});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
- return BlocProvider(
- create: (context) => UpSalesCubit(),
- child: BlocBuilder<UpSalesCubit, UpSalesState>(builder: (context, state) {
- final cubit = context.read<UpSalesCubit>();
- return Container(
- width: width,
- height: height,
- margin: const EdgeInsets.all(8),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(10),
- border: Border.all(color: colorDivider, width: 1),
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Stack(
- children: [
- ClipRRect(
- borderRadius: const BorderRadius.only(
- topLeft: Radius.circular(10),
- topRight: Radius.circular(10),
- ),
- child: Image.asset(
- 'assets/images/welcome_image.jpeg',
- height: 180,
- width: double.infinity,
- fit: BoxFit.cover,
- ),
+ return BlocBuilder<UpSalesCubit, UpSalesState>(builder: (context, state) {
+ final cubit = context.read<UpSalesCubit>();
+ return Container(
+ width: width,
+ height: height,
+ margin: const EdgeInsets.all(8),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(10),
+ border: Border.all(color: colorDivider, width: 1),
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Stack(
+ children: [
+ ClipRRect(
+ borderRadius: const BorderRadius.only(
+ topLeft: Radius.circular(10),
+ topRight: Radius.circular(10),
+ ),
+ child: Image.asset(
+ roomUpgrade.images.first,
+ height: 180,
+ width: double.infinity,
+ fit: BoxFit.cover,
),
- Positioned(
- top: 16,
- right: 16,
- child: Container(
- padding:
- const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(32),
- ),
- child: Text(
- '26 m2',
- style:
- theme.textTheme.headlineMedium?.copyWith(fontSize: 11),
- ),
+ ),
+ Positioned(
+ top: 16,
+ right: 16,
+ child: Container(
+ padding:
+ const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(32),
+ ),
+ child: Text(
+ '${roomUpgrade.tags.first} m2',
+ style:
+ theme.textTheme.headlineMedium?.copyWith(fontSize: 11),
),
),
- ],
- ),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- 'Junior Suite',
- style: theme.textTheme.headlineMedium,
- ),
- Row(
- children: [
- Text(
- '+200 kr.',
- style: theme.textTheme.headlineMedium,
- ),
- const SizedBox(width: 8),
- ComwellRadioButton(selected: cubit.state.selected, onTap: cubit.toggleSelected),
- ],
- ),
- ],
- ),
- const SizedBox(height: 8),
- GestureDetector(
- onTap: () {},
- child: Text(
- 'read_more_up_sales'.tr(),
- style: theme.textTheme.bodySmall?.copyWith(
- color: sandColor[80],
- decoration: TextDecoration.underline,
- decorationColor: sandColor[80],
- ),
+ ),
+ ],
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text(
+ roomUpgrade.name,
+ style: theme.textTheme.headlineMedium,
+ ),
+ Row(
+ children: [
+ Text(
+ '${roomUpgrade.price} kr.',
+ style: theme.textTheme.headlineMedium,
+ ),
+ const SizedBox(width: 8),
+ ComwellRadioButton(selected: cubit.state.selected, onTap: cubit.toggleSelected),
+ ],
+ ),
+ ],
+ ),
+ const SizedBox(height: 8),
+ GestureDetector(
+ onTap: () {},
+ child: Text(
+ 'read_more_up_sales'.tr(),
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: sandColor[80],
+ decoration: TextDecoration.underline,
+ decorationColor: sandColor[80],
),
),
- ],
- ),
+ ),
+ ],
),
- ],
- ),
- ),
+ ),
],
),
- );
- }),
- );
+ ),
+ ],
+ ),
+ );
+ });
}
}
diff --git a/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart b/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
index 0f805b4c..29acb03a 100644
--- a/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
+++ b/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
@@ -1,11 +1,31 @@
import 'package:bloc/bloc.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_state.dart';
+import 'package:comwell_key_app/up_sales/models/dto/room_upgrade_dto.dart';
+import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
+import 'package:comwell_key_app/up_sales/up_sale_repository.dart';
class UpSalesCubit extends Cubit<UpSalesState> {
- UpSalesCubit() : super(UpSalesState(selected: false));
+ final UpSaleRepository upSaleRepository;
+ Iterable<RoomUpgrade> upSales = [];
+
+ UpSalesCubit({required this.upSaleRepository})
+ : super(UpSalesState.initial());
void toggleSelected() {
- emit(UpSalesState(selected: !state.selected));
+ emit(state.copyWith(selected: !state.selected));
+ }
+
+ void init() async {
+ emit(UpSalesState(selected: false, upSales: upSales, isLoading: true, error: null));
+ try {
+ upSales = await upSaleRepository.getMockUpSales();
+ emit(UpSalesState.loaded(upSales: upSales));
+ } catch (e) {
+ emit(UpSalesState.error(error: Error()));
+ }
}
-}
+ void onContinue() {
+ emit(state.copyWith(selected: false));
+ }
+}
diff --git a/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart b/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
index e3b8c084..f14b5b2a 100644
--- a/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
+++ b/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
@@ -1,4 +1,47 @@
-class UpSalesState {
+import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
+import 'package:equatable/equatable.dart';
+
+class UpSalesState extends Equatable {
final bool selected;
- UpSalesState({required this.selected});
+ final Iterable<RoomUpgrade> upSales;
+ final Error? error;
+ final bool isLoading;
+ const UpSalesState({required this.selected, required this.upSales, this.error, required this.isLoading});
+
+ @override
+ List<Object?> get props => [selected, upSales];
+
+ UpSalesState.initial()
+ : selected = false,
+ upSales = [],
+ error = null,
+ isLoading = false;
+
+ UpSalesState.error({required this.error})
+ : selected = false,
+ upSales = [],
+ isLoading = false;
+
+ UpSalesState.loading()
+ : selected = false,
+ upSales = [],
+ error = null,
+ isLoading = true;
+
+ const UpSalesState.loaded({required this.upSales})
+ :
+ selected = false,
+ error = null,
+ isLoading = false;
+
+ UpSalesState copyWith({
+ bool? selected,
+ Iterable<RoomUpgrade>? upSales,
+ bool? isLoading,
+ Error? error,
+ }) {
+ return UpSalesState(selected: selected ?? this.selected, upSales: upSales ?? this.upSales, isLoading: isLoading ?? this.isLoading, error: error ?? this.error);
+ }
+
+
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/up_sales/mappers/room_facility_mapper.dart b/comwell_key_app/lib/up_sales/mappers/room_facility_mapper.dart
new file mode 100644
index 00000000..b39aa222
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/mappers/room_facility_mapper.dart
@@ -0,0 +1,13 @@
+import 'package:comwell_key_app/up_sales/models/dto/room_facility_dto.dart';
+import 'package:comwell_key_app/up_sales/models/room_facility.dart';
+
+extension RoomFacilityDTOMapper on RoomFacilityDTO {
+ RoomFacility toRoomFacility() {
+ return RoomFacility(name: name, icon: icon);
+ }
+}
+
+extension ListRoomFacilityMapper on Iterable<RoomFacilityDTO> {
+ Iterable<RoomFacility> toRoomFacilities() =>
+ map((dto) => dto.toRoomFacility());
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/up_sales/mappers/room_upgrade_mapper.dart b/comwell_key_app/lib/up_sales/mappers/room_upgrade_mapper.dart
new file mode 100644
index 00000000..801c9cdc
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/mappers/room_upgrade_mapper.dart
@@ -0,0 +1,25 @@
+import 'package:comwell_key_app/up_sales/mappers/room_facility_mapper.dart';
+import 'package:comwell_key_app/up_sales/models/dto/room_upgrade_dto.dart';
+
+import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
+
+extension RoomUpgradeDTOMapper on RoomUpgradeDTO {
+ RoomUpgrade toRoomUpgrade() {
+ return RoomUpgrade(
+ name: name,
+ price: price,
+ images: images,
+ description: description,
+ id: id,
+ tags: tags,
+ facilities: facilities.toRoomFacilities(),
+ type: UpgradeType.fromString(type));
+ }
+
+
+}
+
+extension ListRoomUpgradeMapper on Iterable<RoomUpgradeDTO> {
+ Iterable<RoomUpgrade> toRoomUpgrades() =>
+ map((dto) => dto.toRoomUpgrade());
+}
diff --git a/comwell_key_app/lib/up_sales/models/dto/room_facility_dto.dart b/comwell_key_app/lib/up_sales/models/dto/room_facility_dto.dart
new file mode 100644
index 00000000..917927f0
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/models/dto/room_facility_dto.dart
@@ -0,0 +1,17 @@
+import 'package:comwell_key_app/utils/json.dart';
+import 'package:json_annotation/json_annotation.dart';
+
+part '../../../.generated/up_sales/models/dto/room_facility_dto.g.dart';
+
+@JsonSerializable()
+class RoomFacilityDTO {
+ final String name;
+ final String icon;
+
+ RoomFacilityDTO({required this.name, required this.icon});
+
+ Json toJson() => _$RoomFacilityDTOToJson(this);
+
+ factory RoomFacilityDTO.fromJson(Map<String, dynamic> json) =>
+ _$RoomFacilityDTOFromJson(json);
+}
diff --git a/comwell_key_app/lib/up_sales/models/dto/room_upgrade_dto.dart b/comwell_key_app/lib/up_sales/models/dto/room_upgrade_dto.dart
new file mode 100644
index 00000000..22ef0fd3
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/models/dto/room_upgrade_dto.dart
@@ -0,0 +1,32 @@
+import 'package:comwell_key_app/up_sales/models/dto/room_facility_dto.dart';
+import 'package:comwell_key_app/utils/json.dart';
+import 'package:json_annotation/json_annotation.dart';
+
+part '../../../.generated/up_sales/models/dto/room_upgrade_dto.g.dart';
+
+@JsonSerializable()
+class RoomUpgradeDTO {
+ final String name;
+ final String price;
+ final Iterable<String> images;
+ final String description;
+ final String id;
+ final Iterable<String> tags;
+ final Iterable<RoomFacilityDTO> facilities;
+ final String type;
+
+ RoomUpgradeDTO(
+ {required this.name,
+ required this.price,
+ required this.images,
+ required this.description,
+ required this.id,
+ required this.tags,
+ required this.facilities,
+ required this.type});
+
+ Json toJson() => _$RoomUpgradeDTOToJson(this);
+
+ factory RoomUpgradeDTO.fromJson(Map<String, dynamic> json) =>
+ _$RoomUpgradeDTOFromJson(json);
+}
diff --git a/comwell_key_app/lib/up_sales/models/room_facility.dart b/comwell_key_app/lib/up_sales/models/room_facility.dart
new file mode 100644
index 00000000..c315ee79
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/models/room_facility.dart
@@ -0,0 +1,6 @@
+class RoomFacility {
+ final String name;
+ final String icon;
+
+ RoomFacility({required this.name, required this.icon});
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/up_sales/models/room_upgrade.dart b/comwell_key_app/lib/up_sales/models/room_upgrade.dart
new file mode 100644
index 00000000..888a5935
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/models/room_upgrade.dart
@@ -0,0 +1,61 @@
+import 'package:comwell_key_app/up_sales/models/room_facility.dart';
+
+class RoomUpgrade {
+ final String name;
+ final String price;
+ final Iterable<String> images;
+ final String description;
+ final String id;
+ final Iterable<String> tags;
+ final Iterable<RoomFacility> facilities;
+ final UpgradeType type;
+ RoomUpgrade(
+ {required this.name,
+ required this.price,
+ required this.images,
+ required this.description,
+ required this.id,
+ required this.tags,
+ required this.facilities,
+ required this.type});
+
+ RoomUpgrade copyWith({
+ String? name,
+ String? price,
+ Iterable<String>? images,
+ String? description,
+ String? id,
+ Iterable<String>? tags,
+ Iterable<RoomFacility>? facilities,
+ UpgradeType? type,
+ }) {
+ return RoomUpgrade(
+ name: name ?? this.name,
+ price: price ?? this.price,
+ images: images ?? this.images,
+ description: description ?? this.description,
+ id: id ?? this.id,
+ tags: tags ?? this.tags,
+ facilities: facilities ?? this.facilities,
+ type: type ?? this.type,
+ );
+ }
+
+ @override
+ String toString() {
+ return "RoomUpgrade(name: $name, price: $price, images: $images, description: $description, id: $id, tags: $tags, facilities: $facilities)";
+ }
+
+ @override
+ List<Object?> get props =>
+ [name, price, images, description, id, tags, facilities];
+}
+
+enum UpgradeType {
+ room,
+ other;
+
+ static UpgradeType fromString(String value) {
+ return UpgradeType.values.firstWhere((e) => e.name == value);
+ }
+}
diff --git a/comwell_key_app/lib/up_sales/up_sale_repository.dart b/comwell_key_app/lib/up_sales/up_sale_repository.dart
new file mode 100644
index 00000000..cfddbd95
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/up_sale_repository.dart
@@ -0,0 +1,173 @@
+import 'package:comwell_key_app/services/api.dart';
+import 'package:comwell_key_app/up_sales/mappers/room_upgrade_mapper.dart';
+import 'package:comwell_key_app/up_sales/models/dto/room_upgrade_dto.dart';
+import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
+import 'package:comwell_key_app/utils/json.dart';
+import 'package:comwell_key_app/up_sales/models/dto/room_facility_dto.dart';
+
+class UpSaleRepository {
+ final Api api = Api();
+
+ UpSaleRepository();
+
+ Future<Json> getUpSales() async {
+ final response = await api.fetchUpSales();
+ return response;
+ }
+
+ Future<Iterable<RoomUpgrade>> getMockUpSales() async {
+ return mockRoomUpgrades.toRoomUpgrades();
+ }
+}
+
+// Mock data for RoomUpgrade and RoomFacility
+final List<RoomUpgradeDTO> mockRoomUpgrades = [
+ RoomUpgradeDTO(
+ name: 'Standard Double Room',
+ price: '1200',
+ images: ['assets/images/welcome_image.jpeg'],
+ description: 'A cozy room with a double bed, perfect for couples or solo travelers seeking comfort and convenience.',
+ id: '1',
+ tags: ['20'],
+ type: 'room',
+ facilities: [
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hair_dryer'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
+ RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_roomservice'),
+ RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron'),
+ RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar'),
+ ],
+ ),
+ RoomUpgradeDTO(
+ name: 'Junior Suite',
+ price: '1800',
+ images: ['assets/images/no_current_bookings_background.jpeg'],
+ description: 'Spacious Junior Suite with a separate living area, ideal for guests who appreciate extra space and luxury.',
+ id: '2',
+ tags: ['35'],
+ type: 'room',
+ facilities: [
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hairdryer'),
+ RoomFacilityDTO(name: 'Badekar', icon: 'assets/icons/ic_bathtub'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
+ RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_roomservice'),
+ RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron'),
+ RoomFacilityDTO(name: 'Terrasse', icon: 'assets/icons/ic_terrace'),
+ RoomFacilityDTO(name: 'Te-køkken', icon: 'assets/icons/kettle'),
+ RoomFacilityDTO(name: 'Stue', icon: 'assets/icons/ic_livingroom'),
+ RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar'),
+ ],
+ ),
+ RoomUpgradeDTO(
+ name: 'Suite',
+ price: '2500',
+ images: ['assets/images/current_room.png'],
+ description: 'Our most luxurious suite, featuring a large living room, private terrace, and premium amenities for a memorable stay.',
+ id: '3',
+ tags: ['50'],
+ type: 'room',
+ facilities: [
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hair_dryer'),
+ RoomFacilityDTO(name: 'Badekar', icon: 'assets/icons/ic_bathtub'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
+ RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_roomservice'),
+ RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron'),
+ RoomFacilityDTO(name: 'Terrasse', icon: 'assets/icons/ic_terrace'),
+ RoomFacilityDTO(name: 'Te-køkken', icon: 'assets/icons/ic_kitchenette'),
+ RoomFacilityDTO(name: 'Stue', icon: 'assets/icons/ic_livingroom'),
+ RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar'),
+ ],
+ ),
+ RoomUpgradeDTO(
+ name: 'Standard Double Plus Room',
+ price: '1400',
+ images: ['assets/images/login_screen_background.png'],
+ description: 'An upgraded double room with extra amenities and a modern touch, perfect for a relaxing stay.',
+ id: '4',
+ tags: ['25'],
+ type: 'room',
+ facilities: [
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hair_dryer'),
+ RoomFacilityDTO(name: 'Badekar', icon: 'assets/icons/ic_bathtub'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
+ RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_roomservice'),
+ ],
+ ),
+ RoomUpgradeDTO(
+ name: 'Standard Twin Plus Room',
+ price: '1450',
+ images: ['assets/images/login_screen_background.png'],
+ description: 'A spacious twin room with two single beds and modern facilities, ideal for friends or colleagues traveling together.',
+ id: '5',
+ tags: ['27'],
+ type: 'room',
+ facilities: [
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hair_dryer'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
+ RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron'),
+ RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar'),
+ ],
+ ),
+ RoomUpgradeDTO(
+ name: 'Champagne & Chocolate Package',
+ price: '450',
+ images: ['assets/images/catalog_image.png'],
+ description: 'Celebrate your stay with a bottle of premium champagne and a selection of fine chocolates delivered to your room.',
+ id: '6',
+ tags: [],
+ type: 'other',
+ facilities: [],
+ ),
+ RoomUpgradeDTO(
+ name: 'Luxury Flower Arrangement',
+ price: '350',
+ images: ['assets/images/login_screen_background.png'],
+ description: 'A beautiful bouquet of fresh seasonal flowers to brighten up your room and create a welcoming atmosphere.',
+ id: '7',
+ tags: [],
+ type: 'other',
+ facilities: [],
+ ),
+ RoomUpgradeDTO(
+ name: 'Romantic Evening Package',
+ price: '750',
+ images: ['assets/images/catalog_image.png'],
+ description: 'Create a romantic atmosphere with rose petals, candles, champagne, and a special dessert for two.',
+ id: '8',
+ tags: [],
+ type: 'other',
+ facilities: [],
+ ),
+ RoomUpgradeDTO(
+ name: 'Breakfast in Bed',
+ price: '250',
+ images: ['assets/images/login_screen_background.png'],
+ description: 'Start your day in luxury with a full breakfast served in the comfort of your room.',
+ id: '9',
+ tags: [],
+ type: 'other',
+ facilities: [],
+ ),
+ RoomUpgradeDTO(
+ name: 'Wellness Package',
+ price: '600',
+ images: ['assets/images/login_screen_background.png'],
+ description: 'Indulge in a wellness experience with a selection of premium spa products, bath salts, and aromatherapy items.',
+ id: '10',
+ tags: [],
+ type: 'other',
+ facilities: [],
+ ),
+];
+
+
diff --git a/comwell_key_app/lib/up_sales/up_sales_catalog.dart b/comwell_key_app/lib/up_sales/up_sales_catalog.dart
index e54f6232..5b98101e 100644
--- a/comwell_key_app/lib/up_sales/up_sales_catalog.dart
+++ b/comwell_key_app/lib/up_sales/up_sales_catalog.dart
@@ -1,9 +1,11 @@
import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
+import 'package:comwell_key_app/up_sales/components/up_sales_bottom_sheet.dart';
import 'package:comwell_key_app/up_sales/components/up_sales_services_widget.dart';
import 'package:comwell_key_app/up_sales/components/up_sales_upgrades_widget.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_cubit.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_state.dart';
-import 'package:comwell_key_app/themes/dark_theme.dart';
+import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -14,148 +16,109 @@ class UpSalesCatalog extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
- return BlocBuilder<UpSalesCubit, UpSalesState>(
- builder: (context, state) {
- return Scaffold(
- appBar: const ComwellAppBar(),
- backgroundColor: Colors.white,
- body: SingleChildScrollView(
- child: Padding(
- padding: const EdgeInsets.only(
- top: 24,
- bottom: 100, // Add padding to account for bottom sheet
- left: 0,
- right: 0,
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Text('up_sales_catalog_title'.tr(), style: theme.textTheme.headlineLarge),
- ),
- const SizedBox(height: 40),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Text('services'.tr(), style: theme.textTheme.headlineMedium),
- ),
- const SizedBox(height: 16),
- _buildServicesCatalog(context),
- const SizedBox(height: 24),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Text('room_upgrades'.tr(), style: theme.textTheme.headlineMedium),
- ),
- const SizedBox(height: 16),
- _buildRoomUpgradeCatalog(context),
- const SizedBox(height: 24),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Text('other_up_sales'.tr(), style: theme.textTheme.headlineMedium),
- ),
- const SizedBox(height: 16),
- _buildOtherUpSalesCatalog(context),
- ],
- ),
+ return BlocBuilder<UpSalesCubit, UpSalesState>(builder: (context, state) {
+ final cubit = context.read<UpSalesCubit>();
+ return Scaffold(
+ appBar: const ComwellAppBar(),
+ backgroundColor: Colors.white,
+ body: SingleChildScrollView(
+ child: Padding(
+ padding: const EdgeInsets.only(
+ top: 24,
+ bottom: 100, // Add padding to account for bottom sheet
+ left: 0,
+ right: 0,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Text('up_sales_catalog_title'.tr(),
+ style: theme.textTheme.headlineLarge),
+ ),
+ const SizedBox(height: 40),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Text('services'.tr(),
+ style: theme.textTheme.headlineMedium),
+ ),
+ const SizedBox(height: 16),
+ _buildServicesCatalog(context, cubit),
+ const SizedBox(height: 24),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Text('room_upgrades'.tr(),
+ style: theme.textTheme.headlineMedium),
+ ),
+ const SizedBox(height: 16),
+ _buildRoomUpgradeCatalog(context, cubit),
+ const SizedBox(height: 24),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Text('other_up_sales'.tr(),
+ style: theme.textTheme.headlineMedium),
+ ),
+ const SizedBox(height: 16),
+ _buildOtherUpSalesCatalog(context, cubit),
+ const SizedBox(height: 24),
+ ],
),
),
- bottomSheet: Builder(
- builder: (context) {
- return Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- const Divider(
- color: Colors.black12,
- height: 0,
- ),
- Row(
- children: [
- Expanded(
- child: Padding(
- padding: const EdgeInsets.all(16.0),
- child: ElevatedButton(
- onPressed: () {
- // TODO: Implement booking action
- },
- style: ButtonStyle(
- backgroundColor: WidgetStateProperty.resolveWith((states) {
- if (states.contains(WidgetState.disabled)) {
- return Colors.grey;
- }
- return sandColor[80];
- }),
- foregroundColor: const WidgetStatePropertyAll(Colors.white),
- ),
- child: const Padding(
- padding: EdgeInsets.symmetric(vertical: 16.0),
- child: Text('Book Selected Services'),
- ),
- ),
- ),
- ),
- ],
- ),
- ],
- );
- },
- ),
- );
- }
- );
+ ),
+ bottomSheet: UpSalesBottomSheet(onContinue: cubit.onContinue),
+ );
+ });
}
- Widget _buildServicesCatalog(BuildContext context) {
-
- return const SingleChildScrollView(
- scrollDirection: Axis.horizontal,
- child: Column(
- children: [
- Row(
- children: [
- SizedBox(width: 16),
- UpSalesServicesWidget(width: 328, height: 180),
- UpSalesServicesWidget(width: 328, height: 180),
- UpSalesServicesWidget(width: 328, height: 180),
- ],
- ),
- ],
+ Widget _buildServicesCatalog(BuildContext context, UpSalesCubit cubit) {
+ return SizedBox(
+ height: 258, // Height of the UpSalesServicesWidget
+ child: ListView.builder(
+ scrollDirection: Axis.horizontal,
+ itemCount: cubit.upSales.length,
+ itemBuilder: (context, index) {
+ return UpSalesServicesWidget(width: 328, height: 252);
+ },
),
);
}
- Widget _buildRoomUpgradeCatalog(BuildContext context) {
-
- return const SingleChildScrollView(
- scrollDirection: Axis.horizontal,
- child: Column(
- children: [
- Row(
- children: [
- SizedBox(width: 16),
- UpSalesUpgradesWidget(),
- UpSalesUpgradesWidget(),
- ],
- ),
- ],
+ Widget _buildRoomUpgradeCatalog(BuildContext context, UpSalesCubit cubit) {
+ return SizedBox(
+ height: 289, // Height of the UpSalesUpgradesWidget
+ child: ListView.builder(
+ scrollDirection: Axis.horizontal,
+ itemCount: cubit.upSales
+ .where((roomUpgrade) => roomUpgrade.type == UpgradeType.room)
+ .length,
+ itemBuilder: (context, index) {
+ return UpSalesUpgradesWidget(
+ width: 328,
+ height: 268,
+ roomUpgrade: cubit.upSales.elementAt(index),
+ );
+ },
),
);
}
- Widget _buildOtherUpSalesCatalog(BuildContext context) {
-
- return const SingleChildScrollView(
- scrollDirection: Axis.horizontal,
- child: Column(
- children: [
- Row(
- children: [
- SizedBox(width: 16),
- UpSalesUpgradesWidget(),
- UpSalesUpgradesWidget(),
- ],
- ),
- ],
+ Widget _buildOtherUpSalesCatalog(BuildContext context, UpSalesCubit cubit) {
+ return SizedBox(
+ height: 289, // Height of the UpSalesUpgradesWidget
+ child: ListView.builder(
+ scrollDirection: Axis.horizontal,
+ itemCount: cubit.upSales
+ .where((roomUpgrade) => roomUpgrade.type == UpgradeType.other)
+ .length,
+ itemBuilder: (context, index) {
+ return UpSalesUpgradesWidget(
+ width: 328,
+ height: 268,
+ roomUpgrade: cubit.upSales.elementAt(index),
+ );
+ },
),
);
}
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/lib/utils/locator.dart b/comwell_key_app/lib/utils/locator.dart
index 3339263a..1ca1891a 100644
--- a/comwell_key_app/lib/utils/locator.dart
+++ b/comwell_key_app/lib/utils/locator.dart
@@ -10,6 +10,7 @@ import 'package:comwell_key_app/profile/profile_repository.dart';
import 'package:comwell_key_app/profile_settings/repostiory/profile_settings_repository.dart';
import 'package:comwell_key_app/tracking/comwell_tracking.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_cubit.dart';
+import 'package:comwell_key_app/up_sales/up_sale_repository.dart';
import 'package:comwell_key_app/utils/seos_repository.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart';
@@ -45,5 +46,6 @@ void setupLocator() {
locator.registerFactory<NotificationsRepository>(
() => NotificationsRepository());
locator.registerFactory<ContactRepository>(() => ContactRepository());
+ locator.registerFactory<UpSaleRepository>(() => UpSaleRepository());
}
}