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

AuthorEdmir Suljic<esu@dwarf.dk>
Date2025-05-16 10:30:58 +0200
Minor commit

Changed files

comwell_key_app/assets/translations/en-US.json              |  2 +-
 comwell_key_app/lib/check_in/bloc/check_in_cubit.dart       | 13 +++++++------
 .../components/hotel_information_menu.dart                  |  4 +++-
 .../lib/hotel_information/hotel_information_page.dart       |  2 +-
 comwell_key_app/lib/profile/profile_repository.dart         |  1 +
 comwell_key_app/lib/services/api.dart                       |  4 +++-
 comwell_key_app/lib/services/utils/api_endpoints.dart       |  2 +-
 7 files changed, 17 insertions(+), 11 deletions(-)

Diff

diff --git a/comwell_key_app/assets/translations/en-US.json b/comwell_key_app/assets/translations/en-US.json
index 3467b9a4..5aa9f7aa 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -237,7 +237,7 @@
"share_booking": "Share booking",
"total_charge": "Total charge",
"early_checkin": "Early check-in",
- "payed": "PAYED",,
+ "payed": "PAYED",
"room_prefix": "Room {}",
"total_charge_value": "{} kr.",
"generic_error_profile_page": "An error occurred. Please try again later. Or logout and try again.",
diff --git a/comwell_key_app/lib/check_in/bloc/check_in_cubit.dart b/comwell_key_app/lib/check_in/bloc/check_in_cubit.dart
index 53c8d23c..c0c01fd1 100644
--- a/comwell_key_app/lib/check_in/bloc/check_in_cubit.dart
+++ b/comwell_key_app/lib/check_in/bloc/check_in_cubit.dart
@@ -18,15 +18,17 @@ class CheckInCubit extends Cubit<CheckInState> {
await Future<void>.delayed(const Duration(milliseconds: 500));
emit(state.checkInStatusLoading());
await _checkInRepository.checkIn(booking.confirmationId);
- final bookingDetails = await _checkInRepository.getBookingDetails(booking.id);
+ final bookingDetails =
+ await _checkInRepository.getBookingDetails(booking.confirmationId);
emit(state.checkInStatusRoomFound(roomNumber: bookingDetails.roomNumber));
await _checkInRepository.checkIfSetup();
await tryGetKeys();
-
+
await Future<void>.delayed(const Duration(milliseconds: 1000));
print("qqq cubit.state.checkInStatus: ${state.checkInStatus}");
- print("qqq cubit.booking.roomNumber: ${booking.roomNumber}");
- emit(state.checkInStatusYourDigitalCard(roomNumber: booking.roomNumber));
+ print("qqq cubit.booking.roomNumber: ${bookingDetails.roomNumber}");
+ emit(state.checkInStatusYourDigitalCard(
+ roomNumber: bookingDetails.roomNumber));
} catch (err, st) {
if (kDebugMode) print("qqq err=$err, $st");
emit(state.setLoading(false));
@@ -37,8 +39,7 @@ class CheckInCubit extends Cubit<CheckInState> {
Future<void> onDonePressed() async {
emit(state.checkInStatusLoading());
try {
-
- // emit(state.checkInStatusDone());
+ // emit(state.checkInStatusDone());
} catch (err, st) {
if (kDebugMode) print("qqq err=$err, $st");
emit(state.checkInStatusError(Exception(err.toString())));
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
index cb491bfd..15166043 100644
--- a/comwell_key_app/lib/hotel_information/components/hotel_information_menu.dart
+++ b/comwell_key_app/lib/hotel_information/components/hotel_information_menu.dart
@@ -15,6 +15,7 @@ class HotelInformationMenu extends StatelessWidget {
final height = MediaQuery.of(context).size.height;
final cubit = context.read<HotelInformationCubit>();
final hotel = cubit.hotel;
+ final theme = Theme.of(context);
return ListView(
shrinkWrap: true,
children: [
@@ -31,9 +32,10 @@ class HotelInformationMenu extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(hotel.name,
- style: Theme.of(context).textTheme.headlineLarge),
+ style: theme.textTheme.headlineLarge),
const SizedBox(height: 16),
...hotel.facilities.map((facility) {
+ print("qqq facility: ${facility}");
return Padding(
padding: const EdgeInsets.only(bottom: 6.0),
child: HotelInformationListTile(
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 6da10f8b..1b70aca4 100644
--- a/comwell_key_app/lib/hotel_information/hotel_information_page.dart
+++ b/comwell_key_app/lib/hotel_information/hotel_information_page.dart
@@ -13,7 +13,7 @@ class HotelInformationPage extends StatelessWidget {
builder: (context, state) {
return Scaffold(
appBar: const ComwellAppBar(),
- backgroundColor: Theme.of(context).colorScheme.surface,
+ backgroundColor: Colors.white,
body: Builder(builder: (context) {
return switch (state.hotelState) {
HotelState.loading => const Center(child: CircularProgressIndicator()),
diff --git a/comwell_key_app/lib/profile/profile_repository.dart b/comwell_key_app/lib/profile/profile_repository.dart
index 3facc019..8724024f 100644
--- a/comwell_key_app/lib/profile/profile_repository.dart
+++ b/comwell_key_app/lib/profile/profile_repository.dart
@@ -42,6 +42,7 @@ class ProfileRepository {
}
Future<Booking> getBookingDetails(String bookingId) async {
+ final user = await db.userDAO.getUser();
final response = await api.getBookingDetails(bookingId);
final bookingDto = BookingDTO.fromJson(response);
await db.bookingsDao.insertBookings(BookingsDTO(current: [bookingDto], past: [], cancelled: []));
diff --git a/comwell_key_app/lib/services/api.dart b/comwell_key_app/lib/services/api.dart
index 4879f76d..f1a6cda3 100644
--- a/comwell_key_app/lib/services/api.dart
+++ b/comwell_key_app/lib/services/api.dart
@@ -213,7 +213,9 @@ class Api {
}
Future<Json> getBookingDetails(String bookingId) async {
- final response = await dio.get<Json>(ApiEndpoints.getBookingDetails, queryParameters: {'confirmationId': bookingId});
+ final response = await dio.get<Json>(
+ '${ApiEndpoints.getBookingDetails}?confirmationId=$bookingId'
+ );
return response.data!;
}
}
diff --git a/comwell_key_app/lib/services/utils/api_endpoints.dart b/comwell_key_app/lib/services/utils/api_endpoints.dart
index 712d97ae..a7dea569 100644
--- a/comwell_key_app/lib/services/utils/api_endpoints.dart
+++ b/comwell_key_app/lib/services/utils/api_endpoints.dart
@@ -6,7 +6,7 @@ class ApiEndpoints {
static const String getCurrentBookings = '/booking/v1/GetCurrentBookings';
static const String preRegistration = '/booking/v1/Preregistration';
static const String checkIn = '/booking/v1/CheckIn';
- static const String getBookingDetails = '/v1/GetBooking?confirmationId={confirmationId}';
+ static const String getBookingDetails = '/booking/v1/GetBooking';
// Payment endpoints
static const String storedPaymentMethods = '/Payment/v1/stored-payment-methods';