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
9806865b
Unverified
Commit
9806865b
authored
Nov 25, 2020
by
Juyeong Lee
Committed by
GitHub
Nov 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dartpad sample for AnimatedPadding (#71050)
parent
508c4b4d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
implicit_animations.dart
packages/flutter/lib/src/widgets/implicit_animations.dart
+41
-0
No files found.
packages/flutter/lib/src/widgets/implicit_animations.dart
View file @
9806865b
...
...
@@ -813,6 +813,47 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState<AnimatedContainer>
/// of [Curves.fastOutSlowIn].
/// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_padding.mp4}
///
/// {@tool dartpad --template=stateful_widget_scaffold}
///
/// The following code implements the [AnimatedPadding] widget, using a [curve] of
/// [Curves.easeInOut].
///
/// ```dart
/// double padValue = 0.0;
/// _updatePadding(double value) {
/// setState(() {
/// padValue = value;
/// });
/// }
///
/// @override
/// Widget build(BuildContext context) {
/// return Column(
/// mainAxisAlignment: MainAxisAlignment.center,
/// children: [
/// AnimatedPadding(
/// padding: EdgeInsets.all(padValue),
/// duration: const Duration(seconds: 2),
/// curve: Curves.easeInOut,
/// child: Container(
/// width: MediaQuery.of(context).size.width,
/// height: MediaQuery.of(context).size.height / 5,
/// color: Colors.blue,
/// ),
/// ),
/// Text('Padding: $padValue'),
/// ElevatedButton(
/// child: Text('Change padding'),
/// onPressed: () {
/// _updatePadding(padValue == 0.0 ? 100.0 : 0.0);
/// }
/// ),
/// ],
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [AnimatedContainer], which can transition more values at once.
...
...
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