6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 163d4713
Changed files
comwell_key_app/.gitignore | 2 + .../android/app/src/main/AndroidManifest.xml | 7 + comwell_key_app/assets/translations/da-DK.json | 6 +- comwell_key_app/assets/translations/en-US.json | 6 +- .../Pods-Runner-acknowledgements.markdown | 31 ++++ ...frameworks-Debug-Develop-input-files.xcfilelist | 1 + ...rameworks-Debug-Develop-output-files.xcfilelist | 1 + ...-Runner-frameworks-Debug-input-files.xcfilelist | 1 + ...Runner-frameworks-Debug-output-files.xcfilelist | 1 + ...unner-frameworks-Profile-input-files.xcfilelist | 1 + ...nner-frameworks-Profile-output-files.xcfilelist | 1 + ...-frameworks-Release-Prod-input-files.xcfilelist | 1 + ...frameworks-Release-Prod-output-files.xcfilelist | 1 + ...frameworks-Release-Stage-input-files.xcfilelist | 1 + ...rameworks-Release-Stage-output-files.xcfilelist | 1 + ...unner-frameworks-Release-input-files.xcfilelist | 1 + ...nner-frameworks-Release-output-files.xcfilelist | 1 + .../Pods-Runner/Pods-Runner-frameworks.sh | 13 ++ comwell_key_app/ios/Runner/Info.plist | 10 ++ .../lib/.generated/overview/models/booking.g.dart | 4 + .../lib/.generated/overview/models/guest.g.dart | 17 +++ .../bloc/booking_details_state.dart | 31 ++-- .../lib/booking_details/booking_details_page.dart | 4 + .../booking_details/components/share_button.dart | 157 +++++++++++++++++++++ .../lib/check_in/check_in_repository.dart | 2 + .../lib/overview/cubit/overview_cubit.dart | 18 ++- comwell_key_app/lib/overview/models/booking.dart | 42 +++--- comwell_key_app/lib/overview/models/guest.dart | 20 +++ .../overview/repository/overview_repository.dart | 30 +++- comwell_key_app/lib/routing/app_router.dart | 49 +++++++ comwell_key_app/lib/routing/app_routes.dart | 3 +- .../lib/share/components/guest_list.dart | 90 ++++++++++++ comwell_key_app/lib/share/share_booking_page.dart | 136 ++++++++++++++++++ comwell_key_app/pubspec.yaml | 1 + 34 files changed, 657 insertions(+), 34 deletions(-)
Diff
diff --git a/comwell_key_app/.gitignore b/comwell_key_app/.gitignore
index 1b8a1682..67967dc2 100644
--- a/comwell_key_app/.gitignore
+++ b/comwell_key_app/.gitignore
@@ -11,6 +11,7 @@
.svn/
.swiftpm/
migrate_working_dir/
+/mobilekeys_sdk_plugin/.vscode/settings.json
# IntelliJ related
*.iml
@@ -34,6 +35,7 @@ migrate_working_dir/
.pub/
/build/
.env
+android/app/.cxx
# Symbolication related
app.*.symbols
diff --git a/comwell_key_app/android/app/src/main/AndroidManifest.xml b/comwell_key_app/android/app/src/main/AndroidManifest.xml
index 38cdfd5f..963a9c86 100644
--- a/comwell_key_app/android/app/src/main/AndroidManifest.xml
+++ b/comwell_key_app/android/app/src/main/AndroidManifest.xml
@@ -56,6 +56,13 @@
android:host="${applicationId}"
android:path="/adyenPayment"
android:scheme="adyencheckout" />
+
+
+ <data
+ android:host="comwell.app"
+ android:pathPrefix="/booking"
+ android:pathPattern=".*"
+ android:scheme="app" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
diff --git a/comwell_key_app/assets/translations/da-DK.json b/comwell_key_app/assets/translations/da-DK.json
index 48a33646..63692ba7 100644
--- a/comwell_key_app/assets/translations/da-DK.json
+++ b/comwell_key_app/assets/translations/da-DK.json
@@ -180,5 +180,9 @@
"payment_cards_confirm_remove_title": "Du er ved at fjerne et betalingskort",
"payment_cards_confirm_remove_subtitle": "Dette betalingskort vil ikke længere være tilgængeligt, hvis du sletter det.",
"payment_cards_remove_card_button": "Fjern kort",
- "payment_cards_save_card_button": "Gem kort"
+ "payment_cards_save_card_button": "Gem kort",
+ "share_booking_page_title": "Del ophold",
+ "share_booking_page_subtitle": "Her kan du dele dit ophold med en anden gæst og give dem adgang til bookinginformation, nøglekort og Concierge",
+ "share_booking_page_share_button": "Del dit ophold",
+ "handle_guests_title": "Håndter gæster"
}
\ 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 6ba07857..71ce2676 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -180,5 +180,9 @@
"payment_cards_confirm_remove_subtitle": "This payment card will no longer be usable",
"payment_cards_remove_card_button": "Remove card",
"payment_cards_edit_card_title": "Edit card",
- "payment_cards_save_card_button": "Save card"
+ "payment_cards_save_card_button": "Save card",
+ "share_booking_page_title": "Share booking",
+ "share_booking_page_subtitle": "Here you can share your booking with another guest and give them access to booking information, keycard and Concierge",
+ "share_booking_page_share_button": "Share your booking",
+ "handle_guests_title": "Handle guests"
}
\ No newline at end of file
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-acknowledgements.markdown b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-acknowledgements.markdown
index 3f073bf3..258b816d 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-acknowledgements.markdown
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-acknowledgements.markdown
@@ -2149,6 +2149,37 @@ SOFTWARE.
TODO: Add your license here.
+## share_plus
+
+Copyright 2017, the Flutter project authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
## shared_preferences_foundation
Copyright 2013 The Flutter Authors. All rights reserved.
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-Develop-input-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-Develop-input-files.xcfilelist
index f7b0f013..6632bf37 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-Develop-input-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-Develop-input-files.xcfilelist
@@ -21,6 +21,7 @@ ${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framewor
${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework
${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework
${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework
+${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework
${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework
${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework
${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-Develop-output-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-Develop-output-files.xcfilelist
index 50d02c46..5524fa4a 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-Develop-output-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-Develop-output-files.xcfilelist
@@ -20,6 +20,7 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pay_ios.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sentry_flutter.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/seos_mobile_keys_plugin.framework
+${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlcipher_flutter_libs.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-input-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-input-files.xcfilelist
index f7b0f013..6632bf37 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-input-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-input-files.xcfilelist
@@ -21,6 +21,7 @@ ${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framewor
${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework
${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework
${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework
+${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework
${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework
${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework
${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist
index 50d02c46..5524fa4a 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist
@@ -20,6 +20,7 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pay_ios.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sentry_flutter.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/seos_mobile_keys_plugin.framework
+${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlcipher_flutter_libs.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Profile-input-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Profile-input-files.xcfilelist
index f7b0f013..6632bf37 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Profile-input-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Profile-input-files.xcfilelist
@@ -21,6 +21,7 @@ ${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framewor
${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework
${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework
${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework
+${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework
${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework
${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework
${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Profile-output-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Profile-output-files.xcfilelist
index 50d02c46..5524fa4a 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Profile-output-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Profile-output-files.xcfilelist
@@ -20,6 +20,7 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pay_ios.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sentry_flutter.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/seos_mobile_keys_plugin.framework
+${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlcipher_flutter_libs.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Prod-input-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Prod-input-files.xcfilelist
index f7b0f013..6632bf37 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Prod-input-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Prod-input-files.xcfilelist
@@ -21,6 +21,7 @@ ${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framewor
${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework
${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework
${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework
+${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework
${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework
${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework
${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Prod-output-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Prod-output-files.xcfilelist
index 50d02c46..5524fa4a 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Prod-output-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Prod-output-files.xcfilelist
@@ -20,6 +20,7 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pay_ios.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sentry_flutter.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/seos_mobile_keys_plugin.framework
+${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlcipher_flutter_libs.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Stage-input-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Stage-input-files.xcfilelist
index f7b0f013..6632bf37 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Stage-input-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Stage-input-files.xcfilelist
@@ -21,6 +21,7 @@ ${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framewor
${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework
${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework
${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework
+${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework
${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework
${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework
${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Stage-output-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Stage-output-files.xcfilelist
index 50d02c46..5524fa4a 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Stage-output-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-Stage-output-files.xcfilelist
@@ -20,6 +20,7 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pay_ios.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sentry_flutter.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/seos_mobile_keys_plugin.framework
+${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlcipher_flutter_libs.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-input-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-input-files.xcfilelist
index f7b0f013..6632bf37 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-input-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-input-files.xcfilelist
@@ -21,6 +21,7 @@ ${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framewor
${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework
${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework
${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework
+${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework
${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework
${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework
${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-output-files.xcfilelist b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-output-files.xcfilelist
index 50d02c46..5524fa4a 100644
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-output-files.xcfilelist
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Release-output-files.xcfilelist
@@ -20,6 +20,7 @@ ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pay_ios.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sentry_flutter.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/seos_mobile_keys_plugin.framework
+${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlcipher_flutter_libs.framework
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework
diff --git a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh
index 7ea557a6..f715324f 100755
--- a/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh
+++ b/comwell_key_app/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh
@@ -198,6 +198,7 @@ if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -228,6 +229,7 @@ if [[ "$CONFIGURATION" == "Debug-debugtest" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -258,6 +260,7 @@ if [[ "$CONFIGURATION" == "Debug-develop" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -288,6 +291,7 @@ if [[ "$CONFIGURATION" == "Develop" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -318,6 +322,7 @@ if [[ "$CONFIGURATION" == "Prod" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -348,6 +353,7 @@ if [[ "$CONFIGURATION" == "Profile" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -378,6 +384,7 @@ if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -408,6 +415,7 @@ if [[ "$CONFIGURATION" == "Release-Prod" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -438,6 +446,7 @@ if [[ "$CONFIGURATION" == "Release-Stage" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -468,6 +477,7 @@ if [[ "$CONFIGURATION" == "Release-releasetest" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -498,6 +508,7 @@ if [[ "$CONFIGURATION" == "Stage" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -528,6 +539,7 @@ if [[ "$CONFIGURATION" == "Test-Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
@@ -558,6 +570,7 @@ if [[ "$CONFIGURATION" == "Test-Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/pay_ios/pay_ios.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework"
install_framework "${BUILT_PRODUCTS_DIR}/seos_mobile_keys_plugin/seos_mobile_keys_plugin.framework"
+ install_framework "${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework"
install_framework "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework"
install_framework "${BUILT_PRODUCTS_DIR}/sqlcipher_flutter_libs/sqlcipher_flutter_libs.framework"
install_framework "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework"
diff --git a/comwell_key_app/ios/Runner/Info.plist b/comwell_key_app/ios/Runner/Info.plist
index 0c5bcc58..4e6c7b49 100644
--- a/comwell_key_app/ios/Runner/Info.plist
+++ b/comwell_key_app/ios/Runner/Info.plist
@@ -41,6 +41,16 @@
<string>seosmobileaccess</string>
</array>
</dict>
+ <dict>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>CFBundleURLName</key>
+ <string>com.comwell.phoenix</string>
+ <key>CFBundleURLSchemes</key>
+ <array>
+ <string>comwell</string>
+ </array>
+ </dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
diff --git a/comwell_key_app/lib/.generated/overview/models/booking.g.dart b/comwell_key_app/lib/.generated/overview/models/booking.g.dart
index aa3195c3..4a9f50c8 100644
--- a/comwell_key_app/lib/.generated/overview/models/booking.g.dart
+++ b/comwell_key_app/lib/.generated/overview/models/booking.g.dart
@@ -24,6 +24,9 @@ Booking _$BookingFromJson(Map json) => Booking(
bookingDate: DateTime.parse(json['bookingDate'] as String),
paymentDetails: PaymentDetails.fromJson(
Map<String, dynamic>.from(json['paymentDetails'] as Map)),
+ guests: (json['guests'] as List<dynamic>?)
+ ?.map((e) => Guest.fromJson(Map<String, dynamic>.from(e as Map)))
+ .toList(),
);
Map<String, dynamic> _$BookingToJson(Booking instance) => <String, dynamic>{
@@ -43,6 +46,7 @@ Map<String, dynamic> _$BookingToJson(Booking instance) => <String, dynamic>{
'bookingDate': instance.bookingDate.toIso8601String(),
'paymentDetails': instance.paymentDetails.toJson(),
'confirmationId': instance.confirmationId,
+ 'guests': instance.guests?.map((e) => e.toJson()).toList(),
};
const _$BookingStatusEnumMap = {
diff --git a/comwell_key_app/lib/.generated/overview/models/guest.g.dart b/comwell_key_app/lib/.generated/overview/models/guest.g.dart
new file mode 100644
index 00000000..d09b6d96
--- /dev/null
+++ b/comwell_key_app/lib/.generated/overview/models/guest.g.dart
@@ -0,0 +1,17 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of '../../../overview/models/guest.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+Guest _$GuestFromJson(Map json) => Guest(
+ name: json['name'] as String,
+ id: json['id'] as String,
+ );
+
+Map<String, dynamic> _$GuestToJson(Guest instance) => <String, dynamic>{
+ 'name': instance.name,
+ 'id': instance.id,
+ };
diff --git a/comwell_key_app/lib/booking_details/bloc/booking_details_state.dart b/comwell_key_app/lib/booking_details/bloc/booking_details_state.dart
index f4c24c43..d60cc3ad 100644
--- a/comwell_key_app/lib/booking_details/bloc/booking_details_state.dart
+++ b/comwell_key_app/lib/booking_details/bloc/booking_details_state.dart
@@ -1,18 +1,30 @@
part of 'booking_details_bloc.dart';
class BookingDetailsState extends Equatable {
-
final bool isHouseKeepingOrdered;
final BookingDetailsStatus status;
final MobileKeysKey? key;
final List<MobileKeysKey> keys;
- const BookingDetailsState._({required this.status, required this.key, required this.keys, required this.isHouseKeepingOrdered});
-
- BookingDetailsState.initial() : this._(status: BookingDetailsStatus.initial, key: null, keys: [], isHouseKeepingOrdered: false);
- BookingDetailsState setupError() => copyWith(status: BookingDetailsStatus.setupError);
- BookingDetailsState updateKeys(List<MobileKeysKey> keys) => copyWith(status: BookingDetailsStatus.keysUpdated, keys: keys);
- BookingDetailsState houseKeepingOrdered() => copyWith(status: BookingDetailsStatus.houseKeepingOrdered, isHouseKeepingOrdered: true);
+ const BookingDetailsState._(
+ {required this.status,
+ required this.key,
+ required this.keys,
+ required this.isHouseKeepingOrdered});
+
+ BookingDetailsState.initial()
+ : this._(
+ status: BookingDetailsStatus.initial,
+ key: null,
+ keys: [],
+ isHouseKeepingOrdered: false);
+ BookingDetailsState setupError() =>
+ copyWith(status: BookingDetailsStatus.setupError);
+ BookingDetailsState updateKeys(List<MobileKeysKey> keys) =>
+ copyWith(status: BookingDetailsStatus.keysUpdated, keys: keys);
+ BookingDetailsState houseKeepingOrdered() => copyWith(
+ status: BookingDetailsStatus.houseKeepingOrdered,
+ isHouseKeepingOrdered: true);
BookingDetailsState main() => copyWith(status: BookingDetailsStatus.main);
@override
@@ -28,13 +40,14 @@ class BookingDetailsState extends Equatable {
status: status ?? this.status,
key: key ?? this.key,
keys: keys ?? this.keys,
- isHouseKeepingOrdered: isHouseKeepingOrdered ?? this.isHouseKeepingOrdered,
+ isHouseKeepingOrdered:
+ isHouseKeepingOrdered ?? this.isHouseKeepingOrdered,
);
}
@override
String toString() {
- return "BookingDetailsState(status=$status, key=$key, keys=$keys, isHouseKeepingOrdered=$isHouseKeepingOrdered)";
+ return "BookingDetailsState(status=$status, key=$key, keys=$keys, isHouseKeepingOrdered=$isHouseKeepingOrdered)";
}
}
diff --git a/comwell_key_app/lib/booking_details/booking_details_page.dart b/comwell_key_app/lib/booking_details/booking_details_page.dart
index a28c6748..da5d7a1f 100644
--- a/comwell_key_app/lib/booking_details/booking_details_page.dart
+++ b/comwell_key_app/lib/booking_details/booking_details_page.dart
@@ -1,5 +1,6 @@
import 'package:comwell_key_app/booking_details/components/check_in_button.dart';
import 'package:comwell_key_app/booking_details/components/preregister_button.dart';
+import 'package:comwell_key_app/booking_details/components/share_button.dart';
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/booking_details/components/housekeeping_button.dart';
@@ -42,6 +43,9 @@ class BookingDetailsPage extends StatelessWidget {
child: Stack(
alignment: Alignment.center,
children: [
+ const SafeArea(
+ child: ShareButton(),
+ ),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
diff --git a/comwell_key_app/lib/booking_details/components/share_button.dart b/comwell_key_app/lib/booking_details/components/share_button.dart
new file mode 100644
index 00000000..75d6fae2
--- /dev/null
+++ b/comwell_key_app/lib/booking_details/components/share_button.dart
@@ -0,0 +1,157 @@
+import 'package:comwell_key_app/booking_details/bloc/booking_details_bloc.dart';
+import 'package:comwell_key_app/common/components/bottom_sheet_widget.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:comwell_key_app/share/components/guest_list.dart';
+import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+
+class ShareButton extends StatelessWidget {
+ const ShareButton({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final booking = context.read<BookingDetailsBloc>().booking;
+ final theme = Theme.of(context);
+ const userButtonWidth = 50.0;
+ const userButtonOverlap =
+ 15.0; // How much each button overlaps the previous one
+ final numberOfUsers =
+ (booking.guests?.length ?? 0) + 1; // Add 1 for the booker
+ final bookerInitials =
+ booking.booker.split(' ').map((name) => name[0]).join('');
+ final guestInitials = booking.guests
+ ?.map((guest) =>
+ guest.name.split(' ').map((name) => name[0]).join(''))
+ .toList() ??
+ [];
+
+ return Stack(
+ children: [
+ Align(
+ alignment: Alignment.topLeft,
+ child: Padding(
+ padding: const EdgeInsets.only(left: 16.0, top: 16),
+ child: Stack(
+ children: [
+ Positioned(
+ left: (numberOfUsers - 1) *
+ (userButtonWidth - userButtonOverlap) +
+ userButtonWidth -
+ 20,
+ child: SizedBox(
+ width: userButtonWidth,
+ height: userButtonWidth,
+ child: ElevatedButton(
+ onPressed: () {
+ context.pushNamed(AppRoutes.shareBooking.name,
+ extra: booking);
+ },
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Colors.white,
+ elevation: 0,
+ shape: const CircleBorder(),
+ padding: EdgeInsets.zero,
+ ),
+ child: const Center(
+ child: Icon(Icons.add, color: Colors.black, size: 30),
+ ),
+ ),
+ ),
+ ),
+ ...List.generate(
+ numberOfUsers,
+ (index) => Positioned(
+ left: (numberOfUsers - 1 - index) *
+ (userButtonWidth - userButtonOverlap),
+ child: SizedBox(
+ width: userButtonWidth,
+ height: userButtonWidth,
+ child: ElevatedButton(
+ onPressed: () {
+ showModalBottomSheet<void>(
+ context: context,
+ backgroundColor: Colors.white,
+ builder: (BuildContext context) {
+ return SizedBox(
+ height: 450,
+ width: MediaQuery.of(context).size.width,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisSize: MainAxisSize.min,
+ children: <Widget>[
+ Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Row(
+ mainAxisAlignment:
+ MainAxisAlignment.spaceBetween,
+ children: [
+ Text('handle_guests_title'.tr(),
+ style: theme.textTheme.titleLarge
+ ?.copyWith(
+ color: Colors.black,
+ fontWeight: FontWeight.w600,
+ )),
+ ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor:
+ Colors.grey[200],
+ shape: const CircleBorder(),
+ elevation: 0),
+ child: const Icon(Icons.close,
+ color: Colors.black),
+ onPressed: () =>
+ Navigator.pop(context),
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(height: 16),
+ GuestList(
+ guests: booking.guests
+ ?.map((guest) => guest.name)
+ .toList() ??
+ [],
+ onGuestSelected: (guest) {},
+ selectedGuest: booking.booker,
+ ),
+ ],
+ ),
+ );
+ },
+ );
+ },
+ style: ElevatedButton.styleFrom(
+ backgroundColor:
+ index % 2 == 0 ? Colors.black : sandColor,
+ elevation: 0,
+ shape: const CircleBorder(),
+ padding: EdgeInsets.zero,
+ ),
+ child: Center(
+ child: Text(
+ index == 0
+ ? bookerInitials
+ : guestInitials[index - 1],
+ style: const TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.w400,
+ fontSize: 18,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+}
diff --git a/comwell_key_app/lib/check_in/check_in_repository.dart b/comwell_key_app/lib/check_in/check_in_repository.dart
index bb070490..1402af68 100644
--- a/comwell_key_app/lib/check_in/check_in_repository.dart
+++ b/comwell_key_app/lib/check_in/check_in_repository.dart
@@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:comwell_key_app/database/comwell_db.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
+import 'package:comwell_key_app/overview/models/guest.dart';
import 'package:comwell_key_app/overview/models/payment_details.dart';
import 'package:comwell_key_app/services/api.dart';
import 'package:comwell_key_app/utils/json.dart';
@@ -62,5 +63,6 @@ class CheckInRepository {
expiryDate: "expiryDate",
cvc: "cvc",
cardType: CardType.visa),
+ guests: null,
);
}
diff --git a/comwell_key_app/lib/overview/cubit/overview_cubit.dart b/comwell_key_app/lib/overview/cubit/overview_cubit.dart
index f9a5dbd2..51e87dca 100644
--- a/comwell_key_app/lib/overview/cubit/overview_cubit.dart
+++ b/comwell_key_app/lib/overview/cubit/overview_cubit.dart
@@ -23,7 +23,6 @@ class OverviewCubit extends Cubit<OverviewState> {
}
}
-
Future<void> addBooking(Booking newBooking) async {
if (state is OverviewLoaded) {
final currentState = state as OverviewLoaded;
@@ -63,7 +62,8 @@ class OverviewCubit extends Cubit<OverviewState> {
Future<Booking?> findBooking(String bookingReference, String lastName) async {
try {
- final booking = await overviewRepository.findBooking(bookingReference, lastName);
+ final booking =
+ await overviewRepository.findBooking(bookingReference, lastName);
if (booking != null) {
addBooking(booking); // Add the found booking to the current list
return booking;
@@ -79,4 +79,18 @@ class OverviewCubit extends Cubit<OverviewState> {
}
return null;
}
+
+ Future<void> findBookingById(String bookingId) async {
+ emit(OverviewLoading());
+ try {
+ final bookings = await overviewRepository.fetchAllBookingsForUser("1");
+ final booking = bookings.current.firstWhere((b) => b.id == bookingId,
+ orElse: () => bookings.past.firstWhere((b) => b.id == bookingId,
+ orElse: () =>
+ bookings.cancelled.firstWhere((b) => b.id == bookingId)));
+ emit(OverviewLoaded(bookings: bookings));
+ } catch (e) {
+ emit(OverviewError(error: e.toString()));
+ }
+ }
}
diff --git a/comwell_key_app/lib/overview/models/booking.dart b/comwell_key_app/lib/overview/models/booking.dart
index 1fa88267..3cd9dd32 100644
--- a/comwell_key_app/lib/overview/models/booking.dart
+++ b/comwell_key_app/lib/overview/models/booking.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/overview/models/guest.dart';
import 'package:comwell_key_app/overview/models/payment_details.dart';
import 'package:comwell_key_app/utils/json.dart';
import 'package:equatable/equatable.dart';
@@ -6,7 +7,7 @@ import 'package:json_annotation/json_annotation.dart';
part '../../.generated/overview/models/booking.g.dart';
@JsonSerializable()
-class Booking extends Equatable {
+class Booking extends Equatable {
final String id;
final String userId;
final String roomNumber;
@@ -23,6 +24,7 @@ class Booking extends Equatable {
final DateTime bookingDate;
final PaymentDetails paymentDetails;
final String confirmationId;
+ final List<Guest>? guests;
const Booking({
required this.id,
@@ -41,34 +43,36 @@ class Booking extends Equatable {
required this.booker,
required this.bookingDate,
required this.paymentDetails,
+ this.guests,
});
factory Booking.fromJson(Json json) => _$BookingFromJson(json);
Json toJson() => _$BookingToJson(this);
-
+
@override
List<Object?> get props => [
- id,
- userId,
- roomNumber,
- startDate,
- endDate,
- status,
- image,
- hotelName,
- roomType,
- children,
- adults,
- hotelCode,
- booker,
- bookingDate,
- paymentDetails,
- ];
+ id,
+ userId,
+ roomNumber,
+ startDate,
+ endDate,
+ status,
+ image,
+ hotelName,
+ roomType,
+ children,
+ adults,
+ hotelCode,
+ booker,
+ bookingDate,
+ paymentDetails,
+ guests,
+ ];
}
enum BookingStatus {
current,
past,
cancelled,
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/lib/overview/models/guest.dart b/comwell_key_app/lib/overview/models/guest.dart
new file mode 100644
index 00000000..f12cee4c
--- /dev/null
+++ b/comwell_key_app/lib/overview/models/guest.dart
@@ -0,0 +1,20 @@
+import 'package:comwell_key_app/utils/json.dart';
+import 'package:equatable/equatable.dart';
+import 'package:json_annotation/json_annotation.dart';
+
+part '../../.generated/overview/models/guest.g.dart';
+
+@JsonSerializable()
+class Guest extends Equatable {
+ final String name;
+ final String id;
+
+ const Guest({required this.name, required this.id});
+
+ factory Guest.fromJson(Json json) => _$GuestFromJson(json);
+
+ Json toJson() => _$GuestToJson(this);
+
+ @override
+ List<Object?> get props => [name, id];
+}
diff --git a/comwell_key_app/lib/overview/repository/overview_repository.dart b/comwell_key_app/lib/overview/repository/overview_repository.dart
index 96aaba87..2c554d4f 100644
--- a/comwell_key_app/lib/overview/repository/overview_repository.dart
+++ b/comwell_key_app/lib/overview/repository/overview_repository.dart
@@ -49,7 +49,10 @@ final json = {
"cvc": "123",
"cardType": "visa",
"cardName": " Doe Visa"
- }
+ },
+ "guests": [
+ {"name": "John Smith", "id": "123"}
+ ],
};
final response = {
"current": [
@@ -69,6 +72,9 @@ final response = {
"confirmationId": "",
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [
+ {"name": "John Smith", "id": "123"}
+ ],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
@@ -94,6 +100,7 @@ final response = {
"children": 0,
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
@@ -119,6 +126,9 @@ final response = {
"children": 0,
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [
+ {"name": "Jane Doe", "id": "456"}
+ ],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
@@ -146,6 +156,9 @@ final response = {
"children": 1,
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [
+ {"name": "Michael Johnson", "id": "789"}
+ ],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
@@ -171,6 +184,9 @@ final response = {
"children": 0,
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [
+ {"name": "Jane Doe", "id": "456"}
+ ],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
@@ -196,6 +212,9 @@ final response = {
"children": 0,
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [
+ {"name": "Sarah Williams", "id": "101"}
+ ],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
@@ -223,6 +242,9 @@ final response = {
"children": 0,
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [
+ {"name": "Jane Doe", "id": "456"}
+ ],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
@@ -248,6 +270,9 @@ final response = {
"children": 0,
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [
+ {"name": "David Brown", "id": "102"}
+ ],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
@@ -273,6 +298,9 @@ final response = {
"children": 0,
"booker": "John Doe",
"bookingDate": "2024-10-15T14:00:00",
+ "guests": [
+ {"name": "Jane Doe", "id": "456"}
+ ],
"paymentDetails": {
"cardHolder": "John Doe",
"cardNumber": "**** **** **** 1234",
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index 3032217f..fec22331 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -18,6 +18,8 @@ import 'package:comwell_key_app/login/login_page.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
import 'package:comwell_key_app/overview/overview_page.dart';
import 'package:comwell_key_app/overview/past_cancelled_booking_detail_page.dart';
+import 'package:comwell_key_app/overview/cubit/overview_cubit.dart';
+import 'package:comwell_key_app/overview/repository/overview_repository.dart';
import 'package:comwell_key_app/payment_cards/bloc/payment_cards_cubit.dart';
import 'package:comwell_key_app/payment_cards/payment_cards_page.dart';
import 'package:comwell_key_app/pregistration/preregistration_flow.dart';
@@ -27,6 +29,7 @@ import 'package:comwell_key_app/profile_settings/profile_settings_page.dart';
import 'package:comwell_key_app/redeem_debug/redeem_page.dart';
import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/routing/go_router_observer.dart';
+import 'package:comwell_key_app/share/share_booking_page.dart';
import 'package:comwell_key_app/utils/stream_to_listenable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
@@ -139,6 +142,52 @@ GoRouter goRouter(AuthenticationBloc authBloc) {
name: AppRoutes.findBooking.name,
builder: (context, state) => const FindBookingPage(),
),
+ GoRoute(
+ path: "/${AppRoutes.shareBooking.name}",
+ name: AppRoutes.shareBooking.name,
+ builder: (context, state) {
+ final booking = state.extra as Booking;
+ return BlocProvider<BookingDetailsBloc>(
+ create: (BuildContext context) => BookingDetailsBloc(
+ booking,
+ bookingDetailsRepository: locator<BookingDetailsRepository>(),
+ ),
+ child: ShareBookingPage(booking: booking),
+ );
+ },
+ ),
+ GoRoute(
+ path: "/booking/:id",
+ name: "booking_deep_link",
+ builder: (context, state) {
+ final bookingId = state.pathParameters['id']!;
+ return BlocProvider<OverviewCubit>(
+ create: (context) => OverviewCubit(locator<OverviewRepository>())
+ ..findBookingById(bookingId),
+ child: BlocListener<OverviewCubit, OverviewState>(
+ listener: (context, state) {
+ if (state is OverviewLoaded) {
+ final booking = state.bookings.current.firstWhere(
+ (b) => b.id == bookingId,
+ orElse: () => state.bookings.past.firstWhere(
+ (b) => b.id == bookingId,
+ orElse: () => state.bookings.cancelled
+ .firstWhere((b) => b.id == bookingId)));
+ if (context.mounted) {
+ context.pushNamed(AppRoutes.bookingDetails.name,
+ extra: booking);
+ }
+ } else if (state is OverviewError) {
+ if (context.mounted) {
+ context.pushNamed(AppRoutes.findBooking.name);
+ }
+ }
+ },
+ child: const LoadingPage(),
+ ),
+ );
+ },
+ ),
GoRoute(
path: "/${AppRoutes.checkIn.name}",
name: AppRoutes.checkIn.name,
diff --git a/comwell_key_app/lib/routing/app_routes.dart b/comwell_key_app/lib/routing/app_routes.dart
index dc9b9a99..f79645df 100644
--- a/comwell_key_app/lib/routing/app_routes.dart
+++ b/comwell_key_app/lib/routing/app_routes.dart
@@ -15,7 +15,7 @@ enum AppRoutes {
findBooking,
loadingPage,
changePassword,
- checkIn,
+ checkIn,
contact,
preregistration,
hotelInformation,
@@ -25,4 +25,5 @@ enum AppRoutes {
houseKeeping,
checkOut,
paymentCards,
+ shareBooking,
}
diff --git a/comwell_key_app/lib/share/components/guest_list.dart b/comwell_key_app/lib/share/components/guest_list.dart
new file mode 100644
index 00000000..c376d92b
--- /dev/null
+++ b/comwell_key_app/lib/share/components/guest_list.dart
@@ -0,0 +1,90 @@
+import 'package:flutter/material.dart';
+
+class GuestList extends StatefulWidget {
+ final List<String> guests;
+ final Function(String) onGuestSelected;
+ final String? selectedGuest;
+
+ const GuestList({
+ super.key,
+ required this.guests,
+ required this.onGuestSelected,
+ this.selectedGuest,
+ });
+
+ @override
+ State<GuestList> createState() => _GuestListState();
+}
+
+class _GuestListState extends State<GuestList> {
+ @override
+ Widget build(BuildContext context) {
+ return SingleChildScrollView(
+ child: ListView.builder(
+ shrinkWrap: true,
+ itemCount: widget.guests.length,
+ itemBuilder: (context, index) {
+ final guest = widget.guests[index];
+ final initials = guest.split(' ').map((name) => name[0]).join('');
+
+ return Padding(
+ padding:
+ const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.grey[300]!,
+ width: 1.0,
+ ),
+ borderRadius: BorderRadius.circular(8.0),
+ ),
+ padding: const EdgeInsets.all(12.0),
+ child: Row(
+ children: [
+ // Initials circle
+ Container(
+ width: 40,
+ height: 40,
+ decoration: const BoxDecoration(
+ color: Colors.black,
+ shape: BoxShape.circle,
+ ),
+ child: Center(
+ child: Text(
+ initials,
+ style: const TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.w400,
+ fontSize: 16,
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(width: 16),
+
+ // Guest name
+ Expanded(
+ child: Text(
+ guest,
+ style: Theme.of(context).textTheme.bodyLarge,
+ ),
+ ),
+ // Radio button
+ Radio<String>(
+ value: guest,
+ groupValue: widget.selectedGuest,
+ onChanged: (String? value) {
+ if (value != null) {
+ widget.onGuestSelected(value);
+ }
+ },
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/share/share_booking_page.dart b/comwell_key_app/lib/share/share_booking_page.dart
new file mode 100644
index 00000000..cc2d78be
--- /dev/null
+++ b/comwell_key_app/lib/share/share_booking_page.dart
@@ -0,0 +1,136 @@
+import 'package:comwell_key_app/overview/models/booking.dart';
+import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:share_plus/share_plus.dart';
+
+class ShareBookingPage extends StatelessWidget {
+ final Booking booking;
+ const ShareBookingPage({super.key, required this.booking});
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ return Scaffold(
+ backgroundColor: sandColor,
+ body: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ const SizedBox(width: 40),
+ Text('share_booking_page_title'.tr(),
+ style: theme.textTheme.titleMedium?.copyWith(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ )),
+ ElevatedButton(
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Colors.white,
+ shape: const CircleBorder(),
+ elevation: 0),
+ child: const Icon(Icons.close, color: Colors.black),
+ )
+ ],
+ ),
+ Card(
+ clipBehavior: Clip.antiAlias,
+ child: Stack(
+ children: [
+ Image.asset(
+ 'assets/images/booking_background.png',
+ height: 450,
+ width: 330,
+ fit: BoxFit.cover,
+ ),
+ Positioned(
+ top: 16,
+ left: 16,
+ child: Text(
+ booking.hotelName,
+ style: Theme.of(context).textTheme.titleLarge?.copyWith(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Positioned(
+ bottom: 16,
+ left: 16,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Text(DateFormat('d. MMM').format(booking.startDate),
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: Colors.white,
+ )),
+ const Icon(Icons.arrow_forward,
+ size: 16, color: Colors.white),
+ Text(DateFormat('d. MMM').format(booking.endDate),
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: Colors.white,
+ )),
+ ],
+ ),
+ Text(
+ '${booking.adults} ${booking.adults > 1 ? 'adults'.tr() : 'adult'.tr()}${booking.children > 0 ? ' | ${booking.children} ${booking.children > 1 ? 'children'.tr() : 'child'.tr()}' : ''}',
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: Colors.white.withValues(alpha: 0.7),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Text(
+ 'share_booking_page_subtitle'.tr(),
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(
+ color: Colors.white.withValues(alpha: 0.8),
+ ),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: SizedBox(
+ width: double.infinity,
+ child: ElevatedButton(
+ onPressed: () {
+ Share.share(
+ 'Check out my booking at ${booking.hotelName}!\n\n'
+ 'Dates: ${DateFormat('d. MMM').format(booking.startDate)} - ${DateFormat('d. MMM').format(booking.endDate)}\n'
+ 'Guests: ${booking.adults} ${booking.adults > 1 ? 'adults'.tr() : 'adult'.tr()}${booking.children > 0 ? ' | ${booking.children} ${booking.children > 1 ? 'children'.tr() : 'child'.tr()}' : ''}\n\n'
+ 'View booking: https://comwell.app/booking/${booking.id}',
+ subject: 'Comwell Booking',
+ );
+ },
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Colors.white,
+ minimumSize: const Size.fromHeight(50),
+ elevation: 0,
+ ),
+ child: Text('share_booking_page_share_button'.tr(),
+ style: theme.textTheme.bodyMedium?.copyWith(
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ )),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/pubspec.yaml b/comwell_key_app/pubspec.yaml
index b477b99b..6b2cb64e 100644
--- a/comwell_key_app/pubspec.yaml
+++ b/comwell_key_app/pubspec.yaml
@@ -52,6 +52,7 @@ dependencies:
path: ^1.9.0
path_provider: ^2.1.5
sentry_flutter: ^8.13.0
+ share_plus: ^10.1.4
dependency_overrides:
#Remove override when slider button updates