Unverified Commit a51b8e43 authored by Pierre-Louis's avatar Pierre-Louis Committed by GitHub

Fix text direction logic for material icon variants (#71852)

parent 2cb65260
......@@ -383,8 +383,7 @@ class _Icon {
// e.g. e547
String hexCodepoint;
// TODO(guidezpl): will be fixed in a future PR to be shortId instead of id
String get mirroredInRTL => _iconsMirroredWhenRTL.contains(id) ? ', matchTextDirection: true' : '';
String get mirroredInRTL => _iconsMirroredWhenRTL.contains(shortId) ? ', matchTextDirection: true' : '';
String get name => id.replaceAll('_', ' ');
......
......@@ -17,6 +17,18 @@ void main() {
expect(Icons.search.fontFamily, 'MaterialIcons');
});
testWidgets('Certain icons (and their variants) match text direction', (WidgetTester tester) async {
expect(Icons.arrow_back.matchTextDirection, true);
expect(Icons.arrow_back_rounded.matchTextDirection, true);
expect(Icons.arrow_back_outlined.matchTextDirection, true);
expect(Icons.arrow_back_sharp.matchTextDirection, true);
expect(Icons.access_time.matchTextDirection, false);
expect(Icons.access_time_rounded.matchTextDirection, false);
expect(Icons.access_time_outlined.matchTextDirection, false);
expect(Icons.access_time_sharp.matchTextDirection, false);
});
testWidgets('Adaptive icons are correct on cupertino platforms',
(WidgetTester tester) async {
expect(Icons.adaptive.arrow_back, Icons.arrow_back_ios);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment