format initializer list of constructors (#27111)

This commit is contained in:
Alexandre Ardhuin 2019-01-29 21:47:16 +01:00 committed by GitHub
parent ca92efecae
commit ef276ffea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
107 changed files with 675 additions and 549 deletions

View File

@ -267,7 +267,9 @@ class Tween<T extends dynamic> extends Animatable<T> {
/// A [Tween] that evaluates its [parent] in reverse. /// A [Tween] that evaluates its [parent] in reverse.
class ReverseTween<T> extends Tween<T> { class ReverseTween<T> extends Tween<T> {
/// Construct a [Tween] that evaluates its [parent] in reverse. /// Construct a [Tween] that evaluates its [parent] in reverse.
ReverseTween(this.parent) : assert(parent != null), super(begin: parent.end, end: parent.begin); ReverseTween(this.parent)
: assert(parent != null),
super(begin: parent.end, end: parent.begin);
/// This tween's value is the same as the parent's value evaluated in reverse. /// This tween's value is the same as the parent's value evaluated in reverse.
/// ///

View File

@ -44,7 +44,9 @@ class TweenSequence<T> extends Animatable<T> {
/// There's a small cost associated with building a `TweenSequence` so /// There's a small cost associated with building a `TweenSequence` so
/// it's best to reuse one, rather than rebuilding it on every frame, /// it's best to reuse one, rather than rebuilding it on every frame,
/// when that's possible. /// when that's possible.
TweenSequence(List<TweenSequenceItem<T>> items) : assert(items != null), assert(items.isNotEmpty) { TweenSequence(List<TweenSequenceItem<T>> items)
: assert(items != null),
assert(items.isNotEmpty) {
_items.addAll(items); _items.addAll(items);
double totalWeight = 0.0; double totalWeight = 0.0;
@ -95,7 +97,9 @@ class TweenSequenceItem<T> {
const TweenSequenceItem({ const TweenSequenceItem({
@required this.tween, @required this.tween,
@required this.weight, @required this.weight,
}) : assert(tween != null), assert(weight != null), assert(weight > 0.0); }) : assert(tween != null),
assert(weight != null),
assert(weight > 0.0);
/// Defines the value of the [TweenSequence] for the interval within the /// Defines the value of the [TweenSequence] for the interval within the
/// animation's duration indicated by [weight] and this item's position /// animation's duration indicated by [weight] and this item's position

View File

@ -7,10 +7,15 @@ import 'dart:typed_data';
// TODO(abarth): Consider using vector_math. // TODO(abarth): Consider using vector_math.
class _Vector { class _Vector {
_Vector(int size) : _offset = 0, _length = size, _elements = Float64List(size); _Vector(int size)
: _offset = 0,
_length = size,
_elements = Float64List(size);
_Vector.fromVOL(List<double> values, int offset, int length) _Vector.fromVOL(List<double> values, int offset, int length)
: _offset = offset, _length = length, _elements = values; : _offset = offset,
_length = length,
_elements = values;
final int _offset; final int _offset;

View File

@ -330,8 +330,7 @@ class VerticalDragGestureRecognizer extends DragGestureRecognizer {
/// track each touch point independently. /// track each touch point independently.
class HorizontalDragGestureRecognizer extends DragGestureRecognizer { class HorizontalDragGestureRecognizer extends DragGestureRecognizer {
/// Create a gesture recognizer for interactions in the horizontal axis. /// Create a gesture recognizer for interactions in the horizontal axis.
HorizontalDragGestureRecognizer({ Object debugOwner }) : HorizontalDragGestureRecognizer({ Object debugOwner }) : super(debugOwner: debugOwner);
super(debugOwner: debugOwner);
@override @override
bool _isFlingGesture(VelocityEstimate estimate) { bool _isFlingGesture(VelocityEstimate estimate) {

View File

@ -22,7 +22,8 @@ class UnderlineTabIndicator extends Decoration {
const UnderlineTabIndicator({ const UnderlineTabIndicator({
this.borderSide = const BorderSide(width: 2.0, color: Colors.white), this.borderSide = const BorderSide(width: 2.0, color: Colors.white),
this.insets = EdgeInsets.zero, this.insets = EdgeInsets.zero,
}) : assert(borderSide != null), assert(insets != null); }) : assert(borderSide != null),
assert(insets != null);
/// The color and weight of the horizontal line drawn below the selected tab. /// The color and weight of the horizontal line drawn below the selected tab.
final BorderSide borderSide; final BorderSide borderSide;
@ -64,7 +65,8 @@ class UnderlineTabIndicator extends Decoration {
class _UnderlinePainter extends BoxPainter { class _UnderlinePainter extends BoxPainter {
_UnderlinePainter(this.decoration, VoidCallback onChanged) _UnderlinePainter(this.decoration, VoidCallback onChanged)
: assert(decoration != null), super(onChanged); : assert(decoration != null),
super(onChanged);
final UnderlineTabIndicator decoration; final UnderlineTabIndicator decoration;

View File

@ -1236,7 +1236,10 @@ class TabPageSelectorIndicator extends StatelessWidget {
@required this.backgroundColor, @required this.backgroundColor,
@required this.borderColor, @required this.borderColor,
@required this.size, @required this.size,
}) : assert(backgroundColor != null), assert(borderColor != null), assert(size != null), super(key: key); }) : assert(backgroundColor != null),
assert(borderColor != null),
assert(size != null),
super(key: key);
/// The indicator circle's background color. /// The indicator circle's background color.
final Color backgroundColor; final Color backgroundColor;
@ -1275,7 +1278,8 @@ class TabPageSelector extends StatelessWidget {
this.indicatorSize = 12.0, this.indicatorSize = 12.0,
this.color, this.color,
this.selectedColor, this.selectedColor,
}) : assert(indicatorSize != null && indicatorSize > 0.0), super(key: key); }) : assert(indicatorSize != null && indicatorSize > 0.0),
super(key: key);
/// This widget's selection and animation state. /// This widget's selection and animation state.
/// ///

View File

@ -57,7 +57,9 @@ class TimeOfDay {
/// ///
/// The [hour] is set to the time's hour and the [minute] is set to the time's /// The [hour] is set to the time's hour and the [minute] is set to the time's
/// minute in the timezone of the given [DateTime]. /// minute in the timezone of the given [DateTime].
TimeOfDay.fromDateTime(DateTime time) : hour = time.hour, minute = time.minute; TimeOfDay.fromDateTime(DateTime time)
: hour = time.hour,
minute = time.minute;
/// Creates a time of day based on the current time. /// Creates a time of day based on the current time.
/// ///

View File

@ -330,7 +330,10 @@ class EdgeInsets extends EdgeInsetsGeometry {
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
const EdgeInsets.all(double value) const EdgeInsets.all(double value)
: left = value, top = value, right = value, bottom = value; : left = value,
top = value,
right = value,
bottom = value;
/// Creates insets with only the given values non-zero. /// Creates insets with only the given values non-zero.
/// ///
@ -359,9 +362,13 @@ class EdgeInsets extends EdgeInsetsGeometry {
/// const EdgeInsets.symmetric(vertical: 8.0) /// const EdgeInsets.symmetric(vertical: 8.0)
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
const EdgeInsets.symmetric({ double vertical = 0.0, const EdgeInsets.symmetric({
double horizontal = 0.0 }) double vertical = 0.0,
: left = horizontal, top = vertical, right = horizontal, bottom = vertical; double horizontal = 0.0,
}) : left = horizontal,
top = vertical,
right = horizontal,
bottom = vertical;
/// Creates insets that match the given window padding. /// Creates insets that match the given window padding.
/// ///

View File

@ -323,7 +323,8 @@ class TextureLayer extends Layer {
@required this.rect, @required this.rect,
@required this.textureId, @required this.textureId,
this.freeze = false, this.freeze = false,
}): assert(rect != null), assert(textureId != null); }) : assert(rect != null),
assert(textureId != null);
/// Bounding rectangle of this layer. /// Bounding rectangle of this layer.
final Rect rect; final Rect rect;
@ -366,7 +367,8 @@ class PlatformViewLayer extends Layer {
PlatformViewLayer({ PlatformViewLayer({
@required this.rect, @required this.rect,
@required this.viewId, @required this.viewId,
}): assert(rect != null), assert(viewId != null); }) : assert(rect != null),
assert(viewId != null);
/// Bounding rectangle of this layer in the global coordinate space. /// Bounding rectangle of this layer in the global coordinate space.
final Rect rect; final Rect rect;
@ -815,9 +817,13 @@ class ClipRectLayer extends ContainerLayer {
/// ///
/// The [clipRect] property must be non-null before the compositing phase of /// The [clipRect] property must be non-null before the compositing phase of
/// the pipeline. /// the pipeline.
ClipRectLayer({ @required Rect clipRect, Clip clipBehavior = Clip.hardEdge }) : ClipRectLayer({
_clipRect = clipRect, _clipBehavior = clipBehavior, @required Rect clipRect,
assert(clipBehavior != null), assert(clipBehavior != Clip.none); Clip clipBehavior = Clip.hardEdge,
}) : _clipRect = clipRect,
_clipBehavior = clipBehavior,
assert(clipBehavior != null),
assert(clipBehavior != Clip.none);
/// The rectangle to clip in the parent's coordinate system. /// The rectangle to clip in the parent's coordinate system.
/// ///
@ -887,9 +893,13 @@ class ClipRRectLayer extends ContainerLayer {
/// ///
/// The [clipRRect] property must be non-null before the compositing phase of /// The [clipRRect] property must be non-null before the compositing phase of
/// the pipeline. /// the pipeline.
ClipRRectLayer({ @required RRect clipRRect, Clip clipBehavior = Clip.antiAlias }) : ClipRRectLayer({
_clipRRect = clipRRect, _clipBehavior = clipBehavior, @required RRect clipRRect,
assert(clipBehavior != null), assert(clipBehavior != Clip.none); Clip clipBehavior = Clip.antiAlias,
}) : _clipRRect = clipRRect,
_clipBehavior = clipBehavior,
assert(clipBehavior != null),
assert(clipBehavior != Clip.none);
/// The rounded-rect to clip in the parent's coordinate system. /// The rounded-rect to clip in the parent's coordinate system.
/// ///
@ -955,9 +965,13 @@ class ClipPathLayer extends ContainerLayer {
/// ///
/// The [clipPath] property must be non-null before the compositing phase of /// The [clipPath] property must be non-null before the compositing phase of
/// the pipeline. /// the pipeline.
ClipPathLayer({ @required Path clipPath, Clip clipBehavior = Clip.antiAlias }) : ClipPathLayer({
_clipPath = clipPath, _clipBehavior = clipBehavior, @required Path clipPath,
assert(clipBehavior != null), assert(clipBehavior != Clip.none); Clip clipBehavior = Clip.antiAlias,
}) : _clipPath = clipPath,
_clipBehavior = clipBehavior,
assert(clipBehavior != null),
assert(clipBehavior != Clip.none);
/// The path to clip in the parent's coordinate system. /// The path to clip in the parent's coordinate system.
/// ///
@ -1094,8 +1108,11 @@ class OpacityLayer extends ContainerLayer {
/// ///
/// The [alpha] property must be non-null before the compositing phase of /// The [alpha] property must be non-null before the compositing phase of
/// the pipeline. /// the pipeline.
OpacityLayer({ @required int alpha, Offset offset = Offset.zero }) OpacityLayer({
: _alpha = alpha, _offset = offset; @required int alpha,
Offset offset = Offset.zero,
}) : _alpha = alpha,
_offset = offset;
/// The amount to multiply into the alpha channel. /// The amount to multiply into the alpha channel.
/// ///
@ -1152,8 +1169,13 @@ class ShaderMaskLayer extends ContainerLayer {
/// ///
/// The [shader], [maskRect], and [blendMode] properties must be non-null /// The [shader], [maskRect], and [blendMode] properties must be non-null
/// before the compositing phase of the pipeline. /// before the compositing phase of the pipeline.
ShaderMaskLayer({ @required Shader shader, @required Rect maskRect, @required BlendMode blendMode }) ShaderMaskLayer({
: _shader = shader, _maskRect = maskRect, _blendMode = blendMode; @required Shader shader,
@required Rect maskRect,
@required BlendMode blendMode,
}) : _shader = shader,
_maskRect = maskRect,
_blendMode = blendMode;
/// The shader to apply to the children. /// The shader to apply to the children.
/// ///

View File

@ -1153,7 +1153,9 @@ abstract class _RenderCustomClip<T> extends RenderProxyBox {
RenderBox child, RenderBox child,
CustomClipper<T> clipper, CustomClipper<T> clipper,
this.clipBehavior = Clip.antiAlias, this.clipBehavior = Clip.antiAlias,
}) : _clipper = clipper, assert(clipBehavior != null), super(child); }) : _clipper = clipper,
assert(clipBehavior != null),
super(child);
/// If non-null, determines which clip to use on the child. /// If non-null, determines which clip to use on the child.
CustomClipper<T> get clipper => _clipper; CustomClipper<T> get clipper => _clipper;
@ -1318,7 +1320,9 @@ class RenderClipRRect extends _RenderCustomClip<RRect> {
BorderRadius borderRadius = BorderRadius.zero, BorderRadius borderRadius = BorderRadius.zero,
CustomClipper<RRect> clipper, CustomClipper<RRect> clipper,
Clip clipBehavior = Clip.antiAlias, Clip clipBehavior = Clip.antiAlias,
}) : assert(clipBehavior != Clip.none), _borderRadius = borderRadius, super(child: child, clipper: clipper, clipBehavior: clipBehavior) { }) : assert(clipBehavior != Clip.none),
_borderRadius = borderRadius,
super(child: child, clipper: clipper, clipBehavior: clipBehavior) {
assert(_borderRadius != null || clipper != null); assert(_borderRadius != null || clipper != null);
} }
@ -1389,7 +1393,8 @@ class RenderClipOval extends _RenderCustomClip<Rect> {
RenderBox child, RenderBox child,
CustomClipper<Rect> clipper, CustomClipper<Rect> clipper,
Clip clipBehavior = Clip.antiAlias, Clip clipBehavior = Clip.antiAlias,
}) : assert(clipBehavior != Clip.none), super(child: child, clipper: clipper, clipBehavior: clipBehavior); }) : assert(clipBehavior != Clip.none),
super(child: child, clipper: clipper, clipBehavior: clipBehavior);
Rect _cachedRect; Rect _cachedRect;
Path _cachedPath; Path _cachedPath;
@ -1464,7 +1469,8 @@ class RenderClipPath extends _RenderCustomClip<Path> {
RenderBox child, RenderBox child,
CustomClipper<Path> clipper, CustomClipper<Path> clipper,
Clip clipBehavior = Clip.antiAlias, Clip clipBehavior = Clip.antiAlias,
}) : assert(clipBehavior != Clip.none), super(child: child, clipper: clipper, clipBehavior: clipBehavior); }) : assert(clipBehavior != Clip.none),
super(child: child, clipper: clipper, clipBehavior: clipBehavior);
@override @override
Path get _defaultClip => Path()..addRect(Offset.zero & size); Path get _defaultClip => Path()..addRect(Offset.zero & size);
@ -2878,7 +2884,9 @@ class RenderIgnorePointer extends RenderProxyBox {
RenderBox child, RenderBox child,
bool ignoring = true, bool ignoring = true,
bool ignoringSemantics bool ignoringSemantics
}) : _ignoring = ignoring, _ignoringSemantics = ignoringSemantics, super(child) { }) : _ignoring = ignoring,
_ignoringSemantics = ignoringSemantics,
super(child) {
assert(_ignoring != null); assert(_ignoring != null);
} }
@ -4381,7 +4389,11 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
class RenderBlockSemantics extends RenderProxyBox { class RenderBlockSemantics extends RenderProxyBox {
/// Create a render object that blocks semantics for nodes below it in paint /// Create a render object that blocks semantics for nodes below it in paint
/// order. /// order.
RenderBlockSemantics({ RenderBox child, bool blocking = true, }) : _blocking = blocking, super(child); RenderBlockSemantics({
RenderBox child,
bool blocking = true,
}) : _blocking = blocking,
super(child);
/// Whether this render object is blocking semantics of previously painted /// Whether this render object is blocking semantics of previously painted
/// [RenderObject]s below a common semantics boundary from the semantic tree. /// [RenderObject]s below a common semantics boundary from the semantic tree.
@ -4440,7 +4452,8 @@ class RenderExcludeSemantics extends RenderProxyBox {
RenderExcludeSemantics({ RenderExcludeSemantics({
RenderBox child, RenderBox child,
bool excluding = true, bool excluding = true,
}) : _excluding = excluding, super(child) { }) : _excluding = excluding,
super(child) {
assert(_excluding != null); assert(_excluding != null);
} }

View File

@ -297,7 +297,8 @@ class RenderSliverFixedExtentList extends RenderSliverFixedExtentBoxAdaptor {
RenderSliverFixedExtentList({ RenderSliverFixedExtentList({
@required RenderSliverBoxChildManager childManager, @required RenderSliverBoxChildManager childManager,
double itemExtent, double itemExtent,
}) : _itemExtent = itemExtent, super(childManager: childManager); }) : _itemExtent = itemExtent,
super(childManager: childManager);
@override @override
double get itemExtent => _itemExtent; double get itemExtent => _itemExtent;

View File

@ -356,7 +356,8 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste
RenderSliverFloatingPersistentHeader({ RenderSliverFloatingPersistentHeader({
RenderBox child, RenderBox child,
FloatingHeaderSnapConfiguration snapConfiguration, FloatingHeaderSnapConfiguration snapConfiguration,
}) : _snapConfiguration = snapConfiguration, super(child: child); }) : _snapConfiguration = snapConfiguration,
super(child: child);
AnimationController _controller; AnimationController _controller;
Animation<double> _animation; Animation<double> _animation;

View File

@ -630,7 +630,8 @@ class RenderIndexedStack extends RenderStack {
AlignmentGeometry alignment = AlignmentDirectional.topStart, AlignmentGeometry alignment = AlignmentDirectional.topStart,
TextDirection textDirection, TextDirection textDirection,
int index = 0, int index = 0,
}) : _index = index, super( }) : _index = index,
super(
children: children, children: children,
alignment: alignment, alignment: alignment,
textDirection: textDirection, textDirection: textDirection,

View File

@ -36,7 +36,9 @@ import 'object.dart';
/// for how to create and manage backend textures on iOS. /// for how to create and manage backend textures on iOS.
class TextureBox extends RenderBox { class TextureBox extends RenderBox {
/// Creates a box backed by the texture identified by [textureId]. /// Creates a box backed by the texture identified by [textureId].
TextureBox({ @required int textureId }) : assert(textureId != null), _textureId = textureId; TextureBox({ @required int textureId })
: assert(textureId != null),
_textureId = textureId;
/// The identity of the backend texture. /// The identity of the backend texture.
int get textureId => _textureId; int get textureId => _textureId;

View File

@ -90,7 +90,8 @@ class RevealedOffset {
const RevealedOffset({ const RevealedOffset({
@required this.offset, @required this.offset,
@required this.rect, @required this.rect,
}) : assert(offset != null), assert(rect != null); }) : assert(offset != null),
assert(rect != null);
/// Offset for the viewport to reveal a specific element in the viewport. /// Offset for the viewport to reveal a specific element in the viewport.
/// ///

View File

@ -65,8 +65,8 @@ abstract class SemanticsEvent {
class AnnounceSemanticsEvent extends SemanticsEvent { class AnnounceSemanticsEvent extends SemanticsEvent {
/// Constructs an event that triggers an announcement by the platform. /// Constructs an event that triggers an announcement by the platform.
const AnnounceSemanticsEvent(this.message, this.textDirection) : const AnnounceSemanticsEvent(this.message, this.textDirection)
assert(message != null), : assert(message != null),
assert(textDirection != null), assert(textDirection != null),
super('announce'); super('announce');

View File

@ -119,7 +119,10 @@ class TextSelection extends TextRange {
const TextSelection.collapsed({ const TextSelection.collapsed({
@required int offset, @required int offset,
this.affinity = TextAffinity.downstream this.affinity = TextAffinity.downstream
}) : baseOffset = offset, extentOffset = offset, isDirectional = false, super.collapsed(offset); }) : baseOffset = offset,
extentOffset = offset,
isDirectional = false,
super.collapsed(offset);
/// Creates a collapsed selection at the given text position. /// Creates a collapsed selection at the given text position.
/// ///

View File

@ -60,8 +60,8 @@ typedef TextInputFormatFunction = TextEditingValue Function(
/// Wiring for [TextInputFormatter.withFunction]. /// Wiring for [TextInputFormatter.withFunction].
class _SimpleTextInputFormatter extends TextInputFormatter { class _SimpleTextInputFormatter extends TextInputFormatter {
_SimpleTextInputFormatter(this.formatFunction) : _SimpleTextInputFormatter(this.formatFunction)
assert(formatFunction != null); : assert(formatFunction != null);
final TextInputFormatFunction formatFunction; final TextInputFormatFunction formatFunction;
@ -215,8 +215,8 @@ class WhitelistingTextInputFormatter extends TextInputFormatter {
/// Creates a formatter that allows only the insertion of whitelisted characters patterns. /// Creates a formatter that allows only the insertion of whitelisted characters patterns.
/// ///
/// The [whitelistedPattern] must not be null. /// The [whitelistedPattern] must not be null.
WhitelistingTextInputFormatter(this.whitelistedPattern) : WhitelistingTextInputFormatter(this.whitelistedPattern)
assert(whitelistedPattern != null); : assert(whitelistedPattern != null);
/// A [Pattern] to extract all instances of allowed characters. /// A [Pattern] to extract all instances of allowed characters.
/// ///

View File

@ -23,7 +23,9 @@ export 'dart:ui' show TextAffinity;
/// for additional flags for some input types. For example, numeric input /// for additional flags for some input types. For example, numeric input
/// can specify whether it supports decimal numbers and/or signed numbers. /// can specify whether it supports decimal numbers and/or signed numbers.
class TextInputType { class TextInputType {
const TextInputType._(this.index) : signed = null, decimal = null; const TextInputType._(this.index)
: signed = null,
decimal = null;
/// Optimize for numerical information. /// Optimize for numerical information.
/// ///

View File

@ -26,7 +26,9 @@ const Duration _kDuration = Duration(milliseconds: 300);
class _ActiveItem implements Comparable<_ActiveItem> { class _ActiveItem implements Comparable<_ActiveItem> {
_ActiveItem.incoming(this.controller, this.itemIndex) : removedItemBuilder = null; _ActiveItem.incoming(this.controller, this.itemIndex) : removedItemBuilder = null;
_ActiveItem.outgoing(this.controller, this.itemIndex, this.removedItemBuilder); _ActiveItem.outgoing(this.controller, this.itemIndex, this.removedItemBuilder);
_ActiveItem.index(this.itemIndex) : controller = null, removedItemBuilder = null; _ActiveItem.index(this.itemIndex)
: controller = null,
removedItemBuilder = null;
final AnimationController controller; final AnimationController controller;
final AnimatedListRemovedItemBuilder removedItemBuilder; final AnimatedListRemovedItemBuilder removedItemBuilder;

View File

@ -3590,7 +3590,8 @@ typedef ErrorWidgetBuilder = Widget Function(FlutterErrorDetails details);
/// information such as the stack trace for the exception. /// information such as the stack trace for the exception.
class ErrorWidget extends LeafRenderObjectWidget { class ErrorWidget extends LeafRenderObjectWidget {
/// Creates a widget that displays the given error message. /// Creates a widget that displays the given error message.
ErrorWidget(Object exception) : message = _stringify(exception), ErrorWidget(Object exception)
: message = _stringify(exception),
super(key: UniqueKey()); super(key: UniqueKey());
/// The configurable factory for [ErrorWidget]. /// The configurable factory for [ErrorWidget].
@ -3796,7 +3797,8 @@ class StatelessElement extends ComponentElement {
class StatefulElement extends ComponentElement { class StatefulElement extends ComponentElement {
/// Creates an element that uses the given widget as its configuration. /// Creates an element that uses the given widget as its configuration.
StatefulElement(StatefulWidget widget) StatefulElement(StatefulWidget widget)
: _state = widget.createState(), super(widget) { : _state = widget.createState(),
super(widget) {
assert(() { assert(() {
if (!_state._debugTypesAreRight(widget)) { if (!_state._debugTypesAreRight(widget)) {
throw FlutterError( throw FlutterError(

View File

@ -83,8 +83,8 @@ class GestureRecognizerFactoryWithHandlers<T extends GestureRecognizer> extends
/// Creates a gesture recognizer factory with the given callbacks. /// Creates a gesture recognizer factory with the given callbacks.
/// ///
/// The arguments must not be null. /// The arguments must not be null.
const GestureRecognizerFactoryWithHandlers(this._constructor, this._initializer) : const GestureRecognizerFactoryWithHandlers(this._constructor, this._initializer)
assert(_constructor != null), : assert(_constructor != null),
assert(_initializer != null); assert(_initializer != null);
final GestureRecognizerFactoryConstructor<T> _constructor; final GestureRecognizerFactoryConstructor<T> _constructor;

View File

@ -1377,7 +1377,8 @@ class RenderSliverOverlapAbsorber extends RenderSliver with RenderObjectWithChil
RenderSliverOverlapAbsorber({ RenderSliverOverlapAbsorber({
@required SliverOverlapAbsorberHandle handle, @required SliverOverlapAbsorberHandle handle,
RenderSliver child, RenderSliver child,
}) : assert(handle != null), _handle = handle { }) : assert(handle != null),
_handle = handle {
this.child = child; this.child = child;
} }
@ -1522,7 +1523,8 @@ class RenderSliverOverlapInjector extends RenderSliver {
/// The [handle] must not be null. /// The [handle] must not be null.
RenderSliverOverlapInjector({ RenderSliverOverlapInjector({
@required SliverOverlapAbsorberHandle handle, @required SliverOverlapAbsorberHandle handle,
}) : assert(handle != null), _handle = handle; }) : assert(handle != null),
_handle = handle;
double _currentLayoutExtent; double _currentLayoutExtent;
double _currentMaxExtent; double _currentMaxExtent;

View File

@ -425,7 +425,8 @@ class DragScrollActivity extends ScrollActivity {
DragScrollActivity( DragScrollActivity(
ScrollActivityDelegate delegate, ScrollActivityDelegate delegate,
ScrollDragController controller, ScrollDragController controller,
) : _controller = controller, super(delegate); ) : _controller = controller,
super(delegate);
ScrollDragController _controller; ScrollDragController _controller;

View File

@ -756,7 +756,8 @@ class ListView extends BoxScrollView {
addAutomaticKeepAlives: addAutomaticKeepAlives, addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries, addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes, addSemanticIndexes: addSemanticIndexes,
), super( ),
super(
key: key, key: key,
scrollDirection: scrollDirection, scrollDirection: scrollDirection,
reverse: reverse, reverse: reverse,
@ -820,7 +821,8 @@ class ListView extends BoxScrollView {
addAutomaticKeepAlives: addAutomaticKeepAlives, addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries, addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes, addSemanticIndexes: addSemanticIndexes,
), super( ),
super(
key: key, key: key,
scrollDirection: scrollDirection, scrollDirection: scrollDirection,
reverse: reverse, reverse: reverse,
@ -925,7 +927,8 @@ class ListView extends BoxScrollView {
semanticIndexCallback: (Widget _, int index) { semanticIndexCallback: (Widget _, int index) {
return index.isEven ? index ~/ 2 : null; return index.isEven ? index ~/ 2 : null;
} }
), super( ),
super(
key: key, key: key,
scrollDirection: scrollDirection, scrollDirection: scrollDirection,
reverse: reverse, reverse: reverse,
@ -1327,7 +1330,8 @@ class GridView extends BoxScrollView {
addAutomaticKeepAlives: addAutomaticKeepAlives, addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries, addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes, addSemanticIndexes: addSemanticIndexes,
), super( ),
super(
key: key, key: key,
scrollDirection: scrollDirection, scrollDirection: scrollDirection,
reverse: reverse, reverse: reverse,
@ -1385,7 +1389,8 @@ class GridView extends BoxScrollView {
addAutomaticKeepAlives: addAutomaticKeepAlives, addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries, addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes, addSemanticIndexes: addSemanticIndexes,
), super( ),
super(
key: key, key: key,
scrollDirection: scrollDirection, scrollDirection: scrollDirection,
reverse: reverse, reverse: reverse,

View File

@ -595,7 +595,8 @@ class _ScrollSemantics extends SingleChildRenderObjectWidget {
@required this.allowImplicitScrolling, @required this.allowImplicitScrolling,
@required this.semanticChildCount, @required this.semanticChildCount,
Widget child Widget child
}) : assert(position != null), super(key: key, child: child); }) : assert(position != null),
super(key: key, child: child);
final ScrollPosition position; final ScrollPosition position;
final bool allowImplicitScrolling; final bool allowImplicitScrolling;
@ -628,7 +629,8 @@ class _RenderScrollSemantics extends RenderProxyBox {
}) : _position = position, }) : _position = position,
_allowImplicitScrolling = allowImplicitScrolling, _allowImplicitScrolling = allowImplicitScrolling,
_semanticChildCount = semanticChildCount, _semanticChildCount = semanticChildCount,
assert(position != null), super(child) { assert(position != null),
super(child) {
position.addListener(markNeedsSemanticsUpdate); position.addListener(markNeedsSemanticsUpdate);
} }

View File

@ -39,7 +39,8 @@ class SliverPrototypeExtentList extends SliverMultiBoxAdaptorWidget {
Key key, Key key,
@required SliverChildDelegate delegate, @required SliverChildDelegate delegate,
@required this.prototypeItem, @required this.prototypeItem,
}) : assert(prototypeItem != null), super(key: key, delegate: delegate); }) : assert(prototypeItem != null),
super(key: key, delegate: delegate);
/// Defines the main axis extent of all of this sliver's children. /// Defines the main axis extent of all of this sliver's children.
/// ///

View File

@ -34,7 +34,11 @@ import 'framework.dart';
/// for how to create and manage backend textures on iOS. /// for how to create and manage backend textures on iOS.
class Texture extends LeafRenderObjectWidget { class Texture extends LeafRenderObjectWidget {
/// Creates a widget backed by the texture identified by [textureId]. /// Creates a widget backed by the texture identified by [textureId].
const Texture({ Key key, @required this.textureId }): assert(textureId != null), super(key: key); const Texture({
Key key,
@required this.textureId,
}) : assert(textureId != null),
super(key: key);
/// The identity of the backend texture. /// The identity of the backend texture.
final int textureId; final int textureId;

View File

@ -607,7 +607,12 @@ class _DiagnosticsPathNode {
/// [DiagnosticsNode] objects. /// [DiagnosticsNode] objects.
/// ///
/// The [node] and [child] arguments must not be null. /// The [node] and [child] arguments must not be null.
_DiagnosticsPathNode({ @required this.node, @required this.children, this.childIndex }) : assert(node != null), assert(children != null); _DiagnosticsPathNode({
@required this.node,
@required this.children,
this.childIndex,
}) : assert(node != null),
assert(children != null);
/// Node at the point in the path this [_DiagnosticsPathNode] is describing. /// Node at the point in the path this [_DiagnosticsPathNode] is describing.
final DiagnosticsNode node; final DiagnosticsNode node;
@ -686,8 +691,7 @@ class _SerializeConfig {
_SerializeConfig base, { _SerializeConfig base, {
int subtreeDepth, int subtreeDepth,
Iterable<Diagnosticable> pathToInclude, Iterable<Diagnosticable> pathToInclude,
}) : }) : groupName = base.groupName,
groupName = base.groupName,
summaryTree = base.summaryTree, summaryTree = base.summaryTree,
subtreeDepth = subtreeDepth ?? base.subtreeDepth, subtreeDepth = subtreeDepth ?? base.subtreeDepth,
pathToInclude = pathToInclude ?? base.pathToInclude, pathToInclude = pathToInclude ?? base.pathToInclude,
@ -2443,7 +2447,9 @@ class _InspectorOverlay extends LeafRenderObjectWidget {
class _RenderInspectorOverlay extends RenderBox { class _RenderInspectorOverlay extends RenderBox {
/// The arguments must not be null. /// The arguments must not be null.
_RenderInspectorOverlay({ @required InspectorSelection selection }) : _selection = selection, assert(selection != null); _RenderInspectorOverlay({ @required InspectorSelection selection })
: _selection = selection,
assert(selection != null);
InspectorSelection get selection => _selection; InspectorSelection get selection => _selection;
InspectorSelection _selection; InspectorSelection _selection;
@ -2476,8 +2482,8 @@ class _RenderInspectorOverlay extends RenderBox {
} }
class _TransformedRect { class _TransformedRect {
_TransformedRect(RenderObject object) : _TransformedRect(RenderObject object)
rect = object.semanticBounds, : rect = object.semanticBounds,
transform = object.getTransformTo(null); transform = object.getTransformTo(null);
final Rect rect; final Rect rect;
@ -2545,7 +2551,8 @@ class _InspectorOverlayLayer extends Layer {
_InspectorOverlayLayer({ _InspectorOverlayLayer({
@required this.overlayRect, @required this.overlayRect,
@required this.selection, @required this.selection,
}) : assert(overlayRect != null), assert(selection != null) { }) : assert(overlayRect != null),
assert(selection != null) {
bool inDebugMode = false; bool inDebugMode = false;
assert(() { assert(() {
inDebugMode = true; inDebugMode = true;

View File

@ -11,8 +11,8 @@ import 'package:flutter/scheduler.dart' show timeDilation;
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
class FakeFrameInfo implements FrameInfo { class FakeFrameInfo implements FrameInfo {
FakeFrameInfo(int width, int height, this._duration) : FakeFrameInfo(int width, int height, this._duration)
_image = FakeImage(width, height); : _image = FakeImage(width, height);
final Duration _duration; final Duration _duration;
final Image _image; final Image _image;

View File

@ -559,7 +559,8 @@ abstract class _TestRecordingCanvasMatcher extends Matcher {
class _TestRecordingCanvasPaintsCountMatcher extends _TestRecordingCanvasMatcher { class _TestRecordingCanvasPaintsCountMatcher extends _TestRecordingCanvasMatcher {
_TestRecordingCanvasPaintsCountMatcher(Symbol methodName, int count) _TestRecordingCanvasPaintsCountMatcher(Symbol methodName, int count)
: _methodName = methodName, _count = count; : _methodName = methodName,
_count = count;
final Symbol _methodName; final Symbol _methodName;
final int _count; final int _count;

View File

@ -17,7 +17,9 @@ import 'widget_tester.dart';
/// The result of evaluating a semantics node by a [AccessibilityGuideline]. /// The result of evaluating a semantics node by a [AccessibilityGuideline].
class Evaluation { class Evaluation {
/// Create a passing evaluation. /// Create a passing evaluation.
const Evaluation.pass() : passed = true, reason = null; const Evaluation.pass()
: passed = true,
reason = null;
/// Create a failing evaluation, with an optional [reason] explaining the /// Create a failing evaluation, with an optional [reason] explaining the
/// result. /// result.

View File

@ -310,6 +310,7 @@ class _Reporter {
_yellow = color ? '\u001b[33m' : '', _yellow = color ? '\u001b[33m' : '',
_bold = color ? '\u001b[1m' : '', _bold = color ? '\u001b[1m' : '',
_noColor = color ? '\u001b[0m' : ''; _noColor = color ? '\u001b[0m' : '';
final List<LiveTest> passed = <LiveTest>[]; final List<LiveTest> passed = <LiveTest>[];
final List<LiveTest> failed = <LiveTest>[]; final List<LiveTest> failed = <LiveTest>[];
final List<Test> skipped = <Test>[]; final List<Test> skipped = <Test>[];

View File

@ -76,8 +76,10 @@ String _artifactToFileName(Artifact artifact, [TargetPlatform platform, BuildMod
} }
class EngineBuildPaths { class EngineBuildPaths {
const EngineBuildPaths({ @required this.targetEngine, @required this.hostEngine }): const EngineBuildPaths({
assert(targetEngine != null), @required this.targetEngine,
@required this.hostEngine,
}) : assert(targetEngine != null),
assert(hostEngine != null); assert(hostEngine != null);
final String targetEngine; final String targetEngine;

View File

@ -361,7 +361,9 @@ class ProcessExit implements Exception {
} }
class RunResult { class RunResult {
RunResult(this.processResult, this._command) : assert(_command != null), assert(_command.isNotEmpty); RunResult(this.processResult, this._command)
: assert(_command != null),
assert(_command.isNotEmpty);
final ProcessResult processResult; final ProcessResult processResult;

View File

@ -903,7 +903,8 @@ class PubspecDependency extends PubspecLine {
DependencyKind kind, DependencyKind kind,
this.version, this.version,
this.sourcePath, this.sourcePath,
}) : _kind = kind, super(line); }) : _kind = kind,
super(line);
static PubspecDependency parse(String line, { @required String filename }) { static PubspecDependency parse(String line, { @required String filename }) {
// We recognize any line that: // We recognize any line that:

View File

@ -286,9 +286,13 @@ abstract class _CompilationRequest {
} }
class _RecompileRequest extends _CompilationRequest { class _RecompileRequest extends _CompilationRequest {
_RecompileRequest(Completer<CompilerOutput> completer, this.mainPath, _RecompileRequest(
this.invalidatedFiles, this.outputPath, this.packagesFilePath) : Completer<CompilerOutput> completer,
super(completer); this.mainPath,
this.invalidatedFiles,
this.outputPath,
this.packagesFilePath,
) : super(completer);
String mainPath; String mainPath;
List<String> invalidatedFiles; List<String> invalidatedFiles;
@ -301,9 +305,15 @@ class _RecompileRequest extends _CompilationRequest {
} }
class _CompileExpressionRequest extends _CompilationRequest { class _CompileExpressionRequest extends _CompilationRequest {
_CompileExpressionRequest(Completer<CompilerOutput> completer, this.expression, this.definitions, _CompileExpressionRequest(
this.typeDefinitions, this.libraryUri, this.klass, this.isStatic) : Completer<CompilerOutput> completer,
super(completer); this.expression,
this.definitions,
this.typeDefinitions,
this.libraryUri,
this.klass,
this.isStatic
) : super(completer);
String expression; String expression;
List<String> definitions; List<String> definitions;

View File

@ -26,8 +26,8 @@ String _dottedNameToString(analyzer.DottedName dottedName) {
} }
class DartDependencySetBuilder { class DartDependencySetBuilder {
DartDependencySetBuilder(String mainScriptPath, String packagesFilePath) : DartDependencySetBuilder(String mainScriptPath, String packagesFilePath)
_mainScriptPath = canonicalizePath(mainScriptPath), : _mainScriptPath = canonicalizePath(mainScriptPath),
_mainScriptUri = fs.path.toUri(mainScriptPath), _mainScriptUri = fs.path.toUri(mainScriptPath),
_packagesFilePath = canonicalizePath(packagesFilePath); _packagesFilePath = canonicalizePath(packagesFilePath);

View File

@ -193,7 +193,9 @@ class DevFSByteContent extends DevFSContent {
/// String content to be copied to the device. /// String content to be copied to the device.
class DevFSStringContent extends DevFSByteContent { class DevFSStringContent extends DevFSByteContent {
DevFSStringContent(String string) : _string = string, super(utf8.encode(string)); DevFSStringContent(String string)
: _string = string,
super(utf8.encode(string));
String _string; String _string;
@ -377,23 +379,23 @@ class UpdateFSReport {
class DevFS { class DevFS {
/// Create a [DevFS] named [fsName] for the local files in [rootDirectory]. /// Create a [DevFS] named [fsName] for the local files in [rootDirectory].
DevFS(VMService serviceProtocol, DevFS(
VMService serviceProtocol,
this.fsName, this.fsName,
this.rootDirectory, { this.rootDirectory, {
String packagesFilePath String packagesFilePath
}) }) : _operations = ServiceProtocolDevFSOperations(serviceProtocol),
: _operations = ServiceProtocolDevFSOperations(serviceProtocol),
_httpWriter = _DevFSHttpWriter(fsName, serviceProtocol) { _httpWriter = _DevFSHttpWriter(fsName, serviceProtocol) {
_packagesFilePath = _packagesFilePath =
packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName); packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName);
} }
DevFS.operations(this._operations, DevFS.operations(
this._operations,
this.fsName, this.fsName,
this.rootDirectory, { this.rootDirectory, {
String packagesFilePath, String packagesFilePath,
}) }) : _httpWriter = null {
: _httpWriter = null {
_packagesFilePath = _packagesFilePath =
packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName); packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName);
} }

View File

@ -361,8 +361,8 @@ class DebuggingOptions {
this.observatoryPort, this.observatoryPort,
}) : debuggingEnabled = true; }) : debuggingEnabled = true;
DebuggingOptions.disabled(this.buildInfo) : DebuggingOptions.disabled(this.buildInfo)
debuggingEnabled = false, : debuggingEnabled = false,
useTestFonts = false, useTestFonts = false,
startPaused = false, startPaused = false,
enableSoftwareRendering = false, enableSoftwareRendering = false,
@ -387,7 +387,9 @@ class DebuggingOptions {
class LaunchResult { class LaunchResult {
LaunchResult.succeeded({ this.observatoryUri }) : started = true; LaunchResult.succeeded({ this.observatoryUri }) : started = true;
LaunchResult.failed() : started = false, observatoryUri = null; LaunchResult.failed()
: started = false,
observatoryUri = null;
bool get hasObservatory => observatoryUri != null; bool get hasObservatory => observatoryUri != null;

View File

@ -111,7 +111,9 @@ class IOSDevices extends PollingDeviceDiscovery {
} }
class IOSDevice extends Device { class IOSDevice extends Device {
IOSDevice(String id, { this.name, String sdkVersion }) : _sdkVersion = sdkVersion, super(id) { IOSDevice(String id, { this.name, String sdkVersion })
: _sdkVersion = sdkVersion,
super(id) {
_installerPath = _checkForCommand('ideviceinstaller'); _installerPath = _checkForCommand('ideviceinstaller');
_iproxyPath = _checkForCommand('iproxy'); _iproxyPath = _checkForCommand('iproxy');
} }

View File

@ -540,7 +540,12 @@ String _shortGitRevision(String revision) {
class GitTagVersion { class GitTagVersion {
const GitTagVersion(this.x, this.y, this.z, this.commits, this.hash); const GitTagVersion(this.x, this.y, this.z, this.commits, this.hash);
const GitTagVersion.unknown() : x = null, y = null, z = null, commits = 0, hash = ''; const GitTagVersion.unknown()
: x = null,
y = null,
z = null,
commits = 0,
hash = '';
/// The X in vX.Y.Z. /// The X in vX.Y.Z.
final int x; final int x;

View File

@ -590,8 +590,8 @@ class FlutterRunTestDriver extends FlutterTestDriver {
} }
class FlutterTestTestDriver extends FlutterTestDriver { class FlutterTestTestDriver extends FlutterTestDriver {
FlutterTestTestDriver(Directory _projectFolder, {String logPrefix}): FlutterTestTestDriver(Directory _projectFolder, {String logPrefix})
super(_projectFolder, logPrefix: logPrefix); : super(_projectFolder, logPrefix: logPrefix);
Future<void> test({ Future<void> test({
String testFile = 'test/test.dart', String testFile = 'test/test.dart',

View File

@ -69,8 +69,7 @@ class LogMessage {
/// ///
/// When this message is created, it sets its [time] to [DateTime.now]. /// When this message is created, it sets its [time] to [DateTime.now].
LogMessage(this.message, this.tag, this.level) LogMessage(this.message, this.tag, this.level)
: levelName = : levelName = level.toString().substring(level.toString().indexOf('.') + 1),
level.toString().substring(level.toString().indexOf('.') + 1),
time = DateTime.now(); time = DateTime.now();
/// The actual log message. /// The actual log message.