6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 79ffeee9
Changed files
.../android/app/src/main/AndroidManifest.xml | 8 +-- comwell_key_app/assets/icons/ic_bed.svg | 3 + comwell_key_app/assets/icons/ic_car.svg | 3 + comwell_key_app/assets/icons/ic_chefs_hat.svg | 3 + comwell_key_app/assets/icons/ic_info.svg | 3 + comwell_key_app/assets/icons/ic_spa.svg | 3 + comwell_key_app/assets/icons/ic_telephone.svg | 3 + comwell_key_app/assets/translations/da-DK.json | 12 +++- comwell_key_app/assets/translations/en-US.json | 11 +++- comwell_key_app/lib/comwell_app.dart | 8 --- .../components/practical_information_button.dart | 58 ++++++++++++++++++++ .../lib/home/components/room_key_widget.dart | 1 - comwell_key_app/lib/home/home_page.dart | 40 +++++++++++--- .../components/hotel_information_list_tile.dart | 38 ++++++++----- .../components/hotel_information_menu.dart | 63 +++++++++++++++++++++ .../components/restaurant_page.dart | 16 ++++++ .../components/spa_facility_page.dart | 64 ++++++++++++++++++++++ .../cubit/hotel_information_cubit.dart | 45 +++++++++++---- .../cubit/hotel_information_state.dart | 52 +++++++++++------- .../hotel_information/hotel_information_page.dart | 46 +++++----------- .../lib/hotel_information/models/facilities.dart | 4 +- .../lib/hotel_information/models/hotel.dart | 9 ++- .../repository/hotel_information_repository.dart | 63 +++++++++++++++++++++ .../repository/hotel_information_repostiory.dart | 63 --------------------- comwell_key_app/lib/routing/app_router.dart | 53 ++++++++++++++++-- comwell_key_app/lib/services/api.dart | 6 ++ comwell_key_app/lib/utils/locator.dart | 2 +- 27 files changed, 501 insertions(+), 179 deletions(-)
Diff
diff --git a/comwell_key_app/android/app/src/main/AndroidManifest.xml b/comwell_key_app/android/app/src/main/AndroidManifest.xml
index c2498957..38cdfd5f 100644
--- a/comwell_key_app/android/app/src/main/AndroidManifest.xml
+++ b/comwell_key_app/android/app/src/main/AndroidManifest.xml
@@ -4,10 +4,6 @@
android:name="android.hardware.nfc.hce"
android:required="false"/>
- <application
- android:label="@string/app_name"
- android:name="${applicationName}"
- android:icon="@mipmap/launcher_icon">
<queries>
<!-- If your app checks for SMS support -->
<intent>
@@ -24,6 +20,10 @@
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries>
+ <application
+ android:label="@string/app_name"
+ android:name="${applicationName}"
+ android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
diff --git a/comwell_key_app/assets/icons/ic_bed.svg b/comwell_key_app/assets/icons/ic_bed.svg
new file mode 100644
index 00000000..340d8d62
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_bed.svg
@@ -0,0 +1,3 @@
+<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M10.25 10H10.75V9.5V5.00057C10.7503 4.7353 10.8558 4.48098 11.0434 4.2934C11.2309 4.10586 11.4852 4.00036 11.7504 4C11.7504 4 11.7505 4 11.7506 4H17.7494C17.7495 4 17.7495 4 17.7496 4C18.6113 4.00107 19.4375 4.34386 20.0468 4.9532C20.6562 5.56258 20.999 6.38879 21 7.25059V16.5H20.5V11V10.5H20H2H1.5V11V16.5H1V0.5H1.5V9.5V10H2H10.25ZM20 10H20.5V9.5V7.25V7.24945C20.4992 6.5205 20.2093 5.82163 19.6938 5.30618C19.1784 4.79073 18.4795 4.5008 17.7505 4.5H17.75H11.75H11.25V5V9.5V10H11.75H20ZM6.125 3.75L6.12443 3.75C5.69376 3.75049 5.28086 3.92179 4.97632 4.22632C4.67179 4.53086 4.50049 4.94376 4.5 5.37443V5.375C4.5 5.69639 4.5953 6.01057 4.77386 6.2778C4.95242 6.54503 5.20621 6.75331 5.50314 6.8763C5.80007 6.9993 6.1268 7.03148 6.44202 6.96878C6.75724 6.90608 7.04679 6.75131 7.27405 6.52405C7.50131 6.29679 7.65608 6.00724 7.71878 5.69202C7.78148 5.3768 7.7493 5.05007 7.6263 4.75314C7.50331 4.45621 7.29503 4.20242 7.0278 4.02386C6.76057 3.84531 6.44639 3.75 6.125 3.75ZM4.94441 3.60813C5.29387 3.37463 5.70471 3.25 6.125 3.25C6.68858 3.25 7.22909 3.47388 7.6276 3.8724C8.02612 4.27091 8.25 4.81142 8.25 5.375C8.25 5.79529 8.12537 6.20613 7.89187 6.55559C7.65837 6.90504 7.3265 7.17741 6.9382 7.33824C6.54991 7.49908 6.12264 7.54116 5.71043 7.45917C5.29822 7.37718 4.91959 7.17479 4.6224 6.8776C4.32521 6.58042 4.12283 6.20178 4.04083 5.78957C3.95884 5.37736 4.00092 4.95009 4.16176 4.5618C4.32259 4.17351 4.59496 3.84163 4.94441 3.60813Z" fill="black" stroke="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_car.svg b/comwell_key_app/assets/icons/ic_car.svg
new file mode 100644
index 00000000..8e693d84
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_car.svg
@@ -0,0 +1,3 @@
+<svg width="18" height="13" viewBox="0 0 18 13" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M17.3362 4.9585L12.5034 3.22207L10.4838 0.685441C10.3081 0.470703 10.0868 0.297777 9.83594 0.179217C9.5851 0.0606572 9.31101 -0.000561802 9.03356 3.88491e-06H4.036C3.73039 -0.000122592 3.42938 0.0745016 3.15921 0.217373C2.88905 0.360243 2.65793 0.567024 2.486 0.819691L0.791376 3.30932C0.438256 3.82748 0.249586 4.44008 0.250001 5.06713V10C0.250001 10.1658 0.315849 10.3247 0.433059 10.4419C0.550269 10.5592 0.70924 10.625 0.875001 10.625H2.21381C2.35009 11.1611 2.66115 11.6365 3.09781 11.976C3.53448 12.3156 4.07185 12.4999 4.625 12.4999C5.17815 12.4999 5.71552 12.3156 6.15219 11.976C6.58885 11.6365 6.89991 11.1611 7.03619 10.625H10.9638C11.1001 11.1611 11.4111 11.6365 11.8478 11.976C12.2845 12.3156 12.8219 12.4999 13.375 12.4999C13.9281 12.4999 14.4655 12.3156 14.9022 11.976C15.3389 11.6365 15.6499 11.1611 15.7862 10.625H17.125C17.2908 10.625 17.4497 10.5592 17.5669 10.4419C17.6842 10.3247 17.75 10.1658 17.75 10V5.54688C17.75 5.41813 17.7103 5.29251 17.6362 5.18719C17.5622 5.08188 17.4574 5.00201 17.3362 4.9585ZM4.625 11.25C4.37777 11.25 4.1361 11.1767 3.93054 11.0393C3.72498 10.902 3.56476 10.7068 3.47015 10.4784C3.37554 10.25 3.35079 9.99862 3.39902 9.75614C3.44725 9.51367 3.5663 9.29094 3.74112 9.11612C3.91593 8.94131 4.13866 8.82225 4.38114 8.77402C4.62361 8.72579 4.87495 8.75055 5.10335 8.84516C5.33176 8.93976 5.52699 9.09998 5.66434 9.30554C5.80169 9.5111 5.875 9.75278 5.875 10C5.87455 10.3314 5.74271 10.6491 5.50839 10.8834C5.27407 11.1177 4.95638 11.2496 4.625 11.25ZM13.375 11.25C13.1278 11.25 12.8861 11.1767 12.6805 11.0393C12.475 10.902 12.3148 10.7068 12.2202 10.4784C12.1255 10.25 12.1008 9.99862 12.149 9.75614C12.1973 9.51367 12.3163 9.29094 12.4911 9.11612C12.6659 8.94131 12.8887 8.82225 13.1311 8.77402C13.3736 8.72579 13.6249 8.75055 13.8534 8.84516C14.0818 8.93976 14.277 9.09998 14.4143 9.30554C14.5517 9.5111 14.625 9.75278 14.625 10C14.6246 10.3314 14.4928 10.6491 14.2584 10.8834C14.0241 11.1178 13.7064 11.2496 13.375 11.25ZM16.5 9.37501H15.7862C15.6499 8.83891 15.3389 8.36352 14.9022 8.02397C14.4655 7.68441 13.9281 7.50007 13.375 7.50007C12.8219 7.50007 12.2845 7.68441 11.8478 8.02397C11.4111 8.36352 11.1001 8.83891 10.9638 9.37501H7.03619C6.89991 8.83891 6.58885 8.36352 6.15219 8.02397C5.71552 7.68441 5.17815 7.50007 4.625 7.50007C4.07185 7.50007 3.53448 7.68441 3.09781 8.02397C2.66115 8.36352 2.35009 8.83891 2.21381 9.37501H1.5V5.06713C1.49986 4.6907 1.61311 4.32295 1.825 4.01182L3.51938 1.52344C3.57665 1.43918 3.65367 1.37021 3.74372 1.32255C3.83377 1.27489 3.93412 1.24998 4.036 1.25H9.03356C9.1246 1.24961 9.21461 1.26926 9.29721 1.30755C9.37981 1.34584 9.45297 1.40184 9.5115 1.47157L11.6361 4.13938C11.7084 4.2302 11.8046 4.2991 11.9138 4.33838L16.5 5.98632V9.37501Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_chefs_hat.svg b/comwell_key_app/assets/icons/ic_chefs_hat.svg
new file mode 100644
index 00000000..5f597b2c
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_chefs_hat.svg
@@ -0,0 +1,3 @@
+<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11.0565 3.20285L11.0543 3.19974C10.6006 2.54761 9.84956 2.125 9 2.125C8.15044 2.125 7.39938 2.54761 6.94567 3.19974L6.9435 3.20285C7.63424 3.88303 8.0625 4.829 8.0625 5.875H6.8125C6.8125 4.49429 5.69321 3.375 4.3125 3.375C2.93179 3.375 1.8125 4.49429 1.8125 5.875C1.8125 7.11251 2.71289 8.14217 3.89432 8.34038L4.9375 8.51539V9.57315V12.75H13.0625V9.57315V8.51539L14.1057 8.34038C15.2871 8.14217 16.1875 7.11251 16.1875 5.875C16.1875 4.49429 15.0682 3.375 13.6875 3.375C12.3068 3.375 11.1875 4.49429 11.1875 5.875V6.5H9.9375V5.875C9.9375 4.829 10.3658 3.88303 11.0565 3.20285ZM4.9375 15.875V14H6.8125V15.875H4.9375ZM8.0625 15.875V14H9.9375V15.875H8.0625ZM11.1875 15.875V14H13.0625V15.875H11.1875ZM12.0804 2.48584C11.4031 1.51225 10.2759 0.875 9 0.875C7.72405 0.875 6.59695 1.51225 5.91958 2.48584C5.43249 2.25447 4.88762 2.125 4.3125 2.125C2.24143 2.125 0.5625 3.80393 0.5625 5.875C0.5625 7.73312 1.91393 9.2756 3.6875 9.57315V15.875V17.125H4.9375H13.0625H14.3125V15.875V9.57315C16.0861 9.2756 17.4375 7.73312 17.4375 5.875C17.4375 3.80393 15.7586 2.125 13.6875 2.125C13.1124 2.125 12.5675 2.25447 12.0804 2.48584Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_info.svg b/comwell_key_app/assets/icons/ic_info.svg
new file mode 100644
index 00000000..3bf32b25
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_info.svg
@@ -0,0 +1,3 @@
+<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M0.25 9.2085C0.25 14.041 4.16751 17.9585 9 17.9585C13.8325 17.9585 17.75 14.041 17.75 9.2085C17.75 4.376 13.8325 0.458496 9 0.458496C4.16751 0.458496 0.25 4.376 0.25 9.2085ZM1.5 9.2085C1.5 5.06636 4.85786 1.7085 9 1.7085C13.1421 1.7085 16.5 5.06636 16.5 9.2085C16.5 13.3506 13.1421 16.7085 9 16.7085C4.85786 16.7085 1.5 13.3506 1.5 9.2085ZM9.625 12.7502V7.12516H7.125V8.37516H8.375V12.7502H6.5V14.0002H11.5V12.7502H9.625ZM8.0625 4.31266C8.0625 3.7949 8.48223 3.37516 9 3.37516C9.51777 3.37516 9.9375 3.7949 9.9375 4.31266C9.9375 4.83043 9.51777 5.25016 9 5.25016C8.48223 5.25016 8.0625 4.83043 8.0625 4.31266Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_spa.svg b/comwell_key_app/assets/icons/ic_spa.svg
new file mode 100644
index 00000000..0e7f72ef
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_spa.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8.625 1.72136C9.08309 1.20235 9.75332 0.875 10.5 0.875C11.8807 0.875 13 1.99429 13 3.375V4.625H15.5V5.875H13V8.37501C13.743 8.37635 14.1468 8.55061 14.4935 8.70259L14.5039 8.70716C14.7784 8.8275 15.0007 8.925 15.4938 8.925V10.175C14.7453 10.175 14.3396 9.99998 13.9916 9.84741L13.9812 9.84284C13.7068 9.7225 13.4844 9.625 12.9914 9.625C12.4995 9.625 12.2789 9.72198 12.006 9.842L11.9943 9.84716C11.6461 10.0002 11.2406 10.175 10.489 10.175C9.73746 10.175 9.33198 10.0002 8.98376 9.84716L8.97203 9.842C8.6991 9.72198 8.47856 9.625 7.98665 9.625C7.49424 9.625 7.27379 9.72221 7.00182 9.84212L6.99096 9.84691C6.64409 9.9998 6.23993 10.175 5.4911 10.175C4.74227 10.175 4.3381 9.9998 3.99124 9.84691L3.98038 9.84212C3.70841 9.72221 3.48796 9.625 2.99555 9.625C2.50314 9.625 2.28269 9.72221 2.01072 9.84212L1.99986 9.84691C1.653 9.9998 1.24883 10.175 0.5 10.175V8.925C0.992411 8.925 1.21286 8.8278 1.48483 8.70788L1.49569 8.7031C1.84255 8.5502 2.24672 8.375 2.99555 8.375C3.74438 8.375 4.14854 8.5502 4.49541 8.7031L4.50627 8.70788C4.77824 8.8278 4.99869 8.925 5.4911 8.925C5.98351 8.925 6.20396 8.8278 6.47593 8.70788L6.48679 8.7031C6.83365 8.5502 7.23782 8.375 7.98665 8.375C7.99111 8.375 7.99556 8.37501 8 8.37502V5.875H0.5V4.625H8V3.375C8 2.68464 7.44036 2.125 6.75 2.125C6.05964 2.125 5.5 2.68464 5.5 3.375H4.25C4.25 1.99429 5.36929 0.875 6.75 0.875C7.49668 0.875 8.16691 1.20235 8.625 1.72136ZM9.25 3.375V4.625H11.75V3.375C11.75 2.68464 11.1904 2.125 10.5 2.125C9.80964 2.125 9.25 2.68464 9.25 3.375ZM9.25 5.875V8.6024C9.33356 8.6356 9.41151 8.66975 9.48679 8.70284L9.49679 8.70724C9.76955 8.82717 9.99204 8.925 10.489 8.925C10.986 8.925 11.2085 8.82717 11.4812 8.70724L11.4912 8.70284C11.5731 8.66687 11.6581 8.62964 11.75 8.59375V5.875H9.25ZM0.5 11.6624C0.992411 11.6624 1.21286 11.5652 1.48483 11.4452L1.49569 11.4404C1.84255 11.2876 2.24672 11.1124 2.99555 11.1124C3.74438 11.1124 4.14854 11.2876 4.49541 11.4404L4.50627 11.4452C4.77824 11.5652 4.99869 11.6624 5.4911 11.6624C5.98351 11.6624 6.20396 11.5652 6.47593 11.4452L6.48679 11.4404C6.83365 11.2876 7.23782 11.1124 7.98665 11.1124C8.73548 11.1124 9.13961 11.2876 9.48679 11.4402L9.49679 11.4446C9.76955 11.5645 9.99204 11.6624 10.489 11.6624C10.986 11.6624 11.2085 11.5645 11.4812 11.4446L11.4912 11.4402C11.8384 11.2876 12.2425 11.1124 12.9914 11.1124C13.7399 11.1124 14.1455 11.2874 14.4935 11.4399L14.5039 11.4445C14.7784 11.5649 15.0007 11.6624 15.4938 11.6624V12.9124C14.7453 12.9124 14.3396 12.7373 13.9916 12.5848L13.9812 12.5802C13.7068 12.4598 13.4844 12.3624 12.9914 12.3624C12.4995 12.3624 12.2789 12.4593 12.006 12.5794L11.9943 12.5845C11.6461 12.7376 11.2406 12.9124 10.489 12.9124C9.73746 12.9124 9.33198 12.7376 8.98376 12.5845L8.97203 12.5794C8.6991 12.4593 8.47856 12.3624 7.98665 12.3624C7.49424 12.3624 7.27379 12.4596 7.00182 12.5795L6.99096 12.5843C6.64409 12.7372 6.23993 12.9124 5.4911 12.9124C4.74227 12.9124 4.3381 12.7372 3.99124 12.5843L3.98038 12.5795C3.70841 12.4596 3.48796 12.3624 2.99555 12.3624C2.50314 12.3624 2.28269 12.4596 2.01072 12.5795L1.99986 12.5843C1.653 12.7372 1.24883 12.9124 0.5 12.9124V11.6624ZM1.48483 14.1827C1.21286 14.3026 0.992411 14.3998 0.5 14.3998V15.6498C1.24883 15.6498 1.653 15.4746 1.99986 15.3217L2.01072 15.3169C2.28269 15.197 2.50314 15.0998 2.99555 15.0998C3.48796 15.0998 3.70841 15.197 3.98038 15.3169L3.99124 15.3217C4.3381 15.4746 4.74227 15.6498 5.4911 15.6498C6.23993 15.6498 6.64409 15.4746 6.99096 15.3217L7.00182 15.3169C7.27379 15.197 7.49424 15.0998 7.98665 15.0998C8.47856 15.0998 8.6991 15.1968 8.97203 15.3168L8.98376 15.3219C9.33198 15.475 9.73746 15.6498 10.489 15.6498C11.2406 15.6498 11.6461 15.475 11.9943 15.3219L12.006 15.3168C12.2789 15.1968 12.4995 15.0998 12.9914 15.0998C13.4844 15.0998 13.7068 15.1973 13.9812 15.3176L13.9916 15.3222C14.3396 15.4748 14.7453 15.6498 15.4938 15.6498V14.3998C15.0007 14.3998 14.7784 14.3023 14.5039 14.1819L14.4935 14.1774C14.1455 14.0248 13.7399 13.8498 12.9914 13.8498C12.2425 13.8498 11.8384 14.025 11.4912 14.1776L11.4812 14.182C11.2085 14.302 10.986 14.3998 10.489 14.3998C9.99204 14.3998 9.76955 14.302 9.49679 14.182L9.48679 14.1776C9.13961 14.025 8.73548 13.8498 7.98665 13.8498C7.23782 13.8498 6.83365 14.025 6.48679 14.1779L6.47593 14.1827C6.20396 14.3026 5.98351 14.3998 5.4911 14.3998C4.99869 14.3998 4.77824 14.3026 4.50627 14.1827L4.49541 14.1779C4.14854 14.025 3.74438 13.8498 2.99555 13.8498C2.24672 13.8498 1.84255 14.025 1.49569 14.1779L1.48483 14.1827Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_telephone.svg b/comwell_key_app/assets/icons/ic_telephone.svg
new file mode 100644
index 00000000..80da7e33
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_telephone.svg
@@ -0,0 +1,3 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M2.31933 0.25H6.45183M2.31933 0.25C2.0242 0.272741 1.73646 0.353493 1.47259 0.48763C1.20872 0.621766 0.973912 0.80665 0.781619 1.03169C0.589326 1.25673 0.443327 1.5175 0.351987 1.79906C0.260648 2.08062 0.225763 2.37744 0.249331 2.6725L6.45183 0.25M2.31933 0.25V0.750001H2.33977M2.31933 0.25L2.35774 0.748523C2.35175 0.748985 2.34576 0.749477 2.33977 0.750001M6.45183 0.25C6.75225 0.24971 7.04583 0.339633 7.29456 0.508122C7.54328 0.676611 7.73568 0.915903 7.84683 1.195L8.98683 4L6.45183 0.25ZM2.33977 0.750001L6.45183 0.750001L6.45232 0.75C6.65259 0.749807 6.84832 0.809755 7.01413 0.922081C7.17995 1.03441 7.30821 1.19394 7.38232 1.38L7.3823 1.38001L7.38363 1.38326L8.523 4.18672C8.5231 4.18695 8.52319 4.18717 8.52328 4.1874C8.59622 4.36899 8.61429 4.568 8.57523 4.75977C8.53611 4.95177 8.44145 5.12806 8.303 5.26672L8.30163 5.2681L6.70413 6.8806L6.52206 7.06438L6.5669 7.31916C6.83419 8.83811 7.56161 10.2383 8.65073 11.3303C9.73986 12.4223 11.1381 13.1534 12.6564 13.4247L12.9119 13.4704L13.0962 13.2877L14.7219 11.677C14.8625 11.5408 15.0398 11.4489 15.2321 11.4126C15.4251 11.3761 15.6245 11.3973 15.8055 11.4734L15.8055 11.4735L15.8134 11.4767L18.6373 12.6077C18.8193 12.6843 18.9745 12.8131 19.0835 12.9778C19.193 13.1434 19.2507 13.3379 19.2493 13.5365V13.54V17.5C19.2493 17.9641 19.065 18.4092 18.7368 18.7374C18.4086 19.0656 17.9635 19.25 17.4993 19.25H17.3863C10.1914 18.8323 6.12983 15.6026 3.81272 12.0438C1.47659 8.45566 0.891239 4.49443 0.747853 2.63408L0.747854 2.63408L0.747744 2.63269C0.729413 2.40319 0.756545 2.17234 0.827587 1.95335C0.898629 1.73435 1.01218 1.53153 1.16175 1.3565C1.31131 1.18147 1.49394 1.03767 1.69917 0.933345C1.89904 0.831741 2.11652 0.769518 2.33977 0.750001ZM1.24933 2.56V2.5794L17.4543 18.25L17.4235 18.749C17.4239 18.7491 17.4243 18.7491 17.4247 18.7491C17.5885 18.7591 17.7527 18.7367 17.9079 18.6832C18.0634 18.6296 18.2069 18.5458 18.33 18.4367L17.9982 18.0626L18.33 18.4367C18.4531 18.3275 18.5534 18.1951 18.6252 18.0471L18.1754 17.8288L18.6252 18.0471C18.697 17.8991 18.7389 17.7383 18.7485 17.574L18.7493 17.5595V17.545V13.54V13.2016L18.4352 13.0758L15.6077 11.9433L15.3027 11.8212L15.0695 12.0527L13.0898 14.0187L12.9715 14.0039C9.89664 13.6186 8.16486 11.9006 7.1871 10.258C6.69536 9.43192 6.39582 8.62559 6.21956 8.02132C6.13162 7.71981 6.07494 7.47059 6.04057 7.29708C6.02338 7.21032 6.01188 7.14304 6.00487 7.0982C6.00246 7.08273 6.00064 7.07031 5.99933 7.06098V7.05887L5.99547 7.02798L5.9806 6.90902L7.93974 4.92919L8.16986 4.69664L8.04891 4.39266L6.92391 1.56516L6.79852 1.25H6.45933H2.49933C2.16781 1.25 1.84987 1.3817 1.61545 1.61612C1.38103 1.85054 1.24933 2.16848 1.24933 2.5V2.56ZM5.99641 7.03789C5.99646 7.03812 5.99675 7.04046 5.99713 7.04438C5.99654 7.03962 5.99635 7.03765 5.99641 7.03789Z" fill="black" stroke="black"/>
+</svg>
diff --git a/comwell_key_app/assets/translations/da-DK.json b/comwell_key_app/assets/translations/da-DK.json
index b1a722a6..36fd3419 100644
--- a/comwell_key_app/assets/translations/da-DK.json
+++ b/comwell_key_app/assets/translations/da-DK.json
@@ -118,5 +118,15 @@
"get_a_call": "Bliv ringet op",
"get_a_call_description": "Indtast dit telefonnummer herunder og bliv ringet op.",
"telephone_number": "Telefonnummer",
- "comwell_telefon_number": "+4570274274"
+ "comwell_telefon_number": "+4570274274",
+
+ "hotel_information_page_menu_restaurants_title": "Restauranter",
+ "hotel_information_page_menu_restaurants_subtitle": "Læs om vores restaurant",
+ "hotel_information_page_menu_spa_title": "Spa",
+ "hotel_information_page_menu_spa_subtitle": "Bade, saunaer, brechelbath, mm.",
+ "hotel_information_page_menu_parking_title": "Parkering",
+ "hotel_information_page_menu_other_info_title": "Øvrige informationer",
+ "hotel_information_page_menu_other_info_subtitle": "Find mere information om hotellet",
+ "hotel_information_page_spa_button": "Book spa"
+
}
\ 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 dccc5e83..d5ac5f95 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -116,5 +116,14 @@
"get_a_call": "Get a call",
"get_a_call_description": "Enter your phone number below and we will call you.",
"telephone_number": "Telephone number",
- "comwell_telefon_number": "+4570274274"
+ "comwell_telefon_number": "+4570274274",
+
+ "hotel_information_page_menu_restaurants_title": "Restaurants",
+ "hotel_information_page_menu_restaurants_subtitle": "Read about our restaurant",
+ "hotel_information_page_menu_spa_title": "Spa",
+ "hotel_information_page_menu_spa_subtitle": "Baths, saunas, brechelbath, etc.",
+ "hotel_information_page_menu_parking_title": "Parking",
+ "hotel_information_page_menu_other_info_title": "More information",
+ "hotel_information_page_menu_other_info_subtitle": "Find more information",
+ "hotel_information_page_spa_button": "Book spa"
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/comwell_app.dart b/comwell_key_app/lib/comwell_app.dart
index bf31fc53..1b7ac184 100644
--- a/comwell_key_app/lib/comwell_app.dart
+++ b/comwell_key_app/lib/comwell_app.dart
@@ -2,9 +2,6 @@ import 'package:comwell_key_app/authentication/authentication_repository.dart';
import 'package:comwell_key_app/authentication/bloc/authentication_bloc.dart';
import 'package:comwell_key_app/home/bloc/home_bloc.dart';
import 'package:comwell_key_app/home/home_repository.dart';
-import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
-import 'package:comwell_key_app/hotel_information/models/hotel.dart';
-import 'package:comwell_key_app/hotel_information/repository/hotel_information_repostiory.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';
@@ -77,9 +74,4 @@ final List<BlocProvider> blocProviderList = [
profileSettingsRepository: locator<ProfileSettingsRepository>(),
authenticationRepository: locator<AuthenticationRepository>()),
),
- BlocProvider<HotelInformationCubit>(
- lazy: false,
- create: (BuildContext context) =>
- HotelInformationCubit(hotelInformationRepository: locator<HotelInformationRepository>()),
- ),
];
diff --git a/comwell_key_app/lib/home/components/practical_information_button.dart b/comwell_key_app/lib/home/components/practical_information_button.dart
new file mode 100644
index 00000000..a0061488
--- /dev/null
+++ b/comwell_key_app/lib/home/components/practical_information_button.dart
@@ -0,0 +1,58 @@
+import 'package:comwell_key_app/themes/dark_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+
+class PracticalInformationButton extends StatelessWidget {
+ final String iconPath;
+ final String title;
+ final String subtitle;
+ final Function onClick;
+
+ const PracticalInformationButton({
+ super.key,
+ required this.iconPath,
+ required this.title,
+ required this.subtitle,
+ required this.onClick,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return InkWell(
+ borderRadius: const BorderRadius.all(Radius.circular(15)),
+ onTap: () => onClick(),
+ child: Ink(
+ decoration: const BoxDecoration(
+ borderRadius: BorderRadius.all(Radius.circular(16)),
+ color: Color(0xFFF9F6F2),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Expanded(
+ child: Container(
+ decoration: const BoxDecoration(
+ shape: BoxShape.circle,
+ color: colorSecondary,
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: SvgPicture.asset(iconPath,
+ colorFilter: const ColorFilter.mode(
+ Colors.black,
+ BlendMode.dst,
+ )),
+ )),
+ ),
+ const Spacer(),
+ Text(title),
+ Text(subtitle),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/home/components/room_key_widget.dart b/comwell_key_app/lib/home/components/room_key_widget.dart
index 73a29884..5e59fb37 100644
--- a/comwell_key_app/lib/home/components/room_key_widget.dart
+++ b/comwell_key_app/lib/home/components/room_key_widget.dart
@@ -31,7 +31,6 @@ class RoomKeyWidget extends StatelessWidget {
padding: const EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
-
children: [
Container(
decoration: BoxDecoration(
diff --git a/comwell_key_app/lib/home/home_page.dart b/comwell_key_app/lib/home/home_page.dart
index 4429eb87..c1533e3e 100644
--- a/comwell_key_app/lib/home/home_page.dart
+++ b/comwell_key_app/lib/home/home_page.dart
@@ -1,6 +1,7 @@
import 'package:comwell_key_app/common/components/bottom_sheet_widget.dart';
import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
import 'package:comwell_key_app/home/bloc/home_bloc.dart';
+import 'package:comwell_key_app/home/components/practical_information_button.dart';
import 'package:comwell_key_app/home/components/room_key_widget.dart';
import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
@@ -70,14 +71,6 @@ class _HomeWidget extends State<HomeWidget> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Spacer(),
- Row(mainAxisAlignment: MainAxisAlignment.center, children: [
- RoomKeyWidget(onPressed: () {
- context.pushNamed(AppRoutes.hotelInformation.name);
- }),
- RoomKeyWidget(onPressed: () {
- context.pushNamed(AppRoutes.contact.name);
- }),
- ]),
if (state.status == HomeStatus.invalidOrNoKey)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
@@ -126,8 +119,37 @@ class _HomeWidget extends State<HomeWidget> {
height: 10,
width: double.infinity,
),
+ const Text("Practical information"),
+ Row(children: [
+ const SizedBox(width: 16),
+ Expanded(
+ child: AspectRatio(
+ aspectRatio: 175/220,
+ child: PracticalInformationButton(
+ iconPath: "assets/icons/ic_bed.svg",
+ title: "Hotel information",
+ subtitle: "Find relevant information om hotellet",
+ onClick: () {
+ context.pushNamed(AppRoutes.hotelInformation.name);
+ }),
+ ),
+ ),
+ const SizedBox(width: 8),
+ Expanded(
+ child: AspectRatio(
+ aspectRatio: 175/220,
+ child: PracticalInformationButton(
+ iconPath: "assets/icons/ic_telephone.svg",
+ title: "Hotel information".tr(),
+ subtitle: "Find relevant information om hotellet",
+ onClick: () {
+ context.pushNamed(AppRoutes.contact.name);
+ }),
+ ),
+ ),
+ const SizedBox(width: 16),
+ ]),
const Text('Rooms'),
- const SizedBox(height: 400),
ElevatedButton(
onPressed: () {
context.pushNamed(AppRoutes.preregistration.name);
diff --git a/comwell_key_app/lib/hotel_information/components/hotel_information_list_tile.dart b/comwell_key_app/lib/hotel_information/components/hotel_information_list_tile.dart
index 89ec2343..2e0995b9 100644
--- a/comwell_key_app/lib/hotel_information/components/hotel_information_list_tile.dart
+++ b/comwell_key_app/lib/hotel_information/components/hotel_information_list_tile.dart
@@ -4,26 +4,34 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
class HotelInformationListTile extends StatelessWidget {
- const HotelInformationListTile({super.key});
+ final String iconPath;
+ final String title;
+ final String subtitle;
+ final Function onClick;
+
+ const HotelInformationListTile({
+ super.key,
+ required this.iconPath,
+ required this.title,
+ required this.subtitle,
+ required this.onClick,
+ });
@override
Widget build(BuildContext context) {
return ListTile(
+ onTap: () => onClick(),
leading: Container(
- decoration: BoxDecoration(
- shape: BoxShape.circle,
- color: sandColor[40],
- ),
- padding: const EdgeInsets.all(8),
- child: ImageIcon(
- const AssetImage('assets/images/key.png'),
- size: 24,
- color: Theme.of(context).colorScheme.onSecondary,
- ),
- ),
- title: Text("hotel_information_address".tr()),
- subtitle: const Text("hotel.address"),
- trailing: SvgPicture.asset('assetName'),
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: sandColor[40],
+ ),
+ padding: const EdgeInsets.all(8),
+ child: SvgPicture.asset(iconPath),
+ ),
+ title: Text(title),
+ subtitle: Text(subtitle),
+ trailing: SvgPicture.asset("assets/icons/arrow-left.svg"),
);
}
}
diff --git a/comwell_key_app/lib/hotel_information/components/hotel_information_menu.dart b/comwell_key_app/lib/hotel_information/components/hotel_information_menu.dart
new file mode 100644
index 00000000..7f1a54da
--- /dev/null
+++ b/comwell_key_app/lib/hotel_information/components/hotel_information_menu.dart
@@ -0,0 +1,63 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+import '../cubit/hotel_information_cubit.dart';
+import 'hotel_information_list_tile.dart';
+
+class HotelInformationMenu extends StatelessWidget {
+ const HotelInformationMenu({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final height = MediaQuery.of(context).size.height;
+ final cubit = context.read<HotelInformationCubit>();
+ final hotel = cubit.hotel;
+ return Column(
+ children: [
+ Image.asset(
+ hotel.image,
+ width: double.infinity,
+ height: height * 0.4,
+ fit: BoxFit.cover,
+ ),
+ const SizedBox(height: 16),
+ Text(hotel.name, style: Theme.of(context).textTheme.headlineLarge),
+ const SizedBox(height: 16),
+ ListView(
+ shrinkWrap: true,
+ children: [
+ HotelInformationListTile(
+ iconPath: "assets/icons/ic_chefs_hat.svg",
+ title: "Restauranter",
+ subtitle: "Læs om vores restaurant",
+ onClick: () {
+ context.pushNamed("/restaurants");
+ },
+ ),
+ HotelInformationListTile(
+ iconPath: "assets/icons/ic_spa.svg",
+ title: "Spa",
+ subtitle: "Bade, saunaer, brechelbath mm.",
+ onClick: () {
+ context.pushNamed('/spa');
+ },
+ ),
+ HotelInformationListTile(
+ iconPath: "assets/icons/ic_car.svg",
+ title: "Parkeing",
+ subtitle: "",
+ onClick: cubit.onParkingClicked,
+ ),
+ HotelInformationListTile(
+ iconPath: "assets/icons/ic_info.svg",
+ title: "Øvrige informationer",
+ subtitle: "Find mere information om hotellet",
+ onClick: cubit.onMoreInformationClicked,
+ ),
+ ],
+ )
+ ],
+ );
+ }
+}
diff --git a/comwell_key_app/lib/hotel_information/components/restaurant_page.dart b/comwell_key_app/lib/hotel_information/components/restaurant_page.dart
index e69de29b..7f2e538f 100644
--- a/comwell_key_app/lib/hotel_information/components/restaurant_page.dart
+++ b/comwell_key_app/lib/hotel_information/components/restaurant_page.dart
@@ -0,0 +1,16 @@
+import 'package:flutter/material.dart';
+
+class RestaurantPage extends StatelessWidget {
+ const RestaurantPage({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return const Scaffold(
+ body: Center(
+ child: Column(
+ children: [Text("Restaurant page")],
+ ),
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/hotel_information/components/spa_facility_page.dart b/comwell_key_app/lib/hotel_information/components/spa_facility_page.dart
index e69de29b..acb6e991 100644
--- a/comwell_key_app/lib/hotel_information/components/spa_facility_page.dart
+++ b/comwell_key_app/lib/hotel_information/components/spa_facility_page.dart
@@ -0,0 +1,64 @@
+import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+
+class SpaFacilityPage extends StatelessWidget {
+ const SpaFacilityPage({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final cubit = context.read<HotelInformationCubit>();
+ final isLoading = cubit.state.spaButtonIsLoading;
+ print("qqq asda sda $isLoading");
+ return Scaffold(
+ 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: isLoading
+ ? null
+ : cubit.onBookSpaClicked,
+ style: ButtonStyle(
+ backgroundColor:
+ WidgetStateProperty.resolveWith((states) {
+ if (states.contains(WidgetState.disabled)) {
+ return Colors.grey;
+ }
+ return const Color(0xffAA8D65);
+ }),
+ foregroundColor:
+ const WidgetStatePropertyAll(Colors.white)),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 16.0),
+ child: Builder(builder: (context) {
+ if (isLoading) {
+ return const CircularProgressIndicator();
+ }
+ return Text("Book Spa ${cubit.state.spaButtonIsLoading}");
+ }),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ );
+ }),
+ body: const Center(
+ child: Column(
+ children: [Text("Spa")],
+ )),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/hotel_information/cubit/hotel_information_cubit.dart b/comwell_key_app/lib/hotel_information/cubit/hotel_information_cubit.dart
index 36529d80..66555edc 100644
--- a/comwell_key_app/lib/hotel_information/cubit/hotel_information_cubit.dart
+++ b/comwell_key_app/lib/hotel_information/cubit/hotel_information_cubit.dart
@@ -1,23 +1,46 @@
import 'package:bloc/bloc.dart';
import 'package:comwell_key_app/hotel_information/models/hotel.dart';
-import 'package:comwell_key_app/hotel_information/repository/hotel_information_repostiory.dart';
+import 'package:comwell_key_app/hotel_information/repository/hotel_information_repository.dart';
+import 'package:comwell_key_app/services/api.dart';
import 'package:equatable/equatable.dart';
+import 'package:flutter/foundation.dart';
part 'hotel_information_state.dart';
class HotelInformationCubit extends Cubit<HotelInformationState> {
+ final api = Api();
final HotelInformationRepository hotelInformationRepository;
- HotelInformationCubit({required this.hotelInformationRepository}) : super(HotelInformationInitial());
-
- void fetchHotelInformation() async{
- emit(HotelInformationLoading());
- // Fetch hotel information
- try{
- final hotel = await hotelInformationRepository.fetchHotelInformation();
- emit(HotelInformationLoaded(hotel));
+ late final Hotel hotel;
+
+ HotelInformationCubit({required this.hotelInformationRepository})
+ : super(const HotelInformationState.initial());
+
+ void fetchHotelInformation() async {
+ try {
+ hotel = await hotelInformationRepository.fetchHotelInformation();
+ emit(state.hotelSuccess());
} catch (e) {
- emit(HotelInformationError());
+ emit(state.hotelError());
+ }
+ }
+
+ void onRestaurantsClicked() {}
+
+ void onSpaClicked() {}
+
+ void onParkingClicked() {}
+
+ void onMoreInformationClicked() {}
+
+ void onBookSpaClicked() async {
+ emit(state.bookingSpa(true));
+ try {
+ await api.bookSpa(hotel);
+ } catch (e, st) {
+ if (kDebugMode) {
+ print("e=$e, $st");
+ }
}
-
+ emit(state.bookingSpa(false));
}
}
diff --git a/comwell_key_app/lib/hotel_information/cubit/hotel_information_state.dart b/comwell_key_app/lib/hotel_information/cubit/hotel_information_state.dart
index 436918e2..83d0558a 100644
--- a/comwell_key_app/lib/hotel_information/cubit/hotel_information_state.dart
+++ b/comwell_key_app/lib/hotel_information/cubit/hotel_information_state.dart
@@ -1,25 +1,39 @@
part of 'hotel_information_cubit.dart';
-sealed class HotelInformationState extends Equatable {
- const HotelInformationState();
+class HotelInformationState extends Equatable {
+ final HotelState hotelState;
+ final bool spaButtonIsLoading;
+
+ const HotelInformationState._({
+ required this.hotelState,
+ required this.spaButtonIsLoading,
+ });
+
+ const HotelInformationState.initial()
+ : hotelState = HotelState.loading,
+ spaButtonIsLoading = false;
+
+ HotelInformationState bookingSpa(bool spaButtonIsLoading) => _copyWith(spaButtonIsLoading: spaButtonIsLoading);
+ HotelInformationState hotelSuccess() => _copyWith(hotelState: HotelState.success);
+ HotelInformationState hotelError() => _copyWith(hotelState: HotelState.error);
+
+ HotelInformationState _copyWith({
+ HotelState? hotelState,
+ bool? spaButtonIsLoading,
+ }) {
+ print("qqq spaButtonIsLoading=$spaButtonIsLoading");
+ return HotelInformationState._(
+ hotelState: hotelState ?? this.hotelState,
+ spaButtonIsLoading: spaButtonIsLoading ?? this.spaButtonIsLoading,
+ );
+ }
@override
- List<Object> get props => [];
+ List<Object?> get props => [hotelState, spaButtonIsLoading];
}
-final class HotelInformationInitial extends HotelInformationState {}
-
-final class HotelInformationLoading extends HotelInformationState {}
-
-final class HotelInformationLoaded extends HotelInformationState {
- final Hotel hotel;
-
- const HotelInformationLoaded(this.hotel);
-
- @override
- List<Object> get props => [hotel];
-}
-
-final class HotelInformationError extends HotelInformationState {}
-
-
+enum HotelState {
+ loading,
+ success,
+ error;
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/hotel_information/hotel_information_page.dart b/comwell_key_app/lib/hotel_information/hotel_information_page.dart
index 09b12284..cbafdd3d 100644
--- a/comwell_key_app/lib/hotel_information/hotel_information_page.dart
+++ b/comwell_key_app/lib/hotel_information/hotel_information_page.dart
@@ -1,50 +1,30 @@
import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
import 'package:comwell_key_app/hotel_information/components/hotel_information_list_tile.dart';
+import 'package:comwell_key_app/hotel_information/components/restaurant_page.dart';
import 'package:comwell_key_app/hotel_information/cubit/hotel_information_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 HotelInformationPage extends StatelessWidget {
- const HotelInformationPage({super.key});
+ final Widget child;
+ const HotelInformationPage({super.key, required this.child});
@override
Widget build(BuildContext context) {
- final height = MediaQuery.of(context).size.height;
- context.read<HotelInformationCubit>().fetchHotelInformation();
return BlocBuilder<HotelInformationCubit, HotelInformationState>(
builder: (context, state) {
- if (state is HotelInformationLoading || state is HotelInformationInitial) {
- return const Center(child: CircularProgressIndicator());
- }
- if (state is HotelInformationLoaded) {
- final hotel = state.hotel;
- return Scaffold(
+ return Scaffold(
appBar: const ComwellAppBar(),
- body: Column(
- children: [
- Image.asset(
- 'hotel.image',
- width: double.infinity,
- height: height * 0.4,
- fit: BoxFit.cover,
- ),
- const SizedBox(height: 16),
- Text(hotel.name, style: Theme.of(context).textTheme.headlineLarge),
- const SizedBox(height: 16),
- ListView(
- shrinkWrap: true,
- children: const [
- HotelInformationListTile()
- ],
- )
-
- ],
- ),
+ body: Builder(builder: (context) {
+ return switch (state.hotelState) {
+ HotelState.loading => const Center(child: CircularProgressIndicator()),
+ HotelState.error => const Center(child: Text("Error")),
+ HotelState.success => child,
+ };
+ }),
);
-
- }
- return const Center(child: Text("Error"));
});
}
}
diff --git a/comwell_key_app/lib/hotel_information/models/facilities.dart b/comwell_key_app/lib/hotel_information/models/facilities.dart
index cf750860..6a09be67 100644
--- a/comwell_key_app/lib/hotel_information/models/facilities.dart
+++ b/comwell_key_app/lib/hotel_information/models/facilities.dart
@@ -8,8 +8,8 @@ part '../../.generated/hotel_information/models/facilities.g.dart';
@JsonSerializable()
class Facilities {
- final List<Restaurant> restaurants;
- final List<Spa> spas;
+ final Iterable<Restaurant> restaurants;
+ final Iterable<Spa> spas;
final ParkingInfo parking;
Facilities({
diff --git a/comwell_key_app/lib/hotel_information/models/hotel.dart b/comwell_key_app/lib/hotel_information/models/hotel.dart
index 555f2e1e..7a88ef69 100644
--- a/comwell_key_app/lib/hotel_information/models/hotel.dart
+++ b/comwell_key_app/lib/hotel_information/models/hotel.dart
@@ -15,8 +15,6 @@ class Hotel {
final String image;
final Facilities facilities;
-
-
Hotel({
required this.id,
required this.name,
@@ -25,9 +23,10 @@ class Hotel {
required this.country,
required this.starRating,
required this.image,
- required this.facilities
+ required this.facilities,
});
-factory Hotel.fromJson(Map<String, dynamic> json) => _$HotelFromJson(json);
- Json toJson() => _$HotelToJson(this);
+ factory Hotel.fromJson(Map<String, dynamic> json) => _$HotelFromJson(json);
+
+ Json toJson() => _$HotelToJson(this);
}
diff --git a/comwell_key_app/lib/hotel_information/repository/hotel_information_repository.dart b/comwell_key_app/lib/hotel_information/repository/hotel_information_repository.dart
new file mode 100644
index 00000000..5e7222f1
--- /dev/null
+++ b/comwell_key_app/lib/hotel_information/repository/hotel_information_repository.dart
@@ -0,0 +1,63 @@
+import 'package:comwell_key_app/hotel_information/models/facilities.dart';
+import 'package:comwell_key_app/hotel_information/models/hotel.dart';
+
+import 'package:comwell_key_app/hotel_information/models/parking_info.dart';
+import 'package:comwell_key_app/hotel_information/models/restaurant.dart';
+import 'package:comwell_key_app/hotel_information/models/spa.dart';
+
+class HotelInformationRepository {
+
+ Future<Hotel> fetchHotelInformation() async {
+ // Fetch hotel information
+ return Hotel(
+ id: '1',
+ name: 'Comwell Hotel',
+ address: 'Vesterbrogade 6C',
+ city: 'Copenhagen',
+ country: 'Denmark',
+ starRating: 4,
+ image: 'assets/images/hotel.jpg',
+ facilities: Facilities(
+ restaurants: [
+ Restaurant(
+ name: 'Restaurant 1',
+ description: 'Description 1',
+ imageUrl: 'assets/images/restaurant1.jpg',
+ address: 'Address 1',
+ openingHours: 'Opening Hours 1',
+ phoneNumber: '+4528424242',
+ email: 'email@comwell.com'
+ ),
+ Restaurant(
+ name: 'Restaurant 2',
+ description: 'Description 1',
+ imageUrl: 'assets/images/restaurant1.jpg',
+ address: 'Address 2',
+ openingHours: 'Opening Hours 2',
+ phoneNumber: '+4528424242',
+ email: 'email@comwell.com'
+ ),
+ ],
+ spas: [
+ Spa(
+ title: 'Spa 1',
+ description: 'Description 1',
+ image: 'assets/images/spa1.jpg'
+ ),
+ Spa(
+ title: 'Spa 2',
+ description: 'Description 2',
+ image: 'assets/images/spa2.jpg'
+ ),
+ ],
+ parking: ParkingInfo(
+ title: 'Parking',
+ description: 'Description',
+ electricCharging: true,
+ electricChargingTitle: 'Electric Charging',
+ electricChargingDescription: 'Electric Charging Description'
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/hotel_information/repository/hotel_information_repostiory.dart b/comwell_key_app/lib/hotel_information/repository/hotel_information_repostiory.dart
deleted file mode 100644
index 3410dec9..00000000
--- a/comwell_key_app/lib/hotel_information/repository/hotel_information_repostiory.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-import 'package:comwell_key_app/hotel_information/models/facilities.dart';
-import 'package:comwell_key_app/hotel_information/models/hotel.dart';
-
-import 'package:comwell_key_app/hotel_information/models/parking_info.dart';
-import 'package:comwell_key_app/hotel_information/models/restaurant.dart';
-import 'package:comwell_key_app/hotel_information/models/spa.dart';
-
-class HotelInformationRepository {
-
- Future<Hotel> fetchHotelInformation() async {
- // Fetch hotel information
- return await Hotel(
- id: '1',
- name: 'Comwell Hotel',
- address: 'Vesterbrogade 6C',
- city: 'Copenhagen',
- country: 'Denmark',
- starRating: 4,
- image: 'assets/images/hotel.jpg',
- facilities: Facilities(
- restaurants: [
- Restaurant(
- name: 'Restaurant 1',
- description: 'Description 1',
- imageUrl: 'assets/images/restaurant1.jpg',
- address: 'Address 1',
- openingHours: 'Opening Hours 1',
- phoneNumber: '+4528424242',
- email: 'email@comwell.com'
- ),
- Restaurant(
- name: 'Restaurant 2',
- description: 'Description 1',
- imageUrl: 'assets/images/restaurant1.jpg',
- address: 'Address 2',
- openingHours: 'Opening Hours 2',
- phoneNumber: '+4528424242',
- email: 'email@comwell.com'
- ),
- ],
- spas: [
- Spa(
- title: 'Spa 1',
- description: 'Description 1',
- image: 'assets/images/spa1.jpg'
- ),
- Spa(
- title: 'Spa 2',
- description: 'Description 2',
- image: 'assets/images/spa2.jpg'
- ),
- ],
- parking: ParkingInfo(
- title: 'Parking',
- description: 'Description',
- electricCharging: true,
- electricChargingTitle: 'Electric Charging',
- electricChargingDescription: 'Electric Charging Description'
- ),
- ),
- );
- }
-}
\ No newline at end of file
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index eb970cab..ce626b97 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -2,10 +2,15 @@ import 'package:comwell_key_app/authentication/authentication_repository.dart';
import 'package:comwell_key_app/authentication/bloc/authentication_bloc.dart';
import 'package:comwell_key_app/check_in/bloc/check_in_cubit.dart';
import 'package:comwell_key_app/check_in/check_in_page.dart';
+import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
import 'package:comwell_key_app/contact/contact_page.dart';
import 'package:comwell_key_app/find_booking/find_booking_page.dart';
import 'package:comwell_key_app/find_booking/loading_page.dart';
import 'package:comwell_key_app/home/home_page.dart';
+import 'package:comwell_key_app/hotel_information/components/hotel_information_menu.dart';
+import 'package:comwell_key_app/hotel_information/components/restaurant_page.dart';
+import 'package:comwell_key_app/hotel_information/components/spa_facility_page.dart';
+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/key/key_page.dart';
import 'package:comwell_key_app/login/login_page.dart';
@@ -24,7 +29,11 @@ import 'package:go_router/go_router.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
+import '../hotel_information/repository/hotel_information_repository.dart';
+import '../utils/locator.dart';
+
final _rootNavigatorKey = GlobalKey<NavigatorState>();
+final _shellNavigatorKey = GlobalKey<NavigatorState>();
GoRouter goRouter(AuthenticationBloc authBloc) {
return GoRouter(
@@ -58,13 +67,45 @@ GoRouter goRouter(AuthenticationBloc authBloc) {
return null;
},
routes: <RouteBase>[
+ ShellRoute(
+ navigatorKey: _shellNavigatorKey,
+ pageBuilder: (context, state, child) {
+ return NoTransitionPage(
+ child: BlocProvider<HotelInformationCubit>(
+ create: (BuildContext context) => HotelInformationCubit(
+ hotelInformationRepository:
+ locator<HotelInformationRepository>())
+ ..fetchHotelInformation(),
+ child:
+ BlocBuilder<HotelInformationCubit, HotelInformationState>(
+ builder: (context, state) {
+ return HotelInformationPage(child: child);
+ }),
+ ),
+ );
+ },
+ parentNavigatorKey: _rootNavigatorKey,
+ routes: [
+ GoRoute(
+ path: '/${AppRoutes.hotelInformation.name}',
+ name: AppRoutes.hotelInformation.name,
+ builder: (context, state) {
+ return const HotelInformationMenu();
+ }),
+ GoRoute(
+ path: '/spa',
+ name: '/spa',
+ builder: (context, state) {
+ return const SpaFacilityPage();
+ }),
+ GoRoute(
+ path: '/restaurants',
+ name: "/restaurants",
+ builder: (context, state) {
+ return const RestaurantPage();
+ }),
+ ]),
GoRoute(
- path: '/${AppRoutes.hotelInformation.name}',
- name: AppRoutes.hotelInformation.name,
- builder: (context, state) {
- return const HotelInformationPage();
- }),
- GoRoute(
path: '/${AppRoutes.contact.name}',
name: AppRoutes.contact.name,
builder: (context, state) {
diff --git a/comwell_key_app/lib/services/api.dart b/comwell_key_app/lib/services/api.dart
index 96d81e85..95bcbeca 100644
--- a/comwell_key_app/lib/services/api.dart
+++ b/comwell_key_app/lib/services/api.dart
@@ -1,5 +1,6 @@
import 'dart:convert';
+import 'package:comwell_key_app/hotel_information/models/hotel.dart';
import 'package:comwell_key_app/profile_settings/model/user.dart';
import 'package:comwell_key_app/services/http_client.dart';
import 'package:comwell_key_app/utils/json.dart';
@@ -86,4 +87,9 @@ class Api {
}
Future<void> sendContact(String hotelCode) async {}
+
+ Future<void> bookSpa(Hotel hotel) async {
+ await Future<void>.delayed(const Duration(seconds: 2));
+ // TODO implement
+ }
}
diff --git a/comwell_key_app/lib/utils/locator.dart b/comwell_key_app/lib/utils/locator.dart
index d8a56153..802dbcbf 100644
--- a/comwell_key_app/lib/utils/locator.dart
+++ b/comwell_key_app/lib/utils/locator.dart
@@ -2,7 +2,7 @@ import 'package:comwell_key_app/authentication/authentication_repository.dart';
import 'package:comwell_key_app/database/comwell_db.dart';
import 'package:comwell_key_app/home/home_repository.dart';
import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
-import 'package:comwell_key_app/hotel_information/repository/hotel_information_repostiory.dart';
+import 'package:comwell_key_app/hotel_information/repository/hotel_information_repository.dart';
import 'package:comwell_key_app/key/repository/key_repository.dart';
import 'package:comwell_key_app/overview/repository/overview_repository.dart';
import 'package:comwell_key_app/pregistration/pregistration_repository.dart';