Sitelet https://github.com/flutter/flutter/pull/81067/files
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/flutter/lib/src/material/stepper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
AnimatedSize(
curve: Curves.fastOutSlowIn,
duration: kThemeAnimationDuration,
vsync: this,
child: widget.steps[widget.currentStep].content,
),
_buildVerticalControls(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 0 additions & 1 deletion packages/flutter/lib/src/widgets/animated_cross_fade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ class _AnimatedCrossFadeState extends State<AnimatedCrossFade> with TickerProvid
duration: widget.duration,
reverseDuration: widget.reverseDuration,
curve: widget.sizeCurve,
vsync: this,
child: widget.layoutBuilder(topChild, topKey, bottomChild, bottomKey),
),
);
Expand Down
7 changes: 5 additions & 2 deletions packages/flutter/lib/src/widgets/animated_size.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
62 changes: 24 additions & 38 deletions packages/flutter/test/widgets/animated_size_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -228,7 +220,6 @@ void main() {
const Center(
child: AnimatedSize(
duration: Duration(milliseconds: 200),
vsync: TestVSync(),
child: SizedBox(
width: 100.0,
height: 100.0,
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -303,7 +291,6 @@ void main() {
Center(
child: AnimatedSize(
duration: const Duration(milliseconds: 200),
vsync: tester,
clipBehavior: clip,
child: const SizedBox(
width: 100.0,
Expand All @@ -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,
Expand Down