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

AuthorEdmir Suljic<esu@dwarf.dk>
Date2025-06-13 10:47:16 +0200
Mid commit

Changed files

comwell_key_app/assets/icons/ic_iron.svg           |   3 +
 comwell_key_app/assets/icons/ic_ironer.svg         |   3 -
 comwell_key_app/lib/routing/app_router.dart        |  10 +
 comwell_key_app/lib/routing/app_routes.dart        |   1 +
 .../components/up_sales_services_widget.dart       |   2 +-
 .../components/up_sales_upgrades_widget.dart       |  28 ++-
 .../lib/up_sales/cubit/up_sales_state.dart         |  12 +-
 .../lib/up_sales/models/room_facility.dart         |   6 +
 .../lib/up_sales/pages/room_upgrade_page.dart      | 257 +++++++++++++++++++++
 .../lib/up_sales/up_sale_repository.dart           |  66 +++---
 comwell_key_app/lib/up_sales/up_sales_catalog.dart |  28 ++-
 11 files changed, 359 insertions(+), 57 deletions(-)

Diff

diff --git a/comwell_key_app/assets/icons/ic_iron.svg b/comwell_key_app/assets/icons/ic_iron.svg
new file mode 100644
index 00000000..2afe06aa
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_iron.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 3.75H3V5.25H10.875V6.75001H6.75001C4.67894 6.75001 3 8.42894 3 10.5V15V15.75H3.75H21.75V14.25H4.5L4.5 12.7499L19.5 12.7499V12.7424C19.5 12.7449 19.5 12.7475 19.5 12.75H21C21 7.77945 16.9706 3.75 12 3.75ZM19.35 11.2499C18.6791 7.94522 15.8354 5.42961 12.375 5.25922V7.50001V8.25001H11.625H6.75001C5.50736 8.25001 4.5 9.25737 4.5 10.5L4.5 11.2499L19.35 11.2499ZM10.5008 17.2499C10.0866 17.2499 9.75076 17.5857 9.75076 17.9999C9.75076 18.4141 10.0866 18.7499 10.5008 18.7499C10.915 18.7499 11.2508 18.4141 11.2508 17.9999C11.2508 17.5857 10.915 17.2499 10.5008 17.2499ZM11.9996 19.4998C11.5854 19.4998 11.2496 19.8356 11.2496 20.2498C11.2496 20.664 11.5854 20.9998 11.9996 20.9998C12.4138 20.9998 12.7496 20.664 12.7496 20.2498C12.7496 19.8356 12.4138 19.4998 11.9996 19.4998ZM12.7503 17.9999C12.7503 17.5857 13.0861 17.2499 13.5003 17.2499C13.9146 17.2499 14.2503 17.5857 14.2503 17.9999C14.2503 18.4141 13.9146 18.7499 13.5003 18.7499C13.0861 18.7499 12.7503 18.4141 12.7503 17.9999ZM15.0011 19.4998C14.5869 19.4998 14.2511 19.8356 14.2511 20.2498C14.2511 20.664 14.5869 20.9998 15.0011 20.9998C15.4153 20.9998 15.7511 20.664 15.7511 20.2498C15.7511 19.8356 15.4153 19.4998 15.0011 19.4998ZM8.25 20.2498C8.25 19.8356 8.58579 19.4998 9 19.4998C9.41422 19.4998 9.75001 19.8356 9.75001 20.2498C9.75001 20.664 9.41422 20.9998 9 20.9998C8.58579 20.9998 8.25 20.664 8.25 20.2498Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_ironer.svg b/comwell_key_app/assets/icons/ic_ironer.svg
deleted file mode 100644
index 2afe06aa..00000000
--- a/comwell_key_app/assets/icons/ic_ironer.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M12 3.75H3V5.25H10.875V6.75001H6.75001C4.67894 6.75001 3 8.42894 3 10.5V15V15.75H3.75H21.75V14.25H4.5L4.5 12.7499L19.5 12.7499V12.7424C19.5 12.7449 19.5 12.7475 19.5 12.75H21C21 7.77945 16.9706 3.75 12 3.75ZM19.35 11.2499C18.6791 7.94522 15.8354 5.42961 12.375 5.25922V7.50001V8.25001H11.625H6.75001C5.50736 8.25001 4.5 9.25737 4.5 10.5L4.5 11.2499L19.35 11.2499ZM10.5008 17.2499C10.0866 17.2499 9.75076 17.5857 9.75076 17.9999C9.75076 18.4141 10.0866 18.7499 10.5008 18.7499C10.915 18.7499 11.2508 18.4141 11.2508 17.9999C11.2508 17.5857 10.915 17.2499 10.5008 17.2499ZM11.9996 19.4998C11.5854 19.4998 11.2496 19.8356 11.2496 20.2498C11.2496 20.664 11.5854 20.9998 11.9996 20.9998C12.4138 20.9998 12.7496 20.664 12.7496 20.2498C12.7496 19.8356 12.4138 19.4998 11.9996 19.4998ZM12.7503 17.9999C12.7503 17.5857 13.0861 17.2499 13.5003 17.2499C13.9146 17.2499 14.2503 17.5857 14.2503 17.9999C14.2503 18.4141 13.9146 18.7499 13.5003 18.7499C13.0861 18.7499 12.7503 18.4141 12.7503 17.9999ZM15.0011 19.4998C14.5869 19.4998 14.2511 19.8356 14.2511 20.2498C14.2511 20.664 14.5869 20.9998 15.0011 20.9998C15.4153 20.9998 15.7511 20.664 15.7511 20.2498C15.7511 19.8356 15.4153 19.4998 15.0011 19.4998ZM8.25 20.2498C8.25 19.8356 8.58579 19.4998 9 19.4998C9.41422 19.4998 9.75001 19.8356 9.75001 20.2498C9.75001 20.664 9.41422 20.9998 9 20.9998C8.58579 20.9998 8.25 20.664 8.25 20.2498Z" fill="black"/>
-</svg>
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index 6abdee43..203d67c6 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -46,6 +46,8 @@ import 'package:comwell_key_app/routing/go_router_observer.dart';
import 'package:comwell_key_app/share/cubit/share_booking_cubit.dart';
import 'package:comwell_key_app/share/share_booking_page.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_cubit.dart';
+import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
+import 'package:comwell_key_app/up_sales/pages/room_upgrade_page.dart';
import 'package:comwell_key_app/up_sales/up_sale_repository.dart';
import 'package:comwell_key_app/up_sales/up_sales_catalog.dart';
import 'package:comwell_key_app/utils/stream_to_listenable.dart';
@@ -372,6 +374,14 @@ GoRouter goRouter() {
);
},
),
+ GoRoute(
+ path: "/${AppRoutes.roomUpgrade.name}",
+ name: AppRoutes.roomUpgrade.name,
+ builder: (context, state) {
+ final roomUpgrade = state.extra as RoomUpgrade;
+ return RoomUpgradePage(roomUpgrade: roomUpgrade);
+ },
+ ),
/* GoRoute(
path: "/keys",
name: AppRoutes.keys.name,
diff --git a/comwell_key_app/lib/routing/app_routes.dart b/comwell_key_app/lib/routing/app_routes.dart
index ae0f54e4..0ee65702 100644
--- a/comwell_key_app/lib/routing/app_routes.dart
+++ b/comwell_key_app/lib/routing/app_routes.dart
@@ -29,4 +29,5 @@ enum AppRoutes {
notifications,
myBooking,
upSalesCatalog,
+ roomUpgrade,
}
diff --git a/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart b/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
index 7376ed0f..f967176e 100644
--- a/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
+++ b/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
@@ -59,7 +59,7 @@ class UpSalesServicesWidget extends StatelessWidget {
style: theme.textTheme.headlineMedium,
),
const SizedBox(width: 8),
- ComwellRadioButton(selected: cubit.state.selected, onTap: cubit.toggleSelected),
+ // ComwellRadioButton(selected: cubit.state.selected, onTap: cubit.toggleSelected),
],
),
],
diff --git a/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart b/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
index a8ab248a..b42cfd01 100644
--- a/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
+++ b/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/up_sales/components/comwell_radio_button.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_cubit.dart';
import 'package:comwell_key_app/up_sales/cubit/up_sales_state.dart';
@@ -7,12 +8,14 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
class UpSalesUpgradesWidget extends StatelessWidget {
final double width;
final double height;
final RoomUpgrade roomUpgrade;
- const UpSalesUpgradesWidget({super.key, this.width = 328, this.height = 268, required this.roomUpgrade});
+ final bool isSelected;
+ const UpSalesUpgradesWidget({super.key, this.width = 328, this.height = 268, required this.roomUpgrade, this.isSelected = false});
@override
Widget build(BuildContext context) {
@@ -45,6 +48,7 @@ class UpSalesUpgradesWidget extends StatelessWidget {
fit: BoxFit.cover,
),
),
+ if (roomUpgrade.tags.firstOrNull != null)
Positioned(
top: 16,
right: 16,
@@ -65,7 +69,7 @@ class UpSalesUpgradesWidget extends StatelessWidget {
],
),
Padding(
- padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
+ padding: const EdgeInsets.only(left: 8, right: 8, top: 16, bottom: 8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -76,25 +80,35 @@ class UpSalesUpgradesWidget extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Text(
- roomUpgrade.name,
- style: theme.textTheme.headlineMedium,
+ Flexible(
+ child: Text(
+ roomUpgrade.name,
+ style: theme.textTheme.headlineMedium,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ ),
),
Row(
+ mainAxisSize: MainAxisSize.min,
children: [
Text(
'${roomUpgrade.price} kr.',
style: theme.textTheme.headlineMedium,
),
const SizedBox(width: 8),
- ComwellRadioButton(selected: cubit.state.selected, onTap: cubit.toggleSelected),
+ ComwellRadioButton(
+ selected: isSelected,
+ onTap: () => cubit.toggleSelected(),
+ ),
],
),
],
),
const SizedBox(height: 8),
GestureDetector(
- onTap: () {},
+ onTap: () {
+ context.pushNamed(AppRoutes.roomUpgrade.name, extra: roomUpgrade);
+ },
child: Text(
'read_more_up_sales'.tr(),
style: theme.textTheme.bodySmall?.copyWith(
diff --git a/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart b/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
index f14b5b2a..bc36f38d 100644
--- a/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
+++ b/comwell_key_app/lib/up_sales/cubit/up_sales_state.dart
@@ -29,8 +29,7 @@ class UpSalesState extends Equatable {
isLoading = true;
const UpSalesState.loaded({required this.upSales})
- :
- selected = false,
+ : selected = false,
error = null,
isLoading = false;
@@ -40,8 +39,11 @@ class UpSalesState extends Equatable {
bool? isLoading,
Error? error,
}) {
- return UpSalesState(selected: selected ?? this.selected, upSales: upSales ?? this.upSales, isLoading: isLoading ?? this.isLoading, error: error ?? this.error);
+ return UpSalesState(
+ selected: selected ?? this.selected,
+ upSales: upSales ?? this.upSales,
+ isLoading: isLoading ?? this.isLoading,
+ error: error ?? this.error
+ );
}
-
-
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/up_sales/models/room_facility.dart b/comwell_key_app/lib/up_sales/models/room_facility.dart
index c315ee79..156fa5a2 100644
--- a/comwell_key_app/lib/up_sales/models/room_facility.dart
+++ b/comwell_key_app/lib/up_sales/models/room_facility.dart
@@ -3,4 +3,10 @@ class RoomFacility {
final String icon;
RoomFacility({required this.name, required this.icon});
+
+ @override
+ String toString() {
+ return 'RoomFacility(name: $name, icon: $icon)';
+ }
+
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/up_sales/pages/room_upgrade_page.dart b/comwell_key_app/lib/up_sales/pages/room_upgrade_page.dart
new file mode 100644
index 00000000..b290172d
--- /dev/null
+++ b/comwell_key_app/lib/up_sales/pages/room_upgrade_page.dart
@@ -0,0 +1,257 @@
+import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
+import 'package:flutter/material.dart';
+import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
+import 'package:comwell_key_app/up_sales/models/room_facility.dart';
+import 'package:comwell_key_app/up_sales/components/tags.dart';
+import 'package:flutter_svg/svg.dart';
+
+class RoomUpgradePage extends StatelessWidget {
+ final RoomUpgrade roomUpgrade;
+ const RoomUpgradePage({super.key, required this.roomUpgrade});
+
+ List<RoomFacility> get allFacilities => [
+ ...roomUpgrade.facilities,
+ // Optionally add more facilities if needed, or fetch from a global list
+ ];
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ return Scaffold(
+ appBar: const ComwellAppBar(),
+ backgroundColor: const Color(0xFFF2F2F2),
+ body: Column(
+ children: [
+ // Image and back button
+ Stack(
+ children: [
+ SizedBox(
+ width: double.infinity,
+ height: 260,
+ child: Image.asset(
+ roomUpgrade.images.first,
+ fit: BoxFit.cover,
+ ),
+ ),
+ Positioned(
+ top: 16,
+ left: 16,
+ child: CircleAvatar(
+ backgroundColor: Colors.white,
+ child: IconButton(
+ icon: const Icon(Icons.arrow_back),
+ onPressed: () => Navigator.of(context).pop(),
+ ),
+ ),
+ ),
+ ],
+ ),
+ Expanded(
+ child: Container(
+ width: double.infinity,
+ decoration: const BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.only(
+ topLeft: Radius.circular(24),
+ topRight: Radius.circular(24),
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
+ child: SingleChildScrollView(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Text(
+ roomUpgrade.name,
+ style: theme.textTheme.headlineMedium?.copyWith(fontWeight: FontWeight.bold),
+ ),
+ const SizedBox(width: 12),
+ if (roomUpgrade.tags.isNotEmpty)
+ TagWidget(text: '${roomUpgrade.tags.first} M2', textColor: const Color(0xFFD1B48C)),
+ ],
+ ),
+ const SizedBox(height: 12),
+ Text(
+ roomUpgrade.description,
+ style: theme.textTheme.bodyMedium,
+ maxLines: 3,
+ overflow: TextOverflow.ellipsis,
+ ),
+ const SizedBox(height: 4),
+ GestureDetector(
+ onTap: () {},
+ child: Text(
+ 'Læs mere',
+ style: theme.textTheme.bodyMedium?.copyWith(
+ color: const Color(0xFFD1B48C),
+ decoration: TextDecoration.underline,
+ ),
+ ),
+ ),
+ const SizedBox(height: 16),
+ // Facilities row
+ Wrap(
+ spacing: 16,
+ runSpacing: 8,
+ children: [
+ ...roomUpgrade.facilities.map((f) => _FacilityIconText(facility: f)),
+ GestureDetector(
+ onTap: () => _showFacilitiesSheet(context),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4.0),
+ child: Text(
+ 'Se alle faciliteter',
+ style: theme.textTheme.bodyMedium?.copyWith(
+ color: const Color(0xFFD1B48C),
+ decoration: TextDecoration.underline,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ const SizedBox(height: 32),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ),
+ // Booking button
+ Container(
+ color: const Color(0xFFF2F2F2),
+ padding: const EdgeInsets.all(16),
+ child: Row(
+ children: [
+ Expanded(
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: const Color(0xFFD1B48C),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(32),
+ ),
+ padding: const EdgeInsets.symmetric(vertical: 18),
+ ),
+ onPressed: () {},
+ child: const Text(
+ 'Tilføj til booking',
+ style: TextStyle(fontSize: 18, color: Colors.white),
+ ),
+ ),
+ ),
+ const SizedBox(width: 12),
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 16),
+ decoration: BoxDecoration(
+ color: const Color(0xFFD1B48C),
+ borderRadius: BorderRadius.circular(32),
+ ),
+ child: Text(
+ '+${roomUpgrade.price} kr.',
+ style: const TextStyle(fontSize: 18, color: Colors.white),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ void _showFacilitiesSheet(BuildContext context) {
+ showModalBottomSheet<void>(
+ context: context,
+ isScrollControlled: true,
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
+ ),
+ builder: (context) => _FacilitiesBottomSheet(facilities: allFacilities),
+ );
+ }
+}
+
+class _FacilityIconText extends StatelessWidget {
+ final RoomFacility facility;
+ const _FacilityIconText({required this.facility});
+
+ @override
+ Widget build(BuildContext context) {
+ return Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ SvgPicture.asset(facility.icon, width: 20, height: 20),
+ const SizedBox(width: 4),
+ Text(facility.name, style: Theme.of(context).textTheme.bodyMedium),
+ ],
+ );
+ }
+}
+
+class _FacilitiesBottomSheet extends StatelessWidget {
+ final List<RoomFacility> facilities;
+ const _FacilitiesBottomSheet({required this.facilities});
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ // Group facilities for display (mocked for now)
+ final Map<String, List<RoomFacility>> grouped = {
+ 'SENGETYPER': facilities.where((f) => f.name.contains('seng')).toList(),
+ 'ELEKTRONIK': facilities.where((f) => f.name == 'TV' || f.name == 'Gratis WiFi').toList(),
+ 'BADEVÆRELSE': facilities.where((f) => f.name == 'Hårtørrer' || f.name == 'Badekar').toList(),
+ 'BUSINESS': facilities.where((f) => f.name == 'Arbejdsplads').toList(),
+ 'SERVICE': facilities.where((f) => f.name == 'Roomservice').toList(),
+ 'VÆRELSESFACILITETER': facilities.where((f) => [
+ 'Strygejern & -bræt', 'Terrasse', 'Te-køkken', 'Stue', 'Minibar'
+ ].contains(f.name)).toList(),
+ };
+ return DraggableScrollableSheet(
+ expand: false,
+ initialChildSize: 0.7,
+ minChildSize: 0.4,
+ maxChildSize: 0.95,
+ builder: (context, scrollController) => Container(
+ padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
+ decoration: const BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
+ ),
+ child: ListView(
+ controller: scrollController,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text('Faciliteter', style: theme.textTheme.headlineMedium?.copyWith(fontWeight: FontWeight.bold)),
+ IconButton(
+ icon: const Icon(Icons.close),
+ onPressed: () => Navigator.of(context).pop(),
+ ),
+ ],
+ ),
+ const SizedBox(height: 12),
+ ...grouped.entries.map((entry) => Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(entry.key, style: theme.textTheme.bodySmall?.copyWith(fontWeight: FontWeight.bold, color: Colors.black54)),
+ const SizedBox(height: 8),
+ Wrap(
+ spacing: 16,
+ runSpacing: 8,
+ children: entry.value
+ .map((f) => _FacilityIconText(facility: f))
+ .toList(),
+ ),
+ const SizedBox(height: 16),
+ ],
+ )),
+ ],
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/up_sales/up_sale_repository.dart b/comwell_key_app/lib/up_sales/up_sale_repository.dart
index cfddbd95..5039f08f 100644
--- a/comwell_key_app/lib/up_sales/up_sale_repository.dart
+++ b/comwell_key_app/lib/up_sales/up_sale_repository.dart
@@ -31,13 +31,13 @@ final List<RoomUpgradeDTO> mockRoomUpgrades = [
tags: ['20'],
type: 'room',
facilities: [
- RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
- RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
- RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hair_dryer'),
- RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
- RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_roomservice'),
- RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron'),
- RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar'),
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv.svg'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi.svg'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hairdryer.svg'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_desk.svg'),
+ RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_service_bowl.svg'),
+ RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron.svg'),
+ RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar.svg'),
],
),
RoomUpgradeDTO(
@@ -53,8 +53,8 @@ final List<RoomUpgradeDTO> mockRoomUpgrades = [
RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hairdryer'),
RoomFacilityDTO(name: 'Badekar', icon: 'assets/icons/ic_bathtub'),
- RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
- RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_roomservice'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_desk'),
+ RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_service_bowl'),
RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron'),
RoomFacilityDTO(name: 'Terrasse', icon: 'assets/icons/ic_terrace'),
RoomFacilityDTO(name: 'Te-køkken', icon: 'assets/icons/kettle'),
@@ -71,17 +71,17 @@ final List<RoomUpgradeDTO> mockRoomUpgrades = [
tags: ['50'],
type: 'room',
facilities: [
- RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
- RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
- RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hair_dryer'),
- RoomFacilityDTO(name: 'Badekar', icon: 'assets/icons/ic_bathtub'),
- RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
- RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_roomservice'),
- RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron'),
- RoomFacilityDTO(name: 'Terrasse', icon: 'assets/icons/ic_terrace'),
- RoomFacilityDTO(name: 'Te-køkken', icon: 'assets/icons/ic_kitchenette'),
- RoomFacilityDTO(name: 'Stue', icon: 'assets/icons/ic_livingroom'),
- RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar'),
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv.svg'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi.svg'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hairdryer.svg'),
+ RoomFacilityDTO(name: 'Badekar', icon: 'assets/icons/ic_bathtub.svg'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_desk.svg'),
+ RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_service_bowl.svg'),
+ RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron.svg'),
+ RoomFacilityDTO(name: 'Terrasse', icon: 'assets/icons/ic_terrace.svg'),
+ RoomFacilityDTO(name: 'Te-køkken', icon: 'assets/icons/ic_kitchenette.svg'),
+ RoomFacilityDTO(name: 'Stue', icon: 'assets/icons/ic_livingroom.svg'),
+ RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar.svg'),
],
),
RoomUpgradeDTO(
@@ -93,12 +93,12 @@ final List<RoomUpgradeDTO> mockRoomUpgrades = [
tags: ['25'],
type: 'room',
facilities: [
- RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
- RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
- RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hair_dryer'),
- RoomFacilityDTO(name: 'Badekar', icon: 'assets/icons/ic_bathtub'),
- RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
- RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_roomservice'),
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv.svg'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi.svg'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hairdryer.svg'),
+ RoomFacilityDTO(name: 'Badekar', icon: 'assets/icons/ic_bathtub.svg'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_desk.svg'),
+ RoomFacilityDTO(name: 'Roomservice', icon: 'assets/icons/ic_service_bowl.svg'),
],
),
RoomUpgradeDTO(
@@ -110,16 +110,16 @@ final List<RoomUpgradeDTO> mockRoomUpgrades = [
tags: ['27'],
type: 'room',
facilities: [
- RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv'),
- RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi'),
- RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hair_dryer'),
- RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_workspace'),
- RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron'),
- RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar'),
+ RoomFacilityDTO(name: 'TV', icon: 'assets/icons/ic_tv.svg'),
+ RoomFacilityDTO(name: 'Gratis WiFi', icon: 'assets/icons/ic_wifi.svg'),
+ RoomFacilityDTO(name: 'Hårtørrer', icon: 'assets/icons/ic_hairdryer.svg'),
+ RoomFacilityDTO(name: 'Arbejdsplads', icon: 'assets/icons/ic_desk.svg'),
+ RoomFacilityDTO(name: 'Strygejern & -bræt', icon: 'assets/icons/ic_iron.svg'),
+ RoomFacilityDTO(name: 'Minibar', icon: 'assets/icons/ic_minibar.svg'),
],
),
RoomUpgradeDTO(
- name: 'Champagne & Chocolate Package',
+ name: 'Bottle of Champagne',
price: '450',
images: ['assets/images/catalog_image.png'],
description: 'Celebrate your stay with a bottle of premium champagne and a selection of fine chocolates delivered to your room.',
diff --git a/comwell_key_app/lib/up_sales/up_sales_catalog.dart b/comwell_key_app/lib/up_sales/up_sales_catalog.dart
index 5b98101e..e5f515ba 100644
--- a/comwell_key_app/lib/up_sales/up_sales_catalog.dart
+++ b/comwell_key_app/lib/up_sales/up_sales_catalog.dart
@@ -44,6 +44,7 @@ class UpSalesCatalog extends StatelessWidget {
style: theme.textTheme.headlineMedium),
),
const SizedBox(height: 16),
+ const SizedBox(width: 20),
_buildServicesCatalog(context, cubit),
const SizedBox(height: 24),
Padding(
@@ -52,6 +53,7 @@ class UpSalesCatalog extends StatelessWidget {
style: theme.textTheme.headlineMedium),
),
const SizedBox(height: 16),
+ const SizedBox(width: 20),
_buildRoomUpgradeCatalog(context, cubit),
const SizedBox(height: 24),
Padding(
@@ -60,6 +62,7 @@ class UpSalesCatalog extends StatelessWidget {
style: theme.textTheme.headlineMedium),
),
const SizedBox(height: 16),
+ const SizedBox(width: 20),
_buildOtherUpSalesCatalog(context, cubit),
const SizedBox(height: 24),
],
@@ -85,18 +88,23 @@ class UpSalesCatalog extends StatelessWidget {
}
Widget _buildRoomUpgradeCatalog(BuildContext context, UpSalesCubit cubit) {
+ final roomUpSales = cubit.upSales
+ .where((roomUpgrade) => roomUpgrade.type == UpgradeType.room)
+ .toList();
+
+ print("roomUpSales ${roomUpSales}");
+
return SizedBox(
height: 289, // Height of the UpSalesUpgradesWidget
child: ListView.builder(
scrollDirection: Axis.horizontal,
- itemCount: cubit.upSales
- .where((roomUpgrade) => roomUpgrade.type == UpgradeType.room)
- .length,
+ itemCount: roomUpSales.length,
itemBuilder: (context, index) {
return UpSalesUpgradesWidget(
width: 328,
height: 268,
- roomUpgrade: cubit.upSales.elementAt(index),
+ roomUpgrade: roomUpSales.elementAt(index),
+ isSelected: cubit.state.selected,
);
},
),
@@ -104,18 +112,22 @@ class UpSalesCatalog extends StatelessWidget {
}
Widget _buildOtherUpSalesCatalog(BuildContext context, UpSalesCubit cubit) {
+ final otherUpSales = cubit.upSales
+ .where((roomUpgrade) => roomUpgrade.type == UpgradeType.other)
+ .toList();
+
+ print("otherUpSales ${otherUpSales}");
return SizedBox(
height: 289, // Height of the UpSalesUpgradesWidget
child: ListView.builder(
scrollDirection: Axis.horizontal,
- itemCount: cubit.upSales
- .where((roomUpgrade) => roomUpgrade.type == UpgradeType.other)
- .length,
+ itemCount: otherUpSales.length,
itemBuilder: (context, index) {
return UpSalesUpgradesWidget(
width: 328,
height: 268,
- roomUpgrade: cubit.upSales.elementAt(index),
+ roomUpgrade: otherUpSales.elementAt(index),
+ isSelected: cubit.state.selected,
);
},
),