6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 53bb84c2

AuthorEdmir Suljic<esu@dwarf.dk>
Date2025-06-26 09:44:18 +0200
Resolved PR comments

Changed files

.../lib/booking_details/booking_details_page.dart  |   2 +-
 .../lib/common/components/placeholders.dart        | 113 ---------------------
 .../booking_details_shimmer_loader.dart            |   4 +-
 .../hotel_information_shimmer_loader.dart          |   6 +-
 .../notifications_shimmer_loader.dart              |   2 +-
 .../shimmer_loader/overview_shimmer_loader.dart    |   4 +-
 .../payment_cards_shimmer_loader.dart              |   3 +-
 .../placeholders/banner_placeholder.dart           |  18 ++++
 .../placeholders/content_placeholder.dart          |  63 ++++++++++++
 .../placeholders/title_placeholder.dart            |  34 +++++++
 .../components/hotel_information_list_tile.dart    |  19 +---
 .../lib/hotel_information/utils/hotel_utils.dart   |  18 ++++
 12 files changed, 150 insertions(+), 136 deletions(-)

Diff

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 4f36ae25..dc866f24 100644
--- a/comwell_key_app/lib/booking_details/booking_details_page.dart
+++ b/comwell_key_app/lib/booking_details/booking_details_page.dart
@@ -33,7 +33,7 @@ class BookingDetailsPage extends StatelessWidget {
return Scaffold(
extendBodyBehindAppBar: true,
- backgroundColor: Colors.white,
+ backgroundColor: Colors.transparent,
appBar: const ComwellAppBar(),
body: Builder(
builder: (context) {
diff --git a/comwell_key_app/lib/common/components/placeholders.dart b/comwell_key_app/lib/common/components/placeholders.dart
deleted file mode 100644
index 98fa9f0e..00000000
--- a/comwell_key_app/lib/common/components/placeholders.dart
+++ /dev/null
@@ -1,113 +0,0 @@
-import 'package:flutter/material.dart';
-
-class BannerPlaceholder extends StatelessWidget {
- const BannerPlaceholder({super.key});
-
- @override
- Widget build(BuildContext context) {
- return Container(
- width: double.infinity,
- height: 200.0,
- margin: const EdgeInsets.all(16.0),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(12.0),
- color: Colors.white,
- ),
- );
- }
-}
-
-class TitlePlaceholder extends StatelessWidget {
- final double width;
-
- const TitlePlaceholder({
- super.key,
- required this.width,
- });
-
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16.0),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: width,
- height: 12.0,
- color: Colors.white,
- ),
- const SizedBox(height: 8.0),
- Container(
- width: width,
- height: 12.0,
- color: Colors.white,
- ),
- ],
- ),
- );
- }
-}
-
-enum ContentLineType {
- twoLines,
- threeLines,
-}
-
-class ContentPlaceholder extends StatelessWidget {
- final ContentLineType lineType;
-
- const ContentPlaceholder({
- super.key,
- required this.lineType,
- });
-
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16.0),
- child: Row(
- mainAxisSize: MainAxisSize.max,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- width: 96.0,
- height: 72.0,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(12.0),
- color: Colors.white,
- ),
- ),
- const SizedBox(width: 12.0),
- Expanded(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: double.infinity,
- height: 10.0,
- color: Colors.white,
- margin: const EdgeInsets.only(bottom: 8.0),
- ),
- if (lineType == ContentLineType.threeLines)
- Container(
- width: double.infinity,
- height: 10.0,
- color: Colors.white,
- margin: const EdgeInsets.only(bottom: 8.0),
- ),
- Container(
- width: 100.0,
- height: 10.0,
- color: Colors.white,
- )
- ],
- ),
- )
- ],
- ),
- );
- }
-}
\ No newline at end of file
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/booking_details_shimmer_loader.dart b/comwell_key_app/lib/common/components/shimmer_loader/booking_details_shimmer_loader.dart
index b7046ea4..53062908 100644
--- a/comwell_key_app/lib/common/components/shimmer_loader/booking_details_shimmer_loader.dart
+++ b/comwell_key_app/lib/common/components/shimmer_loader/booking_details_shimmer_loader.dart
@@ -1,7 +1,9 @@
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/banner_placeholder.dart';
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/content_placeholder.dart';
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/title_placeholder.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
-import '../placeholders.dart';
class BookingDetailsShimmerLoader extends StatelessWidget {
const BookingDetailsShimmerLoader({super.key});
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/hotel_information_shimmer_loader.dart b/comwell_key_app/lib/common/components/shimmer_loader/hotel_information_shimmer_loader.dart
index b4eb5910..92e48a06 100644
--- a/comwell_key_app/lib/common/components/shimmer_loader/hotel_information_shimmer_loader.dart
+++ b/comwell_key_app/lib/common/components/shimmer_loader/hotel_information_shimmer_loader.dart
@@ -1,6 +1,8 @@
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/banner_placeholder.dart';
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/content_placeholder.dart';
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/title_placeholder.dart';
import 'package:flutter/material.dart';
-import 'package:shimmer/shimmer.dart';
-import '../placeholders.dart';
+import 'package:shimmer/shimmer.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
class HotelInformationShimmerLoader extends StatelessWidget {
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/notifications_shimmer_loader.dart b/comwell_key_app/lib/common/components/shimmer_loader/notifications_shimmer_loader.dart
index d4841086..ef5471e9 100644
--- a/comwell_key_app/lib/common/components/shimmer_loader/notifications_shimmer_loader.dart
+++ b/comwell_key_app/lib/common/components/shimmer_loader/notifications_shimmer_loader.dart
@@ -1,6 +1,6 @@
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/content_placeholder.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
-import '../placeholders.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
class NotificationsShimmerLoader extends StatelessWidget {
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/overview_shimmer_loader.dart b/comwell_key_app/lib/common/components/shimmer_loader/overview_shimmer_loader.dart
index 62a0ee3e..7c334f5f 100644
--- a/comwell_key_app/lib/common/components/shimmer_loader/overview_shimmer_loader.dart
+++ b/comwell_key_app/lib/common/components/shimmer_loader/overview_shimmer_loader.dart
@@ -1,4 +1,6 @@
-import 'package:comwell_key_app/common/components/placeholders.dart';
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/banner_placeholder.dart';
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/content_placeholder.dart';
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/title_placeholder.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/payment_cards_shimmer_loader.dart b/comwell_key_app/lib/common/components/shimmer_loader/payment_cards_shimmer_loader.dart
index 0e1f047d..54925525 100644
--- a/comwell_key_app/lib/common/components/shimmer_loader/payment_cards_shimmer_loader.dart
+++ b/comwell_key_app/lib/common/components/shimmer_loader/payment_cards_shimmer_loader.dart
@@ -1,7 +1,8 @@
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/content_placeholder.dart';
+import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/title_placeholder.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
-import '../placeholders.dart';
class PaymentCardsShimmerLoader extends StatelessWidget {
const PaymentCardsShimmerLoader({super.key});
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/placeholders/banner_placeholder.dart b/comwell_key_app/lib/common/components/shimmer_loader/placeholders/banner_placeholder.dart
new file mode 100644
index 00000000..d3429763
--- /dev/null
+++ b/comwell_key_app/lib/common/components/shimmer_loader/placeholders/banner_placeholder.dart
@@ -0,0 +1,18 @@
+import 'package:flutter/material.dart';
+
+class BannerPlaceholder extends StatelessWidget {
+ const BannerPlaceholder({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ width: double.infinity,
+ height: 200.0,
+ margin: const EdgeInsets.all(16.0),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(12.0),
+ color: Colors.white,
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/placeholders/content_placeholder.dart b/comwell_key_app/lib/common/components/shimmer_loader/placeholders/content_placeholder.dart
new file mode 100644
index 00000000..fb655590
--- /dev/null
+++ b/comwell_key_app/lib/common/components/shimmer_loader/placeholders/content_placeholder.dart
@@ -0,0 +1,63 @@
+import 'package:flutter/material.dart';
+
+enum ContentLineType {
+ twoLines,
+ threeLines,
+}
+
+class ContentPlaceholder extends StatelessWidget {
+ final ContentLineType lineType;
+
+ const ContentPlaceholder({
+ super.key,
+ required this.lineType,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
+ child: Row(
+ mainAxisSize: MainAxisSize.max,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Container(
+ width: 96.0,
+ height: 72.0,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(12.0),
+ color: Colors.white,
+ ),
+ ),
+ const SizedBox(width: 12.0),
+ Expanded(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ width: double.infinity,
+ height: 10.0,
+ color: Colors.white,
+ margin: const EdgeInsets.only(bottom: 8.0),
+ ),
+ if (lineType == ContentLineType.threeLines)
+ Container(
+ width: double.infinity,
+ height: 10.0,
+ color: Colors.white,
+ margin: const EdgeInsets.only(bottom: 8.0),
+ ),
+ Container(
+ width: 100.0,
+ height: 10.0,
+ color: Colors.white,
+ )
+ ],
+ ),
+ )
+ ],
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/placeholders/title_placeholder.dart b/comwell_key_app/lib/common/components/shimmer_loader/placeholders/title_placeholder.dart
new file mode 100644
index 00000000..00f12174
--- /dev/null
+++ b/comwell_key_app/lib/common/components/shimmer_loader/placeholders/title_placeholder.dart
@@ -0,0 +1,34 @@
+import 'package:flutter/material.dart';
+
+class TitlePlaceholder extends StatelessWidget {
+ final double width;
+
+ const TitlePlaceholder({
+ super.key,
+ required this.width,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ width: width,
+ height: 12.0,
+ color: Colors.white,
+ ),
+ const SizedBox(height: 8.0),
+ Container(
+ width: width,
+ height: 12.0,
+ color: Colors.white,
+ ),
+ ],
+ ),
+ );
+ }
+}
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 421db516..9a17ee8a 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,3 +1,4 @@
+import 'package:comwell_key_app/hotel_information/utils/hotel_utils.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
@@ -33,7 +34,7 @@ class HotelInformationListTile extends StatelessWidget {
color: sandColor[40],
),
padding: const EdgeInsets.all(8),
- child: _buildIcon(),
+ child: buildIcon(iconPath),
),
const SizedBox(width: 12),
Expanded(
@@ -55,19 +56,5 @@ class HotelInformationListTile extends StatelessWidget {
);
}
- Widget _buildIcon() {
- // Check if the iconPath is a network URL
- if (iconPath.startsWith('http://') || iconPath.startsWith('https://')) {
- return SvgPicture.network(
- iconPath,
- errorBuilder: (context, error, stackTrace) {
- // Fallback to a default icon if network loading fails
- return SvgPicture.asset("assets/icons/ic_info.svg");
- },
- );
- } else {
- // Treat as local asset
- return SvgPicture.asset(iconPath);
- }
- }
+
}
diff --git a/comwell_key_app/lib/hotel_information/utils/hotel_utils.dart b/comwell_key_app/lib/hotel_information/utils/hotel_utils.dart
new file mode 100644
index 00000000..58f88cbf
--- /dev/null
+++ b/comwell_key_app/lib/hotel_information/utils/hotel_utils.dart
@@ -0,0 +1,18 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/svg.dart';
+
+Widget buildIcon(String iconPath) {
+ // Check if the iconPath is a network URL
+ if (iconPath.startsWith('http://') || iconPath.startsWith('https://')) {
+ return SvgPicture.network(
+ iconPath,
+ errorBuilder: (context, error, stackTrace) {
+ // Fallback to a default icon if network loading fails
+ return SvgPicture.asset("assets/icons/ic_info.svg");
+ },
+ );
+ } else {
+ // Treat as local asset
+ return SvgPicture.asset(iconPath);
+ }
+ }
\ No newline at end of file