From c78130264384936547b51e8f3e1184dd1dd879a6 Mon Sep 17 00:00:00 2001
From: Mitchell Goodwin <58190796+MitchellGoodwin@users.noreply.github.com>
Date: Wed, 13 Dec 2023 12:59:00 -0800
Subject: [PATCH] Swap iOS back button icon in Material app bar (#134754)
Fixes #128555.
Changes the back icon for the Material app bar when running on Apple devices from `arrow_back_ios` to `arrow_back_ios_new_rounded`, as the old version of the icon wasn't centered (https://github.com/google/material-design-icons/issues/824) and the native back icon, as well as the one in Cupertino, are rounded.
| Before | After |
| ------------- | ------------- |
|
|
|
New icon works as expected with RTL:
---
packages/flutter/lib/src/material/action_buttons.dart | 2 +-
packages/flutter/test/material/scaffold_test.dart | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/flutter/lib/src/material/action_buttons.dart b/packages/flutter/lib/src/material/action_buttons.dart
index b57a801ba45..7ec0d7d3a21 100644
--- a/packages/flutter/lib/src/material/action_buttons.dart
+++ b/packages/flutter/lib/src/material/action_buttons.dart
@@ -153,7 +153,7 @@ class BackButtonIcon extends StatelessWidget {
return Icons.arrow_back;
case TargetPlatform.iOS:
case TargetPlatform.macOS:
- return Icons.arrow_back_ios;
+ return Icons.arrow_back_ios_new_rounded;
}
},
getAndroidSemanticsLabel: (MaterialLocalizations materialLocalization) {
diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart
index 8476d4f0e34..949021da4cb 100644
--- a/packages/flutter/test/material/scaffold_test.dart
+++ b/packages/flutter/test/material/scaffold_test.dart
@@ -856,7 +856,7 @@ void main() {
}, variant: const TargetPlatformVariant({ TargetPlatform.android, TargetPlatform.fuchsia }));
testWidgetsWithLeakTracking('Back arrow uses correct default', (WidgetTester tester) async {
- await expectBackIcon(tester, kIsWeb ? Icons.arrow_back : Icons.arrow_back_ios);
+ await expectBackIcon(tester, kIsWeb ? Icons.arrow_back : Icons.arrow_back_ios_new_rounded);
}, variant: const TargetPlatformVariant({ TargetPlatform.iOS, TargetPlatform.macOS }));
});