6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit a1308a14
Changed files
comwell_key_app/assets/icons/ic_exit.svg | 3 + comwell_key_app/assets/icons/ic_unlocked.svg | 3 + comwell_key_app/assets/translations/da-DK.json | 3 +- comwell_key_app/assets/translations/en-US.json | 1 + .../lib/booking_details/booking_details_page.dart | 32 ++-------- .../components/check_in_button.dart | 68 ++++++++++++++++++++++ .../components/preregister_button.dart | 54 ++++++++++++----- .../components/unlock_room_button.dart | 40 +++++++++++++ 8 files changed, 162 insertions(+), 42 deletions(-)
Diff
diff --git a/comwell_key_app/assets/icons/ic_exit.svg b/comwell_key_app/assets/icons/ic_exit.svg
new file mode 100644
index 00000000..2f05cfcd
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_exit.svg
@@ -0,0 +1,3 @@
+<svg width="19" height="20" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 1.75C5.5 0.921574 6.17157 0.25 7 0.25H16.75C17.5784 0.25 18.25 0.921573 18.25 1.75V19.75H16.75V1.75L7 1.75V8.125H5.5V1.75ZM5.5 12.625H7V19.75H5.5V12.625ZM10.1553 6.46967L13.5303 9.84467L14.0607 10.375L13.5303 10.9053L10.1553 14.2803L9.09467 13.2197L11.1893 11.125H0.25V9.625H11.1893L9.09467 7.53033L10.1553 6.46967Z" fill="white"/>
+</svg>
diff --git a/comwell_key_app/assets/icons/ic_unlocked.svg b/comwell_key_app/assets/icons/ic_unlocked.svg
new file mode 100644
index 00000000..be300135
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_unlocked.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="22" viewBox="0 0 16 22" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14 9.5H5V5C5 3.34315 6.34315 2 8 2C9.65685 2 11 3.34315 11 5H12.5C12.5 2.51472 10.4853 0.5 8 0.5C5.51472 0.5 3.5 2.51472 3.5 5V9.5H2C1.17157 9.5 0.5 10.1716 0.5 11V20C0.5 20.8284 1.17157 21.5 2 21.5H14C14.8284 21.5 15.5 20.8284 15.5 20V11C15.5 10.1716 14.8284 9.5 14 9.5ZM14 20H2V11H14V20Z" fill="white"/>
+</svg>
diff --git a/comwell_key_app/assets/translations/da-DK.json b/comwell_key_app/assets/translations/da-DK.json
index b6a3da00..cdd23932 100644
--- a/comwell_key_app/assets/translations/da-DK.json
+++ b/comwell_key_app/assets/translations/da-DK.json
@@ -147,5 +147,6 @@
"restaurant_page_address": "Adresse",
"restaurant_page_opening_hours": "Åbningstider",
"restaurant_page_book_table": "Book bord",
- "restaurant_page_send_email": "Skriv en email"
+ "restaurant_page_send_email": "Skriv en email",
+ "overview_page_check_in_button_subtitle": "Få dit digitale nøglekort med det samme"
}
\ No newline at end of file
diff --git a/comwell_key_app/assets/translations/en-US.json b/comwell_key_app/assets/translations/en-US.json
index bd30bc22..efe518a0 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -40,6 +40,7 @@
"prepare_room": "Prepare your room",
"jump_line_text": "Skip the line with digital check-in",
"overview_add_booking": "Find booking",
+ "overview_page_check_in_button_subtitle": "Get your digital key card",
"open_room": "Åben værelse",
"hold_phone_to_door": "Hold tæt på læser",
"open_room_success": "Succes",
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 93d7a259..8a8043a3 100644
--- a/comwell_key_app/lib/booking_details/booking_details_page.dart
+++ b/comwell_key_app/lib/booking_details/booking_details_page.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/booking_details/components/check_in_button.dart';
import 'package:comwell_key_app/booking_details/components/preregister_button.dart';
import 'package:comwell_key_app/common/components/bottom_sheet_widget.dart';
import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
@@ -8,18 +9,16 @@ import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
-import 'package:slider_button/slider_button.dart';
import 'bloc/booking_details_bloc.dart';
+import 'components/unlock_room_button.dart';
class BookingDetailsPage extends StatelessWidget {
const BookingDetailsPage({super.key});
@override
Widget build(BuildContext context) {
- final theme = Theme.of(context);
return BlocConsumer<BookingDetailsBloc, BookingDetailsState>(
listener: (context, state) {},
builder: (context, state) {
@@ -46,30 +45,9 @@ class BookingDetailsPage extends StatelessWidget {
children: [
const Spacer(),
if (state.keys.isNotEmpty)
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: SliderButton(
- backgroundColor: sandColor,
- width: 300,
- icon: Center(
- child: SvgPicture.asset(
- 'assets/icons/Union.svg',
- width: 30,
- ),
- ),
- action: () async {
- context.pushNamed(AppRoutes.key.name);
- return false;
- },
- alignLabel: Alignment.center,
- label: Text(
- 'open_room'.tr(),
- style: theme.textTheme.headlineSmall
- ?.copyWith(color: Colors.white),
- textAlign: TextAlign.center,
- ),
- ),
- ),
+ const UnlockRoomButton()
+ else
+ const CheckInButton(),
const SizedBox(
height: 220,
),
diff --git a/comwell_key_app/lib/booking_details/components/check_in_button.dart b/comwell_key_app/lib/booking_details/components/check_in_button.dart
new file mode 100644
index 00000000..0606ea5a
--- /dev/null
+++ b/comwell_key_app/lib/booking_details/components/check_in_button.dart
@@ -0,0 +1,68 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:flutter_svg/svg.dart';
+import 'package:go_router/go_router.dart';
+
+import '../../routing/app_routes.dart';
+import '../../themes/dark_theme.dart';
+import '../bloc/booking_details_bloc.dart';
+
+class CheckInButton extends StatelessWidget {
+ const CheckInButton({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final bloc = context.read<BookingDetailsBloc>();
+ return Container(
+ margin: const EdgeInsets.symmetric(horizontal: 30),
+ child: ElevatedButton(
+ onPressed: () {
+ context.pushNamed(AppRoutes.checkIn.name,
+ extra: bloc.booking);
+ },
+ style: ElevatedButton.styleFrom(
+ backgroundColor: sandColor[80],
+ textStyle: const TextStyle(
+ color: Colors.white,
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ ),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(30),
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Row(
+ children: [
+ SvgPicture.asset("assets/icons/ic_unlocked.svg"),
+ const SizedBox(width: 16),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ "check_in".tr(),
+ style: Theme
+ .of(context)
+ .textTheme
+ .titleMedium
+ ?.copyWith(color: Colors.white),
+ ),
+ Text(
+ "overview_page_check_in_button_subtitle".tr(),
+ style: Theme
+ .of(context)
+ .textTheme
+ .bodySmall
+ ?.copyWith(color: Colors.white),
+ ),
+ ],
+ )
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/booking_details/components/preregister_button.dart b/comwell_key_app/lib/booking_details/components/preregister_button.dart
index bdc94621..503ecdc0 100644
--- a/comwell_key_app/lib/booking_details/components/preregister_button.dart
+++ b/comwell_key_app/lib/booking_details/components/preregister_button.dart
@@ -1,10 +1,12 @@
-import 'package:comwell_key_app/booking_details/bloc/booking_details_bloc.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import '../../routing/app_routes.dart';
+import '../../themes/dark_theme.dart';
+import '../bloc/booking_details_bloc.dart';
class PreregisterButton extends StatelessWidget {
const PreregisterButton({super.key});
@@ -12,25 +14,49 @@ class PreregisterButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bloc = context.read<BookingDetailsBloc>();
- final booking = bloc.booking;
return ElevatedButton(
onPressed: () {
- context.pushNamed(AppRoutes.checkIn.name, extra: booking);
+ context.pushNamed(AppRoutes.preregistration.name,
+ extra: bloc.booking);
},
- style: ButtonStyle(
- backgroundColor: WidgetStateProperty.resolveWith((states) {
- if (states.contains(WidgetState.disabled)) {
- return Colors.grey;
- }
- return const Color(0xffAA8D65);
- }),
- foregroundColor: const WidgetStatePropertyAll(Colors.white)),
+ style: ElevatedButton.styleFrom(
+ backgroundColor: sandColor[80],
+ textStyle: const TextStyle(
+ color: Colors.white,
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ ),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(30),
+ ),
+ ),
child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 16.0),
+ padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
- Text("prepare_room".tr()),
+ SvgPicture.asset("assets/icons/ic_exit.svg"),
+ const SizedBox(width: 16),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ "prepare_room".tr(),
+ style: Theme
+ .of(context)
+ .textTheme
+ .titleMedium
+ ?.copyWith(color: Colors.white),
+ ),
+ Text(
+ "jump_line_text".tr(),
+ style: Theme
+ .of(context)
+ .textTheme
+ .bodySmall
+ ?.copyWith(color: Colors.white),
+ ),
+ ],
+ )
],
),
),
diff --git a/comwell_key_app/lib/booking_details/components/unlock_room_button.dart b/comwell_key_app/lib/booking_details/components/unlock_room_button.dart
new file mode 100644
index 00000000..ccaab257
--- /dev/null
+++ b/comwell_key_app/lib/booking_details/components/unlock_room_button.dart
@@ -0,0 +1,40 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/svg.dart';
+import 'package:go_router/go_router.dart';
+import 'package:slider_button/slider_button.dart';
+
+import '../../routing/app_routes.dart';
+import '../../themes/dark_theme.dart';
+
+class UnlockRoomButton extends StatelessWidget {
+ const UnlockRoomButton({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: SliderButton(
+ backgroundColor: sandColor,
+ width: 300,
+ icon: Center(
+ child: SvgPicture.asset(
+ 'assets/icons/Union.svg',
+ width: 30,
+ ),
+ ),
+ action: () async {
+ context.pushNamed(AppRoutes.key.name);
+ return false;
+ },
+ alignLabel: Alignment.center,
+ label: Text(
+ 'open_room'.tr(),
+ style: theme.textTheme.headlineSmall?.copyWith(color: Colors.white),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ );
+ }
+}