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
d176b308
Commit
d176b308
authored
Sep 14, 2015
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1158 from Hixie/mounted
Various and sundry code cleanup
parents
b0c300e5
61f8651c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
16 deletions
+18
-16
animated_value.dart
packages/flutter/lib/src/animation/animated_value.dart
+5
-3
animated_component.dart
packages/flutter/lib/src/widgets/animated_component.dart
+3
-1
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+7
-7
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+3
-5
No files found.
packages/flutter/lib/src/animation/animated_value.dart
View file @
d176b308
...
...
@@ -22,7 +22,9 @@ abstract class AnimatedVariable {
String
toString
();
}
///
/// Used by [AnimationPerformance] to convert the timing of a performance to a different timescale.
/// For example, by setting different values for the interval and reverseInterval, a performance
/// can be made to take longer in one direction that the other.
class
AnimationTiming
{
AnimationTiming
({
this
.
interval
,
...
...
@@ -36,7 +38,7 @@ class AnimationTiming {
/// The interval during which this timing is active in the reverse direction
///
/// If this field is null, the timing defaul
e
s to using [interval] in both directions.
/// If this field is null, the timing defaul
t
s to using [interval] in both directions.
Interval
reverseInterval
;
/// The curve that this timing applies to the animation clock in the forward direction
...
...
@@ -44,7 +46,7 @@ class AnimationTiming {
/// The curve that this timing applies to the animation clock in the reverse direction
///
/// If this field is null, the timing defaul
e
s to using [curve] in both directions.
/// If this field is null, the timing defaul
t
s to using [curve] in both directions.
Curve
reverseCurve
;
/// Applies this timing to the given animation clock value in the given direction
...
...
packages/flutter/lib/src/widgets/animated_component.dart
View file @
d176b308
...
...
@@ -20,7 +20,9 @@ abstract class AnimatedComponent extends StatefulComponent {
});
}
bool
isWatching
(
performance
)
=>
_watchedPerformances
.
contains
(
performance
);
bool
isWatching
(
AnimationPerformance
performance
)
{
return
_watchedPerformances
.
contains
(
performance
);
}
void
watch
(
AnimationPerformance
performance
)
{
assert
(!
isWatching
(
performance
));
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
d176b308
...
...
@@ -511,9 +511,10 @@ abstract class Widget {
return
'
$startPrefix${toStringName()}$suffix
\n
$childrenString
'
;
}
String
toStringName
()
{
if
(
key
==
null
)
return
'
$runtimeType
(unkeyed; hashCode=
$hashCode
)'
;
return
'
$runtimeType
(
$key
; hashCode=
$hashCode
)'
;
String
keyString
=
key
==
null
?
''
:
'
$key
; '
;
String
hashCodeString
=
'hashCode=
$hashCode
'
;
String
mountedString
=
mounted
?
'; mounted'
:
'; not mounted'
;
return
'
$runtimeType
(
$keyString$hashCodeString$mountedString
)'
;
}
// This function can be safely called when the layout is valid.
...
...
@@ -916,16 +917,15 @@ abstract class StatefulComponent extends Component {
// because our retainStatefulNodeIfPossible() method returns true,
// when _sync is called, our 'old' is actually the new instance that
// we are to copy state from.
void
_sync
(
Widge
t
old
,
dynamic
slot
)
{
void
_sync
(
StatefulComponen
t
old
,
dynamic
slot
)
{
if
(
old
==
null
)
{
if
(!
_isStateInitialized
)
{
initState
();
_isStateInitialized
=
true
;
}
}
if
(
old
!=
null
)
{
}
else
{
assert
(
_isStateInitialized
);
assert
(!
(
old
as
StatefulComponent
)
.
_isStateInitialized
);
assert
(!
old
.
_isStateInitialized
);
syncConstructorArguments
(
old
);
}
super
.
_sync
(
old
,
slot
);
...
...
packages/flutter/lib/src/widgets/transitions.dart
View file @
d176b308
...
...
@@ -60,8 +60,8 @@ class _AnchorTransition extends AnimatedComponent {
abstract
class
TransitionBase
extends
AnimatedComponent
{
TransitionBase
({
Key
key
,
this
.
anchor
,
this
.
child
,
this
.
anchor
,
this
.
direction
,
this
.
duration
,
this
.
performance
,
...
...
@@ -84,9 +84,9 @@ abstract class TransitionBase extends AnimatedComponent {
if
(
performance
==
null
)
{
assert
(
duration
!=
null
);
performance
=
new
AnimationPerformance
(
duration:
duration
);
if
(
direction
==
Direction
.
reverse
)
performance
.
progress
=
1.0
;
}
if
(
direction
==
Direction
.
reverse
)
performance
.
progress
=
1.0
;
performance
.
addStatusListener
(
_checkStatusChanged
);
watch
(
performance
);
...
...
@@ -127,8 +127,6 @@ abstract class TransitionBase extends AnimatedComponent {
}
class
SlideTransition
extends
TransitionBase
{
// TODO(mpcomplete): this constructor is mostly boilerplate, passing values
// to super. Is there a simpler way?
SlideTransition
({
Key
key
,
Anchor
anchor
,
...
...
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