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
86087cbb
Commit
86087cbb
authored
Oct 21, 2015
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RotationTransition
A transition that rotates its contents.
parent
babba2f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+26
-1
No files found.
packages/flutter/lib/src/widgets/transitions.dart
View file @
86087cbb
...
...
@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'package:flutter/animation.dart'
;
import
'package:vector_math/vector_math_64.dart'
show
Matrix4
;
import
'package:flutter/rendering.dart'
;
import
'package:vector_math/vector_math_64.dart'
show
Matrix4
;
import
'basic.dart'
;
import
'framework.dart'
;
...
...
@@ -90,6 +92,29 @@ class SlideTransition extends TransitionWithChild {
}
}
class
RotationTransition
extends
TransitionWithChild
{
RotationTransition
({
Key
key
,
this
.
turns
,
PerformanceView
performance
,
Widget
child
})
:
super
(
key:
key
,
performance:
performance
,
child:
child
);
final
AnimatedValue
<
double
>
turns
;
Widget
buildWithChild
(
BuildContext
context
,
Widget
child
)
{
performance
.
updateVariable
(
turns
);
Matrix4
transform
=
new
Matrix4
.
rotationZ
(
turns
.
value
*
math
.
PI
*
2.0
);
return
new
Transform
(
transform:
transform
,
alignment:
const
FractionalOffset
(
0.5
,
0.5
),
child:
child
);
}
}
class
FadeTransition
extends
TransitionWithChild
{
FadeTransition
({
Key
key
,
...
...
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