Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2a6ed0a8
Unverified
Commit
2a6ed0a8
authored
Feb 16, 2018
by
Matt Sullivan
Committed by
GitHub
Feb 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sample code to AnimatedOpacity API docs (#14730)
* Added sample code to AnimatedOpacity docs
parent
31a0a5f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
implicit_animations.dart
packages/flutter/lib/src/widgets/implicit_animations.dart
+35
-0
No files found.
packages/flutter/lib/src/widgets/implicit_animations.dart
View file @
2a6ed0a8
...
@@ -906,6 +906,41 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat
...
@@ -906,6 +906,41 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat
///
///
/// Animating an opacity is relatively expensive because it requires painting
/// Animating an opacity is relatively expensive because it requires painting
/// the child into an intermediate buffer.
/// the child into an intermediate buffer.
///
/// ## Sample code
///
/// ```dart
/// class LogoFade extends StatefulWidget {
/// @override
/// createState() => new LogoFadeState();
/// }
///
/// class LogoFadeState extends State<LogoFade> {
/// 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
{
class
AnimatedOpacity
extends
ImplicitlyAnimatedWidget
{
/// Creates a widget that animates its opacity implicitly.
/// Creates a widget that animates its opacity implicitly.
///
///
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment