diff --git a/assets/images/dashboard-placeholder.png b/assets/images/dashboard-placeholder.png deleted file mode 100644 index f08a22b..0000000 Binary files a/assets/images/dashboard-placeholder.png and /dev/null differ diff --git a/assets/images/dashboard-placeholder.svg b/assets/images/dashboard-placeholder.svg new file mode 100644 index 0000000..a34426a --- /dev/null +++ b/assets/images/dashboard-placeholder.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/device-profile-placeholder.png b/assets/images/device-profile-placeholder.png deleted file mode 100644 index 908525b..0000000 Binary files a/assets/images/device-profile-placeholder.png and /dev/null differ diff --git a/assets/images/device-profile-placeholder.svg b/assets/images/device-profile-placeholder.svg new file mode 100644 index 0000000..88a5d12 --- /dev/null +++ b/assets/images/device-profile-placeholder.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/lib/constants/assets_path.dart b/lib/constants/assets_path.dart index c4b446d..f8ac2cc 100644 --- a/lib/constants/assets_path.dart +++ b/lib/constants/assets_path.dart @@ -3,8 +3,8 @@ abstract class ThingsboardImage { static final thingsboard = 'assets/images/thingsboard.svg'; static final thingsboardOuter = 'assets/images/thingsboard_outer.svg'; static final thingsboardCenter = 'assets/images/thingsboard_center.svg'; - static final dashboardPlaceholder = 'assets/images/dashboard-placeholder.png'; - static final deviceProfilePlaceholder = 'assets/images/device-profile-placeholder.png'; + static final dashboardPlaceholder = 'assets/images/dashboard-placeholder.svg'; + static final deviceProfilePlaceholder = 'assets/images/device-profile-placeholder.svg'; static final oauth2Logos = { 'google-logo': 'assets/images/google-logo.svg', diff --git a/lib/modules/dashboard/dashboards_base.dart b/lib/modules/dashboard/dashboards_base.dart index 7cb9cea..cc89a13 100644 --- a/lib/modules/dashboard/dashboards_base.dart +++ b/lib/modules/dashboard/dashboards_base.dart @@ -1,6 +1,7 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:thingsboard_app/constants/assets_path.dart'; import 'package:thingsboard_app/core/context/tb_context.dart'; import 'package:thingsboard_app/core/context/tb_context_widget.dart'; @@ -158,7 +159,10 @@ class _DashboardGridCardState extends TbContextState { image = Utils.imageFromBase64(profile.image!); imageFit = BoxFit.contain; } else { - image = Image.asset(ThingsboardImage.deviceProfilePlaceholder); + image = SvgPicture.asset(ThingsboardImage.deviceProfilePlaceholder, + color: Theme.of(context).primaryColor, + colorBlendMode: BlendMode.color, + semanticsLabel: 'Device'); imageFit = BoxFit.cover; } return Row( @@ -298,7 +302,10 @@ class _DeviceCardState extends TbContextState { image = Utils.imageFromBase64(profile.image!); imageFit = BoxFit.contain; } else { - image = Image.asset(ThingsboardImage.deviceProfilePlaceholder); + image = SvgPicture.asset(ThingsboardImage.deviceProfilePlaceholder, + color: Theme.of(context).primaryColor, + colorBlendMode: BlendMode.color, + semanticsLabel: 'Device'); imageFit = BoxFit.cover; } return ClipRRect(