Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f0e32fc6
Unverified
Commit
f0e32fc6
authored
Jun 01, 2023
by
Hans Muller
Committed by
GitHub
Jun 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Menu examples (#128080)
parent
ffe94a22
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
10 deletions
+13
-10
menu_accelerator_label.0.dart
...pi/lib/material/menu_anchor/menu_accelerator_label.0.dart
+1
-0
menu_anchor.0.dart
examples/api/lib/material/menu_anchor/menu_anchor.0.dart
+3
-2
menu_anchor.1.dart
examples/api/lib/material/menu_anchor/menu_anchor.1.dart
+3
-2
menu_accelerator_label.0_test.dart
...t/material/menu_anchor/menu_accelerator_label.0_test.dart
+4
-4
menu_anchor.1_test.dart
...les/api/test/material/menu_anchor/menu_anchor.1_test.dart
+2
-2
No files found.
examples/api/lib/material/menu_anchor/menu_accelerator_label.0.dart
View file @
f0e32fc6
...
...
@@ -103,6 +103,7 @@ class MenuAcceleratorApp extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
true
),
home:
Shortcuts
(
shortcuts:
<
ShortcutActivator
,
Intent
>{
const
SingleActivator
(
LogicalKeyboardKey
.
keyT
,
control:
true
):
VoidCallbackIntent
(()
{
...
...
examples/api/lib/material/menu_anchor/menu_anchor.0.dart
View file @
f0e32fc6
...
...
@@ -202,8 +202,9 @@ class MenuApp extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
const
MaterialApp
(
home:
Scaffold
(
body:
MyCascadingMenu
(
message:
kMessage
)),
return
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
true
),
home:
const
Scaffold
(
body:
MyCascadingMenu
(
message:
kMessage
)),
);
}
}
examples/api/lib/material/menu_anchor/menu_anchor.1.dart
View file @
f0e32fc6
...
...
@@ -201,8 +201,9 @@ class ContextMenuApp extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
const
MaterialApp
(
home:
Scaffold
(
body:
MyContextMenu
(
message:
kMessage
)),
return
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
true
),
home:
const
Scaffold
(
body:
MyContextMenu
(
message:
kMessage
)),
);
}
}
examples/api/test/material/menu_anchor/menu_accelerator_label.0_test.dart
View file @
f0e32fc6
...
...
@@ -29,7 +29,7 @@ void main() {
expect
(
find
.
text
(
'About'
,
findRichText:
true
),
findsOneWidget
);
expect
(
tester
.
getRect
(
findMenu
(
'About'
)),
equals
(
const
Rect
.
fromLTRB
(
4.0
,
48.0
,
98
.0
,
208.0
)),
equals
(
const
Rect
.
fromLTRB
(
4.0
,
48.0
,
111
.0
,
208.0
)),
);
expect
(
find
.
text
(
'Save'
,
findRichText:
true
),
findsOneWidget
);
expect
(
find
.
text
(
'Quit'
,
findRichText:
true
),
findsOneWidget
);
...
...
@@ -45,10 +45,10 @@ void main() {
expect
(
find
.
text
(
'Quit'
,
findRichText:
true
),
findsNothing
);
expect
(
find
.
text
(
'Magnify'
,
findRichText:
true
),
findsNothing
);
expect
(
find
.
text
(
'Minify'
,
findRichText:
true
),
findsNothing
);
expect
(
find
.
text
(
'C
LOSE
'
),
findsOneWidget
);
expect
(
find
.
text
(
'C
lose
'
),
findsOneWidget
);
await
tester
.
tap
(
find
.
text
(
'C
LOSE
'
));
await
tester
.
tap
(
find
.
text
(
'C
lose
'
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'C
LOSE
'
),
findsNothing
);
expect
(
find
.
text
(
'C
lose
'
),
findsNothing
);
});
}
examples/api/test/material/menu_anchor/menu_anchor.1_test.dart
View file @
f0e32fc6
...
...
@@ -21,14 +21,14 @@ void main() {
await
tester
.
sendKeyDownEvent
(
LogicalKeyboardKey
.
controlRight
);
await
tester
.
tapAt
(
const
Offset
(
100
,
200
));
await
tester
.
pump
();
expect
(
tester
.
getRect
(
findMenu
()),
equals
(
const
Rect
.
fromLTRB
(
100.0
,
200.0
,
388
.0
,
360.0
)));
expect
(
tester
.
getRect
(
findMenu
()),
equals
(
const
Rect
.
fromLTRB
(
100.0
,
200.0
,
433
.0
,
360.0
)));
// Make sure tapping in a different place causes the menu to move.
await
tester
.
tapAt
(
const
Offset
(
200
,
100
));
await
tester
.
pump
();
await
tester
.
sendKeyUpEvent
(
LogicalKeyboardKey
.
controlRight
);
expect
(
tester
.
getRect
(
findMenu
()),
equals
(
const
Rect
.
fromLTRB
(
200.0
,
100.0
,
488
.0
,
260.0
)));
expect
(
tester
.
getRect
(
findMenu
()),
equals
(
const
Rect
.
fromLTRB
(
200.0
,
100.0
,
533
.0
,
260.0
)));
expect
(
find
.
text
(
example
.
MenuEntry
.
about
.
label
),
findsOneWidget
);
expect
(
find
.
text
(
example
.
MenuEntry
.
showMessage
.
label
),
findsOneWidget
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment