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
00f10da1
Commit
00f10da1
authored
Apr 25, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document some construtors in transitions.dart (#3522)
parent
23634de9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
6 deletions
+31
-6
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+31
-6
No files found.
packages/flutter/lib/src/widgets/transitions.dart
View file @
00f10da1
...
...
@@ -20,6 +20,7 @@ export 'package:flutter/rendering.dart' show RelativeRect;
/// For more complex case involving additional state, consider using
/// [AnimatedBuilder].
abstract
class
AnimatedWidget
extends
StatefulWidget
{
/// The [animation] argument is required.
AnimatedWidget
({
Key
key
,
this
.
animation
...
...
@@ -80,14 +81,15 @@ class _AnimatedState extends State<AnimatedWidget> {
/// Animates the position of a widget relative to its normal position.
class
SlideTransition
extends
AnimatedWidget
{
/// Creates a fractional translation transition.
///
/// The [position] argument is required.
SlideTransition
({
Key
key
,
Animation
<
FractionalOffset
>
position
,
this
.
transformHitTests
:
true
,
this
.
child
})
:
position
=
position
,
super
(
key:
key
,
animation:
position
)
{
assert
(
position
!=
null
);
}
})
:
position
=
position
,
super
(
key:
key
,
animation:
position
);
/// The animation that controls the position of the child.
///
...
...
@@ -118,12 +120,18 @@ class SlideTransition extends AnimatedWidget {
/// Animates the scale of transformed widget.
class
ScaleTransition
extends
AnimatedWidget
{
/// Creates a scale transition.
///
/// The [scale] argument is required. The [alignment] argument defaults to
/// [FractionalOffset.center].
ScaleTransition
({
Key
key
,
Animation
<
double
>
scale
,
this
.
alignment
:
FractionalOffset
.
center
,
this
.
child
})
:
scale
=
scale
,
super
(
key:
key
,
animation:
scale
);
})
:
scale
=
scale
,
super
(
key:
key
,
animation:
scale
)
{
assert
(
scale
!=
null
);
}
/// The animation that controls the scale of the child.
///
...
...
@@ -143,9 +151,9 @@ class ScaleTransition extends AnimatedWidget {
@override
Widget
build
(
BuildContext
context
)
{
double
scaleValue
=
scale
.
value
;
final
double
scaleValue
=
scale
.
value
;
Matrix4
transform
=
new
Matrix4
.
identity
()
..
scale
(
scaleValue
,
scaleValue
);
..
scale
(
scaleValue
,
scaleValue
,
1.0
);
return
new
Transform
(
transform:
transform
,
alignment:
alignment
,
...
...
@@ -156,6 +164,9 @@ class ScaleTransition extends AnimatedWidget {
/// Animates the rotation of a widget.
class
RotationTransition
extends
AnimatedWidget
{
/// Creates a rotation transition.
///
/// The [turns] argument is required.
RotationTransition
({
Key
key
,
Animation
<
double
>
turns
,
...
...
@@ -185,6 +196,11 @@ class RotationTransition extends AnimatedWidget {
/// Animates its own size and clips and aligns the child.
class
SizeTransition
extends
AnimatedWidget
{
/// Creates a size transition.
///
/// The [sizeFactor] argument is required. The [axis] argument defaults to
/// [Axis.vertical]. The [axisAlignment] defaults to 0.5, which centers the
/// child along the main axis during the transition.
SizeTransition
({
Key
key
,
this
.
axis
:
Axis
.
vertical
,
...
...
@@ -229,6 +245,9 @@ class SizeTransition extends AnimatedWidget {
/// Animates the opacity of a widget.
class
FadeTransition
extends
AnimatedWidget
{
/// Creates an opacity transition.
///
/// The [opacity] argument is required.
FadeTransition
({
Key
key
,
Animation
<
double
>
opacity
,
...
...
@@ -271,6 +290,9 @@ class RelativeRectTween extends Tween<RelativeRect> {
///
/// Only works if it's the child of a [Stack].
class
PositionedTransition
extends
AnimatedWidget
{
/// Creates a transition for [Positioned].
///
/// The [rect] argument is required.
PositionedTransition
({
Key
key
,
Animation
<
RelativeRect
>
rect
,
...
...
@@ -320,6 +342,9 @@ typedef Widget TransitionBuilder(BuildContext context, Widget child);
/// For simple cases without additional state, consider using
/// [AnimatedWidget].
class
AnimatedBuilder
extends
AnimatedWidget
{
/// Creates an animated builder.
///
/// The [animation] argument is required.
AnimatedBuilder
({
Key
key
,
Animation
<
Object
>
animation
,
...
...
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