diff --git a/lib/pangea/analytics/widgets/analytics_summary/vocab_analytics_popup/vocab_analytics_popup.dart b/lib/pangea/analytics/widgets/analytics_summary/vocab_analytics_popup/vocab_analytics_popup.dart index 78e394554..a819a3a59 100644 --- a/lib/pangea/analytics/widgets/analytics_summary/vocab_analytics_popup/vocab_analytics_popup.dart +++ b/lib/pangea/analytics/widgets/analytics_summary/vocab_analytics_popup/vocab_analytics_popup.dart @@ -211,17 +211,10 @@ class VocabAnalyticsPopupState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - CircleAvatar( - backgroundColor: - Theme.of(context).brightness == Brightness.light - ? Colors.white - : Colors.black, - radius: 16, - child: CustomizedSvg( - svgUrl: type.svgURL, - colorReplacements: const {}, - errorIcon: Text(type.emoji), - ), + CustomizedSvg( + svgUrl: type.svgURL, + colorReplacements: const {}, + errorIcon: Text(type.emoji), ), Text( " ${type.xpString} XP", diff --git a/lib/pangea/common/widgets/customized_svg.dart b/lib/pangea/common/widgets/customized_svg.dart index f6bed0177..4e52bc354 100644 --- a/lib/pangea/common/widgets/customized_svg.dart +++ b/lib/pangea/common/widgets/customized_svg.dart @@ -5,8 +5,13 @@ import 'package:get_storage/get_storage.dart'; import 'package:http/http.dart' as http; class CustomizedSvg extends StatelessWidget { + /// URL of the SVG file final String svgUrl; + + /// Map of color replacements final Map colorReplacements; + + /// Icon to show in case of error final Widget errorIcon; const CustomizedSvg({ @@ -38,6 +43,8 @@ class CustomizedSvg extends StatelessWidget { Future _getModifiedSvg() async { final svgContent = await _fetchSvg(); String modifiedSvg = svgContent; + // find the white and replace with black + // or find black and replace with white modifiedSvg = modifiedSvg.replaceAll("fill=\"none\"", ''); for (final entry in colorReplacements.entries) { modifiedSvg = modifiedSvg.replaceAll(entry.key, entry.value); diff --git a/lib/pangea/toolbar/widgets/practice_activity/emoji_practice_button.dart b/lib/pangea/toolbar/widgets/practice_activity/emoji_practice_button.dart index f0f473b7a..b6487e473 100644 --- a/lib/pangea/toolbar/widgets/practice_activity/emoji_practice_button.dart +++ b/lib/pangea/toolbar/widgets/practice_activity/emoji_practice_button.dart @@ -33,6 +33,6 @@ class EmojiPracticeButton extends StatelessWidget { isSelected: isSelected, onPressed: onPressed, ) - : const SizedBox(width: 40); + : const SizedBox(width: 60); } } diff --git a/lib/pangea/toolbar/widgets/practice_activity/word_zoom_activity_button.dart b/lib/pangea/toolbar/widgets/practice_activity/word_zoom_activity_button.dart index 7dda78b39..90b1d4d18 100644 --- a/lib/pangea/toolbar/widgets/practice_activity/word_zoom_activity_button.dart +++ b/lib/pangea/toolbar/widgets/practice_activity/word_zoom_activity_button.dart @@ -23,6 +23,7 @@ class WordZoomActivityButton extends StatelessWidget { Widget buttonContent = IconButton( onPressed: onPressed, icon: icon, + iconSize: 24, color: isSelected ? Theme.of(context).colorScheme.primary : null, style: IconButton.styleFrom( backgroundColor: isSelected diff --git a/lib/pangea/toolbar/widgets/word_zoom/morphs/morphological_list_item.dart b/lib/pangea/toolbar/widgets/word_zoom/morphs/morphological_list_item.dart index 3fa907085..c90b09c73 100644 --- a/lib/pangea/toolbar/widgets/word_zoom/morphs/morphological_list_item.dart +++ b/lib/pangea/toolbar/widgets/word_zoom/morphs/morphological_list_item.dart @@ -36,12 +36,14 @@ class MorphologicalListItem extends StatelessWidget { icon: svgLink != null ? CustomizedSvg( svgUrl: svgLink!, - colorReplacements: { - "white": Theme.of(context).cardColor.hexValue.toString(), - "black": Theme.of(context).brightness == Brightness.dark - ? "white" - : "black", - }, + colorReplacements: + Theme.of(context).brightness == Brightness.dark + ? { + "white": + Theme.of(context).cardColor.hexValue.toString(), + "black": "white", + } + : {}, errorIcon: Icon(icon), ) : Icon(icon),