From 0cbe77b385419007c03f27b0681b9651b7cdd0bd Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 11 Dec 2023 00:08:24 +0100 Subject: [PATCH] rtl icon fix --- lib/theme/icons.dart | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/theme/icons.dart b/lib/theme/icons.dart index 3a53625c6..667be39d0 100644 --- a/lib/theme/icons.dart +++ b/lib/theme/icons.dart @@ -32,7 +32,11 @@ class AIcons { static const folder = Icons.folder_outlined; static const grid = Icons.grid_on_outlined; static const home = Icons.home_outlined; - static const important = Icons.label_important_outline; + + // as of Flutter v3.16.3, + // `label_important_outlined` matches text direction but is filled + // `label_important_outline` is outlined but does not match text direction + static final important = Icons.label_important_outline.copyWith(matchTextDirection: true); static const language = Icons.translate_outlined; static const location = Icons.place_outlined; static const locationUnlocated = Icons.location_off_outlined; @@ -181,3 +185,17 @@ class AIcons { static final github = MdiIcons.github; static final legal = MdiIcons.scaleBalance; } + +extension ExtraIconData on IconData { + IconData copyWith({ + bool? matchTextDirection, + }) { + return IconData( + codePoint, + fontFamily: fontFamily, + fontPackage: fontPackage, + matchTextDirection: matchTextDirection ?? this.matchTextDirection, + fontFamilyFallback: fontFamilyFallback, + ); + } +}