diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index 7a36d2e621..4a58459ed1 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -436,6 +436,51 @@ class RotationTransition extends AnimatedWidget { /// animated by a [CurvedAnimation] set to [Curves.fastOutSlowIn]: /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/size_transition.mp4} /// +/// {@tool dartpad --template=stateful_widget_material_ticker} +/// +/// This code defines a widget that uses [SizeTransition] to change the size +/// of [FlutterLogo] continually. It is built with a [Scaffold] +/// where the internal widget has space to change its size. +/// +/// ```dart +/// AnimationController _controller; +/// Animation _animation; +/// +/// @override +/// void initState() { +/// super.initState(); +/// _controller = AnimationController( +/// duration: const Duration(seconds: 3), +/// vsync: this, +/// )..repeat(); +/// _animation = CurvedAnimation( +/// parent: _controller, +/// curve: Curves.fastOutSlowIn, +/// ); +/// } +/// +/// @override +/// void dispose() { +/// super.dispose(); +/// _controller.dispose(); +/// } +/// +/// @override +/// Widget build(BuildContext context) { +/// return Scaffold( +/// body: SizeTransition( +/// sizeFactor: _animation, +/// axis: Axis.horizontal, +/// axisAlignment: -1, +/// child: Center( +/// child: FlutterLogo(size: 200.0), +/// ), +/// ), +/// ); +/// } +/// ``` +/// {@end-tool} +/// /// See also: /// /// * [AnimatedCrossFade], for a widget that automatically animates between