Skip to content

Commit d488205

Browse files
[raw_menu_anchor.0.dart] Remove misdrawn emojis. (#162807)
This PR removes the leading emojis displayed on the RawMenuAnchor example. I knew emojis usually showed up monochrome on web, but code samples also appear to incorrectly display the emoji source. Because this change doesn't affect the menu's functionality, I didn't include additional tests, but I'd be happy to add tests if needed. One test was modified to account for menu items no longer having a leading icon. <img width="1247" alt="image" src="https://github.com/user-attachments/assets/58a338c8-c882-4ad1-af44-596d91e9f382" /> Fixes flutter/flutter#162806 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Tirth <[email protected]>
1 parent 2d30cae commit d488205

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

examples/api/lib/widgets/raw_menu_anchor/raw_menu_anchor.0.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ void main() {
1212
}
1313

1414
enum Animal {
15-
cat('Cat', leading: Text('🦁')),
16-
kitten('Kitten', leading: Text('🐱')),
17-
felisCatus('Felis catus', leading: Text('🐈')),
18-
dog('Dog', leading: Text('🐕'));
15+
cat('Cat'),
16+
kitten('Kitten'),
17+
felisCatus('Felis catus'),
18+
dog('Dog');
1919

20-
const Animal(this.label, {this.leading});
20+
const Animal(this.label);
2121
final String label;
22-
final Widget? leading;
2322
}
2423

2524
class RawMenuAnchorExample extends StatefulWidget {
@@ -81,7 +80,6 @@ class _RawMenuAnchorExampleState extends State<RawMenuAnchorExample> {
8180
});
8281
controller.close();
8382
},
84-
leadingIcon: SizedBox(width: 24, child: Center(child: animal.leading)),
8583
trailingIcon:
8684
_selectedAnimal == animal ? const Icon(Icons.check, size: 20) : null,
8785
child: Text(animal.label),

examples/api/test/widgets/raw_menu_anchor/raw_menu_anchor.0_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void main() {
2727
expect(find.text(dogLabel), findsOneWidget);
2828
expect(
2929
tester.getRect(find.ancestor(of: find.text(catLabel), matching: find.byType(TapRegion))),
30-
rectMoreOrLessEquals(const Rect.fromLTRB(447.2, 328.0, 662.3, 532.0), epsilon: 0.1),
30+
rectMoreOrLessEquals(const Rect.fromLTRB(447.2, 328.0, 626.3, 532.0), epsilon: 0.1),
3131
);
3232

3333
// Close the menu.
@@ -90,7 +90,7 @@ void main() {
9090

9191
expect(
9292
tester.getRect(find.ancestor(of: find.text(catLabel), matching: find.byType(TapRegion))),
93-
rectMoreOrLessEquals(const Rect.fromLTRB(447.2, 328.0, 662.3, 532.0), epsilon: 0.1),
93+
rectMoreOrLessEquals(const Rect.fromLTRB(447.2, 328.0, 626.3, 532.0), epsilon: 0.1),
9494
);
9595

9696
expect(

0 commit comments

Comments
 (0)