mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix text direction logic for material icon variants (#71852)
This commit is contained in:
parent
2cb652600c
commit
a51b8e4309
@ -383,8 +383,7 @@ class _Icon {
|
|||||||
// e.g. e547
|
// e.g. e547
|
||||||
String hexCodepoint;
|
String hexCodepoint;
|
||||||
|
|
||||||
// TODO(guidezpl): will be fixed in a future PR to be shortId instead of id
|
String get mirroredInRTL => _iconsMirroredWhenRTL.contains(shortId) ? ', matchTextDirection: true' : '';
|
||||||
String get mirroredInRTL => _iconsMirroredWhenRTL.contains(id) ? ', matchTextDirection: true' : '';
|
|
||||||
|
|
||||||
String get name => id.replaceAll('_', ' ');
|
String get name => id.replaceAll('_', ' ');
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,18 @@ void main() {
|
|||||||
expect(Icons.search.fontFamily, 'MaterialIcons');
|
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',
|
testWidgets('Adaptive icons are correct on cupertino platforms',
|
||||||
(WidgetTester tester) async {
|
(WidgetTester tester) async {
|
||||||
expect(Icons.adaptive.arrow_back, Icons.arrow_back_ios);
|
expect(Icons.adaptive.arrow_back, Icons.arrow_back_ios);
|
||||||
|
Loading…
Reference in New Issue
Block a user