Commit abb76697 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

apply prefer_asserts_in_initializer_list lint (#10489)

parent c55097da
......@@ -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,
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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.
///
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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.
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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.
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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;
}
......
......@@ -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.
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment