6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit f6adff7a
Changed files
.../components/hotel_information_list_tile.dart | 18 +++++++++++++++++- .../pages/hotel_information_menu.dart | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-)
Diff
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 7b147429..421db516 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
@@ -33,7 +33,7 @@ class HotelInformationListTile extends StatelessWidget {
color: sandColor[40],
),
padding: const EdgeInsets.all(8),
- child: SvgPicture.asset(iconPath),
+ child: _buildIcon(),
),
const SizedBox(width: 12),
Expanded(
@@ -54,4 +54,20 @@ 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/pages/hotel_information_menu.dart b/comwell_key_app/lib/hotel_information/pages/hotel_information_menu.dart
index c50ceb94..4fec9b13 100644
--- a/comwell_key_app/lib/hotel_information/pages/hotel_information_menu.dart
+++ b/comwell_key_app/lib/hotel_information/pages/hotel_information_menu.dart
@@ -33,7 +33,7 @@ class HotelInformationMenu extends StatelessWidget {
return Padding(
padding: const EdgeInsets.only(bottom: 6.0),
child: HotelInformationListTile(
- iconPath: "assets/icons/ic_info.svg", // TODO: Add icon for facility when cms is updated
+ iconPath: facility.icon ?? "assets/icons/ic_info.svg", // TODO: Add icon for facility when cms is updated
title: facility.title,
onClick: () {
context.pushNamed(