6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 7033ade5
Changed files
comwell_key_app/assets/icons/ic_calendar.svg | 4 +++ .../components/booking_list_item_view.dart | 21 +++++++++---- .../lib/overview/components/bookings_tab_view.dart | 2 +- .../components/current_booking_list_item_view.dart | 5 ++-- comwell_key_app/lib/overview/overview_page.dart | 34 ++++++++++++---------- .../components/date_time_picker.dart | 2 +- 6 files changed, 42 insertions(+), 26 deletions(-)
Diff
diff --git a/comwell_key_app/assets/icons/ic_calendar.svg b/comwell_key_app/assets/icons/ic_calendar.svg
new file mode 100644
index 00000000..2926adb5
--- /dev/null
+++ b/comwell_key_app/assets/icons/ic_calendar.svg
@@ -0,0 +1,4 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="20" height="20" fill="white"/>
+<path d="M16.25 2.5H13.75V1.25H12.5V2.5H7.5V1.25H6.25V2.5H3.75C3.0625 2.5 2.5 3.0625 2.5 3.75V16.25C2.5 16.9375 3.0625 17.5 3.75 17.5H16.25C16.9375 17.5 17.5 16.9375 17.5 16.25V3.75C17.5 3.0625 16.9375 2.5 16.25 2.5ZM16.25 16.25H3.75V7.5H16.25V16.25ZM16.25 6.25H3.75V3.75H6.25V5H7.5V3.75H12.5V5H13.75V3.75H16.25V6.25Z" fill="black"/>
+</svg>
diff --git a/comwell_key_app/lib/overview/components/booking_list_item_view.dart b/comwell_key_app/lib/overview/components/booking_list_item_view.dart
index 9df6e5bf..d8673105 100644
--- a/comwell_key_app/lib/overview/components/booking_list_item_view.dart
+++ b/comwell_key_app/lib/overview/components/booking_list_item_view.dart
@@ -2,6 +2,7 @@ import 'package:comwell_key_app/overview/models/booking.dart';
import 'package:comwell_key_app/routing/app_routes.dart';
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';
class BookingListItemView extends StatelessWidget {
@@ -26,8 +27,8 @@ class BookingListItemView extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Theme.of(context);
return InkWell(
- onTap: () =>
- context.pushNamed(AppRoutes.pastCancelledBookings.name, extra: booking),
+ onTap: () => context.pushNamed(AppRoutes.pastCancelledBookings.name,
+ extra: booking),
child: Container(
height: 66,
margin: const EdgeInsets.only(bottom: 8, left: 8, right: 8),
@@ -49,7 +50,13 @@ class BookingListItemView extends StatelessWidget {
),
width: 84,
height: 66,
- child: hotelImage,
+ child: ClipRRect(
+ borderRadius: const BorderRadius.only(
+ topLeft: Radius.circular(6),
+ bottomLeft: Radius.circular(6),
+ ),
+ child: hotelImage,
+ ),
),
const SizedBox(width: 8),
Padding(
@@ -62,9 +69,10 @@ class BookingListItemView extends StatelessWidget {
style: theme.textTheme.headlineSmall,
),
Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- const Icon(Icons.calendar_today_outlined,
- size: 16, color: Colors.black),
+ SvgPicture.asset("assets/icons/ic_calendar.svg",
+ width: 16, height: 16),
const SizedBox(width: 4),
Text(
DateFormat('d. MMM').format(startDate),
@@ -86,7 +94,8 @@ class BookingListItemView extends StatelessWidget {
if (isCancelled)
Text(
"booking_annulled".tr(),
- style: theme.textTheme.bodyMedium?.copyWith(color: Colors.red),
+ style:
+ theme.textTheme.bodyMedium?.copyWith(color: Colors.red),
),
const SizedBox(width: 16),
],
diff --git a/comwell_key_app/lib/overview/components/bookings_tab_view.dart b/comwell_key_app/lib/overview/components/bookings_tab_view.dart
index d5f3a1a5..1d0ff104 100644
--- a/comwell_key_app/lib/overview/components/bookings_tab_view.dart
+++ b/comwell_key_app/lib/overview/components/bookings_tab_view.dart
@@ -70,7 +70,7 @@ class BookingsTabView extends StatelessWidget {
hotelName: bookings.elementAt(index).hotelName,
startDate: bookings.elementAt(index).startDate,
endDate: bookings.elementAt(index).endDate,
- hotelImage: Image.asset(bookings.elementAt(index).image),
+ hotelImage: Image.asset(bookings.elementAt(index).image, fit: BoxFit.cover),
isCancelled: isCancelled,
),
);
diff --git a/comwell_key_app/lib/overview/components/current_booking_list_item_view.dart b/comwell_key_app/lib/overview/components/current_booking_list_item_view.dart
index 457a759f..7e6d2fb0 100644
--- a/comwell_key_app/lib/overview/components/current_booking_list_item_view.dart
+++ b/comwell_key_app/lib/overview/components/current_booking_list_item_view.dart
@@ -50,9 +50,10 @@ class CurrentBookingListItem extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- const Icon(Icons.calendar_today_outlined,
- size: 16, color: Colors.black),
+ SvgPicture.asset("assets/icons/ic_calendar.svg",
+ width: 16, height: 16),
const SizedBox(width: 4),
Text(DateFormat('d. MMM').format(booking.startDate),
style: theme.textTheme.bodySmall),
diff --git a/comwell_key_app/lib/overview/overview_page.dart b/comwell_key_app/lib/overview/overview_page.dart
index f872a2e2..8534c5f7 100644
--- a/comwell_key_app/lib/overview/overview_page.dart
+++ b/comwell_key_app/lib/overview/overview_page.dart
@@ -59,7 +59,7 @@ class OverviewTabViewState extends State<OverviewPage>
child: Column(
children: [
Padding(
- padding: const EdgeInsets.all(8),
+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: Container(
height: 39,
decoration: BoxDecoration(
@@ -107,21 +107,23 @@ class OverviewTabViewState extends State<OverviewPage>
bookings: const Bookings(
cancelled: [], current: [], past: [])),
],
- OutlinedButton.icon(
- onPressed: () async {
- throw Exception('This is test exception');
- //context.pushNamed(AppRoutes.findBooking.name);
- },
- icon: Icon(Icons.search,
- color: Theme.of(context).dividerColor),
- label: Text(
- 'find_booking'.tr(),
- style: TextStyle(color: Theme.of(context).dividerColor),
- ),
- style: OutlinedButton.styleFrom(
- side: BorderSide(color: Theme.of(context).dividerColor),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(25),
+ Padding(
+ padding: const EdgeInsets.only(top: 6.0, bottom: 8.0),
+ child: OutlinedButton.icon(
+ onPressed: () async {
+ context.pushNamed(AppRoutes.findBooking.name);
+ },
+ icon: Icon(Icons.search,
+ color: Theme.of(context).dividerColor),
+ label: Text(
+ 'find_booking'.tr(),
+ style: TextStyle(color: Theme.of(context).dividerColor),
+ ),
+ style: OutlinedButton.styleFrom(
+ side: BorderSide(color: Theme.of(context).dividerColor),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(25),
+ ),
),
),
),
diff --git a/comwell_key_app/lib/profile_settings/components/date_time_picker.dart b/comwell_key_app/lib/profile_settings/components/date_time_picker.dart
index 4ebb1fd1..0c7fea45 100644
--- a/comwell_key_app/lib/profile_settings/components/date_time_picker.dart
+++ b/comwell_key_app/lib/profile_settings/components/date_time_picker.dart
@@ -80,7 +80,7 @@ class _DatePickerState extends State<DateTimePicker> {
],
),
SvgPicture.asset(
- "assets/icons/calendar.svg",
+ "assets/icons/ic_calendar.svg",
height: 24.0,
),
],