File tree Expand file tree Collapse file tree 5 files changed +10
-14
lines changed Expand file tree Collapse file tree 5 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,8 @@ class MenuApp extends StatelessWidget {
101101
102102 @override
103103 Widget build (BuildContext context) {
104- return MaterialApp (
105- theme: ThemeData (useMaterial3: true ),
106- home: const Scaffold (body: SafeArea (child: MyCheckboxMenu (message: kMessage))),
104+ return const MaterialApp (
105+ home: Scaffold (body: SafeArea (child: MyCheckboxMenu (message: kMessage))),
107106 );
108107 }
109108}
Original file line number Diff line number Diff line change @@ -103,7 +103,6 @@ class MenuAcceleratorApp extends StatelessWidget {
103103 @override
104104 Widget build (BuildContext context) {
105105 return MaterialApp (
106- theme: ThemeData (useMaterial3: true ),
107106 home: Shortcuts (
108107 shortcuts: < ShortcutActivator , Intent > {
109108 const SingleActivator (LogicalKeyboardKey .keyT, control: true ): VoidCallbackIntent (() {
Original file line number Diff line number Diff line change @@ -202,9 +202,8 @@ class MenuApp extends StatelessWidget {
202202
203203 @override
204204 Widget build (BuildContext context) {
205- return MaterialApp (
206- theme: ThemeData (useMaterial3: true ),
207- home: const Scaffold (body: SafeArea (child: MyCascadingMenu (message: kMessage))),
205+ return const MaterialApp (
206+ home: Scaffold (body: SafeArea (child: MyCascadingMenu (message: kMessage))),
208207 );
209208 }
210209}
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
66
77/// Flutter code sample for [MenuAnchor] .
88
9-
109void main () => runApp (const MenuAnchorApp ());
1110
1211// This is the type used by the menu below.
@@ -17,9 +16,8 @@ class MenuAnchorApp extends StatelessWidget {
1716
1817 @override
1918 Widget build (BuildContext context) {
20- return MaterialApp (
21- theme: ThemeData (useMaterial3: true ),
22- home: const MenuAnchorExample (),
19+ return const MaterialApp (
20+ home: MenuAnchorExample (),
2321 );
2422 }
2523}
@@ -43,8 +41,7 @@ class _MenuAnchorExampleState extends State<MenuAnchorExample> {
4341 ),
4442 body: Center (
4543 child: MenuAnchor (
46- builder:
47- (BuildContext context, MenuController controller, Widget ? child) {
44+ builder: (BuildContext context, MenuController controller, Widget ? child) {
4845 return IconButton (
4946 onPressed: () {
5047 if (controller.isOpen) {
@@ -55,7 +52,8 @@ class _MenuAnchorExampleState extends State<MenuAnchorExample> {
5552 },
5653 icon: const Icon (Icons .more_horiz),
5754 tooltip: 'Show menu' ,
58- );},
55+ );
56+ },
5957 menuChildren: List <MenuItemButton >.generate (
6058 3 ,
6159 (int index) => MenuItemButton (
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ void main() {
5151 expect (find.text (example.MenuBarApp .kMessage), findsOneWidget);
5252 expect (find.text ('Last Selected: Show Message' ), findsOneWidget);
5353 });
54+
5455 testWidgets ('Shortcuts work' , (WidgetTester tester) async {
5556 await tester.pumpWidget (
5657 const example.MenuBarApp (),
You can’t perform that action at this time.
0 commit comments