6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 4406e952
Changed files
comwell_key_app/assets/translations/en-US.json | 2 +- .../lib/booking_details/booking_details_page.dart | 6 ++- .../components/practical_information_button.dart | 39 ++++++++++--------- .../lib/common/components/bottom_sheet_widget.dart | 45 +++++++++++++++++----- 4 files changed, 60 insertions(+), 32 deletions(-)
Diff
diff --git a/comwell_key_app/assets/translations/en-US.json b/comwell_key_app/assets/translations/en-US.json
index e30068e7..7b17e3da 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -127,7 +127,7 @@
"booking_details_page_hotel_information_button_title": "Hotel information",
"booking_details_page_hotel_information_button_subtitle": "Find relevant information about the hotel",
"booking_details_page_contact_button_title": "Contact",
- "booking_details_page_contact_button_subtitle": "Contact the reception",
+ "booking_details_page_contact_button_subtitle": "Contact the reception ",
"housekeeping_page_title": "Housekeeping",
"housekeeping_page_subtitle": "If you wish for housekeeping, you can order it here",
"housekeeping_page_button": "Order housekeeping",
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 788fa4ec..b9a5fff6 100644
--- a/comwell_key_app/lib/booking_details/booking_details_page.dart
+++ b/comwell_key_app/lib/booking_details/booking_details_page.dart
@@ -28,6 +28,7 @@ class BookingDetailsPage extends StatelessWidget {
if (state.status == BookingDetailsStatus.initial) {
cubit.add(InitialEvent());
}
+ final checkOutDate = DateTime.now() == cubit.booking.endDate;
return Scaffold(
extendBodyBehindAppBar: true,
@@ -89,7 +90,7 @@ class BookingDetailsPage extends StatelessWidget {
roomNumber: cubit.booking.roomNumber)
: const SizedBox(),
const SizedBox(height: 20),
- const CheckOutButton(),
+ if (checkOutDate) const CheckOutButton(),
const SizedBox(height: 20),
Text("booking_details_page_practical_information".tr()),
const SizedBox(height: 20),
@@ -134,7 +135,8 @@ class BookingDetailsPage extends StatelessWidget {
const SizedBox(height: 16),
const PreregisterButton(),
const SizedBox(height: 16),
- Text('room_keys'.tr()),
+ if (state.keys.isNotEmpty)
+ Text('room_keys'.tr()),
const SizedBox(height: 400),
],
)
diff --git a/comwell_key_app/lib/booking_details/components/practical_information_button.dart b/comwell_key_app/lib/booking_details/components/practical_information_button.dart
index 3de7757d..f8ab5214 100644
--- a/comwell_key_app/lib/booking_details/components/practical_information_button.dart
+++ b/comwell_key_app/lib/booking_details/components/practical_information_button.dart
@@ -18,6 +18,7 @@ class PracticalInformationButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final height = MediaQuery.of(context).size.height;
return Material(
color: sandColor[10],
borderRadius: const BorderRadius.all(Radius.circular(16)),
@@ -27,7 +28,9 @@ class PracticalInformationButton extends StatelessWidget {
onTap: () => onClick(),
child: Padding(
padding: const EdgeInsets.all(12),
- child: Stack(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
@@ -45,25 +48,23 @@ class PracticalInformationButton extends StatelessWidget {
)),
),
),
- Positioned(
- top: 160,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(title),
- SizedBox(
- width: 200,
- child: Text(
- subtitle,
- style: Theme.of(context)
- .textTheme
- .bodySmall
- ?.copyWith(color: Colors.grey),
- maxLines: 3,
- ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(title),
+ SizedBox(
+ width: 200,
+ child: Text(
+ subtitle,
+ style: Theme.of(context)
+ .textTheme
+ .bodySmall
+ ?.copyWith(color: Colors.grey),
+ maxLines: 3,
+
),
- ],
- ),
+ ),
+ ],
),
],
),
diff --git a/comwell_key_app/lib/common/components/bottom_sheet_widget.dart b/comwell_key_app/lib/common/components/bottom_sheet_widget.dart
index 7109e3aa..98adc835 100644
--- a/comwell_key_app/lib/common/components/bottom_sheet_widget.dart
+++ b/comwell_key_app/lib/common/components/bottom_sheet_widget.dart
@@ -1,8 +1,9 @@
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
import 'package:snapping_sheet/snapping_sheet.dart';
-class BottomSheetWidget extends StatelessWidget {
+class BottomSheetWidget extends StatefulWidget {
final List<Widget> widgetChildren;
const BottomSheetWidget({
@@ -10,6 +11,35 @@ class BottomSheetWidget extends StatelessWidget {
super.key,
});
+ @override
+ State<BottomSheetWidget> createState() => _BottomSheetWidgetState();
+}
+
+class _BottomSheetWidgetState extends State<BottomSheetWidget> {
+ @override
+ void initState() {
+ super.initState();
+ // Set the navigation bar color to match the bottom sheet
+ SystemChrome.setSystemUIOverlayStyle(
+ const SystemUiOverlayStyle(
+ systemNavigationBarColor: Colors.white,
+ systemNavigationBarIconBrightness: Brightness.dark,
+ ),
+ );
+ }
+
+ @override
+ void dispose() {
+ // Reset the navigation bar color when the bottom sheet is closed
+ SystemChrome.setSystemUIOverlayStyle(
+ const SystemUiOverlayStyle(
+ systemNavigationBarColor: Colors.transparent,
+ systemNavigationBarIconBrightness: Brightness.dark,
+ ),
+ );
+ super.dispose();
+ }
+
@override
Widget build(BuildContext context) {
final height = MediaQuery.of(context).size.height;
@@ -39,18 +69,13 @@ class BottomSheetWidget extends StatelessWidget {
children: [
Container(
margin: const EdgeInsets.only(top: 20),
- width: 100,
- height: 7,
+ width: 70,
+ height: 5,
decoration: BoxDecoration(
- color: Colors.grey,
+ color: colorDivider,
borderRadius: BorderRadius.circular(5),
),
),
- Container(
- color: Colors.grey[200],
- height: 2,
- margin: const EdgeInsets.all(15).copyWith(top: 0, bottom: 0),
- )
],
),
),
@@ -63,7 +88,7 @@ class BottomSheetWidget extends StatelessWidget {
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
- children: widgetChildren)),
+ children: widget.widgetChildren)),
),
),
),