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
aa7ab108
Unverified
Commit
aa7ab108
authored
Apr 17, 2021
by
xubaolin
Committed by
GitHub
Apr 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BorderRadiusTween.lerp supports null begin/end values (#79860)
parent
7aa188ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
backdrop.dart
...tegration_tests/flutter_gallery/lib/gallery/backdrop.dart
+2
-2
implicit_animations.dart
packages/flutter/lib/src/widgets/implicit_animations.dart
+2
-2
tween_test.dart
packages/flutter/test/animation/tween_test.dart
+7
-0
No files found.
dev/integration_tests/flutter_gallery/lib/gallery/backdrop.dart
View file @
aa7ab108
...
@@ -11,7 +11,7 @@ const double _kFrontClosedHeight = 92.0; // front layer height when closed
...
@@ -11,7 +11,7 @@ const double _kFrontClosedHeight = 92.0; // front layer height when closed
const
double
_kBackAppBarHeight
=
56.0
;
// back layer (options) appbar height
const
double
_kBackAppBarHeight
=
56.0
;
// back layer (options) appbar height
// The size of the front layer heading's left and right beveled corners.
// The size of the front layer heading's left and right beveled corners.
final
Animatable
<
BorderRadius
>
_kFrontHeadingBevelRadius
=
BorderRadiusTween
(
final
Animatable
<
BorderRadius
?
>
_kFrontHeadingBevelRadius
=
BorderRadiusTween
(
begin:
const
BorderRadius
.
only
(
begin:
const
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
12.0
),
topLeft:
Radius
.
circular
(
12.0
),
topRight:
Radius
.
circular
(
12.0
),
topRight:
Radius
.
circular
(
12.0
),
...
@@ -315,7 +315,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
...
@@ -315,7 +315,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
color:
Theme
.
of
(
context
).
canvasColor
,
color:
Theme
.
of
(
context
).
canvasColor
,
clipper:
ShapeBorderClipper
(
clipper:
ShapeBorderClipper
(
shape:
BeveledRectangleBorder
(
shape:
BeveledRectangleBorder
(
borderRadius:
_kFrontHeadingBevelRadius
.
transform
(
_controller
!.
value
),
borderRadius:
_kFrontHeadingBevelRadius
.
transform
(
_controller
!.
value
)
!
,
),
),
),
),
clipBehavior:
Clip
.
antiAlias
,
clipBehavior:
Clip
.
antiAlias
,
...
...
packages/flutter/lib/src/widgets/implicit_animations.dart
View file @
aa7ab108
...
@@ -125,7 +125,7 @@ class EdgeInsetsGeometryTween extends Tween<EdgeInsetsGeometry> {
...
@@ -125,7 +125,7 @@ class EdgeInsetsGeometryTween extends Tween<EdgeInsetsGeometry> {
/// [BorderRadius.lerp].
/// [BorderRadius.lerp].
///
///
/// See [Tween] for a discussion on how to use interpolation objects.
/// See [Tween] for a discussion on how to use interpolation objects.
class
BorderRadiusTween
extends
Tween
<
BorderRadius
>
{
class
BorderRadiusTween
extends
Tween
<
BorderRadius
?
>
{
/// Creates a [BorderRadius] tween.
/// Creates a [BorderRadius] tween.
///
///
/// The [begin] and [end] properties may be null; the null value
/// The [begin] and [end] properties may be null; the null value
...
@@ -134,7 +134,7 @@ class BorderRadiusTween extends Tween<BorderRadius> {
...
@@ -134,7 +134,7 @@ class BorderRadiusTween extends Tween<BorderRadius> {
/// Returns the value this variable has at the given animation clock value.
/// Returns the value this variable has at the given animation clock value.
@override
@override
BorderRadius
lerp
(
double
t
)
=>
BorderRadius
.
lerp
(
begin
,
end
,
t
)!
;
BorderRadius
?
lerp
(
double
t
)
=>
BorderRadius
.
lerp
(
begin
,
end
,
t
)
;
}
}
/// An interpolation between two [Border]s.
/// An interpolation between two [Border]s.
...
...
packages/flutter/test/animation/tween_test.dart
View file @
aa7ab108
...
@@ -230,4 +230,11 @@ void main() {
...
@@ -230,4 +230,11 @@ void main() {
expect
(
tween
.
transform
(
0.5
),
0.31640625
);
expect
(
tween
.
transform
(
0.5
),
0.31640625
);
expect
(
tween
.
transform
(
1.0
),
1.0
);
expect
(
tween
.
transform
(
1.0
),
1.0
);
});
});
test
(
'BorderRadiusTween nullable test'
,
()
{
final
BorderRadiusTween
tween
=
BorderRadiusTween
(
begin:
null
,
end:
null
);
expect
(
tween
.
transform
(
0.0
),
null
);
expect
(
tween
.
transform
(
1.0
),
null
);
expect
(
tween
.
lerp
(
0.0
),
null
);
});
}
}
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