diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index fa0398475cc..95a5e640ffc 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -660,7 +660,49 @@ class SizeTransition extends AnimatedWidget { /// Here's an illustration of the [FadeTransition] widget, with it's [opacity] /// animated by a [CurvedAnimation] set to [Curves.fastOutSlowIn]: /// -/// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/fade_transition.mp4} +/// {@tool dartpad --template=stateful_widget_material_ticker} +/// +/// The following code implements the [FadeTransition] using +/// the Flutter logo: +/// +/// ```dart +/// AnimationController _controller; +/// Animation _animation; +/// +/// @override +/// void initState() { +/// super.initState(); +/// _controller = AnimationController( +/// duration: const Duration(seconds: 2), +/// vsync: this, +/// )..repeat(reverse: true); +/// _animation = CurvedAnimation( +/// parent: _controller, +/// curve: Curves.easeIn, +/// ); +/// } +/// +/// @override +/// void dispose() { +/// _controller.dispose(); +/// super.dispose(); +/// } +/// +/// @override +/// Widget build(BuildContext context) { +/// return Container( +/// color: Colors.white, +/// child: FadeTransition( +/// opacity: _animation, +/// child: const Padding( +/// padding: EdgeInsets.all(8), +/// child: FlutterLogo() +/// ), +/// ), +/// ); +/// } +/// ``` +/// {@end-tool} /// /// See also: ///