From 97bc2ba141e6ad39471140f69b1eb4200976eed2 Mon Sep 17 00:00:00 2001 From: vishnukvmd Date: Fri, 8 Sep 2023 17:48:26 +0530 Subject: [PATCH] Accept icon-width as a param --- lib/ui/utils/icon_utils.dart | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/ui/utils/icon_utils.dart b/lib/ui/utils/icon_utils.dart index 4ee3f8592..1a0ec3edc 100644 --- a/lib/ui/utils/icon_utils.dart +++ b/lib/ui/utils/icon_utils.dart @@ -18,29 +18,39 @@ class IconUtils { await _loadJson(); } - Widget getIcon(String provider) { + Widget getIcon( + String provider, { + double width = 24, + }) { final title = _getProviderTitle(provider); if (_customIcons.containsKey(title)) { return _getSVGIcon( "assets/custom-icons/icons/$title.svg", title, _customIcons[title]!, + width, ); } else if (_simpleIcons.containsKey(title)) { return _getSVGIcon( "assets/simple-icons/icons/$title.svg", title, _simpleIcons[title]!, + width, ); } else { return const SizedBox.shrink(); } } - Widget _getSVGIcon(String path, String title, String color) { + Widget _getSVGIcon( + String path, + String title, + String color, + double width, + ) { return SvgPicture.asset( path, - width: 24, + width: width, semanticsLabel: title, colorFilter: ColorFilter.mode( Color(int.parse("0xFF" + color)),