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
e13b44d9
Unverified
Commit
e13b44d9
authored
Jun 10, 2020
by
Hansol Lee
Committed by
GitHub
Jun 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sample code to PositionedTransition (#59156)
parent
8cf15ee2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+54
-0
No files found.
packages/flutter/lib/src/widgets/transitions.dart
View file @
e13b44d9
...
...
@@ -724,6 +724,60 @@ class RelativeRectTween extends Tween<RelativeRect> {
/// animated by a [CurvedAnimation] set to [Curves.elasticInOut]:
/// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/positioned_transition.mp4}
///
/// {@tool dartpad --template=stateful_widget_material_ticker}
///
/// The following code implements the [PositionedTransition] as seen in the video
/// above:
///
/// ```dart
/// AnimationController _controller;
///
/// @override
/// void initState() {
/// super.initState();
/// _controller = AnimationController(
/// duration: const Duration(seconds: 2),
/// vsync: this,
/// )..repeat(reverse: true);
/// }
///
/// @override
/// void dispose() {
/// _controller.dispose();
/// super.dispose();
/// }
///
/// @override
/// Widget build(BuildContext context) {
/// final double smallLogo = 100;
/// final double bigLogo = 200;
///
/// return LayoutBuilder(
/// builder: (context, constraints) {
/// final Size biggest = constraints.biggest;
/// return Stack(
/// children: [
/// PositionedTransition(
/// rect: RelativeRectTween(
/// begin: RelativeRect.fromSize(Rect.fromLTWH(0, 0, smallLogo, smallLogo), biggest),
/// end: RelativeRect.fromSize(Rect.fromLTWH(biggest.width - bigLogo, biggest.height - bigLogo, bigLogo, bigLogo), biggest),
/// ).animate(CurvedAnimation(
/// parent: _controller,
/// curve: Curves.elasticInOut,
/// )),
/// child: Padding(
/// padding: const EdgeInsets.all(8),
/// child: FlutterLogo()
/// ),
/// ),
/// ],
/// );
/// },
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [AnimatedPositioned], which transitions a child's position 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