6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit eb2edab3

AuthorMikkel Thygesen<mth@dwarf.dk>
Date2025-02-11 17:10:05 +0100
455: fixed booking details not getting updated after check in

Changed files

.../lib/booking_details/components/check_in_button.dart    | 14 +++++++-------
 .../booking_details/components/housekeeping_button.dart    |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

Diff

diff --git a/comwell_key_app/lib/booking_details/components/check_in_button.dart b/comwell_key_app/lib/booking_details/components/check_in_button.dart
index 0606ea5a..60a062bf 100644
--- a/comwell_key_app/lib/booking_details/components/check_in_button.dart
+++ b/comwell_key_app/lib/booking_details/components/check_in_button.dart
@@ -17,9 +17,11 @@ class CheckInButton extends StatelessWidget {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 30),
child: ElevatedButton(
- onPressed: () {
- context.pushNamed(AppRoutes.checkIn.name,
- extra: bloc.booking);
+ onPressed: () async {
+ await context.pushNamed(AppRoutes.checkIn.name, extra: bloc.booking);
+ if (!bloc.isClosed) {
+ bloc.add(InitialEvent());
+ }
},
style: ElevatedButton.styleFrom(
backgroundColor: sandColor[80],
@@ -43,16 +45,14 @@ class CheckInButton extends StatelessWidget {
children: [
Text(
"check_in".tr(),
- style: Theme
- .of(context)
+ style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(color: Colors.white),
),
Text(
"overview_page_check_in_button_subtitle".tr(),
- style: Theme
- .of(context)
+ style: Theme.of(context)
.textTheme
.bodySmall
?.copyWith(color: Colors.white),
diff --git a/comwell_key_app/lib/booking_details/components/housekeeping_button.dart b/comwell_key_app/lib/booking_details/components/housekeeping_button.dart
index df482174..9a003106 100644
--- a/comwell_key_app/lib/booking_details/components/housekeeping_button.dart
+++ b/comwell_key_app/lib/booking_details/components/housekeeping_button.dart
@@ -19,7 +19,7 @@ class HousekeepingButton extends StatelessWidget {
onTap: () async {
if (bloc.state.isHouseKeepingOrdered) return;
await context.pushNamed(AppRoutes.houseKeeping.name);
- bloc.add(CheckIfHouseKeepingOrdered());
+ if(!bloc.isClosed) bloc.add(CheckIfHouseKeepingOrdered());
},
child: Container(
decoration: BoxDecoration(