Commit 26c36623 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Added a TabBar regression test (#9038)

parent 6bf0ceb0
......@@ -730,4 +730,33 @@ void main() {
expect(indicatorRect2.width, 400.0);
expect(indicatorRect2.height, 2.0);
});
testWidgets('TabBarView child disposed during animation', (WidgetTester tester) async {
// This is a regression test for this patch:
// https://github.com/flutter/flutter/pull/9015
final TabController controller = new TabController(
vsync: const TestVSync(),
length: 2,
);
Widget buildFrame() {
return new Material(
child: new TabBar(
key: new UniqueKey(),
controller: controller,
tabs: <Widget>[ new Text('A'), new Text('B') ],
),
);
}
await tester.pumpWidget(buildFrame());
// The original TabBar will be disposed. The controller should no
// longer have any listeners from the original TabBar.
await tester.pumpWidget(buildFrame());
controller.index = 1;
await tester.pump(const Duration(milliseconds: 300));
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment