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

AuthorEdmir Suljic<esu@dwarf.dk>
Date2025-07-08 12:59:39 +0200
Resolved bugs: 2012, 2013 and 2014

Changed files

.../choose_share_room/choose_share_room_page.dart  |   4 +-
 .../components/choose_room_widget.dart             | 334 +++++++++------------
 .../components/my_room_widget.dart                 |  61 ++--
 .../components/share_room_confirm_dialog.dart      |  78 +++++
 .../choose_share_room/pages/room_info_page.dart    |  55 ++--
 .../choose_share_room_shimmer_loader.dart          |   6 +-
 .../placeholders/room_card_placeholder.dart        |  68 +++++
 comwell_key_app/lib/routing/app_router.dart        |   6 +-
 8 files changed, 359 insertions(+), 253 deletions(-)

Diff

diff --git a/comwell_key_app/lib/choose_share_room/choose_share_room_page.dart b/comwell_key_app/lib/choose_share_room/choose_share_room_page.dart
index a5309f68..9aa330db 100644
--- a/comwell_key_app/lib/choose_share_room/choose_share_room_page.dart
+++ b/comwell_key_app/lib/choose_share_room/choose_share_room_page.dart
@@ -21,12 +21,12 @@ class ChooseShareRoomPage extends StatelessWidget {
appBar: const ComwellAppBar(),
body: BlocBuilder<ChooseShareRoomCubit, ChooseShareRoomState>(
builder: (context, state) {
+ final cubit = context.read<ChooseShareRoomCubit>();
+
if (state.isLoading) {
return const ChooseShareRoomShimmerLoader();
}
- final cubit = context.read<ChooseShareRoomCubit>();
-
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: ListView(
diff --git a/comwell_key_app/lib/choose_share_room/components/choose_room_widget.dart b/comwell_key_app/lib/choose_share_room/components/choose_room_widget.dart
index 37b29a0b..321e38d3 100644
--- a/comwell_key_app/lib/choose_share_room/components/choose_room_widget.dart
+++ b/comwell_key_app/lib/choose_share_room/components/choose_room_widget.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/choose_share_room/components/share_room_confirm_dialog.dart';
import 'package:comwell_key_app/choose_share_room/cubit/choose_share_room_cubit.dart';
import 'package:comwell_key_app/choose_share_room/cubit/choose_share_room_state.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
@@ -31,213 +32,158 @@ class ChooseRoomWidget extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Theme.of(context);
return BlocBuilder<ChooseShareRoomCubit, ChooseShareRoomState>(
- builder: (context, state) {
- final cubit = context.read<ChooseShareRoomCubit>();
- final isAssigned = cubit.rooms.any((room) => room.confirmationNumber == booking.rooms.first.confirmationNumber && room.assignedTo != null);
- return GestureDetector(
- onTap: () {
- context.pushNamed(AppRoutes.roomInfo.name, extra: booking);
- },
- child: Container(
- margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 0),
- decoration: BoxDecoration(
- border: Border.all(color: colorDivider),
- borderRadius: BorderRadius.circular(16),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Padding(
- padding: const EdgeInsets.all(16.0),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Expanded(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- roomName,
- style: theme.textTheme.headlineSmall,
- ),
- const SizedBox(height: 4),
- SizedBox(
- width: 200,
- child: Text(
- description,
- style: theme.textTheme.bodySmall,
- maxLines: 2,
- overflow: TextOverflow.ellipsis,
- softWrap: true,
- ),
- ),
- ],
- ),
- ClipRRect(
- borderRadius: BorderRadius.circular(8),
- child: Image.asset(
- imageAsset,
- width: 60,
- height: 60,
- fit: BoxFit.cover,
- ),
- ),
- ],
+ builder: (context, state) {
+ final cubit = context.read<ChooseShareRoomCubit>();
+ final isAssigned = cubit.rooms.any((room) =>
+ room.confirmationNumber == booking.rooms.first.confirmationNumber &&
+ room.assignedTo != null);
+ return GestureDetector(
+ onTap: () async {
+
+ final result = await context.pushNamed(AppRoutes.roomInfo.name, extra: [booking, isAssigned]);
+ if (result != null && result is bool) {
+ await cubit.assignRoomToUser(
+ booking.rooms.first.confirmationNumber, booking.booker.id);
+ }
+
+ },
+ child: Container(
+ margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 0),
+ decoration: BoxDecoration(
+ border: Border.all(color: colorDivider),
+ borderRadius: BorderRadius.circular(16),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ roomName,
+ style: theme.textTheme.headlineSmall,
),
- ),
- ],
- ),
- ),
- Padding(
- padding:
- const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 8.0),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- SvgPicture.asset("assets/icons/user-circle.svg",
- width: 20, height: 20),
- const SizedBox(width: 4),
- Text(
- '${booking.adults} ${booking.adults > 1 ? 'adults'.tr() : 'adult'.tr()}${booking.children > 0 ? ' | ${booking.children} ${booking.children > 1 ? 'children'.tr() : 'child'.tr()}' : ''}',
- style: theme.textTheme.bodySmall,
- ),
- const VerticalDivider(color: colorDivider, thickness: 1.5),
- Text(
- 'read_more'.tr(),
- style: theme.textTheme.bodySmall?.copyWith(
- decoration: TextDecoration.underline,
+ const SizedBox(height: 4),
+ SizedBox(
+ width: 200,
+ child: Text(
+ description,
+ style: theme.textTheme.bodySmall,
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ softWrap: true,
+ ),
),
+ ],
+ ),
+ ClipRRect(
+ borderRadius: BorderRadius.circular(8),
+ child: Image.asset(
+ imageAsset,
+ width: 60,
+ height: 60,
+ fit: BoxFit.cover,
),
- ],
- ),
+ ),
+ ],
),
- if (extraInfo != null) ...[
- const SizedBox(height: 8),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16.0),
- child: Text(
- 'added_to_room'.tr(),
+ ),
+ Padding(
+ padding:
+ const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 8.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ SvgPicture.asset("assets/icons/user-circle.svg",
+ width: 20, height: 20),
+ const SizedBox(width: 4),
+ Text(
+ '${booking.adults} ${booking.adults > 1 ? 'adults'.tr() : 'adult'.tr()}${booking.children > 0 ? ' | ${booking.children} ${booking.children > 1 ? 'children'.tr() : 'child'.tr()}' : ''}',
style: theme.textTheme.bodySmall,
),
- ),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16.0),
- child: Text(
- extraInfo!,
- style: theme.textTheme.bodySmall
- ?.copyWith(fontWeight: FontWeight.bold),
- ),
- ),
- const SizedBox(height: 8),
- ],
- Column(
- children: [
- const Divider(color: colorDivider),
- Padding(
- padding: const EdgeInsets.only(
- left: 16.0, right: 16.0, top: 8.0, bottom: 16.0),
- child: SizedBox(
- width: double.infinity,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- elevation: 0,
- foregroundColor: Colors.white,
- ),
- onPressed: () async {
- if (isAssigned) {
- context.pushNamed(AppRoutes.shareRoom.name, extra: booking);
- return;
- }
- await showDialog<bool>(
- context: context,
- barrierDismissible: false,
- builder: (context) {
- return _buildConfirmationDialog(context, cubit);
- },
- );
- },
- child: Text(isAssigned ? 'share_room'.tr() : 'choose_room'.tr()),
- ),
+ const VerticalDivider(color: colorDivider, thickness: 1.5),
+ Text(
+ 'read_more'.tr(),
+ style: theme.textTheme.bodySmall?.copyWith(
+ decoration: TextDecoration.underline,
),
),
],
),
- ],
- ),
- ),
- );
- }
- );
- }
-
- Widget _buildConfirmationDialog(BuildContext context, ChooseShareRoomCubit cubit) {
- final theme = Theme.of(context);
- return Dialog(
- backgroundColor: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(24),
- ),
- child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 32.0, horizontal: 16.0),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- 'choose_room_confirmation_title'.tr(),
- textAlign: TextAlign.center,
- style: theme.textTheme.headlineMedium,
- ),
- const SizedBox(height: 16),
- Text(
- 'choose_room_confirmation_subtitle'.tr(),
- textAlign: TextAlign.center,
- style: theme.textTheme.bodySmall,
- ),
- const SizedBox(height: 32),
- ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: sandColor,
- foregroundColor: Colors.white,
- elevation: 0,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(40),
- ),
- padding: const EdgeInsets.symmetric(vertical: 16),
),
- onPressed: () {
- cubit.assignRoomToUser(booking.rooms.first.confirmationNumber, booking.booker.id);
- context.pop();
- },
- child: Text('choose_room_confirmation_confirm'.tr(),
- style: theme.textTheme.headlineSmall
- ?.copyWith(color: Colors.white)),
- ),
- const SizedBox(height: 16),
- ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Colors.white,
- foregroundColor: Colors.black,
- elevation: 0,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(40),
+ if (extraInfo != null) ...[
+ const SizedBox(height: 8),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
+ child: Text(
+ 'added_to_room'.tr(),
+ style: theme.textTheme.bodySmall,
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
+ child: Text(
+ extraInfo!,
+ style: theme.textTheme.bodySmall
+ ?.copyWith(fontWeight: FontWeight.bold),
+ ),
),
- side: const BorderSide(color: colorDivider),
- padding: const EdgeInsets.symmetric(vertical: 16),
+ const SizedBox(height: 8),
+ ],
+ Column(
+ children: [
+ const Divider(color: colorDivider),
+ Padding(
+ padding: const EdgeInsets.only(
+ left: 16.0, right: 16.0, top: 8.0, bottom: 16.0),
+ child: SizedBox(
+ width: double.infinity,
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ elevation: 0,
+ foregroundColor: Colors.white,
+ ),
+ onPressed: () async {
+ if (isAssigned) {
+ context.pushNamed(AppRoutes.shareRoom.name,
+ extra: booking);
+ return;
+ }
+ final result = await showDialog<bool>(
+ context: context,
+ barrierDismissible: false,
+ builder: (context) {
+ return const ShareRoomConfirmDialog();
+ },
+ );
+ if (result != null && result) {
+ await cubit.assignRoomToUser(
+ booking.rooms.first.confirmationNumber,
+ booking.booker.id);
+ if (context.mounted) {
+ context.pop();
+ }
+ }
+ },
+ child: Text(isAssigned
+ ? 'share_room'.tr()
+ : 'choose_room'.tr()),
+ ),
+ ),
+ ),
+ ],
),
- onPressed: () {
- context.pop();
- },
- child: Text('choose_room_confirmation_cancel'.tr(),
- style: theme.textTheme.headlineSmall),
- ),
- ],
+ ],
+ ),
),
- ),
- );
+ );
+ });
}
}
diff --git a/comwell_key_app/lib/choose_share_room/components/my_room_widget.dart b/comwell_key_app/lib/choose_share_room/components/my_room_widget.dart
index 5d82de69..a17171df 100644
--- a/comwell_key_app/lib/choose_share_room/components/my_room_widget.dart
+++ b/comwell_key_app/lib/choose_share_room/components/my_room_widget.dart
@@ -39,42 +39,35 @@ class MyRoomWidget extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Expanded(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- roomName,
- style: theme.textTheme.headlineSmall,
- ),
- const SizedBox(height: 4),
- SizedBox(
- width: 200,
- child: Text(
- description,
- style: theme.textTheme.bodySmall,
- maxLines: 2,
- overflow: TextOverflow.ellipsis,
- softWrap: true,
- ),
- ),
- ],
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ roomName,
+ style: theme.textTheme.headlineSmall,
+ ),
+ const SizedBox(height: 4),
+ SizedBox(
+ width: 200,
+ child: Text(
+ description,
+ style: theme.textTheme.bodySmall,
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ softWrap: true,
),
- ClipRRect(
- borderRadius: BorderRadius.circular(8),
- child: Image.asset(
- imageAsset,
- width: 60,
- height: 60,
- fit: BoxFit.cover,
- ),
- ),
- ],
+ ),
+ ],
+ ),
+ ClipRRect(
+ borderRadius: BorderRadius.circular(8),
+ child: Image.asset(
+ imageAsset,
+ width: 60,
+ height: 60,
+ fit: BoxFit.cover,
),
),
],
diff --git a/comwell_key_app/lib/choose_share_room/components/share_room_confirm_dialog.dart b/comwell_key_app/lib/choose_share_room/components/share_room_confirm_dialog.dart
new file mode 100644
index 00000000..c859e55f
--- /dev/null
+++ b/comwell_key_app/lib/choose_share_room/components/share_room_confirm_dialog.dart
@@ -0,0 +1,78 @@
+import 'package:comwell_key_app/choose_share_room/cubit/choose_share_room_cubit.dart';
+import 'package:comwell_key_app/overview/models/booking.dart';
+import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:go_router/go_router.dart';
+import 'package:easy_localization/easy_localization.dart';
+
+class ShareRoomConfirmDialog extends StatelessWidget {
+
+ const ShareRoomConfirmDialog({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ return Dialog(
+ backgroundColor: Colors.white,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(24),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 32.0, horizontal: 16.0),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ 'choose_room_confirmation_title'.tr(),
+ textAlign: TextAlign.center,
+ style: theme.textTheme.headlineMedium,
+ ),
+ const SizedBox(height: 16),
+ Text(
+ 'choose_room_confirmation_subtitle'.tr(),
+ textAlign: TextAlign.center,
+ style: theme.textTheme.bodySmall,
+ ),
+ const SizedBox(height: 32),
+ ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: sandColor,
+ foregroundColor: Colors.white,
+ elevation: 0,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(40),
+ ),
+ padding: const EdgeInsets.symmetric(vertical: 16),
+ ),
+ onPressed: () {
+
+ context.pop(true);
+ },
+ child: Text('choose_room_confirmation_confirm'.tr(),
+ style: theme.textTheme.headlineSmall
+ ?.copyWith(color: Colors.white)),
+ ),
+ const SizedBox(height: 16),
+ ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Colors.white,
+ foregroundColor: Colors.black,
+ elevation: 0,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(40),
+ ),
+ side: const BorderSide(color: colorDivider),
+ padding: const EdgeInsets.symmetric(vertical: 16),
+ ),
+ onPressed: () {
+ context.pop(false);
+ },
+ child: Text('choose_room_confirmation_cancel'.tr(),
+ style: theme.textTheme.headlineSmall),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/choose_share_room/pages/room_info_page.dart b/comwell_key_app/lib/choose_share_room/pages/room_info_page.dart
index 733bd2d0..0969165f 100644
--- a/comwell_key_app/lib/choose_share_room/pages/room_info_page.dart
+++ b/comwell_key_app/lib/choose_share_room/pages/room_info_page.dart
@@ -1,7 +1,9 @@
+import 'package:comwell_key_app/choose_share_room/components/share_room_confirm_dialog.dart';
import 'package:comwell_key_app/choose_share_room/cubit/choose_share_room_cubit.dart';
import 'package:comwell_key_app/choose_share_room/cubit/choose_share_room_state.dart';
import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
import 'package:comwell_key_app/common/const.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:comwell_key_app/common/components/room_image_carousel.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
@@ -13,10 +15,12 @@ import 'package:comwell_key_app/up_sales/components/tags.dart';
import 'package:comwell_key_app/up_sales/models/room_facility.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:comwell_key_app/common/components/shimmer_loader/room_info_shimmer_loader.dart';
+import 'package:go_router/go_router.dart';
class RoomInfoPage extends StatefulWidget {
final Booking booking;
- const RoomInfoPage({super.key, required this.booking});
+ final bool isAssigned;
+ const RoomInfoPage({super.key, required this.booking, required this.isAssigned});
@override
State<RoomInfoPage> createState() => _RoomInfoPageState();
@@ -40,6 +44,7 @@ class _RoomInfoPageState extends State<RoomInfoPage> {
return BlocBuilder<ChooseShareRoomCubit, ChooseShareRoomState>(
builder: (context, state) {
+ final cubit = context.read<ChooseShareRoomCubit>();
if (state.isLoading) {
return const RoomInfoShimmerLoader();
}
@@ -93,21 +98,23 @@ class _RoomInfoPageState extends State<RoomInfoPage> {
overflow: _isExpanded ? null : TextOverflow.ellipsis,
),
const SizedBox(height: 4),
- GestureDetector(
- onTap: () {
- setState(() {
- _isExpanded = !_isExpanded;
- });
- },
- child: Text(
- _isExpanded ? 'read_less'.tr() : 'read_more'.tr(),
- style: theme.textTheme.bodySmall?.copyWith(
- color: sandColor,
- decoration: TextDecoration.underline,
- decorationColor: sandColor,
+ if (description.length > 200) ...[
+ GestureDetector(
+ onTap: () {
+ setState(() {
+ _isExpanded = !_isExpanded;
+ });
+ },
+ child: Text(
+ _isExpanded ? 'read_less'.tr() : 'read_more'.tr(),
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: sandColor,
+ decoration: TextDecoration.underline,
+ decorationColor: sandColor,
+ ),
),
),
- ),
+ ],
const SizedBox(height: 24),
if (hasFacilities) ...[
Wrap(
@@ -156,11 +163,25 @@ class _RoomInfoPageState extends State<RoomInfoPage> {
bottom: 40,
),
child: ElevatedButton(
- onPressed: () {
- Navigator.pop(context);
+ onPressed: () async {
+ if (widget.isAssigned) {
+ context.pushNamed(AppRoutes.shareRoom.name,
+ extra: widget.booking);
+ return;
+ }
+ await showDialog<bool>(
+ context: context,
+ builder: (context) {
+ return const ShareRoomConfirmDialog();
+ },
+ );
+
+ if (context.mounted) {
+ context.pop(true);
+ }
},
child: Text(
- 'choose_room'.tr(),
+ widget.isAssigned ? 'share_room'.tr() : 'choose_room'.tr(),
style: theme.textTheme.headlineSmall
?.copyWith(color: Colors.white),
),
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/choose_share_room_shimmer_loader.dart b/comwell_key_app/lib/common/components/shimmer_loader/choose_share_room_shimmer_loader.dart
index f8161616..a3a3dcca 100644
--- a/comwell_key_app/lib/common/components/shimmer_loader/choose_share_room_shimmer_loader.dart
+++ b/comwell_key_app/lib/common/components/shimmer_loader/choose_share_room_shimmer_loader.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/room_card_placeholder.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
@@ -20,10 +21,7 @@ class ChooseShareRoomShimmerLoader extends StatelessWidget {
const SizedBox(height: 8),
const TitlePlaceholder(width: double.infinity),
const SizedBox(height: 24),
- ...List.generate(3, (index) => const Padding(
- padding: EdgeInsets.only(bottom: 24),
- child: ContentPlaceholder(lineType: ContentLineType.threeLines),
- )),
+ ...List.generate(3, (index) => const RoomCardPlaceholder()),
const SizedBox(height: 32),
],
),
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/placeholders/room_card_placeholder.dart b/comwell_key_app/lib/common/components/shimmer_loader/placeholders/room_card_placeholder.dart
new file mode 100644
index 00000000..0c0e9ba0
--- /dev/null
+++ b/comwell_key_app/lib/common/components/shimmer_loader/placeholders/room_card_placeholder.dart
@@ -0,0 +1,68 @@
+import 'package:flutter/material.dart';
+
+class RoomCardPlaceholder extends StatelessWidget {
+ const RoomCardPlaceholder({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ // Text lines
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ width: double.infinity,
+ height: 16.0,
+ color: Colors.white,
+ margin: const EdgeInsets.only(bottom: 8.0),
+ ),
+ Container(
+ width: 120.0,
+ height: 14.0,
+ color: Colors.white,
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(width: 12.0),
+ // Image placeholder
+ Container(
+ width: 80.0,
+ height: 64.0,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(12.0),
+ color: Colors.white,
+ ),
+ ),
+ ],
+ ),
+ const SizedBox(height: 24.0),
+ // Wide text placeholder
+ Container(
+ width: 170,
+ height: 14.0,
+ color: Colors.white,
+ margin: const EdgeInsets.only(bottom: 10.0),
+ ),
+ // Button placeholder
+ Container(
+ width: double.infinity,
+ height: 44.0,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(24.0),
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index 05912bfa..0e035057 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -459,10 +459,12 @@ GoRouter goRouter() {
path: "/${AppRoutes.roomInfo.name}",
name: AppRoutes.roomInfo.name,
builder: (context, state) {
- final booking = state.extra as Booking;
+ final extras = state.extra as List<dynamic>;
+ final booking = extras[0] as Booking;
+ final isAssigned = extras[1] as bool;
return BlocProvider(
create: (context) => ChooseShareRoomCubit(locator<ChooseShareRoomRepository>()),
- child: RoomInfoPage(booking: booking),
+ child: RoomInfoPage(booking: booking, isAssigned: isAssigned),
);
},
),