diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart index 62178c8d7b..267716e6d2 100755 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -713,7 +713,6 @@ class _StepperState extends State with TickerProviderStateMixin { AnimatedSize( curve: Curves.fastOutSlowIn, duration: kThemeAnimationDuration, - vsync: this, child: widget.steps[widget.currentStep].content, ), _buildVerticalControls(), diff --git a/packages/flutter/lib/src/material/text_selection_toolbar.dart b/packages/flutter/lib/src/material/text_selection_toolbar.dart index e1f5555dda..229159a79f 100644 --- a/packages/flutter/lib/src/material/text_selection_toolbar.dart +++ b/packages/flutter/lib/src/material/text_selection_toolbar.dart @@ -189,7 +189,6 @@ class _TextSelectionToolbarOverflowableState extends State<_TextSelectionToolbar overflowOpen: _overflowOpen, textDirection: Directionality.of(context), child: AnimatedSize( - vsync: this, // This duration was eyeballed on a Pixel 2 emulator running Android // API 28. duration: const Duration(milliseconds: 140), diff --git a/packages/flutter/lib/src/widgets/animated_cross_fade.dart b/packages/flutter/lib/src/widgets/animated_cross_fade.dart index 8a386f698b..0ee3fa6c08 100644 --- a/packages/flutter/lib/src/widgets/animated_cross_fade.dart +++ b/packages/flutter/lib/src/widgets/animated_cross_fade.dart @@ -366,7 +366,6 @@ class _AnimatedCrossFadeState extends State with TickerProvid duration: widget.duration, reverseDuration: widget.reverseDuration, curve: widget.sizeCurve, - vsync: this, child: widget.layoutBuilder(topChild, topKey, bottomChild, bottomKey), ), ); diff --git a/packages/flutter/lib/src/widgets/animated_size.dart b/packages/flutter/lib/src/widgets/animated_size.dart index bcf7cc80d2..87697f3861 100644 --- a/packages/flutter/lib/src/widgets/animated_size.dart +++ b/packages/flutter/lib/src/widgets/animated_size.dart @@ -60,8 +60,11 @@ class AnimatedSize extends StatefulWidget { this.curve = Curves.linear, required this.duration, this.reverseDuration, - // TODO(jsimmons): deprecate when customers tests are updated. - TickerProvider? vsync, // ignore: avoid_unused_constructor_parameters + @Deprecated( + 'This field is now ignored. ' + 'This feature was deprecated after v2.2.0-10.1.pre.' + ) + TickerProvider? vsync, this.clipBehavior = Clip.hardEdge, }) : assert(clipBehavior != null), super(key: key); diff --git a/packages/flutter/test/widgets/animated_size_test.dart b/packages/flutter/test/widgets/animated_size_test.dart index 606efe5776..ddbb444eda 100644 --- a/packages/flutter/test/widgets/animated_size_test.dart +++ b/packages/flutter/test/widgets/animated_size_test.dart @@ -19,11 +19,10 @@ void main() { group('AnimatedSize', () { testWidgets('animates forwards then backwards with stable-sized children', (WidgetTester tester) async { await tester.pumpWidget( - Center( + const Center( child: AnimatedSize( - duration: const Duration(milliseconds: 200), - vsync: tester, - child: const SizedBox( + duration: Duration(milliseconds: 200), + child: SizedBox( width: 100.0, height: 100.0, ), @@ -36,11 +35,10 @@ void main() { expect(box.size.height, equals(100.0)); await tester.pumpWidget( - Center( + const Center( child: AnimatedSize( - duration: const Duration(milliseconds: 200), - vsync: tester, - child: const SizedBox( + duration: Duration(milliseconds: 200), + child: SizedBox( width: 200.0, height: 200.0, ), @@ -63,11 +61,10 @@ void main() { expect(box.size.height, equals(200.0)); await tester.pumpWidget( - Center( + const Center( child: AnimatedSize( - duration: const Duration(milliseconds: 200), - vsync: tester, - child: const SizedBox( + duration: Duration(milliseconds: 200), + child: SizedBox( width: 100.0, height: 100.0, ), @@ -92,14 +89,13 @@ void main() { testWidgets('clamps animated size to constraints', (WidgetTester tester) async { await tester.pumpWidget( - Center( + const Center( child: SizedBox ( width: 100.0, height: 100.0, child: AnimatedSize( - duration: const Duration(milliseconds: 200), - vsync: tester, - child: const SizedBox( + duration: Duration(milliseconds: 200), + child: SizedBox( width: 100.0, height: 100.0, ), @@ -114,14 +110,13 @@ void main() { // Attempt to animate beyond the outer SizedBox. await tester.pumpWidget( - Center( + const Center( child: SizedBox ( width: 100.0, height: 100.0, child: AnimatedSize( - duration: const Duration(milliseconds: 200), - vsync: tester, - child: const SizedBox( + duration: Duration(milliseconds: 200), + child: SizedBox( width: 200.0, height: 200.0, ), @@ -158,7 +153,6 @@ void main() { Center( child: AnimatedSize( duration: const Duration(milliseconds: 200), - vsync: tester, child: AnimatedContainer( duration: const Duration(milliseconds: 100), width: 100.0, @@ -175,7 +169,6 @@ void main() { Center( child: AnimatedSize( duration: const Duration(milliseconds: 200), - vsync: tester, child: AnimatedContainer( duration: const Duration(milliseconds: 100), width: 200.0, @@ -204,7 +197,6 @@ void main() { Center( child: AnimatedSize( duration: const Duration(milliseconds: 200), - vsync: tester, child: AnimatedContainer( duration: const Duration(milliseconds: 1), width: 100.0, @@ -228,7 +220,6 @@ void main() { const Center( child: AnimatedSize( duration: Duration(milliseconds: 200), - vsync: TestVSync(), child: SizedBox( width: 100.0, height: 100.0, @@ -238,11 +229,10 @@ void main() { ); await tester.pumpWidget( - Center( + const Center( child: AnimatedSize( - duration: const Duration(milliseconds: 200), - vsync: tester, - child: const SizedBox( + duration: Duration(milliseconds: 200), + child: SizedBox( width: 200.0, height: 100.0, ), @@ -258,11 +248,10 @@ void main() { testWidgets('does not run animation unnecessarily', (WidgetTester tester) async { await tester.pumpWidget( - Center( + const Center( child: AnimatedSize( - duration: const Duration(milliseconds: 200), - vsync: tester, - child: const SizedBox( + duration: Duration(milliseconds: 200), + child: SizedBox( width: 100.0, height: 100.0, ), @@ -282,11 +271,10 @@ void main() { testWidgets('can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget( - Center( + const Center( child: AnimatedSize( - duration: const Duration(milliseconds: 200), - vsync: tester, - child: const SizedBox( + duration: Duration(milliseconds: 200), + child: SizedBox( width: 100.0, height: 100.0, ), @@ -303,7 +291,6 @@ void main() { Center( child: AnimatedSize( duration: const Duration(milliseconds: 200), - vsync: tester, clipBehavior: clip, child: const SizedBox( width: 100.0, @@ -327,7 +314,6 @@ void main() { AnimatedSize( duration: const Duration(milliseconds: 200), curve: Curves.easeInOutBack, - vsync: tester, child: SizedBox( width: size.width, height: size.height,