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
8a4ada25
Unverified
Commit
8a4ada25
authored
Aug 17, 2020
by
server-developer
Committed by
GitHub
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecoratedBoxTransition sample code (#63775)
parent
f45cdd57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+68
-0
No files found.
packages/flutter/lib/src/widgets/transitions.dart
View file @
8a4ada25
...
...
@@ -899,6 +899,74 @@ class RelativePositionedTransition extends AnimatedWidget {
/// [decoration] animated by a [CurvedAnimation] set to [Curves.decelerate]:
/// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/decorated_box_transition.mp4}
///
/// {@tool dartpad --template=stateful_widget_material_ticker}
/// The following code implements the [DecoratedBoxTransition] as seen in the video
/// above:
///
/// ```dart
/// final DecorationTween decorationTween = DecorationTween(
/// begin: BoxDecoration(
/// color: const Color(0xFFFFFFFF),
/// border: Border.all(style: BorderStyle.none),
/// borderRadius: BorderRadius.circular(60.0),
/// shape: BoxShape.rectangle,
/// boxShadow: const <BoxShadow>[
/// BoxShadow(
/// color: Color(0x66666666),
/// blurRadius: 10.0,
/// spreadRadius: 3.0,
/// offset: Offset(0, 6.0),
/// )
/// ],
/// ),
/// end: BoxDecoration(
/// color: const Color(0xFFFFFFFF),
/// border: Border.all(
/// style: BorderStyle.none,
/// ),
/// borderRadius: BorderRadius.zero,
/// // No shadow.
/// ),
/// );
///
/// AnimationController _controller;
///
/// @override
/// void initState() {
/// _controller = AnimationController(
/// vsync: this,
/// duration: const Duration(seconds: 3),
/// )..repeat(reverse: true);
/// super.initState();
/// }
///
/// @override
/// void dispose() {
/// _controller.dispose();
/// super.dispose();
/// }
///
/// @override
/// Widget build(BuildContext context) {
/// return Container(
/// color: Colors.white,
/// child: Center(
/// child: DecoratedBoxTransition(
/// position: DecorationPosition.background,
/// decoration: decorationTween.animate(_controller),
/// child: Container(
/// width: 200,
/// height: 200,
/// padding: const EdgeInsets.all(10),
/// child: const FlutterLogo(),
/// ),
/// ),
/// ),
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [DecoratedBox], which also draws a [Decoration] but is not animated.
...
...
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