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
abb76697
Commit
abb76697
authored
Jun 05, 2017
by
Alexandre Ardhuin
Committed by
GitHub
Jun 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply prefer_asserts_in_initializer_list lint (#10489)
parent
c55097da
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
185 additions
and
196 deletions
+185
-196
animated_size.dart
packages/flutter/lib/src/rendering/animated_size.dart
+5
-4
custom_layout.dart
packages/flutter/lib/src/rendering/custom_layout.dart
+2
-2
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+4
-4
flex.dart
packages/flutter/lib/src/rendering/flex.dart
+5
-5
flow.dart
packages/flutter/lib/src/rendering/flow.dart
+2
-2
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+3
-5
object.dart
packages/flutter/lib/src/rendering/object.dart
+29
-27
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+7
-8
performance_overlay.dart
packages/flutter/lib/src/rendering/performance_overlay.dart
+8
-9
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+59
-60
rotated_box.dart
packages/flutter/lib/src/rendering/rotated_box.dart
+2
-2
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+21
-24
sliver_fill.dart
packages/flutter/lib/src/rendering/sliver_fill.dart
+4
-4
sliver_grid.dart
packages/flutter/lib/src/rendering/sliver_grid.dart
+3
-4
sliver_multi_box_adaptor.dart
...s/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart
+2
-3
sliver_padding.dart
packages/flutter/lib/src/rendering/sliver_padding.dart
+3
-3
sliver_persistent_header.dart
...s/flutter/lib/src/rendering/sliver_persistent_header.dart
+3
-5
stack.dart
packages/flutter/lib/src/rendering/stack.dart
+4
-4
table.dart
packages/flutter/lib/src/rendering/table.dart
+5
-6
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+7
-8
wrap.dart
packages/flutter/lib/src/rendering/wrap.dart
+7
-7
No files found.
packages/flutter/lib/src/rendering/animated_size.dart
View file @
abb76697
...
...
@@ -39,10 +39,11 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
Curve
curve:
Curves
.
linear
,
FractionalOffset
alignment:
FractionalOffset
.
center
,
RenderBox
child
,
})
:
_vsync
=
vsync
,
super
(
child:
child
,
alignment:
alignment
)
{
assert
(
vsync
!=
null
);
assert
(
duration
!=
null
);
assert
(
curve
!=
null
);
})
:
assert
(
vsync
!=
null
),
assert
(
duration
!=
null
),
assert
(
curve
!=
null
),
_vsync
=
vsync
,
super
(
child:
child
,
alignment:
alignment
)
{
_controller
=
new
AnimationController
(
vsync:
vsync
,
duration:
duration
,
...
...
packages/flutter/lib/src/rendering/custom_layout.dart
View file @
abb76697
...
...
@@ -268,8 +268,8 @@ class RenderCustomMultiChildLayoutBox extends RenderBox
RenderCustomMultiChildLayoutBox
({
List
<
RenderBox
>
children
,
@required
MultiChildLayoutDelegate
delegate
})
:
_delegate
=
delegate
{
assert
(
delegate
!=
null
);
})
:
assert
(
delegate
!=
null
),
_delegate
=
delegate
{
addAll
(
children
);
}
...
...
packages/flutter/lib/src/rendering/editable.dart
View file @
abb76697
...
...
@@ -71,16 +71,16 @@ class RenderEditable extends RenderBox {
@required
ViewportOffset
offset
,
this
.
onSelectionChanged
,
this
.
onCaretChanged
,
})
:
_textPainter
=
new
TextPainter
(
text:
text
,
textAlign:
textAlign
,
textScaleFactor:
textScaleFactor
),
})
:
assert
(
maxLines
!=
null
),
assert
(
textScaleFactor
!=
null
),
assert
(
offset
!=
null
),
_textPainter
=
new
TextPainter
(
text:
text
,
textAlign:
textAlign
,
textScaleFactor:
textScaleFactor
),
_cursorColor
=
cursorColor
,
_showCursor
=
showCursor
??
new
ValueNotifier
<
bool
>(
false
),
_maxLines
=
maxLines
,
_selection
=
selection
,
_offset
=
offset
{
assert
(
_showCursor
!=
null
);
assert
(
maxLines
!=
null
);
assert
(
textScaleFactor
!=
null
);
assert
(
offset
!=
null
);
assert
(!
_showCursor
.
value
||
cursorColor
!=
null
);
_tap
=
new
TapGestureRecognizer
()
..
onTapDown
=
_handleTapDown
...
...
packages/flutter/lib/src/rendering/flex.dart
View file @
abb76697
...
...
@@ -201,15 +201,15 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
MainAxisAlignment
mainAxisAlignment:
MainAxisAlignment
.
start
,
CrossAxisAlignment
crossAxisAlignment:
CrossAxisAlignment
.
center
,
TextBaseline
textBaseline
})
:
_direction
=
direction
,
})
:
assert
(
direction
!=
null
),
assert
(
mainAxisAlignment
!=
null
),
assert
(
mainAxisSize
!=
null
),
assert
(
crossAxisAlignment
!=
null
),
_direction
=
direction
,
_mainAxisAlignment
=
mainAxisAlignment
,
_mainAxisSize
=
mainAxisSize
,
_crossAxisAlignment
=
crossAxisAlignment
,
_textBaseline
=
textBaseline
{
assert
(
direction
!=
null
);
assert
(
mainAxisAlignment
!=
null
);
assert
(
mainAxisSize
!=
null
);
assert
(
crossAxisAlignment
!=
null
);
addAll
(
children
);
}
...
...
packages/flutter/lib/src/rendering/flow.dart
View file @
abb76697
...
...
@@ -182,8 +182,8 @@ class RenderFlow extends RenderBox
RenderFlow
({
List
<
RenderBox
>
children
,
@required
FlowDelegate
delegate
})
:
_delegate
=
delegate
{
assert
(
delegate
!=
null
);
})
:
assert
(
delegate
!=
null
),
_delegate
=
delegate
{
addAll
(
children
);
}
...
...
packages/flutter/lib/src/rendering/layer.dart
View file @
abb76697
...
...
@@ -643,11 +643,9 @@ class PhysicalModelLayer extends ContainerLayer {
@required
this
.
clipRRect
,
@required
this
.
elevation
,
@required
this
.
color
,
})
{
assert
(
clipRRect
!=
null
);
assert
(
elevation
!=
null
);
assert
(
color
!=
null
);
}
})
:
assert
(
clipRRect
!=
null
),
assert
(
elevation
!=
null
),
assert
(
color
!=
null
);
/// The rounded-rect to clip in the parent's coordinate system.
///
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
abb76697
...
...
@@ -57,10 +57,9 @@ typedef void PaintingContextCallback(PaintingContext context, Offset offset);
/// not hold a reference to the canvas across operations that might paint
/// child render objects.
class
PaintingContext
{
PaintingContext
.
_
(
this
.
_containerLayer
,
this
.
_paintBounds
)
{
assert
(
_containerLayer
!=
null
);
assert
(
_paintBounds
!=
null
);
}
PaintingContext
.
_
(
this
.
_containerLayer
,
this
.
_paintBounds
)
:
assert
(
_containerLayer
!=
null
),
assert
(
_paintBounds
!=
null
);
final
ContainerLayer
_containerLayer
;
final
Rect
_paintBounds
;
...
...
@@ -664,19 +663,17 @@ abstract class _SemanticsFragment {
this
.
annotator
,
List
<
_SemanticsFragment
>
children
,
this
.
dropSemanticsOfPreviousSiblings
,
})
{
assert
(
renderObjectOwner
!=
null
);
_ancestorChain
=
<
RenderObject
>[
renderObjectOwner
];
assert
(()
{
if
(
children
==
null
)
return
true
;
final
Set
<
_SemanticsFragment
>
seenChildren
=
new
Set
<
_SemanticsFragment
>();
for
(
_SemanticsFragment
child
in
children
)
assert
(
seenChildren
.
add
(
child
));
// check for duplicate adds
return
true
;
});
_children
=
children
??
const
<
_SemanticsFragment
>[];
}
})
:
assert
(
renderObjectOwner
!=
null
),
assert
(()
{
if
(
children
==
null
)
return
true
;
final
Set
<
_SemanticsFragment
>
seenChildren
=
new
Set
<
_SemanticsFragment
>();
for
(
_SemanticsFragment
child
in
children
)
assert
(
seenChildren
.
add
(
child
));
// check for duplicate adds
return
true
;
}),
_ancestorChain
=
<
RenderObject
>[
renderObjectOwner
],
_children
=
children
??
const
<
_SemanticsFragment
>[];
final
SemanticsAnnotator
annotator
;
bool
dropSemanticsOfPreviousSiblings
;
...
...
@@ -722,10 +719,12 @@ class _CleanSemanticsFragment extends _SemanticsFragment {
_CleanSemanticsFragment
({
@required
RenderObject
renderObjectOwner
,
bool
dropSemanticsOfPreviousSiblings
,
})
:
super
(
renderObjectOwner:
renderObjectOwner
,
dropSemanticsOfPreviousSiblings:
dropSemanticsOfPreviousSiblings
)
{
assert
(
renderObjectOwner
!=
null
);
assert
(
renderObjectOwner
.
_semantics
!=
null
);
}
})
:
assert
(
renderObjectOwner
!=
null
),
assert
(
renderObjectOwner
.
_semantics
!=
null
),
super
(
renderObjectOwner:
renderObjectOwner
,
dropSemanticsOfPreviousSiblings:
dropSemanticsOfPreviousSiblings
);
@override
Iterable
<
SemanticsNode
>
compile
({
_SemanticsGeometry
geometry
,
SemanticsNode
currentSemantics
,
SemanticsNode
parentSemantics
})
sync
*
{
...
...
@@ -903,10 +902,13 @@ class _ForkingSemanticsFragment extends _SemanticsFragment {
RenderObject
renderObjectOwner
,
@required
Iterable
<
_SemanticsFragment
>
children
,
bool
dropSemanticsOfPreviousSiblings
,
})
:
super
(
renderObjectOwner:
renderObjectOwner
,
children:
children
,
dropSemanticsOfPreviousSiblings:
dropSemanticsOfPreviousSiblings
)
{
assert
(
children
!=
null
);
assert
(
children
.
length
>
1
);
}
})
:
assert
(
children
!=
null
),
assert
(
children
.
length
>
1
),
super
(
renderObjectOwner:
renderObjectOwner
,
children:
children
,
dropSemanticsOfPreviousSiblings:
dropSemanticsOfPreviousSiblings
);
@override
Iterable
<
SemanticsNode
>
compile
({
...
...
@@ -946,8 +948,8 @@ class _ForkingSemanticsFragment extends _SemanticsFragment {
/// [PipelineOwner] for the render tree from which you wish to read semantics.
/// You can obtain the [PipelineOwner] using the [RenderObject.owner] property.
class
SemanticsHandle
{
SemanticsHandle
.
_
(
this
.
_owner
,
this
.
listener
)
{
assert
(
_owner
!=
null
);
SemanticsHandle
.
_
(
this
.
_owner
,
this
.
listener
)
:
assert
(
_owner
!=
null
)
{
if
(
listener
!=
null
)
_owner
.
semanticsOwner
.
addListener
(
listener
);
}
...
...
packages/flutter/lib/src/rendering/paragraph.dart
View file @
abb76697
...
...
@@ -38,7 +38,12 @@ class RenderParagraph extends RenderBox {
TextOverflow
overflow:
TextOverflow
.
clip
,
double
textScaleFactor:
1.0
,
int
maxLines
,
})
:
_softWrap
=
softWrap
,
})
:
assert
(
text
!=
null
),
assert
(
text
.
debugAssertIsValid
()),
assert
(
softWrap
!=
null
),
assert
(
overflow
!=
null
),
assert
(
textScaleFactor
!=
null
),
_softWrap
=
softWrap
,
_overflow
=
overflow
,
_textPainter
=
new
TextPainter
(
text:
text
,
...
...
@@ -46,13 +51,7 @@ class RenderParagraph extends RenderBox {
textScaleFactor:
textScaleFactor
,
maxLines:
maxLines
,
ellipsis:
overflow
==
TextOverflow
.
ellipsis
?
_kEllipsis
:
null
,
)
{
assert
(
text
!=
null
);
assert
(
text
.
debugAssertIsValid
());
assert
(
softWrap
!=
null
);
assert
(
overflow
!=
null
);
assert
(
textScaleFactor
!=
null
);
}
);
final
TextPainter
_textPainter
;
...
...
packages/flutter/lib/src/rendering/performance_overlay.dart
View file @
abb76697
...
...
@@ -66,15 +66,14 @@ class RenderPerformanceOverlay extends RenderBox {
int
rasterizerThreshold:
0
,
bool
checkerboardRasterCacheImages:
false
,
bool
checkerboardOffscreenLayers:
false
,
})
:
_optionsMask
=
optionsMask
,
_rasterizerThreshold
=
rasterizerThreshold
,
_checkerboardRasterCacheImages
=
checkerboardRasterCacheImages
,
_checkerboardOffscreenLayers
=
checkerboardOffscreenLayers
{
assert
(
optionsMask
!=
null
);
assert
(
rasterizerThreshold
!=
null
);
assert
(
checkerboardRasterCacheImages
!=
null
);
assert
(
checkerboardOffscreenLayers
!=
null
);
}
})
:
assert
(
optionsMask
!=
null
),
assert
(
rasterizerThreshold
!=
null
),
assert
(
checkerboardRasterCacheImages
!=
null
),
assert
(
checkerboardOffscreenLayers
!=
null
),
_optionsMask
=
optionsMask
,
_rasterizerThreshold
=
rasterizerThreshold
,
_checkerboardRasterCacheImages
=
checkerboardRasterCacheImages
,
_checkerboardOffscreenLayers
=
checkerboardOffscreenLayers
;
/// The mask is created by shifting 1 by the index of the specific
/// [PerformanceOverlayOption] to enable.
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
abb76697
...
...
@@ -201,10 +201,10 @@ class RenderConstrainedBox extends RenderProxyBox {
RenderConstrainedBox
({
RenderBox
child
,
@required
BoxConstraints
additionalConstraints
,
})
:
_additionalConstraints
=
additionalConstraints
,
super
(
child
)
{
assert
(
additionalConstraints
!=
null
);
assert
(
additionalConstraints
.
debugAssertIsValid
());
}
})
:
assert
(
additionalConstraints
!=
null
),
assert
(
additionalConstraints
.
debugAssertIsValid
()),
_additionalConstraints
=
additionalConstraints
,
super
(
child
);
/// Additional constraints to apply to [child] during layout
BoxConstraints
get
additionalConstraints
=>
_additionalConstraints
;
...
...
@@ -311,10 +311,11 @@ class RenderLimitedBox extends RenderProxyBox {
RenderBox
child
,
double
maxWidth:
double
.
INFINITY
,
double
maxHeight:
double
.
INFINITY
})
:
_maxWidth
=
maxWidth
,
_maxHeight
=
maxHeight
,
super
(
child
)
{
assert
(
maxWidth
!=
null
&&
maxWidth
>=
0.0
);
assert
(
maxHeight
!=
null
&&
maxHeight
>=
0.0
);
}
})
:
assert
(
maxWidth
!=
null
&&
maxWidth
>=
0.0
),
assert
(
maxHeight
!=
null
&&
maxHeight
>=
0.0
),
_maxWidth
=
maxWidth
,
_maxHeight
=
maxHeight
,
super
(
child
);
/// The value to use for maxWidth if the incoming maxWidth constraint is infinite.
double
get
maxWidth
=>
_maxWidth
;
...
...
@@ -400,11 +401,11 @@ class RenderAspectRatio extends RenderProxyBox {
RenderAspectRatio
({
RenderBox
child
,
@required
double
aspectRatio
,
})
:
_aspectRatio
=
aspectRatio
,
super
(
child
)
{
assert
(
aspectRatio
!=
null
);
assert
(
aspectRatio
>
0.0
);
assert
(
aspectRatio
.
isFinite
);
}
})
:
assert
(
aspectRatio
!=
null
),
assert
(
aspectRatio
>
0.0
),
assert
(
aspectRatio
.
isFinite
),
_aspectRatio
=
aspectRatio
,
super
(
child
);
/// The aspect ratio to attempt to use.
///
...
...
@@ -714,10 +715,11 @@ class RenderOpacity extends RenderProxyBox {
///
/// The [opacity] argument must be between 0.0 and 1.0, inclusive.
RenderOpacity
({
double
opacity:
1.0
,
RenderBox
child
})
:
_opacity
=
opacity
,
_alpha
=
_getAlphaFromOpacity
(
opacity
),
super
(
child
)
{
assert
(
opacity
!=
null
);
assert
(
opacity
>=
0.0
&&
opacity
<=
1.0
);
}
:
assert
(
opacity
!=
null
),
assert
(
opacity
>=
0.0
&&
opacity
<=
1.0
),
_opacity
=
opacity
,
_alpha
=
_getAlphaFromOpacity
(
opacity
),
super
(
child
);
@override
bool
get
alwaysNeedsCompositing
=>
child
!=
null
&&
(
_alpha
!=
0
&&
_alpha
!=
255
);
...
...
@@ -792,10 +794,11 @@ class RenderShaderMask extends RenderProxyBox {
RenderBox
child
,
@required
ShaderCallback
shaderCallback
,
BlendMode
blendMode:
BlendMode
.
modulate
,
})
:
_shaderCallback
=
shaderCallback
,
_blendMode
=
blendMode
,
super
(
child
)
{
assert
(
shaderCallback
!=
null
);
assert
(
blendMode
!=
null
);
}
})
:
assert
(
shaderCallback
!=
null
),
assert
(
blendMode
!=
null
),
_shaderCallback
=
shaderCallback
,
_blendMode
=
blendMode
,
super
(
child
);
/// Called to creates the [Shader] that generates the mask.
///
...
...
@@ -849,9 +852,9 @@ class RenderBackdropFilter extends RenderProxyBox {
///
/// The [filter] argument must not be null.
RenderBackdropFilter
({
RenderBox
child
,
@required
ui
.
ImageFilter
filter
})
:
_filter
=
filter
,
super
(
child
)
{
assert
(
filter
!=
null
);
}
:
assert
(
filter
!=
null
),
_filter
=
filter
,
super
(
child
);
/// The image filter to apply to the existing painted content before painting
/// the child.
...
...
@@ -1221,15 +1224,14 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> {
BorderRadius
borderRadius
,
double
elevation:
0.0
,
@required
Color
color
,
})
:
_shape
=
shape
,
})
:
assert
(
shape
!=
null
),
assert
(
elevation
!=
null
),
assert
(
color
!=
null
),
_shape
=
shape
,
_borderRadius
=
borderRadius
,
_elevation
=
elevation
,
_color
=
color
,
super
(
child:
child
)
{
assert
(
shape
!=
null
);
assert
(
elevation
!=
null
);
assert
(
color
!=
null
);
}
super
(
child:
child
);
/// The shape of the layer.
///
...
...
@@ -1347,14 +1349,13 @@ class RenderDecoratedBox extends RenderProxyBox {
DecorationPosition
position:
DecorationPosition
.
background
,
ImageConfiguration
configuration:
ImageConfiguration
.
empty
,
RenderBox
child
})
:
_decoration
=
decoration
,
})
:
assert
(
decoration
!=
null
),
assert
(
position
!=
null
),
assert
(
configuration
!=
null
),
_decoration
=
decoration
,
_position
=
position
,
_configuration
=
configuration
,
super
(
child
)
{
assert
(
decoration
!=
null
);
assert
(
position
!=
null
);
assert
(
configuration
!=
null
);
}
super
(
child
);
BoxPainter
_painter
;
...
...
@@ -1468,9 +1469,9 @@ class RenderTransform extends RenderProxyBox {
FractionalOffset
alignment
,
this
.
transformHitTests
:
true
,
RenderBox
child
})
:
super
(
child
)
{
assert
(
transform
!=
null
);
assert
(
alignment
==
null
||
(
alignment
.
dx
!=
null
&&
alignment
.
dy
!=
null
));
})
:
assert
(
transform
!=
null
),
assert
(
alignment
==
null
||
(
alignment
.
dx
!=
null
&&
alignment
.
dy
!=
null
)),
super
(
child
)
{
this
.
transform
=
transform
;
this
.
alignment
=
alignment
;
this
.
origin
=
origin
;
...
...
@@ -1633,10 +1634,11 @@ class RenderFittedBox extends RenderProxyBox {
RenderBox
child
,
BoxFit
fit:
BoxFit
.
contain
,
FractionalOffset
alignment:
FractionalOffset
.
center
})
:
_fit
=
fit
,
_alignment
=
alignment
,
super
(
child
)
{
assert
(
fit
!=
null
);
assert
(
alignment
!=
null
&&
alignment
.
dx
!=
null
&&
alignment
.
dy
!=
null
);
}
})
:
assert
(
fit
!=
null
),
assert
(
alignment
!=
null
&&
alignment
.
dx
!=
null
&&
alignment
.
dy
!=
null
),
_fit
=
fit
,
_alignment
=
alignment
,
super
(
child
);
/// How to inscribe the child into the space allocated during layout.
BoxFit
get
fit
=>
_fit
;
...
...
@@ -1771,9 +1773,9 @@ class RenderFractionalTranslation extends RenderProxyBox {
FractionalOffset
translation
,
this
.
transformHitTests
:
true
,
RenderBox
child
})
:
_translation
=
translation
,
super
(
child
)
{
assert
(
translation
==
null
||
(
translation
.
dx
!=
null
&&
translation
.
dy
!=
null
));
}
})
:
assert
(
translation
==
null
||
(
translation
.
dx
!=
null
&&
translation
.
dy
!=
null
)),
_translation
=
translation
,
super
(
child
);
/// The translation to apply to the child, as a multiple of the size.
FractionalOffset
get
translation
=>
_translation
;
...
...
@@ -2020,12 +2022,11 @@ class RenderCustomPaint extends RenderProxyBox {
CustomPainter
foregroundPainter
,
Size
preferredSize:
Size
.
zero
,
RenderBox
child
,
})
:
_painter
=
painter
,
})
:
assert
(
preferredSize
!=
null
),
_painter
=
painter
,
_foregroundPainter
=
foregroundPainter
,
_preferredSize
=
preferredSize
,
super
(
child
)
{
assert
(
preferredSize
!=
null
);
}
super
(
child
);
/// The background custom paint delegate.
///
...
...
@@ -2490,9 +2491,9 @@ class RenderOffstage extends RenderProxyBox {
RenderOffstage
({
bool
offstage:
true
,
RenderBox
child
})
:
_offstage
=
offstage
,
super
(
child
)
{
assert
(
offstage
!=
null
);
}
})
:
assert
(
offstage
!=
null
),
_offstage
=
offstage
,
super
(
child
);
/// Whether the child is hidden from the rest of the tree.
///
...
...
@@ -2609,9 +2610,8 @@ class RenderAbsorbPointer extends RenderProxyBox {
RenderAbsorbPointer
({
RenderBox
child
,
this
.
absorbing
:
true
})
:
super
(
child
)
{
assert
(
absorbing
!=
null
);
}
})
:
assert
(
absorbing
!=
null
),
super
(
child
);
/// Whether this render object absorbs pointers during hit testing.
///
...
...
@@ -2824,12 +2824,11 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
bool
container:
false
,
bool
checked
,
String
label
})
:
_container
=
container
,
})
:
assert
(
container
!=
null
),
_container
=
container
,
_checked
=
checked
,
_label
=
label
,
super
(
child
)
{
assert
(
container
!=
null
);
}
super
(
child
);
/// If 'container' is true, this RenderObject will introduce a new
/// node in the semantics tree. Otherwise, the semantics will be
...
...
packages/flutter/lib/src/rendering/rotated_box.dart
View file @
abb76697
...
...
@@ -26,8 +26,8 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB
RenderRotatedBox
({
@required
int
quarterTurns
,
RenderBox
child
})
:
_quarterTurns
=
quarterTurns
{
assert
(
quarterTurns
!=
null
);
})
:
assert
(
quarterTurns
!=
null
),
_quarterTurns
=
quarterTurns
{
this
.
child
=
child
;
}
...
...
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
abb76697
...
...
@@ -93,10 +93,10 @@ class RenderPadding extends RenderShiftedBox {
RenderPadding
({
@required
EdgeInsets
padding
,
RenderBox
child
})
:
_padding
=
padding
,
super
(
child
)
{
assert
(
padding
!=
null
);
assert
(
padding
.
isNonNegative
);
}
})
:
assert
(
padding
!=
null
),
assert
(
padding
.
isNonNegative
),
_padding
=
padding
,
super
(
child
);
/// The amount to pad the child in each dimension.
EdgeInsets
get
padding
=>
_padding
;
...
...
@@ -192,9 +192,9 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
RenderAligningShiftedBox
({
FractionalOffset
alignment:
FractionalOffset
.
center
,
RenderBox
child
})
:
_alignment
=
alignment
,
super
(
child
)
{
assert
(
alignment
!=
null
&&
alignment
.
dx
!=
null
&&
alignment
.
dy
!=
null
);
}
})
:
assert
(
alignment
!=
null
&&
alignment
.
dx
!=
null
&&
alignment
.
dy
!=
null
),
_alignment
=
alignment
,
super
(
child
);
/// How to align the child.
///
...
...
@@ -259,12 +259,11 @@ class RenderPositionedBox extends RenderAligningShiftedBox {
double
widthFactor
,
double
heightFactor
,
FractionalOffset
alignment:
FractionalOffset
.
center
})
:
_widthFactor
=
widthFactor
,
})
:
assert
(
widthFactor
==
null
||
widthFactor
>=
0.0
),
assert
(
heightFactor
==
null
||
heightFactor
>=
0.0
),
_widthFactor
=
widthFactor
,
_heightFactor
=
heightFactor
,
super
(
child:
child
,
alignment:
alignment
)
{
assert
(
widthFactor
==
null
||
widthFactor
>=
0.0
);
assert
(
heightFactor
==
null
||
heightFactor
>=
0.0
);
}
super
(
child:
child
,
alignment:
alignment
);
/// If non-null, sets its width to the child's width multipled by this factor.
///
...
...
@@ -499,10 +498,9 @@ class RenderSizedOverflowBox extends RenderAligningShiftedBox {
RenderBox
child
,
@required
Size
requestedSize
,
FractionalOffset
alignment:
FractionalOffset
.
center
})
:
_requestedSize
=
requestedSize
,
super
(
child:
child
,
alignment:
alignment
)
{
assert
(
requestedSize
!=
null
);
}
})
:
assert
(
requestedSize
!=
null
),
_requestedSize
=
requestedSize
,
super
(
child:
child
,
alignment:
alignment
);
/// The size this render box should attempt to be.
Size
get
requestedSize
=>
_requestedSize
;
...
...
@@ -791,9 +789,9 @@ class RenderCustomSingleChildLayoutBox extends RenderShiftedBox {
RenderCustomSingleChildLayoutBox
({
RenderBox
child
,
@required
SingleChildLayoutDelegate
delegate
})
:
_delegate
=
delegate
,
super
(
child
)
{
assert
(
delegate
!=
null
);
}
})
:
assert
(
delegate
!=
null
),
_delegate
=
delegate
,
super
(
child
);
/// A delegate that controls this object's layout.
SingleChildLayoutDelegate
get
delegate
=>
_delegate
;
...
...
@@ -901,12 +899,11 @@ class RenderBaseline extends RenderShiftedBox {
RenderBox
child
,
@required
double
baseline
,
@required
TextBaseline
baselineType
})
:
_baseline
=
baseline
,
})
:
assert
(
baseline
!=
null
),
assert
(
baselineType
!=
null
),
_baseline
=
baseline
,
_baselineType
=
baselineType
,
super
(
child
)
{
assert
(
baseline
!=
null
);
assert
(
baselineType
!=
null
);
}
super
(
child
);
/// The number of logical pixels from the top of this box at which to position
/// the child's baseline.
...
...
packages/flutter/lib/src/rendering/sliver_fill.dart
View file @
abb76697
...
...
@@ -34,10 +34,10 @@ class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor {
RenderSliverFillViewport
({
@required
RenderSliverBoxChildManager
childManager
,
double
viewportFraction:
1.0
,
})
:
_viewportFraction
=
viewportFraction
,
super
(
childManager:
childManager
)
{
assert
(
viewportFraction
!=
null
);
assert
(
viewportFraction
>
0.0
);
}
})
:
assert
(
viewportFraction
!=
null
),
assert
(
viewportFraction
>
0.0
),
_viewportFraction
=
viewportFraction
,
super
(
childManager:
childManager
);
@override
double
get
itemExtent
=>
constraints
.
viewportMainAxisExtent
*
viewportFraction
;
...
...
packages/flutter/lib/src/rendering/sliver_grid.dart
View file @
abb76697
...
...
@@ -456,10 +456,9 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
RenderSliverGrid
({
@required
RenderSliverBoxChildManager
childManager
,
@required
SliverGridDelegate
gridDelegate
,
})
:
_gridDelegate
=
gridDelegate
,
super
(
childManager:
childManager
)
{
assert
(
gridDelegate
!=
null
);
}
})
:
assert
(
gridDelegate
!=
null
),
_gridDelegate
=
gridDelegate
,
super
(
childManager:
childManager
);
@override
void
setupParentData
(
RenderObject
child
)
{
...
...
packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart
View file @
abb76697
...
...
@@ -149,9 +149,8 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
/// The [childManager] argument must not be null.
RenderSliverMultiBoxAdaptor
({
@required
RenderSliverBoxChildManager
childManager
})
:
_childManager
=
childManager
{
assert
(
childManager
!=
null
);
}
})
:
assert
(
childManager
!=
null
),
_childManager
=
childManager
;
@override
void
setupParentData
(
RenderObject
child
)
{
...
...
packages/flutter/lib/src/rendering/sliver_padding.dart
View file @
abb76697
...
...
@@ -31,9 +31,9 @@ class RenderSliverPadding extends RenderSliver with RenderObjectWithChildMixin<R
RenderSliverPadding
({
@required
EdgeInsets
padding
,
RenderSliver
child
,
})
:
_padding
=
padding
{
assert
(
padding
!=
null
);
assert
(
padding
.
isNonNegative
);
})
:
assert
(
padding
!=
null
),
assert
(
padding
.
isNonNegative
),
_padding
=
padding
{
this
.
child
=
child
;
}
...
...
packages/flutter/lib/src/rendering/sliver_persistent_header.dart
View file @
abb76697
...
...
@@ -270,11 +270,9 @@ class FloatingHeaderSnapConfiguration {
@required
this
.
vsync
,
this
.
curve
:
Curves
.
ease
,
this
.
duration
:
const
Duration
(
milliseconds:
300
),
})
{
assert
(
vsync
!=
null
);
assert
(
curve
!=
null
);
assert
(
duration
!=
null
);
}
})
:
assert
(
vsync
!=
null
),
assert
(
curve
!=
null
),
assert
(
duration
!=
null
);
/// The [TickerProvider] for the [AnimationController] that causes a
/// floating header to snap in or out of view.
...
...
packages/flutter/lib/src/rendering/stack.dart
View file @
abb76697
...
...
@@ -300,12 +300,12 @@ class RenderStack extends RenderBox
FractionalOffset
alignment:
FractionalOffset
.
topLeft
,
StackFit
fit:
StackFit
.
loose
,
Overflow
overflow:
Overflow
.
clip
})
:
_alignment
=
alignment
,
})
:
assert
(
alignment
!=
null
),
assert
(
fit
!=
null
),
assert
(
overflow
!=
null
),
_alignment
=
alignment
,
_fit
=
fit
,
_overflow
=
overflow
{
assert
(
alignment
!=
null
);
assert
(
fit
!=
null
);
assert
(
overflow
!=
null
);
addAll
(
children
);
}
...
...
packages/flutter/lib/src/rendering/table.dart
View file @
abb76697
...
...
@@ -489,12 +489,11 @@ class RenderTable extends RenderBox {
TableCellVerticalAlignment
defaultVerticalAlignment:
TableCellVerticalAlignment
.
top
,
TextBaseline
textBaseline
,
List
<
List
<
RenderBox
>>
children
})
{
assert
(
columns
==
null
||
columns
>=
0
);
assert
(
rows
==
null
||
rows
>=
0
);
assert
(
rows
==
null
||
children
==
null
);
assert
(
defaultColumnWidth
!=
null
);
assert
(
configuration
!=
null
);
})
:
assert
(
columns
==
null
||
columns
>=
0
),
assert
(
rows
==
null
||
rows
>=
0
),
assert
(
rows
==
null
||
children
==
null
),
assert
(
defaultColumnWidth
!=
null
),
assert
(
configuration
!=
null
)
{
_columns
=
columns
??
(
children
!=
null
&&
children
.
isNotEmpty
?
children
.
first
.
length
:
0
);
_rows
=
rows
??
0
;
_children
=
<
RenderBox
>[]..
length
=
_columns
*
_rows
;
...
...
packages/flutter/lib/src/rendering/viewport.dart
View file @
abb76697
...
...
@@ -80,11 +80,10 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
RenderViewportBase
({
AxisDirection
axisDirection:
AxisDirection
.
down
,
@required
ViewportOffset
offset
,
})
:
_axisDirection
=
axisDirection
,
_offset
=
offset
{
assert
(
axisDirection
!=
null
);
assert
(
offset
!=
null
);
}
})
:
assert
(
axisDirection
!=
null
),
assert
(
offset
!=
null
),
_axisDirection
=
axisDirection
,
_offset
=
offset
;
/// The direction in which the [SliverConstraints.scrollOffset] increases.
///
...
...
@@ -639,11 +638,11 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
double
anchor:
0.0
,
List
<
RenderSliver
>
children
,
RenderSliver
center
,
})
:
_anchor
=
anchor
,
})
:
assert
(
anchor
!=
null
),
assert
(
anchor
>=
0.0
&&
anchor
<=
1.0
),
_anchor
=
anchor
,
_center
=
center
,
super
(
axisDirection:
axisDirection
,
offset:
offset
)
{
assert
(
anchor
!=
null
);
assert
(
anchor
>=
0.0
&&
anchor
<=
1.0
);
addAll
(
children
);
if
(
center
==
null
&&
firstChild
!=
null
)
_center
=
firstChild
;
...
...
packages/flutter/lib/src/rendering/wrap.dart
View file @
abb76697
...
...
@@ -91,18 +91,18 @@ class RenderWrap extends RenderBox with ContainerRenderObjectMixin<RenderBox, Wr
WrapAlignment
runAlignment:
WrapAlignment
.
start
,
double
runSpacing:
0.0
,
WrapCrossAlignment
crossAxisAlignment:
WrapCrossAlignment
.
start
,
})
:
_direction
=
direction
,
})
:
assert
(
direction
!=
null
),
assert
(
alignment
!=
null
),
assert
(
spacing
!=
null
),
assert
(
runAlignment
!=
null
),
assert
(
runSpacing
!=
null
),
assert
(
crossAxisAlignment
!=
null
),
_direction
=
direction
,
_alignment
=
alignment
,
_spacing
=
spacing
,
_runAlignment
=
runAlignment
,
_runSpacing
=
runSpacing
,
_crossAxisAlignment
=
crossAxisAlignment
{
assert
(
direction
!=
null
);
assert
(
alignment
!=
null
);
assert
(
spacing
!=
null
);
assert
(
runAlignment
!=
null
);
assert
(
runSpacing
!=
null
);
assert
(
crossAxisAlignment
!=
null
);
addAll
(
children
);
}
...
...
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