Unverified Commit a39a8934 authored by sehee Jeong's avatar sehee Jeong Committed by GitHub

Add sample code to FadeTransition (#64240)

parent 2e643651
...@@ -660,7 +660,49 @@ class SizeTransition extends AnimatedWidget { ...@@ -660,7 +660,49 @@ class SizeTransition extends AnimatedWidget {
/// Here's an illustration of the [FadeTransition] widget, with it's [opacity] /// Here's an illustration of the [FadeTransition] widget, with it's [opacity]
/// animated by a [CurvedAnimation] set to [Curves.fastOutSlowIn]: /// 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<double> _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: /// See also:
/// ///
......
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