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
379a4e73
Unverified
Commit
379a4e73
authored
Sep 22, 2020
by
ny927
Committed by
GitHub
Sep 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sample code to DefaultTextStyleTransition (#64638)
parent
7eb84474
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+45
-0
No files found.
packages/flutter/lib/src/widgets/transitions.dart
View file @
379a4e73
...
@@ -1310,6 +1310,51 @@ class AlignTransition extends AnimatedWidget {
...
@@ -1310,6 +1310,51 @@ class AlignTransition extends AnimatedWidget {
/// Animated version of a [DefaultTextStyle] that animates the different properties
/// Animated version of a [DefaultTextStyle] that animates the different properties
/// of its [TextStyle].
/// of its [TextStyle].
///
///
/// {@tool dartpad --template=stateful_widget_material_ticker}
///
/// The following code implements the [DefaultTextStyleTransition] that shows
/// a transition between thick blue font and thin red font.
///
/// ```dart
/// AnimationController _controller;
/// TextStyleTween _styleTween;
/// CurvedAnimation _curvedAnimation;
///
/// @override
/// void initState() {
/// super.initState();
/// _controller = AnimationController(
/// duration: const Duration(seconds: 2),
/// vsync: this,
/// )..repeat(reverse: true);
/// _styleTween = TextStyleTween(
/// begin: TextStyle(fontSize: 50, color: Colors.blue, fontWeight: FontWeight.w900),
/// end: TextStyle(fontSize: 50, color: Colors.red, fontWeight: FontWeight.w100),
/// );
/// _curvedAnimation = CurvedAnimation(
/// parent: _controller,
/// curve: Curves.elasticInOut,
/// );
/// }
///
/// @override
/// void dispose() {
/// _controller.dispose();
/// super.dispose();
/// }
///
/// @override
/// Widget build(BuildContext context) {
/// return Center(
/// child: DefaultTextStyleTransition(
/// style: _styleTween.animate(_curvedAnimation),
/// child: Text('Flutter'),
/// ),
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
/// See also:
///
///
/// * [AnimatedDefaultTextStyle], which animates changes in text style without
/// * [AnimatedDefaultTextStyle], which animates changes in text style 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