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
a98bfd75
Unverified
Commit
a98bfd75
authored
Aug 20, 2018
by
David Shuckerow
Committed by
GitHub
Aug 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap the ReorderableList's children with a MergeSemantics (#20715)
parent
f7864b81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
4 deletions
+66
-4
reorderable_list.dart
packages/flutter/lib/src/material/reorderable_list.dart
+9
-4
reorderable_list_test.dart
packages/flutter/test/material/reorderable_list_test.dart
+57
-0
No files found.
packages/flutter/lib/src/material/reorderable_list.dart
View file @
a98bfd75
...
...
@@ -391,10 +391,15 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T
//
// We also apply the relevant custom accessibility actions for moving the item
// up, down, to the start, and to the end of the list.
return
new
KeyedSubtree
(
key:
keyIndexGlobalKey
,
child:
new
Semantics
(
customSemanticsActions:
semanticsActions
,
child:
toWrap
,
));
return
new
KeyedSubtree
(
key:
keyIndexGlobalKey
,
child:
new
MergeSemantics
(
child:
new
Semantics
(
customSemanticsActions:
semanticsActions
,
child:
toWrap
,
),
),
);
}
Widget
buildDragTarget
(
BuildContext
context
,
List
<
Key
>
acceptedCandidates
,
List
<
dynamic
>
rejectedCandidates
)
{
...
...
packages/flutter/test/material/reorderable_list_test.dart
View file @
a98bfd75
...
...
@@ -350,6 +350,63 @@ void main() {
handle
.
dispose
();
});
testWidgets
(
"Doesn't hide accessibility when a child declares its own semantics"
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
final
Widget
reorderableListView
=
new
ReorderableListView
(
children:
<
Widget
>[
const
SizedBox
(
key:
Key
(
'List tile 1'
),
height:
itemHeight
,
child:
Text
(
'List tile 1'
),
),
new
SizedBox
(
key:
const
Key
(
'Switch tile'
),
height:
itemHeight
,
child:
new
Material
(
child:
new
SwitchListTile
(
title:
const
Text
(
'Switch tile'
),
value:
true
,
onChanged:
(
bool
newValue
)
{},
),
),
),
const
SizedBox
(
key:
Key
(
'List tile 2'
),
height:
itemHeight
,
child:
Text
(
'List tile 2'
),
),
],
scrollDirection:
Axis
.
vertical
,
onReorder:
(
int
oldIndex
,
int
newIndex
)
{},
);
await
tester
.
pumpWidget
(
new
MaterialApp
(
home:
new
SizedBox
(
height:
itemHeight
*
10
,
child:
reorderableListView
,
),
));
// Get the switch tile's semantics:
final
SemanticsData
semanticsData
=
tester
.
getSemanticsData
(
find
.
byKey
(
const
Key
(
'Switch tile'
)));
// Check for properties of both SwitchTile semantics and the ReorderableListView custom semantics actions.
expect
(
semanticsData
,
matchesSemanticsData
(
hasToggledState:
true
,
isToggled:
true
,
isEnabled:
true
,
hasEnabledState:
true
,
label:
'Switch tile'
,
hasTapAction:
true
,
customActions:
const
<
CustomSemanticsAction
>[
CustomSemanticsAction
(
label:
'Move up'
),
CustomSemanticsAction
(
label:
'Move down'
),
CustomSemanticsAction
(
label:
'Move to the end'
),
CustomSemanticsAction
(
label:
'Move to the start'
),
],
));
handle
.
dispose
();
});
});
});
...
...
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