6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 921f9a13
Changed files
.../booking_details/bloc/booking_details_bloc.dart | 3 ++- .../components/booking_details_bottom_sheet.dart | 27 +++++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-)
Diff
diff --git a/comwell_key_app/lib/booking_details/bloc/booking_details_bloc.dart b/comwell_key_app/lib/booking_details/bloc/booking_details_bloc.dart
index 4223a6a1..5a5b7b69 100644
--- a/comwell_key_app/lib/booking_details/bloc/booking_details_bloc.dart
+++ b/comwell_key_app/lib/booking_details/bloc/booking_details_bloc.dart
@@ -164,8 +164,9 @@ class BookingDetailsBloc
}
}
- //TODO add checkin time from backend when we have it
DateTime getCheckInTime() => booking.startDate.add(const Duration(hours: 15));
+
+ DateTime getCheckOutTime() => booking.endDate.add(const Duration(hours: 5));
Future<void> getUser(Emitter<BookingDetailsState> emit) async {
user = await profileRepository.fetchProfileSettings();
diff --git a/comwell_key_app/lib/booking_details/components/booking_details_bottom_sheet.dart b/comwell_key_app/lib/booking_details/components/booking_details_bottom_sheet.dart
index 38878b46..d55ea1f3 100644
--- a/comwell_key_app/lib/booking_details/components/booking_details_bottom_sheet.dart
+++ b/comwell_key_app/lib/booking_details/components/booking_details_bottom_sheet.dart
@@ -25,7 +25,7 @@ class BookingDetailsBottomSheet extends StatelessWidget {
widgetChildren: [
const SizedBox(height: 16),
const SizedBox(height: 16),
- cubit.booking.reservationStatus == ReservationStatus.checkedin
+ cubit.booking.reservationStatus == ReservationStatus.checkedin && cubit.getCheckOutTime().isBefore(DateTime.now())
? const Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: CheckOutButton(),
@@ -89,16 +89,27 @@ class BookingDetailsBottomSheet extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text('room_keys'.tr(), style: theme.textTheme.headlineMedium),
),
- const SizedBox(height: 400),
- Text("services".tr(), style: theme.textTheme.headlineMedium),
+ const SizedBox(height: 16),
cubit.booking.reservationStatus == ReservationStatus.checkedin
- ? Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16.0),
- child: HousekeepingButton(
- key: ValueKey(state.isHouseKeepingOrdered),
- booking: cubit.booking),
+ ? Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Text("services".tr(),
+ style: theme.textTheme.headlineMedium),
+ ),
+ const SizedBox(height: 16),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
+ child: HousekeepingButton(
+ key: ValueKey(state.isHouseKeepingOrdered),
+ booking: cubit.booking),
+ ),
+ ],
)
: const SizedBox(),
+ const SizedBox(height: 400),
],
);
}