6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 8bd8d600

AuthorMikkel Thygesen<mth@dwarf.dk>
Date2025-01-30 11:20:26 +0100
553: PR changes

Changed files

.../components/practical_information_button.dart   |  8 ++-
 .../components/hotel_information_list_tile.dart    | 49 ++++++++++---
 .../components/hotel_information_menu.dart         | 80 ++++++++++++----------
 .../components/spa_facility_page.dart              |  4 +-
 .../hotel_information/hotel_information_page.dart  |  5 +-
 .../repository/hotel_information_repository.dart   |  2 +-
 .../pregistration/pages/prereg_payment_page.dart   |  3 +-
 comwell_key_app/lib/routing/app_router.dart        | 13 ++--
 comwell_key_app/lib/routing/app_routes.dart        |  5 +-
 9 files changed, 107 insertions(+), 62 deletions(-)

Diff

diff --git a/comwell_key_app/lib/home/components/practical_information_button.dart b/comwell_key_app/lib/home/components/practical_information_button.dart
index a0061488..f5c2dc15 100644
--- a/comwell_key_app/lib/home/components/practical_information_button.dart
+++ b/comwell_key_app/lib/home/components/practical_information_button.dart
@@ -48,7 +48,13 @@ class PracticalInformationButton extends StatelessWidget {
),
const Spacer(),
Text(title),
- Text(subtitle),
+ Text(
+ subtitle,
+ style: Theme.of(context)
+ .textTheme
+ .bodySmall
+ ?.copyWith(color: Colors.grey),
+ ),
],
),
),
diff --git a/comwell_key_app/lib/hotel_information/components/hotel_information_list_tile.dart b/comwell_key_app/lib/hotel_information/components/hotel_information_list_tile.dart
index 2e0995b9..54eb59b9 100644
--- a/comwell_key_app/lib/hotel_information/components/hotel_information_list_tile.dart
+++ b/comwell_key_app/lib/hotel_information/components/hotel_information_list_tile.dart
@@ -1,5 +1,4 @@
import 'package:comwell_key_app/themes/light_theme.dart';
-import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
@@ -19,19 +18,49 @@ class HotelInformationListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return ListTile(
+ return InkWell(
+ borderRadius: BorderRadius.circular(10),
onTap: () => onClick(),
- leading: Container(
+ child: Container(
decoration: BoxDecoration(
- shape: BoxShape.circle,
- color: sandColor[40],
+ borderRadius: BorderRadius.circular(10),
+ border: Border.all(color: colorDivider)),
+ child: Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Row(
+ children: [
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: sandColor[40],
+ ),
+ padding: const EdgeInsets.all(8),
+ child: SvgPicture.asset(iconPath),
+ ),
+ const SizedBox(width: 12),
+ Expanded(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(title),
+ if (subtitle.isNotEmpty)
+ Text(
+ subtitle,
+ style: Theme.of(context)
+ .textTheme
+ .bodySmall
+ ?.copyWith(color: Colors.grey),
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(width: 12),
+ SvgPicture.asset("assets/icons/arrow-left.svg")
+ ],
+ ),
),
- padding: const EdgeInsets.all(8),
- child: SvgPicture.asset(iconPath),
),
- title: Text(title),
- subtitle: Text(subtitle),
- trailing: SvgPicture.asset("assets/icons/arrow-left.svg"),
);
}
}
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 7f1a54da..c873218b 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
@@ -1,7 +1,9 @@
+import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
+import '../../routing/app_routes.dart';
import '../cubit/hotel_information_cubit.dart';
import 'hotel_information_list_tile.dart';
@@ -13,7 +15,8 @@ class HotelInformationMenu extends StatelessWidget {
final height = MediaQuery.of(context).size.height;
final cubit = context.read<HotelInformationCubit>();
final hotel = cubit.hotel;
- return Column(
+ return ListView(
+ shrinkWrap: true,
children: [
Image.asset(
hotel.image,
@@ -22,40 +25,47 @@ class HotelInformationMenu extends StatelessWidget {
fit: BoxFit.cover,
),
const SizedBox(height: 16),
- Text(hotel.name, style: Theme.of(context).textTheme.headlineLarge),
- const SizedBox(height: 16),
- ListView(
- shrinkWrap: true,
- children: [
- HotelInformationListTile(
- iconPath: "assets/icons/ic_chefs_hat.svg",
- title: "Restauranter",
- subtitle: "Læs om vores restaurant",
- onClick: () {
- context.pushNamed("/restaurants");
- },
- ),
- HotelInformationListTile(
- iconPath: "assets/icons/ic_spa.svg",
- title: "Spa",
- subtitle: "Bade, saunaer, brechelbath mm.",
- onClick: () {
- context.pushNamed('/spa');
- },
- ),
- HotelInformationListTile(
- iconPath: "assets/icons/ic_car.svg",
- title: "Parkeing",
- subtitle: "",
- onClick: cubit.onParkingClicked,
- ),
- HotelInformationListTile(
- iconPath: "assets/icons/ic_info.svg",
- title: "Øvrige informationer",
- subtitle: "Find mere information om hotellet",
- onClick: cubit.onMoreInformationClicked,
- ),
- ],
+ Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(hotel.name, style: Theme.of(context).textTheme.headlineLarge),
+ const SizedBox(height: 16),
+ HotelInformationListTile(
+ iconPath: "assets/icons/ic_chefs_hat.svg",
+ title: "hotel_information_page_menu_restaurants_title".tr(),
+ subtitle: "hotel_information_page_menu_restaurants_subtitle".tr(),
+ onClick: () {
+ context.pushNamed("${AppRoutes.hotelInformation.name}/${AppRoutes.restaurants.name}");
+ },
+ ),
+ const SizedBox(height: 6),
+ HotelInformationListTile(
+ iconPath: "assets/icons/ic_spa.svg",
+ title: "hotel_information_page_menu_spa_title".tr(),
+ subtitle: "hotel_information_page_menu_spa_subtitle".tr(),
+ onClick: () {
+ context.pushNamed("${AppRoutes.hotelInformation.name}/${AppRoutes.spa.name}");
+ },
+ ),
+ const SizedBox(height: 6),
+ HotelInformationListTile(
+ iconPath: "assets/icons/ic_car.svg",
+ title: "hotel_information_page_menu_parking_title".tr(),
+ subtitle: "",
+ onClick: cubit.onParkingClicked,
+ ),
+ const SizedBox(height: 6),
+ HotelInformationListTile(
+ iconPath: "assets/icons/ic_info.svg",
+ title: "hotel_information_page_menu_other_info_title".tr(),
+ subtitle: "hotel_information_page_menu_other_info_subtitle".tr(),
+ onClick: cubit.onMoreInformationClicked,
+ ),
+ const SizedBox(height: 100)
+ ],
+ ),
)
],
);
diff --git a/comwell_key_app/lib/hotel_information/components/spa_facility_page.dart b/comwell_key_app/lib/hotel_information/components/spa_facility_page.dart
index acb6e991..1621ebef 100644
--- a/comwell_key_app/lib/hotel_information/components/spa_facility_page.dart
+++ b/comwell_key_app/lib/hotel_information/components/spa_facility_page.dart
@@ -1,4 +1,5 @@
import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
+import 'package:comwell_key_app/themes/dark_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -9,7 +10,6 @@ class SpaFacilityPage extends StatelessWidget {
Widget build(BuildContext context) {
final cubit = context.read<HotelInformationCubit>();
final isLoading = cubit.state.spaButtonIsLoading;
- print("qqq asda sda $isLoading");
return Scaffold(
bottomSheet: Builder(builder: (context) {
return Column(
@@ -34,7 +34,7 @@ class SpaFacilityPage extends StatelessWidget {
if (states.contains(WidgetState.disabled)) {
return Colors.grey;
}
- return const Color(0xffAA8D65);
+ return sandColor[80];
}),
foregroundColor:
const WidgetStatePropertyAll(Colors.white)),
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 cbafdd3d..6da10f8b 100644
--- a/comwell_key_app/lib/hotel_information/hotel_information_page.dart
+++ b/comwell_key_app/lib/hotel_information/hotel_information_page.dart
@@ -1,11 +1,7 @@
import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
-import 'package:comwell_key_app/hotel_information/components/hotel_information_list_tile.dart';
-import 'package:comwell_key_app/hotel_information/components/restaurant_page.dart';
import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
-import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:go_router/go_router.dart';
class HotelInformationPage extends StatelessWidget {
final Widget child;
@@ -17,6 +13,7 @@ class HotelInformationPage extends StatelessWidget {
builder: (context, state) {
return Scaffold(
appBar: const ComwellAppBar(),
+ backgroundColor: Theme.of(context).colorScheme.surface,
body: Builder(builder: (context) {
return switch (state.hotelState) {
HotelState.loading => const Center(child: CircularProgressIndicator()),
diff --git a/comwell_key_app/lib/hotel_information/repository/hotel_information_repository.dart b/comwell_key_app/lib/hotel_information/repository/hotel_information_repository.dart
index 5e7222f1..edec6cb4 100644
--- a/comwell_key_app/lib/hotel_information/repository/hotel_information_repository.dart
+++ b/comwell_key_app/lib/hotel_information/repository/hotel_information_repository.dart
@@ -16,7 +16,7 @@ class HotelInformationRepository {
city: 'Copenhagen',
country: 'Denmark',
starRating: 4,
- image: 'assets/images/hotel.jpg',
+ image: 'assets/images/current_room.png',
facilities: Facilities(
restaurants: [
Restaurant(
diff --git a/comwell_key_app/lib/pregistration/pages/prereg_payment_page.dart b/comwell_key_app/lib/pregistration/pages/prereg_payment_page.dart
index 1142a4fd..e55e28b7 100644
--- a/comwell_key_app/lib/pregistration/pages/prereg_payment_page.dart
+++ b/comwell_key_app/lib/pregistration/pages/prereg_payment_page.dart
@@ -1,4 +1,5 @@
import 'package:comwell_key_app/pregistration/bloc/preregistration_cubit.dart';
+import 'package:comwell_key_app/themes/dark_theme.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -37,7 +38,7 @@ class PreregPaymentPage extends StatelessWidget {
children: [
Checkbox(
value: isTermsAndConditionsAccepted,
- activeColor: const Color(0xffAA8D65),
+ activeColor: sandColor[80],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4),
),
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index ce626b97..27359628 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -2,7 +2,6 @@ import 'package:comwell_key_app/authentication/authentication_repository.dart';
import 'package:comwell_key_app/authentication/bloc/authentication_bloc.dart';
import 'package:comwell_key_app/check_in/bloc/check_in_cubit.dart';
import 'package:comwell_key_app/check_in/check_in_page.dart';
-import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
import 'package:comwell_key_app/contact/contact_page.dart';
import 'package:comwell_key_app/find_booking/find_booking_page.dart';
import 'package:comwell_key_app/find_booking/loading_page.dart';
@@ -69,6 +68,7 @@ GoRouter goRouter(AuthenticationBloc authBloc) {
routes: <RouteBase>[
ShellRoute(
navigatorKey: _shellNavigatorKey,
+ parentNavigatorKey: _rootNavigatorKey,
pageBuilder: (context, state, child) {
return NoTransitionPage(
child: BlocProvider<HotelInformationCubit>(
@@ -84,23 +84,22 @@ GoRouter goRouter(AuthenticationBloc authBloc) {
),
);
},
- parentNavigatorKey: _rootNavigatorKey,
routes: [
GoRoute(
- path: '/${AppRoutes.hotelInformation.name}',
+ path: "/${AppRoutes.hotelInformation.name}",
name: AppRoutes.hotelInformation.name,
builder: (context, state) {
return const HotelInformationMenu();
}),
GoRoute(
- path: '/spa',
- name: '/spa',
+ path: "/${AppRoutes.hotelInformation.name}/${AppRoutes.spa.name}",
+ name: "${AppRoutes.hotelInformation.name}/${AppRoutes.spa.name}",
builder: (context, state) {
return const SpaFacilityPage();
}),
GoRoute(
- path: '/restaurants',
- name: "/restaurants",
+ path: "/${AppRoutes.hotelInformation.name}/${AppRoutes.restaurants.name}",
+ name: "${AppRoutes.hotelInformation.name}/${AppRoutes.restaurants.name}",
builder: (context, state) {
return const RestaurantPage();
}),
diff --git a/comwell_key_app/lib/routing/app_routes.dart b/comwell_key_app/lib/routing/app_routes.dart
index f5986d43..c43f2dd1 100644
--- a/comwell_key_app/lib/routing/app_routes.dart
+++ b/comwell_key_app/lib/routing/app_routes.dart
@@ -18,5 +18,8 @@ enum AppRoutes {
checkIn,
contact,
preregistration,
- hotelInformation
+ hotelInformation,
+ restaurants,
+ spa,
+ parking
}