diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index f03bbc66a0..1ae0e04777 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -906,6 +906,41 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState new LogoFadeState(); +/// } +/// +/// class LogoFadeState extends State { +/// double opacityLevel = 1.0; +/// +/// _changeOpacity() { +/// setState(() => opacityLevel = opacityLevel == 0 ? 1.0 : 0.0); +/// } +/// +/// @override +/// Widget build(BuildContext context) { +/// return new Column( +/// mainAxisAlignment: MainAxisAlignment.center, +/// children: [ +/// new AnimatedOpacity( +/// opacity: opacityLevel, +/// duration: new Duration(seconds: 3), +/// child: new FlutterLogo(), +/// ), +/// new RaisedButton( +/// child: new Text('Fade Logo'), +/// onPressed: _changeOpacity, +/// ), +/// ], +/// ); +/// } +/// } +/// ``` class AnimatedOpacity extends ImplicitlyAnimatedWidget { /// Creates a widget that animates its opacity implicitly. ///