Skip to content
GitLab
Menu
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
mirror
flutter
Commits
f6aad629
Commit
f6aad629
authored
1 year ago
by
Daco Harkes
Browse files
Options
Download
Plain Diff
Merge branch 'main' into native-assets-linux
parents
50fde55e
cf317b5a
native-assets-linux
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bin/internal/engine.version
+1
-1
bin/internal/engine.version
bin/internal/fuchsia-mac.version
+1
-1
bin/internal/fuchsia-mac.version
examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart
+6
-0
examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart
examples/api/test/material/dropdown_menu/dropdown_menu.0_test.dart
+22
-0
...api/test/material/dropdown_menu/dropdown_menu.0_test.dart
with
30 additions
and
2 deletions
+30
-2
bin/internal/engine.version
+
1
-
1
View file @
f6aad629
51a402860f5b537720b72af69a98ad85209671e7
77965cabbaf96e62df3b78d500629b7f23b877ec
This diff is collapsed.
Click to expand it.
bin/internal/fuchsia-mac.version
+
1
-
1
View file @
f6aad629
2TJNsB32jPioIfFaoLtDUK2JsGct6o1oo_fISGZ_vWg
C
3_Lh8otTpmVuf-Zwb5yQy61cqmV-4g7xjO1wsANaeC0
C
This diff is collapsed.
Click to expand it.
examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart
+
6
-
0
View file @
f6aad629
...
...
@@ -74,6 +74,11 @@ class _DropdownMenuExampleState extends State<DropdownMenuExample> {
DropdownMenu
<
ColorLabel
>(
initialSelection:
ColorLabel
.
green
,
controller:
colorController
,
// requestFocusOnTap is enabled/disabled by platforms when it is null.
// On mobile platforms, this is false by default. Setting this to true will
// trigger focus request on the text field and virtual keyboard will appear
// afterward. On desktop platforms however, this defaults to true.
requestFocusOnTap:
true
,
label:
const
Text
(
'Color'
),
onSelected:
(
ColorLabel
?
color
)
{
setState
(()
{
...
...
@@ -97,6 +102,7 @@ class _DropdownMenuExampleState extends State<DropdownMenuExample> {
DropdownMenu
<
IconLabel
>(
controller:
iconController
,
enableFilter:
true
,
requestFocusOnTap:
true
,
leadingIcon:
const
Icon
(
Icons
.
search
),
label:
const
Text
(
'Icon'
),
inputDecorationTheme:
const
InputDecorationTheme
(
...
...
This diff is collapsed.
Click to expand it.
examples/api/test/material/dropdown_menu/dropdown_menu.0_test.dart
+
22
-
0
View file @
f6aad629
...
...
@@ -52,4 +52,26 @@ void main() {
expect
(
find
.
text
(
'You selected a Blue Smile'
),
findsOneWidget
);
});
testWidgets
(
'DropdownMenu has focus when tapping on the text field'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
example
.
DropdownMenuExample
(),
);
// Make sure the dropdown menus are there.
final
Finder
colorMenu
=
find
.
byType
(
DropdownMenu
<
example
.
ColorLabel
>);
final
Finder
iconMenu
=
find
.
byType
(
DropdownMenu
<
example
.
IconLabel
>);
expect
(
colorMenu
,
findsOneWidget
);
expect
(
iconMenu
,
findsOneWidget
);
// Tap on the color menu and make sure it is focused.
await
tester
.
tap
(
colorMenu
);
await
tester
.
pumpAndSettle
();
expect
(
FocusScope
.
of
(
tester
.
element
(
colorMenu
))
.
hasFocus
,
isTrue
);
// Tap on the icon menu and make sure it is focused.
await
tester
.
tap
(
iconMenu
);
await
tester
.
pumpAndSettle
();
expect
(
FocusScope
.
of
(
tester
.
element
(
iconMenu
))
.
hasFocus
,
isTrue
);
});
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Projects
Groups
Snippets