Show accessibility frame while scrolling (#12039)
* Show accessibility frame while scrolling * ++ * fix test
This commit is contained in:
parent
3ee1495c99
commit
ecb56927de
@ -487,6 +487,7 @@ class ScrollableState extends State<Scrollable> with TickerProviderStateMixin
|
|||||||
child: new IgnorePointer(
|
child: new IgnorePointer(
|
||||||
key: _ignorePointerKey,
|
key: _ignorePointerKey,
|
||||||
ignoring: _shouldIgnorePointer,
|
ignoring: _shouldIgnorePointer,
|
||||||
|
ignoringSemantics: false,
|
||||||
child: new _ScrollableScope(
|
child: new _ScrollableScope(
|
||||||
scrollable: this,
|
scrollable: this,
|
||||||
position: position,
|
position: position,
|
||||||
|
@ -239,7 +239,7 @@ void main() {
|
|||||||
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
|
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
|
||||||
' │ size: Size(800.0, 600.0)\n'
|
' │ size: Size(800.0, 600.0)\n'
|
||||||
' │ ignoring: false\n'
|
' │ ignoring: false\n'
|
||||||
' │ ignoringSemantics: implicitly false\n'
|
' │ ignoringSemantics: false\n'
|
||||||
' │\n'
|
' │\n'
|
||||||
' └─child: RenderViewport#00000\n'
|
' └─child: RenderViewport#00000\n'
|
||||||
' │ parentData: <none> (can use size)\n'
|
' │ parentData: <none> (can use size)\n'
|
||||||
@ -344,7 +344,7 @@ void main() {
|
|||||||
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
|
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
|
||||||
' │ size: Size(800.0, 600.0)\n'
|
' │ size: Size(800.0, 600.0)\n'
|
||||||
' │ ignoring: false\n'
|
' │ ignoring: false\n'
|
||||||
' │ ignoringSemantics: implicitly false\n'
|
' │ ignoringSemantics: false\n'
|
||||||
' │\n'
|
' │\n'
|
||||||
' └─child: RenderViewport#00000\n'
|
' └─child: RenderViewport#00000\n'
|
||||||
' │ parentData: <none> (can use size)\n'
|
' │ parentData: <none> (can use size)\n'
|
||||||
|
@ -226,6 +226,33 @@ void main() {
|
|||||||
|
|
||||||
semantics.dispose();
|
semantics.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('Semantics tree is populated mid-scroll', (WidgetTester tester) async {
|
||||||
|
final SemanticsTester semantics = new SemanticsTester(tester);
|
||||||
|
|
||||||
|
final List<Widget> children = <Widget>[];
|
||||||
|
for (int i = 0; i < 80; i++)
|
||||||
|
children.add(new Container(
|
||||||
|
child: new Text('Item $i'),
|
||||||
|
height: 40.0,
|
||||||
|
));
|
||||||
|
await tester.pumpWidget(
|
||||||
|
new Directionality(
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
|
child: new ListView(children: children),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(ListView)));
|
||||||
|
await gesture.moveBy(const Offset(0.0, -40.0));
|
||||||
|
await tester.pump();
|
||||||
|
|
||||||
|
expect(semantics, includesNodeWith(label: 'Item 1'));
|
||||||
|
expect(semantics, includesNodeWith(label: 'Item 2'));
|
||||||
|
expect(semantics, includesNodeWith(label: 'Item 3'));
|
||||||
|
|
||||||
|
semantics.dispose();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Null> flingUp(WidgetTester tester, { int repetitions: 1 }) async {
|
Future<Null> flingUp(WidgetTester tester, { int repetitions: 1 }) async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user