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
649e1885
Unverified
Commit
649e1885
authored
Dec 05, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implicit-casts:false in flutter/lib/src/painting (#45621)
parent
d01de941
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
261 additions
and
333 deletions
+261
-333
_network_image_io.dart
packages/flutter/lib/src/painting/_network_image_io.dart
+4
-4
_network_image_web.dart
packages/flutter/lib/src/painting/_network_image_web.dart
+7
-6
alignment.dart
packages/flutter/lib/src/painting/alignment.dart
+4
-6
beveled_rectangle_border.dart
...es/flutter/lib/src/painting/beveled_rectangle_border.dart
+3
-3
binding.dart
packages/flutter/lib/src/painting/binding.dart
+2
-2
border_radius.dart
packages/flutter/lib/src/painting/border_radius.dart
+9
-9
borders.dart
packages/flutter/lib/src/painting/borders.dart
+6
-14
box_border.dart
packages/flutter/lib/src/painting/box_border.dart
+18
-20
box_decoration.dart
packages/flutter/lib/src/painting/box_decoration.dart
+11
-11
box_shadow.dart
packages/flutter/lib/src/painting/box_shadow.dart
+5
-5
circle_border.dart
packages/flutter/lib/src/painting/circle_border.dart
+2
-2
colors.dart
packages/flutter/lib/src/painting/colors.dart
+20
-23
continuous_rectangle_border.dart
...flutter/lib/src/painting/continuous_rectangle_border.dart
+3
-3
decoration_image.dart
packages/flutter/lib/src/painting/decoration_image.dart
+10
-10
edge_insets.dart
packages/flutter/lib/src/painting/edge_insets.dart
+7
-9
flutter_logo.dart
packages/flutter/lib/src/painting/flutter_logo.dart
+11
-13
fractional_offset.dart
packages/flutter/lib/src/painting/fractional_offset.dart
+2
-2
geometry.dart
packages/flutter/lib/src/painting/geometry.dart
+1
-1
gradient.dart
packages/flutter/lib/src/painting/gradient.dart
+27
-81
image_provider.dart
packages/flutter/lib/src/painting/image_provider.dart
+26
-26
image_resolution.dart
packages/flutter/lib/src/painting/image_resolution.dart
+5
-5
image_stream.dart
packages/flutter/lib/src/painting/image_stream.dart
+7
-7
inline_span.dart
packages/flutter/lib/src/painting/inline_span.dart
+2
-2
matrix_utils.dart
packages/flutter/lib/src/painting/matrix_utils.dart
+2
-2
rounded_rectangle_border.dart
...es/flutter/lib/src/painting/rounded_rectangle_border.dart
+7
-7
shape_decoration.dart
packages/flutter/lib/src/painting/shape_decoration.dart
+10
-10
stadium_border.dart
packages/flutter/lib/src/painting/stadium_border.dart
+11
-11
strut_style.dart
packages/flutter/lib/src/painting/strut_style.dart
+8
-8
text_painter.dart
packages/flutter/lib/src/painting/text_painter.dart
+1
-1
text_span.dart
packages/flutter/lib/src/painting/text_span.dart
+7
-7
text_style.dart
packages/flutter/lib/src/painting/text_style.dart
+23
-23
No files found.
packages/flutter/lib/src/painting/_network_image_io.dart
View file @
649e1885
...
...
@@ -44,7 +44,7 @@ class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkIm
final
StreamController
<
ImageChunkEvent
>
chunkEvents
=
StreamController
<
ImageChunkEvent
>();
return
MultiFrameImageStreamCompleter
(
codec:
_loadAsync
(
key
,
chunkEvents
,
decode
),
codec:
_loadAsync
(
key
as
NetworkImage
,
chunkEvents
,
decode
),
chunkEvents:
chunkEvents
.
stream
,
scale:
key
.
scale
,
informationCollector:
()
{
...
...
@@ -111,9 +111,9 @@ class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkIm
bool
operator
==(
dynamic
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
NetworkImage
typedOther
=
other
;
return
url
==
typedOther
.
url
&&
scale
==
typedOther
.
scale
;
return
other
is
NetworkImage
&&
other
.
url
==
url
&&
other
.
scale
==
scale
;
}
@override
...
...
packages/flutter/lib/src/painting/_network_image_web.dart
View file @
649e1885
...
...
@@ -38,12 +38,12 @@ class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkIm
@override
ImageStreamCompleter
load
(
image_provider
.
NetworkImage
key
,
image_provider
.
DecoderCallback
decode
)
{
return
MultiFrameImageStreamCompleter
(
codec:
_loadAsync
(
key
,
decode
),
codec:
_loadAsync
(
key
as
NetworkImage
,
decode
),
scale:
key
.
scale
,
informationCollector:
()
{
return
<
DiagnosticsNode
>[
DiagnosticsProperty
<
image_provider
.
ImageProvider
>(
'Image provider'
,
this
),
DiagnosticsProperty
<
NetworkImage
>(
'Image key'
,
key
),
DiagnosticsProperty
<
NetworkImage
>(
'Image key'
,
key
as
NetworkImage
),
];
},
);
...
...
@@ -55,13 +55,13 @@ class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkIm
// Web does not support decoding network images to a specified size. The decode parameter
// here is ignored and the web-only `ui.webOnlyInstantiateImageCodecFromUrl` will be used
// directly in place of the typical `instantiateImageCodec` method.
Future
<
ui
.
Codec
>
_loadAsync
(
NetworkImage
key
,
image_provider
.
DecoderCallback
decode
)
async
{
Future
<
ui
.
Codec
>
_loadAsync
(
NetworkImage
key
,
image_provider
.
DecoderCallback
decode
)
{
assert
(
key
==
this
);
final
Uri
resolved
=
Uri
.
base
.
resolve
(
key
.
url
);
// This API only exists in the web engine implementation and is not
// contained in the analyzer summary for Flutter.
return
ui
.
webOnlyInstantiateImageCodecFromUrl
(
resolved
);
// ignore: undefined_function
return
ui
.
webOnlyInstantiateImageCodecFromUrl
(
resolved
)
as
Future
<
ui
.
Codec
>
;
// ignore: undefined_function
}
@override
...
...
@@ -69,8 +69,9 @@ class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkIm
if
(
other
.
runtimeType
!=
runtimeType
)
{
return
false
;
}
final
NetworkImage
typedOther
=
other
;
return
url
==
typedOther
.
url
&&
scale
==
typedOther
.
scale
;
return
other
is
NetworkImage
&&
other
.
url
==
url
&&
other
.
scale
==
scale
;
}
@override
...
...
packages/flutter/lib/src/painting/alignment.dart
View file @
649e1885
...
...
@@ -127,12 +127,10 @@ abstract class AlignmentGeometry {
@override
bool
operator
==(
dynamic
other
)
{
if
(
other
is
!
AlignmentGeometry
)
return
false
;
final
AlignmentGeometry
typedOther
=
other
;
return
_x
==
typedOther
.
_x
&&
_start
==
typedOther
.
_start
&&
_y
==
typedOther
.
_y
;
return
other
is
AlignmentGeometry
&&
other
.
_x
==
_x
&&
other
.
_start
==
_start
&&
other
.
_y
==
_y
;
}
@override
...
...
packages/flutter/lib/src/painting/beveled_rectangle_border.dart
View file @
649e1885
...
...
@@ -136,9 +136,9 @@ class BeveledRectangleBorder extends ShapeBorder {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
BeveledRectangleBorder
typedOther
=
other
;
return
side
==
typedOther
.
side
&&
borderRadius
==
typedOther
.
borderRadius
;
return
other
is
BeveledRectangleBorder
&&
other
.
side
==
side
&&
other
.
borderRadius
==
borderRadius
;
}
@override
...
...
packages/flutter/lib/src/painting/binding.dart
View file @
649e1885
...
...
@@ -113,8 +113,8 @@ mixin PaintingBinding on BindingBase, ServicesBinding {
@override
Future
<
void
>
handleSystemMessage
(
Object
systemMessage
)
async
{
await
super
.
handleSystemMessage
(
systemMessage
);
final
Map
<
String
,
dynamic
>
message
=
systemMessage
;
final
String
type
=
message
[
'type'
];
final
Map
<
String
,
dynamic
>
message
=
systemMessage
as
Map
<
String
,
dynamic
>
;
final
String
type
=
message
[
'type'
]
as
String
;
switch
(
type
)
{
case
'fontsChange'
:
_systemFonts
.
notifyListeners
();
...
...
packages/flutter/lib/src/painting/border_radius.dart
View file @
649e1885
...
...
@@ -244,15 +244,15 @@ abstract class BorderRadiusGeometry {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
BorderRadiusGeometry
typedOther
=
other
;
return
_topLeft
==
typedOther
.
_topLeft
&&
_topRight
==
typedOther
.
_topRight
&&
_bottomLeft
==
typedOther
.
_bottomLeft
&&
_bottomRight
==
typedOther
.
_bottomRight
&&
_topStart
==
typedOther
.
_topStart
&&
_topEnd
==
typedOther
.
_topEnd
&&
_bottomStart
==
typedOther
.
_bottomStart
&&
_bottomEnd
==
typedOther
.
_bottomEnd
;
return
other
is
BorderRadiusGeometry
&&
other
.
_topLeft
==
_topLeft
&&
other
.
_topRight
==
_topRight
&&
other
.
_bottomLeft
==
_bottomLeft
&&
other
.
_bottomRight
==
_bottomRight
&&
other
.
_topStart
==
_topStart
&&
other
.
_topEnd
==
_topEnd
&&
other
.
_bottomStart
==
_bottomStart
&&
other
.
_bottomEnd
==
_bottomEnd
;
}
@override
...
...
packages/flutter/lib/src/painting/borders.dart
View file @
649e1885
...
...
@@ -257,10 +257,10 @@ class BorderSide {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
BorderSide
typedOther
=
other
;
return
color
==
typedOther
.
color
&&
width
==
typedOther
.
width
&&
style
==
typedOther
.
style
;
return
other
is
BorderSide
&&
other
.
color
==
color
&&
other
.
width
==
width
&&
other
.
style
==
style
;
}
@override
...
...
@@ -615,16 +615,8 @@ class _CompoundBorder extends ShapeBorder {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
_CompoundBorder
typedOther
=
other
;
if
(
borders
==
typedOther
.
borders
)
return
true
;
if
(
borders
.
length
!=
typedOther
.
borders
.
length
)
return
false
;
for
(
int
index
=
0
;
index
<
borders
.
length
;
index
+=
1
)
{
if
(
borders
[
index
]
!=
typedOther
.
borders
[
index
])
return
false
;
}
return
true
;
return
other
is
_CompoundBorder
&&
listEquals
<
ShapeBorder
>(
other
.
borders
,
borders
);
}
@override
...
...
packages/flutter/lib/src/painting/box_border.dart
View file @
649e1885
...
...
@@ -105,9 +105,9 @@ abstract class BoxBorder extends ShapeBorder {
static
BoxBorder
lerp
(
BoxBorder
a
,
BoxBorder
b
,
double
t
)
{
assert
(
t
!=
null
);
if
((
a
is
Border
||
a
==
null
)
&&
(
b
is
Border
||
b
==
null
))
return
Border
.
lerp
(
a
,
b
,
t
);
return
Border
.
lerp
(
a
as
Border
,
b
as
Border
,
t
);
if
((
a
is
BorderDirectional
||
a
==
null
)
&&
(
b
is
BorderDirectional
||
b
==
null
))
return
BorderDirectional
.
lerp
(
a
,
b
,
t
);
return
BorderDirectional
.
lerp
(
a
as
BorderDirectional
,
b
as
BorderDirectional
,
t
);
if
(
b
is
Border
&&
a
is
BorderDirectional
)
{
final
BoxBorder
c
=
b
;
b
=
a
;
...
...
@@ -402,14 +402,12 @@ class Border extends BoxBorder {
@override
Border
add
(
ShapeBorder
other
,
{
bool
reversed
=
false
})
{
if
(
other
is
!
Border
)
return
null
;
final
Border
typedOther
=
other
;
if
(
BorderSide
.
canMerge
(
top
,
typedOther
.
top
)
&&
BorderSide
.
canMerge
(
right
,
typedOther
.
right
)
&&
BorderSide
.
canMerge
(
bottom
,
typedOther
.
bottom
)
&&
BorderSide
.
canMerge
(
left
,
typedOther
.
left
))
{
return
Border
.
merge
(
this
,
typedOther
);
if
(
other
is
Border
&&
BorderSide
.
canMerge
(
top
,
other
.
top
)
&&
BorderSide
.
canMerge
(
right
,
other
.
right
)
&&
BorderSide
.
canMerge
(
bottom
,
other
.
bottom
)
&&
BorderSide
.
canMerge
(
left
,
other
.
left
))
{
return
Border
.
merge
(
this
,
other
);
}
return
null
;
}
...
...
@@ -521,11 +519,11 @@ class Border extends BoxBorder {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
Border
typedOther
=
other
;
return
top
==
typedOther
.
top
&&
right
==
typedOther
.
right
&&
bottom
==
typedOther
.
bottom
&&
left
==
typedOther
.
left
;
return
other
is
Border
&&
other
.
top
==
top
&&
other
.
right
==
right
&&
other
.
bottom
==
bottom
&&
other
.
left
==
left
;
}
@override
...
...
@@ -825,11 +823,11 @@ class BorderDirectional extends BoxBorder {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
BorderDirectional
typedOther
=
other
;
return
top
==
typedOther
.
top
&&
start
==
typedOther
.
start
&&
end
==
typedOther
.
end
&&
bottom
==
typedOther
.
bottom
;
return
other
is
BorderDirectional
&&
other
.
top
==
top
&&
other
.
start
==
start
&&
other
.
end
==
end
&&
other
.
bottom
==
bottom
;
}
@override
...
...
packages/flutter/lib/src/painting/box_decoration.dart
View file @
649e1885
...
...
@@ -250,7 +250,7 @@ class BoxDecoration extends Decoration {
return
scale
(
t
);
if
(
a
is
BoxDecoration
)
return
BoxDecoration
.
lerp
(
a
,
this
,
t
);
return
super
.
lerpFrom
(
a
,
t
);
return
super
.
lerpFrom
(
a
,
t
)
as
BoxDecoration
;
}
@override
...
...
@@ -259,7 +259,7 @@ class BoxDecoration extends Decoration {
return
scale
(
1.0
-
t
);
if
(
b
is
BoxDecoration
)
return
BoxDecoration
.
lerp
(
this
,
b
,
t
);
return
super
.
lerpTo
(
b
,
t
);
return
super
.
lerpTo
(
b
,
t
)
as
BoxDecoration
;
}
/// Linearly interpolate between two box decorations.
...
...
@@ -314,14 +314,14 @@ class BoxDecoration extends Decoration {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
BoxDecoration
typedOther
=
other
;
return
color
==
typedOther
.
color
&&
image
==
typedOther
.
image
&&
border
==
typedOther
.
border
&&
borderRadius
==
typedOther
.
borderRadius
&&
boxShadow
==
typedOther
.
boxShadow
&&
gradient
==
typedOther
.
gradient
&&
shape
==
typedOther
.
shape
;
return
other
is
BoxDecoration
&&
other
.
color
==
color
&&
other
.
image
==
image
&&
other
.
border
==
border
&&
other
.
borderRadius
==
borderRadius
&&
other
.
boxShadow
==
boxShadow
&&
other
.
gradient
==
gradient
&&
other
.
shape
==
shape
;
}
@override
...
...
@@ -483,7 +483,7 @@ class _BoxDecorationPainter extends BoxPainter {
canvas
,
rect
,
shape:
_decoration
.
shape
,
borderRadius:
_decoration
.
borderRadius
,
borderRadius:
_decoration
.
borderRadius
as
BorderRadius
,
textDirection:
configuration
.
textDirection
,
);
}
...
...
packages/flutter/lib/src/painting/box_shadow.dart
View file @
649e1885
...
...
@@ -118,11 +118,11 @@ class BoxShadow extends ui.Shadow {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
BoxShadow
typedOther
=
other
;
return
color
==
typedOther
.
color
&&
offset
==
typedOther
.
offset
&&
blurRadius
==
typedOther
.
blurRadius
&&
spreadRadius
==
typedOther
.
spreadRadius
;
return
other
is
BoxShadow
&&
other
.
color
==
color
&&
other
.
offset
==
offset
&&
other
.
blurRadius
==
blurRadius
&&
other
.
spreadRadius
==
spreadRadius
;
}
@override
...
...
packages/flutter/lib/src/painting/circle_border.dart
View file @
649e1885
...
...
@@ -84,8 +84,8 @@ class CircleBorder extends ShapeBorder {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
CircleBorder
typedOther
=
other
;
return
side
==
typedOther
.
side
;
return
other
is
CircleBorder
&&
other
.
side
==
side
;
}
@override
...
...
packages/flutter/lib/src/painting/colors.dart
View file @
649e1885
...
...
@@ -206,10 +206,10 @@ class HSVColor {
if
(
b
==
null
)
return
a
.
_scaleAlpha
(
1.0
-
t
);
return
HSVColor
.
fromAHSV
(
lerpDouble
(
a
.
alpha
,
b
.
alpha
,
t
).
clamp
(
0.0
,
1.0
),
lerpDouble
(
a
.
alpha
,
b
.
alpha
,
t
).
clamp
(
0.0
,
1.0
)
as
double
,
lerpDouble
(
a
.
hue
,
b
.
hue
,
t
)
%
360.0
,
lerpDouble
(
a
.
saturation
,
b
.
saturation
,
t
).
clamp
(
0.0
,
1.0
),
lerpDouble
(
a
.
value
,
b
.
value
,
t
).
clamp
(
0.0
,
1.0
),
lerpDouble
(
a
.
saturation
,
b
.
saturation
,
t
).
clamp
(
0.0
,
1.0
)
as
double
,
lerpDouble
(
a
.
value
,
b
.
value
,
t
).
clamp
(
0.0
,
1.0
)
as
double
,
);
}
...
...
@@ -217,13 +217,11 @@ class HSVColor {
bool
operator
==(
dynamic
other
)
{
if
(
identical
(
this
,
other
))
return
true
;
if
(
other
is
!
HSVColor
)
return
false
;
final
HSVColor
typedOther
=
other
;
return
typedOther
.
alpha
==
alpha
&&
typedOther
.
hue
==
hue
&&
typedOther
.
saturation
==
saturation
&&
typedOther
.
value
==
value
;
return
other
is
HSVColor
&&
other
.
alpha
==
alpha
&&
other
.
hue
==
hue
&&
other
.
saturation
==
saturation
&&
other
.
value
==
value
;
}
@override
...
...
@@ -292,7 +290,7 @@ class HSLColor {
// Saturation can exceed 1.0 with rounding errors, so clamp it.
final
double
saturation
=
lightness
==
1.0
?
0.0
:
(
delta
/
(
1.0
-
(
2.0
*
lightness
-
1.0
).
abs
())).
clamp
(
0.0
,
1.0
);
:
(
(
delta
/
(
1.0
-
(
2.0
*
lightness
-
1.0
).
abs
())).
clamp
(
0.0
,
1.0
)
as
double
);
return
HSLColor
.
fromAHSL
(
alpha
,
hue
,
saturation
,
lightness
);
}
...
...
@@ -392,10 +390,10 @@ class HSLColor {
if
(
b
==
null
)
return
a
.
_scaleAlpha
(
1.0
-
t
);
return
HSLColor
.
fromAHSL
(
lerpDouble
(
a
.
alpha
,
b
.
alpha
,
t
).
clamp
(
0.0
,
1.0
),
lerpDouble
(
a
.
alpha
,
b
.
alpha
,
t
).
clamp
(
0.0
,
1.0
)
as
double
,
lerpDouble
(
a
.
hue
,
b
.
hue
,
t
)
%
360.0
,
lerpDouble
(
a
.
saturation
,
b
.
saturation
,
t
).
clamp
(
0.0
,
1.0
),
lerpDouble
(
a
.
lightness
,
b
.
lightness
,
t
).
clamp
(
0.0
,
1.0
),
lerpDouble
(
a
.
saturation
,
b
.
saturation
,
t
).
clamp
(
0.0
,
1.0
)
as
double
,
lerpDouble
(
a
.
lightness
,
b
.
lightness
,
t
).
clamp
(
0.0
,
1.0
)
as
double
,
);
}
...
...
@@ -403,13 +401,11 @@ class HSLColor {
bool
operator
==(
dynamic
other
)
{
if
(
identical
(
this
,
other
))
return
true
;
if
(
other
is
!
HSLColor
)
return
false
;
final
HSLColor
typedOther
=
other
;
return
typedOther
.
alpha
==
alpha
&&
typedOther
.
hue
==
hue
&&
typedOther
.
saturation
==
saturation
&&
typedOther
.
lightness
==
lightness
;
return
other
is
HSLColor
&&
other
.
alpha
==
alpha
&&
other
.
hue
==
hue
&&
other
.
saturation
==
saturation
&&
other
.
lightness
==
lightness
;
}
@override
...
...
@@ -450,8 +446,9 @@ class ColorSwatch<T> extends Color {
return
true
;
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
ColorSwatch
<
T
>
typedOther
=
other
;
return
super
==
other
&&
_swatch
==
typedOther
.
_swatch
;
return
super
==
other
&&
other
is
ColorSwatch
<
T
>
&&
other
.
_swatch
==
_swatch
;
}
@override
...
...
packages/flutter/lib/src/painting/continuous_rectangle_border.dart
View file @
649e1885
...
...
@@ -151,9 +151,9 @@ class ContinuousRectangleBorder extends ShapeBorder {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
ContinuousRectangleBorder
typedOther
=
other
;
return
side
==
typedOther
.
side
&&
borderRadius
==
typedOther
.
borderRadius
;
return
other
is
ContinuousRectangleBorder
&&
other
.
side
==
side
&&
other
.
borderRadius
==
borderRadius
;
}
@override
...
...
packages/flutter/lib/src/painting/decoration_image.dart
View file @
649e1885
...
...
@@ -141,14 +141,14 @@ class DecorationImage {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
DecorationImage
typedOther
=
other
;
return
image
==
typedOther
.
image
&&
colorFilter
==
typedOther
.
colorFilter
&&
fit
==
typedOther
.
fit
&&
alignment
==
typedOther
.
alignment
&&
centerSlice
==
typedOther
.
centerSlice
&&
repeat
==
typedOther
.
repeat
&&
matchTextDirection
==
typedOther
.
matchTextDirection
;
return
other
is
DecorationImage
&&
other
.
image
==
image
&&
other
.
colorFilter
==
colorFilter
&&
other
.
fit
==
fit
&&
other
.
alignment
==
alignment
&&
other
.
centerSlice
==
centerSlice
&&
other
.
repeat
==
repeat
&&
other
.
matchTextDirection
==
matchTextDirection
;
}
@override
...
...
@@ -392,8 +392,8 @@ void paintImage({
centerSlice
.
left
+
inputSize
.
width
-
centerSlice
.
right
,
centerSlice
.
top
+
inputSize
.
height
-
centerSlice
.
bottom
,
);
outputSize
-=
sliceBorder
;
inputSize
-=
sliceBorder
;
outputSize
=
outputSize
-
sliceBorder
as
Size
;
inputSize
=
inputSize
-
sliceBorder
as
Size
;
}
fit
??=
centerSlice
==
null
?
BoxFit
.
scaleDown
:
BoxFit
.
fill
;
assert
(
centerSlice
==
null
||
(
fit
!=
BoxFit
.
none
&&
fit
!=
BoxFit
.
cover
));
...
...
packages/flutter/lib/src/painting/edge_insets.dart
View file @
649e1885
...
...
@@ -280,15 +280,13 @@ abstract class EdgeInsetsGeometry {
@override
bool
operator
==(
dynamic
other
)
{
if
(
other
is
!
EdgeInsetsGeometry
)
return
false
;
final
EdgeInsetsGeometry
typedOther
=
other
;
return
_left
==
typedOther
.
_left
&&
_right
==
typedOther
.
_right
&&
_start
==
typedOther
.
_start
&&
_end
==
typedOther
.
_end
&&
_top
==
typedOther
.
_top
&&
_bottom
==
typedOther
.
_bottom
;
return
other
is
EdgeInsetsGeometry
&&
other
.
_left
==
_left
&&
other
.
_right
==
_right
&&
other
.
_start
==
_start
&&
other
.
_end
==
_end
&&
other
.
_top
==
_top
&&
other
.
_bottom
==
_bottom
;
}
@override
...
...
packages/flutter/lib/src/painting/flutter_logo.dart
View file @
649e1885
...
...
@@ -171,7 +171,7 @@ class FlutterLogoDecoration extends Decoration {
t
<
0.5
?
a
.
style
:
b
.
style
,
EdgeInsets
.
lerp
(
a
.
margin
,
b
.
margin
,
t
),
a
.
_position
+
(
b
.
_position
-
a
.
_position
)
*
t
,
(
a
.
_opacity
+
(
b
.
_opacity
-
a
.
_opacity
)
*
t
).
clamp
(
0.0
,
1.0
),
(
a
.
_opacity
+
(
b
.
_opacity
-
a
.
_opacity
)
*
t
).
clamp
(
0.0
,
1.0
)
as
double
,
);
}
...
...
@@ -180,9 +180,9 @@ class FlutterLogoDecoration extends Decoration {
assert
(
debugAssertIsValid
());
if
(
a
==
null
||
a
is
FlutterLogoDecoration
)
{
assert
(
a
==
null
||
a
.
debugAssertIsValid
());
return
FlutterLogoDecoration
.
lerp
(
a
,
this
,
t
);
return
FlutterLogoDecoration
.
lerp
(
a
as
FlutterLogoDecoration
,
this
,
t
);
}
return
super
.
lerpFrom
(
a
,
t
);
return
super
.
lerpFrom
(
a
,
t
)
as
FlutterLogoDecoration
;
}
@override
...
...
@@ -190,9 +190,9 @@ class FlutterLogoDecoration extends Decoration {
assert
(
debugAssertIsValid
());
if
(
b
==
null
||
b
is
FlutterLogoDecoration
)
{
assert
(
b
==
null
||
b
.
debugAssertIsValid
());
return
FlutterLogoDecoration
.
lerp
(
this
,
b
,
t
);
return
FlutterLogoDecoration
.
lerp
(
this
,
b
as
FlutterLogoDecoration
,
t
);
}
return
super
.
lerpTo
(
b
,
t
);
return
super
.
lerpTo
(
b
,
t
)
as
FlutterLogoDecoration
;
}
@override
...
...
@@ -210,14 +210,12 @@ class FlutterLogoDecoration extends Decoration {
assert
(
debugAssertIsValid
());
if
(
identical
(
this
,
other
))
return
true
;
if
(
other
is
!
FlutterLogoDecoration
)
return
false
;
final
FlutterLogoDecoration
typedOther
=
other
;
return
lightColor
==
typedOther
.
lightColor
&&
darkColor
==
typedOther
.
darkColor
&&
textColor
==
typedOther
.
textColor
&&
_position
==
typedOther
.
_position
&&
_opacity
==
typedOther
.
_opacity
;
return
other
is
FlutterLogoDecoration
&&
other
.
lightColor
==
lightColor
&&
other
.
darkColor
==
darkColor
&&
other
.
textColor
==
textColor
&&
other
.
_position
==
_position
&&
other
.
_opacity
==
_opacity
;
}
@override
...
...
packages/flutter/lib/src/painting/fractional_offset.dart
View file @
649e1885
...
...
@@ -137,7 +137,7 @@ class FractionalOffset extends Alignment {
Alignment
operator
-(
Alignment
other
)
{
if
(
other
is
!
FractionalOffset
)
return
super
-
other
;
final
FractionalOffset
typedOther
=
other
;
final
FractionalOffset
typedOther
=
other
as
FractionalOffset
;
return
FractionalOffset
(
dx
-
typedOther
.
dx
,
dy
-
typedOther
.
dy
);
}
...
...
@@ -145,7 +145,7 @@ class FractionalOffset extends Alignment {
Alignment
operator
+(
Alignment
other
)
{
if
(
other
is
!
FractionalOffset
)
return
super
+
other
;
final
FractionalOffset
typedOther
=
other
;
final
FractionalOffset
typedOther
=
other
as
FractionalOffset
;
return
FractionalOffset
(
dx
+
typedOther
.
dx
,
dy
+
typedOther
.
dy
);
}
...
...
packages/flutter/lib/src/painting/geometry.dart
View file @
649e1885
...
...
@@ -66,7 +66,7 @@ Offset positionDependentBox({
if
(
size
.
width
-
margin
*
2.0
<
childSize
.
width
)
{
x
=
(
size
.
width
-
childSize
.
width
)
/
2.0
;
}
else
{
final
double
normalizedTargetX
=
target
.
dx
.
clamp
(
margin
,
size
.
width
-
margin
);
final
double
normalizedTargetX
=
target
.
dx
.
clamp
(
margin
,
size
.
width
-
margin
)
as
double
;
final
double
edge
=
margin
+
childSize
.
width
/
2.0
;
if
(
normalizedTargetX
<
edge
)
{
x
=
margin
;
...
...
packages/flutter/lib/src/painting/gradient.dart
View file @
649e1885
...
...
@@ -438,14 +438,14 @@ class LinearGradient extends Gradient {
@override
Gradient
lerpFrom
(
Gradient
a
,
double
t
)
{
if
(
a
==
null
||
(
a
is
LinearGradient
))
return
LinearGradient
.
lerp
(
a
,
this
,
t
);
return
LinearGradient
.
lerp
(
a
as
LinearGradient
,
this
,
t
);
return
super
.
lerpFrom
(
a
,
t
);
}
@override
Gradient
lerpTo
(
Gradient
b
,
double
t
)
{
if
(
b
==
null
||
(
b
is
LinearGradient
))
return
LinearGradient
.
lerp
(
this
,
b
,
t
);
return
LinearGradient
.
lerp
(
this
,
b
as
LinearGradient
,
t
);
return
super
.
lerpTo
(
b
,
t
);
}
...
...
@@ -498,30 +498,12 @@ class LinearGradient extends Gradient {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
LinearGradient
typedOther
=
other
;
if
(
begin
!=
typedOther
.
begin
||
end
!=
typedOther
.
end
||
tileMode
!=
typedOther
.
tileMode
||
colors
?.
length
!=
typedOther
.
colors
?.
length
||
stops
?.
length
!=
typedOther
.
stops
?.
length
)
return
false
;
if
(
colors
!=
null
)
{
assert
(
typedOther
.
colors
!=
null
);
assert
(
colors
.
length
==
typedOther
.
colors
.
length
);
for
(
int
i
=
0
;
i
<
colors
.
length
;
i
+=
1
)
{
if
(
colors
[
i
]
!=
typedOther
.
colors
[
i
])
return
false
;
}
}
if
(
stops
!=
null
)
{
assert
(
typedOther
.
stops
!=
null
);
assert
(
stops
.
length
==
typedOther
.
stops
.
length
);
for
(
int
i
=
0
;
i
<
stops
.
length
;
i
+=
1
)
{
if
(
stops
[
i
]
!=
typedOther
.
stops
[
i
])
return
false
;
}
}
return
true
;
return
other
is
LinearGradient
&&
other
.
begin
==
begin
&&
other
.
end
==
end
&&
other
.
tileMode
==
tileMode
&&
listEquals
<
Color
>(
other
.
colors
,
colors
)
&&
listEquals
<
double
>(
other
.
stops
,
stops
);
}
@override
...
...
@@ -714,14 +696,14 @@ class RadialGradient extends Gradient {
@override
Gradient
lerpFrom
(
Gradient
a
,
double
t
)
{
if
(
a
==
null
||
(
a
is
RadialGradient
))
return
RadialGradient
.
lerp
(
a
,
this
,
t
);
return
RadialGradient
.
lerp
(
a
as
RadialGradient
,
this
,
t
);
return
super
.
lerpFrom
(
a
,
t
);
}
@override
Gradient
lerpTo
(
Gradient
b
,
double
t
)
{
if
(
b
==
null
||
(
b
is
RadialGradient
))
return
RadialGradient
.
lerp
(
this
,
b
,
t
);
return
RadialGradient
.
lerp
(
this
,
b
as
RadialGradient
,
t
);
return
super
.
lerpTo
(
b
,
t
);
}
...
...
@@ -776,32 +758,14 @@ class RadialGradient extends Gradient {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
RadialGradient
typedOther
=
other
;
if
(
center
!=
typedOther
.
center
||
radius
!=
typedOther
.
radius
||
tileMode
!=
typedOther
.
tileMode
||
colors
?.
length
!=
typedOther
.
colors
?.
length
||
stops
?.
length
!=
typedOther
.
stops
?.
length
||
focal
!=
typedOther
.
focal
||
focalRadius
!=
typedOther
.
focalRadius
)
return
false
;
if
(
colors
!=
null
)
{
assert
(
typedOther
.
colors
!=
null
);
assert
(
colors
.
length
==
typedOther
.
colors
.
length
);
for
(
int
i
=
0
;
i
<
colors
.
length
;
i
+=
1
)
{
if
(
colors
[
i
]
!=
typedOther
.
colors
[
i
])
return
false
;
}
}
if
(
stops
!=
null
)
{
assert
(
typedOther
.
stops
!=
null
);
assert
(
stops
.
length
==
typedOther
.
stops
.
length
);
for
(
int
i
=
0
;
i
<
stops
.
length
;
i
+=
1
)
{
if
(
stops
[
i
]
!=
typedOther
.
stops
[
i
])
return
false
;
}
}
return
true
;
return
other
is
RadialGradient
&&
other
.
center
==
center
&&
other
.
radius
==
radius
&&
other
.
tileMode
==
tileMode
&&
listEquals
<
Color
>(
other
.
colors
,
colors
)
&&
listEquals
<
double
>(
other
.
stops
,
stops
)
&&
other
.
focal
==
focal
&&
other
.
focalRadius
==
focalRadius
;
}
@override
...
...
@@ -980,14 +944,14 @@ class SweepGradient extends Gradient {
@override
Gradient
lerpFrom
(
Gradient
a
,
double
t
)
{
if
(
a
==
null
||
(
a
is
SweepGradient
))
return
SweepGradient
.
lerp
(
a
,
this
,
t
);
return
SweepGradient
.
lerp
(
a
as
SweepGradient
,
this
,
t
);
return
super
.
lerpFrom
(
a
,
t
);
}
@override
Gradient
lerpTo
(
Gradient
b
,
double
t
)
{
if
(
b
==
null
||
(
b
is
SweepGradient
))
return
SweepGradient
.
lerp
(
this
,
b
,
t
);
return
SweepGradient
.
lerp
(
this
,
b
as
SweepGradient
,
t
);
return
super
.
lerpTo
(
b
,
t
);
}
...
...
@@ -1040,31 +1004,13 @@ class SweepGradient extends Gradient {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
SweepGradient
typedOther
=
other
;
if
(
center
!=
typedOther
.
center
||
startAngle
!=
typedOther
.
startAngle
||
endAngle
!=
typedOther
.
endAngle
||
tileMode
!=
typedOther
.
tileMode
||
colors
?.
length
!=
typedOther
.
colors
?.
length
||
stops
?.
length
!=
typedOther
.
stops
?.
length
)
return
false
;
if
(
colors
!=
null
)
{
assert
(
typedOther
.
colors
!=
null
);
assert
(
colors
.
length
==
typedOther
.
colors
.
length
);
for
(
int
i
=
0
;
i
<
colors
.
length
;
i
+=
1
)
{
if
(
colors
[
i
]
!=
typedOther
.
colors
[
i
])
return
false
;
}
}
if
(
stops
!=
null
)
{
assert
(
typedOther
.
stops
!=
null
);
assert
(
stops
.
length
==
typedOther
.
stops
.
length
);
for
(
int
i
=
0
;
i
<
stops
.
length
;
i
+=
1
)
{
if
(
stops
[
i
]
!=
typedOther
.
stops
[
i
])
return
false
;
}
}
return
true
;
return
other
is
SweepGradient
&&
other
.
center
==
center
&&
other
.
startAngle
==
startAngle
&&
other
.
endAngle
==
endAngle
&&
other
.
tileMode
==
tileMode
&&
listEquals
<
Color
>(
other
.
colors
,
colors
)
&&
listEquals
<
double
>(
other
.
stops
,
stops
);
}
@override
...
...
packages/flutter/lib/src/painting/image_provider.dart
View file @
649e1885
...
...
@@ -51,7 +51,7 @@ class ImageConfiguration {
Locale
locale
,
TextDirection
textDirection
,
Size
size
,
String
platform
,
TargetPlatform
platform
,
})
{
return
ImageConfiguration
(
bundle:
bundle
??
this
.
bundle
,
...
...
@@ -94,13 +94,13 @@ class ImageConfiguration {
bool
operator
==(
dynamic
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
ImageConfiguration
typedOther
=
other
;
return
typedO
ther
.
bundle
==
bundle
&&
typedO
ther
.
devicePixelRatio
==
devicePixelRatio
&&
typedO
ther
.
locale
==
locale
&&
typedO
ther
.
textDirection
==
textDirection
&&
typedO
ther
.
size
==
size
&&
typedO
ther
.
platform
==
platform
;
return
other
is
ImageConfiguration
&&
o
ther
.
bundle
==
bundle
&&
o
ther
.
devicePixelRatio
==
devicePixelRatio
&&
o
ther
.
locale
==
locale
&&
o
ther
.
textDirection
==
textDirection
&&
o
ther
.
size
==
size
&&
o
ther
.
platform
==
platform
;
}
@override
...
...
@@ -439,10 +439,10 @@ class AssetBundleImageKey {
bool
operator
==(
dynamic
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
AssetBundleImageKey
typedOther
=
other
;
return
bundle
==
typedOther
.
bundle
&&
name
==
typedOther
.
name
&&
scale
==
typedOther
.
scale
;
return
other
is
AssetBundleImageKey
&&
other
.
bundle
==
bundle
&&
other
.
name
==
name
&&
other
.
scale
==
scale
;
}
@override
...
...
@@ -501,10 +501,10 @@ class _SizeAwareCacheKey {
bool
operator
==(
Object
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
_SizeAwareCacheKey
typedOther
=
other
;
return
providerCacheKey
==
typedOther
.
providerCacheKey
&&
width
==
typedOther
.
width
&&
height
==
typedOther
.
height
;
return
other
is
_SizeAwareCacheKey
&&
other
.
providerCacheKey
==
providerCacheKey
&&
other
.
width
==
width
&&
other
.
height
==
height
;
}
@override
...
...
@@ -657,9 +657,9 @@ class FileImage extends ImageProvider<FileImage> {
bool
operator
==(
dynamic
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
FileImage
typedOther
=
other
;
return
file
?.
path
==
typedOther
.
file
?.
path
&&
scale
==
typedOther
.
scale
;
return
other
is
FileImage
&&
other
.
file
?.
path
==
file
?.
path
&&
other
.
scale
==
scale
;
}
@override
...
...
@@ -718,9 +718,9 @@ class MemoryImage extends ImageProvider<MemoryImage> {
bool
operator
==(
dynamic
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
MemoryImage
typedOther
=
other
;
return
bytes
==
typedOther
.
bytes
&&
scale
==
typedOther
.
scale
;
return
other
is
MemoryImage
&&
other
.
bytes
==
bytes
&&
other
.
scale
==
scale
;
}
@override
...
...
@@ -855,10 +855,10 @@ class ExactAssetImage extends AssetBundleImageProvider {
bool
operator
==(
dynamic
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
ExactAssetImage
typedOther
=
other
;
return
keyName
==
typedOther
.
keyName
&&
scale
==
typedOther
.
scale
&&
bundle
==
typedOther
.
bundle
;
return
other
is
ExactAssetImage
&&
other
.
keyName
==
keyName
&&
other
.
scale
==
scale
&&
other
.
bundle
==
bundle
;
}
@override
...
...
packages/flutter/lib/src/painting/image_resolution.dart
View file @
649e1885
...
...
@@ -219,11 +219,11 @@ class AssetImage extends AssetBundleImageProvider {
if
(
jsonData
==
null
)
return
SynchronousFuture
<
Map
<
String
,
List
<
String
>>>(
null
);
// TODO(ianh): JSON decoding really shouldn't be on the main thread.
final
Map
<
String
,
dynamic
>
parsedJson
=
json
.
decode
(
jsonData
);
final
Map
<
String
,
dynamic
>
parsedJson
=
json
.
decode
(
jsonData
)
as
Map
<
String
,
dynamic
>
;
final
Iterable
<
String
>
keys
=
parsedJson
.
keys
;
final
Map
<
String
,
List
<
String
>>
parsedManifest
=
Map
<
String
,
List
<
String
>>.
fromIterables
(
keys
,
keys
.
map
<
List
<
String
>>((
String
key
)
=>
List
<
String
>.
from
(
parsedJson
[
key
])));
keys
.
map
<
List
<
String
>>((
String
key
)
=>
List
<
String
>.
from
(
parsedJson
[
key
]
as
List
<
dynamic
>
)));
// TODO(ianh): convert that data structure to the right types.
return
SynchronousFuture
<
Map
<
String
,
List
<
String
>>>(
parsedManifest
);
}
...
...
@@ -280,9 +280,9 @@ class AssetImage extends AssetBundleImageProvider {
bool
operator
==(
dynamic
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
AssetImage
typedOther
=
other
;
return
keyName
==
typedOther
.
keyName
&&
bundle
==
typedOther
.
bundle
;
return
other
is
AssetImage
&&
other
.
keyName
==
keyName
&&
other
.
bundle
==
bundle
;
}
@override
...
...
packages/flutter/lib/src/painting/image_stream.dart
View file @
649e1885
...
...
@@ -50,9 +50,9 @@ class ImageInfo {
bool
operator
==(
Object
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
ImageInfo
typedOther
=
other
;
return
typedO
ther
.
image
==
image
&&
typedO
ther
.
scale
==
scale
;
return
other
is
ImageInfo
&&
o
ther
.
image
==
image
&&
o
ther
.
scale
==
scale
;
}
}
...
...
@@ -119,10 +119,10 @@ class ImageStreamListener {
bool
operator
==(
dynamic
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
ImageStreamListener
typedOther
=
other
;
return
onImage
==
typedOther
.
onImage
&&
o
nChunk
==
typedOther
.
onChunk
&&
o
nError
==
typedOther
.
onError
;
return
other
is
ImageStreamListener
&&
other
.
onImage
==
onImage
&&
o
ther
.
onChunk
==
onChunk
&&
o
ther
.
onError
==
onError
;
}
}
...
...
packages/flutter/lib/src/painting/inline_span.dart
View file @
649e1885
...
...
@@ -358,8 +358,8 @@ abstract class InlineSpan extends DiagnosticableTree {
return
true
;
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
InlineSpan
typedOther
=
other
;
return
typedO
ther
.
style
==
style
;
return
other
is
InlineSpan
&&
o
ther
.
style
==
style
;
}
@override
...
...
packages/flutter/lib/src/painting/matrix_utils.dart
View file @
649e1885
...
...
@@ -507,11 +507,11 @@ class MatrixUtils {
// Model matrix by first translating the object from the origin of the world
// by radius in the z axis and then rotating against the world.
result
*=
(
result
=
result
*
(
(
orientation
==
Axis
.
horizontal
?
Matrix4
.
rotationY
(
angle
)
:
Matrix4
.
rotationX
(
angle
)
)
*
Matrix4
.
translationValues
(
0.0
,
0.0
,
radius
);
)
*
Matrix4
.
translationValues
(
0.0
,
0.0
,
radius
)
)
as
Matrix4
;
// Essentially perspective * view * model.
return
result
;
...
...
packages/flutter/lib/src/painting/rounded_rectangle_border.dart
View file @
649e1885
...
...
@@ -126,9 +126,9 @@ class RoundedRectangleBorder extends ShapeBorder {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
RoundedRectangleBorder
typedOther
=
other
;
return
side
==
typedOther
.
side
&&
borderRadius
==
typedOther
.
borderRadius
;
return
other
is
RoundedRectangleBorder
&&
other
.
side
==
side
&&
other
.
borderRadius
==
borderRadius
;
}
@override
...
...
@@ -286,10 +286,10 @@ class _RoundedRectangleToCircleBorder extends ShapeBorder {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
_RoundedRectangleToCircleBorder
typedOther
=
other
;
return
side
==
typedOther
.
side
&&
borderRadius
==
typedOther
.
borderRadius
&&
circleness
==
typedOther
.
circleness
;
return
other
is
_RoundedRectangleToCircleBorder
&&
other
.
side
==
side
&&
other
.
borderRadius
==
borderRadius
&&
other
.
circleness
==
circleness
;
}
@override
...
...
packages/flutter/lib/src/painting/shape_decoration.dart
View file @
649e1885
...
...
@@ -193,9 +193,9 @@ class ShapeDecoration extends Decoration {
if
(
a
is
BoxDecoration
)
{
return
ShapeDecoration
.
lerp
(
ShapeDecoration
.
fromBoxDecoration
(
a
),
this
,
t
);
}
else
if
(
a
==
null
||
a
is
ShapeDecoration
)
{
return
ShapeDecoration
.
lerp
(
a
,
this
,
t
);
return
ShapeDecoration
.
lerp
(
a
as
ShapeDecoration
,
this
,
t
);
}
return
super
.
lerpFrom
(
a
,
t
);
return
super
.
lerpFrom
(
a
,
t
)
as
ShapeDecoration
;
}
@override
...
...
@@ -203,9 +203,9 @@ class ShapeDecoration extends Decoration {
if
(
b
is
BoxDecoration
)
{
return
ShapeDecoration
.
lerp
(
this
,
ShapeDecoration
.
fromBoxDecoration
(
b
),
t
);
}
else
if
(
b
==
null
||
b
is
ShapeDecoration
)
{
return
ShapeDecoration
.
lerp
(
this
,
b
,
t
);
return
ShapeDecoration
.
lerp
(
this
,
b
as
ShapeDecoration
,
t
);
}
return
super
.
lerpTo
(
b
,
t
);
return
super
.
lerpTo
(
b
,
t
)
as
ShapeDecoration
;
}
/// Linearly interpolate between two shapes.
...
...
@@ -251,12 +251,12 @@ class ShapeDecoration extends Decoration {
return
true
;
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
ShapeDecoration
typedOther
=
other
;
return
color
==
typedOther
.
color
&&
gradient
==
typedOther
.
gradient
&&
image
==
typedOther
.
image
&&
shadows
==
typedOther
.
shadows
&&
shape
==
typedOther
.
shape
;
return
other
is
ShapeDecoration
&&
other
.
color
==
color
&&
other
.
gradient
==
gradient
&&
other
.
image
==
image
&&
other
.
shadows
==
shadows
&&
other
.
shape
==
shape
;
}
@override
...
...
packages/flutter/lib/src/painting/stadium_border.dart
View file @
649e1885
...
...
@@ -53,7 +53,7 @@ class StadiumBorder extends ShapeBorder {
if
(
a
is
RoundedRectangleBorder
)
{
return
_StadiumToRoundedRectangleBorder
(
side:
BorderSide
.
lerp
(
a
.
side
,
side
,
t
),
borderRadius:
a
.
borderRadius
,
borderRadius:
a
.
borderRadius
as
BorderRadius
,
rectness:
1.0
-
t
,
);
}
...
...
@@ -74,7 +74,7 @@ class StadiumBorder extends ShapeBorder {
if
(
b
is
RoundedRectangleBorder
)
{
return
_StadiumToRoundedRectangleBorder
(
side:
BorderSide
.
lerp
(
side
,
b
.
side
,
t
),
borderRadius:
b
.
borderRadius
,
borderRadius:
b
.
borderRadius
as
BorderRadius
,
rectness:
t
,
);
}
...
...
@@ -113,8 +113,8 @@ class StadiumBorder extends ShapeBorder {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
StadiumBorder
typedOther
=
other
;
return
side
==
typedOther
.
side
;
return
other
is
StadiumBorder
&&
other
.
side
==
side
;
}
@override
...
...
@@ -260,9 +260,9 @@ class _StadiumToCircleBorder extends ShapeBorder {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
_StadiumToCircleBorder
typedOther
=
other
;
return
side
==
typedOther
.
side
&&
circleness
==
typedOther
.
circleness
;
return
other
is
_StadiumToCircleBorder
&&
other
.
side
==
side
&&
other
.
circleness
==
circleness
;
}
@override
...
...
@@ -402,10 +402,10 @@ class _StadiumToRoundedRectangleBorder extends ShapeBorder {
bool
operator
==(
dynamic
other
)
{
if
(
runtimeType
!=
other
.
runtimeType
)
return
false
;
final
_StadiumToRoundedRectangleBorder
typedOther
=
other
;
return
side
==
typedOther
.
side
&&
borderRadius
==
typedOther
.
borderRadius
&&
rectness
==
typedOther
.
rectness
;
return
other
is
_StadiumToRoundedRectangleBorder
&&
other
.
side
==
side
&&
other
.
borderRadius
==
borderRadius
&&
other
.
rectness
==
rectness
;
}
@override
...
...
packages/flutter/lib/src/painting/strut_style.dart
View file @
649e1885
...
...
@@ -546,14 +546,14 @@ class StrutStyle extends Diagnosticable {
return
true
;
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
StrutStyle
typedOther
=
other
;
return
fontFamily
==
typedOther
.
fontFamily
&&
fontSize
==
typedOther
.
fontSize
&&
fontWeight
==
typedOther
.
fontWeight
&&
fontStyle
==
typedOther
.
fontStyle
&&
height
==
typedOther
.
height
&&
leading
==
typedOther
.
leading
&&
forceStrutHeight
==
typedOther
.
forceStrutHeight
;
return
other
is
StrutStyle
&&
other
.
fontFamily
==
fontFamily
&&
other
.
fontSize
==
fontSize
&&
other
.
fontWeight
==
fontWeight
&&
other
.
fontStyle
==
fontStyle
&&
other
.
height
==
height
&&
other
.
leading
==
leading
&&
other
.
forceStrutHeight
==
forceStrutHeight
;
}
@override
...
...
packages/flutter/lib/src/painting/text_painter.dart
View file @
649e1885
...
...
@@ -549,7 +549,7 @@ class TextPainter {
_lastMaxWidth
=
maxWidth
;
_paragraph
.
layout
(
ui
.
ParagraphConstraints
(
width:
maxWidth
));
if
(
minWidth
!=
maxWidth
)
{
final
double
newWidth
=
maxIntrinsicWidth
.
clamp
(
minWidth
,
maxWidth
);
final
double
newWidth
=
maxIntrinsicWidth
.
clamp
(
minWidth
,
maxWidth
)
as
double
;
if
(
newWidth
!=
width
)
{
_paragraph
.
layout
(
ui
.
ParagraphConstraints
(
width:
newWidth
));
}
...
...
packages/flutter/lib/src/painting/text_span.dart
View file @
649e1885
...
...
@@ -261,7 +261,7 @@ class TextSpan extends InlineSpan {
child
is
TextSpan
,
'visitTextSpan is deprecated. Use visitChildren to support InlineSpans'
,
);
final
TextSpan
textSpanChild
=
child
;
final
TextSpan
textSpanChild
=
child
as
TextSpan
;
if
(!
textSpanChild
.
visitTextSpan
(
visitor
))
return
false
;
}
...
...
@@ -388,7 +388,7 @@ class TextSpan extends InlineSpan {
return
RenderComparison
.
identical
;
if
(
other
.
runtimeType
!=
runtimeType
)
return
RenderComparison
.
layout
;
final
TextSpan
textSpan
=
other
;
final
TextSpan
textSpan
=
other
as
TextSpan
;
if
(
textSpan
.
text
!=
text
||
children
?.
length
!=
textSpan
.
children
?.
length
||
(
style
==
null
)
!=
(
textSpan
.
style
==
null
))
...
...
@@ -423,11 +423,11 @@ class TextSpan extends InlineSpan {
return
false
;
if
(
super
!=
other
)
return
false
;
final
TextSpan
typedOther
=
other
;
return
typedO
ther
.
text
==
text
&&
typedO
ther
.
recognizer
==
recognizer
&&
typedO
ther
.
semanticsLabel
==
semanticsLabel
&&
listEquals
<
InlineSpan
>(
typedO
ther
.
children
,
children
);
return
other
is
TextSpan
&&
o
ther
.
text
==
text
&&
o
ther
.
recognizer
==
recognizer
&&
o
ther
.
semanticsLabel
==
semanticsLabel
&&
listEquals
<
InlineSpan
>(
o
ther
.
children
,
children
);
}
@override
...
...
packages/flutter/lib/src/painting/text_style.dart
View file @
649e1885
...
...
@@ -833,7 +833,7 @@ class TextStyle extends Diagnosticable {
fontFamily:
fontFamily
??
this
.
fontFamily
,
fontFamilyFallback:
fontFamilyFallback
??
this
.
fontFamilyFallback
,
fontSize:
fontSize
==
null
?
null
:
fontSize
*
fontSizeFactor
+
fontSizeDelta
,
fontWeight:
fontWeight
==
null
?
null
:
FontWeight
.
values
[(
fontWeight
.
index
+
fontWeightDelta
).
clamp
(
0
,
FontWeight
.
values
.
length
-
1
)],
fontWeight:
fontWeight
==
null
?
null
:
FontWeight
.
values
[(
fontWeight
.
index
+
fontWeightDelta
).
clamp
(
0
,
FontWeight
.
values
.
length
-
1
)
as
int
],
fontStyle:
fontStyle
,
letterSpacing:
letterSpacing
==
null
?
null
:
letterSpacing
*
letterSpacingFactor
+
letterSpacingDelta
,
wordSpacing:
wordSpacing
==
null
?
null
:
wordSpacing
*
wordSpacingFactor
+
wordSpacingDelta
,
...
...
@@ -1144,28 +1144,28 @@ class TextStyle extends Diagnosticable {
return
true
;
if
(
other
.
runtimeType
!=
runtimeType
)
return
false
;
final
TextStyle
typedOther
=
other
;
return
inherit
==
typedOther
.
inherit
&&
color
==
typedOther
.
color
&&
backgroundColor
==
typedOther
.
backgroundColor
&&
fontFamily
==
typedOther
.
fontFamily
&&
fontSize
==
typedOther
.
fontSize
&&
fontWeight
==
typedOther
.
fontWeight
&&
fontStyle
==
typedOther
.
fontStyle
&&
letterSpacing
==
typedOther
.
letterSpacing
&&
wordSpacing
==
typedOther
.
wordSpacing
&&
textBaseline
==
typedOther
.
textBaseline
&&
height
==
typedOther
.
height
&&
locale
==
typedOther
.
locale
&&
foreground
==
typedOther
.
foreground
&&
background
==
typedOther
.
background
&&
decoration
==
typedOther
.
decoration
&&
decorationColor
==
typedOther
.
decorationColor
&&
decorationStyle
==
typedOther
.
decorationStyle
&&
decorationThickness
==
typedOther
.
decorationThickness
&&
listEquals
(
shadows
,
typedOther
.
shadows
)
&&
listEquals
(
fontFeatures
,
typedOther
.
fontFeatures
)
&&
listEquals
(
fontFamilyFallback
,
typedOther
.
fontFamilyFallback
);
return
other
is
TextStyle
&&
other
.
inherit
==
inherit
&&
other
.
color
==
color
&&
other
.
backgroundColor
==
backgroundColor
&&
other
.
fontFamily
==
fontFamily
&&
other
.
fontSize
==
fontSize
&&
other
.
fontWeight
==
fontWeight
&&
other
.
fontStyle
==
fontStyle
&&
other
.
letterSpacing
==
letterSpacing
&&
other
.
wordSpacing
==
wordSpacing
&&
other
.
textBaseline
==
textBaseline
&&
other
.
height
==
height
&&
other
.
locale
==
locale
&&
other
.
foreground
==
foreground
&&
other
.
background
==
background
&&
other
.
decoration
==
decoration
&&
other
.
decorationColor
==
decorationColor
&&
other
.
decorationStyle
==
decorationStyle
&&
other
.
decorationThickness
==
decorationThickness
&&
listEquals
(
other
.
shadows
,
shadows
)
&&
listEquals
(
other
.
fontFeatures
,
fontFeatures
)
&&
listEquals
(
other
.
fontFamilyFallback
,
fontFamilyFallback
);
}
@override
...
...
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