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
28f311ad
Unverified
Commit
28f311ad
authored
Aug 04, 2021
by
Taha Tesser
Committed by
GitHub
Aug 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Documentation] Add `AlignTransition` interactive example (#87021)
parent
3391c7e6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+42
-0
No files found.
packages/flutter/lib/src/widgets/transitions.dart
View file @
28f311ad
...
...
@@ -1208,6 +1208,48 @@ class DecoratedBoxTransition extends AnimatedWidget {
///
/// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/align_transition.mp4}
///
/// {@tool dartpad --template=stateful_widget_material_ticker}
/// The following code implements the [AlignTransition] as seen in the video
/// above:
///
/// ```dart
/// // Using `late final` for [lazy initialization](https://dart.dev/null-safety/understanding-null-safety#lazy-initialization).
/// late final AnimationController _controller = AnimationController(
/// duration: const Duration(seconds: 2),
/// vsync: this,
/// )..repeat(reverse: true);
/// late final Animation<AlignmentGeometry> _animation = Tween<AlignmentGeometry>(
/// begin: Alignment.bottomLeft,
/// end: Alignment.center,
/// ).animate(
/// CurvedAnimation(
/// parent: _controller,
/// curve: Curves.decelerate,
/// ),
/// );
///
/// @override
/// void dispose() {
/// _controller.dispose();
/// super.dispose();
/// }
///
/// @override
/// Widget build(BuildContext context) {
/// return Container(
/// color: Colors.white,
/// child: AlignTransition(
/// alignment: _animation,
/// child: const Padding(
/// padding: EdgeInsets.all(8),
/// child: FlutterLogo(size: 150.0),
/// ),
/// ),
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [AnimatedAlign], which animates changes to the [alignment] without
...
...
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