From 673806fbc16dc396f8bce3a027fda871ff1aa841 Mon Sep 17 00:00:00 2001
From: Elliott Brooks <21270878+elliette@users.noreply.github.com>
Date: Tue, 20 May 2025 09:52:05 -0700
Subject: [PATCH] [CP: 3.32] [Widget Inspector] Update on-device inspector
button to generic unicode icon (#169092)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
### Issue Link:
What is the link to the issue this cherry-pick is addressing?
https://github.com/flutter/flutter/issues/168846
### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples
This cherry pick fixes an issue where some users would see a question mark instead of the appropriate icon in the widget inspector button which toggles select-mode on/off.
### Impact Description:
Users who don't have `cupertino_icons` as a dependency in their pubspec will see a question mark in one of the widget inspector buttons.
### Workaround:
Is there a workaround for this issue?
Yes, add `cupertino_icons` package to user's pubspec.
### Risk:
What is the risk level of this cherry-pick?
Low
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
This was tested manually, there are no screenshot tests for this. However, this is only a UI change and not a behavior change.
### Validation Steps:
What are the steps to validate that this fix works?
1. Run an app that doesn't have `cupertino_icons` in its pubspec
2. Open Flutter DevTools > Inspector
3. Enable select widget mode
4. Should not see a ? on any of the buttons
---
packages/flutter/lib/src/cupertino/app.dart | 6 +++---
packages/flutter/lib/src/material/app.dart | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/packages/flutter/lib/src/cupertino/app.dart b/packages/flutter/lib/src/cupertino/app.dart
index fc13d4e99a..1deda1f9dd 100644
--- a/packages/flutter/lib/src/cupertino/app.dart
+++ b/packages/flutter/lib/src/cupertino/app.dart
@@ -568,9 +568,9 @@ class _CupertinoAppState extends State {
return _CupertinoInspectorButton.toggle(
onPressed: onPressed,
semanticLabel: semanticLabel,
- // This icon is also used for the Material-styled button and for DevTools.
- // It should be updated in all 3 places if changed.
- icon: CupertinoIcons.cursor_rays,
+ // This unicode icon is also used for the Material-styled button and for
+ // DevTools. It should be updated in all 3 places if changed.
+ icon: const IconData(0x1F74A),
toggledOn: selectionOnTapEnabled,
);
}
diff --git a/packages/flutter/lib/src/material/app.dart b/packages/flutter/lib/src/material/app.dart
index d2083c0353..7c3f9f61bc 100644
--- a/packages/flutter/lib/src/material/app.dart
+++ b/packages/flutter/lib/src/material/app.dart
@@ -971,9 +971,9 @@ class _MaterialAppState extends State {
return _MaterialInspectorButton.toggle(
onPressed: onPressed,
semanticLabel: semanticLabel,
- // This icon is also used for the Cupertino-styled button and for DevTools.
- // It should be updated in all 3 places if changed.
- icon: CupertinoIcons.cursor_rays,
+ // This unicode icon is also used for the Cupertino-styled button and for
+ // DevTools. It should be updated in all 3 places if changed.
+ icon: const IconData(0x1F74A),
isDarkTheme: _isDarkTheme(context),
toggledOn: selectionOnTapEnabled,
);