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

@ -797,8 +797,8 @@ class _InterpolationSimulation extends Simulation {
class _RepeatingSimulation extends Simulation {
_RepeatingSimulation(double initialValue, this.min, this.max, this.reverse, Duration period)
: _periodInSeconds = period.inMicroseconds / Duration.microsecondsPerSecond,
_initialT = (max == min) ? 0.0 : (initialValue / (max - min)) * (period.inMicroseconds / Duration.microsecondsPerSecond) {
: _periodInSeconds = period.inMicroseconds / Duration.microsecondsPerSecond,
_initialT = (max == min) ? 0.0 : (initialValue / (max - min)) * (period.inMicroseconds / Duration.microsecondsPerSecond) {
assert(_periodInSeconds > 0.0);
assert(_initialT >= 0.0);
}

View File

@ -493,7 +493,7 @@ class TrainHoppingAnimation extends Animation<double>
/// can be null. If the next train is null, then this object will just proxy
/// the first animation and never hop.
TrainHoppingAnimation(this._currentTrain, this._nextTrain, { this.onSwitchedTrain })
: assert(_currentTrain != null) {
: assert(_currentTrain != null) {
if (_nextTrain != null) {
if (_currentTrain.value == _nextTrain.value) {
_currentTrain = _nextTrain;
@ -701,7 +701,7 @@ class AnimationMax<T extends num> extends CompoundAnimation<T> {
///
/// Both arguments must be non-null. Either can be an [AnimationMax] itself
/// to combine multiple animations.
AnimationMax(Animation<T> first, Animation<T> next): super(first: first, next: next);
AnimationMax(Animation<T> first, Animation<T> next) : super(first: first, next: next);
@override
T get value => math.max(first.value, next.value);
@ -716,7 +716,7 @@ class AnimationMin<T extends num> extends CompoundAnimation<T> {
///
/// Both arguments must be non-null. Either can be an [AnimationMin] itself
/// to combine multiple animations.
AnimationMin(Animation<T> first, Animation<T> next): super(first: first, next: next);
AnimationMin(Animation<T> first, Animation<T> next) : super(first: first, next: next);
@override
T get value => math.min(first.value, next.value);

View File

@ -110,9 +110,9 @@ class Interval extends Curve {
///
/// The arguments must not be null.
const Interval(this.begin, this.end, { this.curve = Curves.linear })
: assert(begin != null),
assert(end != null),
assert(curve != null);
: assert(begin != null),
assert(end != null),
assert(curve != null);
/// The largest value for which this interval is 0.0.
///
@ -199,10 +199,10 @@ class Cubic extends Curve {
///
/// The [a], [b], [c], and [d] arguments must not be null.
const Cubic(this.a, this.b, this.c, this.d)
: assert(a != null),
assert(b != null),
assert(c != null),
assert(d != null);
: assert(a != null),
assert(b != null),
assert(c != null),
assert(d != null);
/// The x coordinate of the first control point.
///

View File

@ -267,7 +267,9 @@ class Tween<T extends dynamic> extends Animatable<T> {
/// A [Tween] that evaluates its [parent] in reverse.
class ReverseTween<T> extends Tween<T> {
/// 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.
///

View File

@ -44,7 +44,9 @@ class TweenSequence<T> extends Animatable<T> {
/// There's a small cost associated with building a `TweenSequence` so
/// it's best to reuse one, rather than rebuilding it on every frame,
/// 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);
double totalWeight = 0.0;
@ -95,7 +97,9 @@ class TweenSequenceItem<T> {
const TweenSequenceItem({
@required this.tween,
@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
/// animation's duration indicated by [weight] and this item's position

View File

@ -107,10 +107,10 @@ class CupertinoActionSheet extends StatelessWidget {
this.messageScrollController,
this.actionScrollController,
this.cancelButton,
}) : assert(actions != null || title != null || message != null || cancelButton != null,
}) : assert(actions != null || title != null || message != null || cancelButton != null,
'An action sheet must have a non-null value for at least one of the following arguments: '
'actions, title, message, or cancelButton'),
super(key: key);
super(key: key);
/// An optional title of the action sheet. When the [message] is non-null,
/// the font of the [title] is bold.
@ -266,8 +266,8 @@ class CupertinoActionSheetAction extends StatelessWidget {
this.isDefaultAction = false,
this.isDestructiveAction = false,
@required this.child,
}) : assert(child != null),
assert(onPressed != null);
}) : assert(child != null),
assert(onPressed != null);
/// The callback that is called when the button is tapped.
///
@ -514,9 +514,9 @@ class _RenderCupertinoAlert extends RenderBox {
RenderBox contentSection,
RenderBox actionsSection,
double dividerThickness = 0.0,
}) : _contentSection = contentSection,
_actionsSection = actionsSection,
_dividerThickness = dividerThickness;
}) : _contentSection = contentSection,
_actionsSection = actionsSection,
_dividerThickness = dividerThickness;
RenderBox get contentSection => _contentSection;
RenderBox _contentSection;
@ -843,8 +843,8 @@ class _CupertinoAlertActionSection extends StatefulWidget {
@required this.children,
this.scrollController,
this.hasCancelButton,
}) : assert(children != null),
super(key: key);
}) : assert(children != null),
super(key: key);
final List<Widget> children;
@ -975,9 +975,9 @@ class _CupertinoAlertActionsRenderWidget extends MultiChildRenderObjectWidget {
@required List<Widget> actionButtons,
double dividerThickness = 0.0,
bool hasCancelButton = false,
}) : _dividerThickness = dividerThickness,
_hasCancelButton = hasCancelButton,
super(key: key, children: actionButtons);
}) : _dividerThickness = dividerThickness,
_hasCancelButton = hasCancelButton,
super(key: key, children: actionButtons);
final double _dividerThickness;
final bool _hasCancelButton;
@ -1022,8 +1022,8 @@ class _RenderCupertinoAlertActions extends RenderBox
List<RenderBox> children,
double dividerThickness = 0.0,
bool hasCancelButton = false,
}) : _dividerThickness = dividerThickness,
_hasCancelButton = hasCancelButton {
}) : _dividerThickness = dividerThickness,
_hasCancelButton = hasCancelButton {
addAll(children);
}

View File

@ -137,8 +137,8 @@ class CupertinoAlertDialog extends StatelessWidget {
this.actions = const <Widget>[],
this.scrollController,
this.actionScrollController,
}) : assert(actions != null),
super(key: key);
}) : assert(actions != null),
super(key: key);
/// The (optional) title of the dialog is displayed in a large font at the top
/// of the dialog.
@ -893,8 +893,8 @@ class _CupertinoAlertActionSection extends StatefulWidget {
Key key,
@required this.children,
this.scrollController,
}) : assert(children != null),
super(key: key);
}) : assert(children != null),
super(key: key);
final List<Widget> children;

View File

@ -910,13 +910,13 @@ class _PersistentNavigationBar extends StatelessWidget {
@immutable
class _NavigationBarStaticComponentsKeys {
_NavigationBarStaticComponentsKeys()
: navBarBoxKey = GlobalKey(debugLabel: 'Navigation bar render box'),
leadingKey = GlobalKey(debugLabel: 'Leading'),
backChevronKey = GlobalKey(debugLabel: 'Back chevron'),
backLabelKey = GlobalKey(debugLabel: 'Back label'),
middleKey = GlobalKey(debugLabel: 'Middle'),
trailingKey = GlobalKey(debugLabel: 'Trailing'),
largeTitleKey = GlobalKey(debugLabel: 'Large title');
: navBarBoxKey = GlobalKey(debugLabel: 'Navigation bar render box'),
leadingKey = GlobalKey(debugLabel: 'Leading'),
backChevronKey = GlobalKey(debugLabel: 'Back chevron'),
backLabelKey = GlobalKey(debugLabel: 'Back label'),
middleKey = GlobalKey(debugLabel: 'Middle'),
trailingKey = GlobalKey(debugLabel: 'Trailing'),
largeTitleKey = GlobalKey(debugLabel: 'Large title');
final GlobalKey navBarBoxKey;
final GlobalKey leadingKey;

View File

@ -87,14 +87,14 @@ class CupertinoSegmentedControl<T> extends StatefulWidget {
this.selectedColor,
this.borderColor,
this.pressedColor,
}) : assert(children != null),
assert(children.length >= 2),
assert(onValueChanged != null),
assert(
groupValue == null || children.keys.any((T child) => child == groupValue),
'The groupValue must be either null or one of the keys in the children map.',
),
super(key: key);
}) : assert(children != null),
assert(children.length >= 2),
assert(onValueChanged != null),
assert(
groupValue == null || children.keys.any((T child) => child == groupValue),
'The groupValue must be either null or one of the keys in the children map.',
),
super(key: key);
/// The identifying keys and corresponding widget values in the
/// segmented control.
@ -472,12 +472,12 @@ class _RenderSegmentedControl<T> extends RenderBox
@required TextDirection textDirection,
@required List<Color> backgroundColors,
@required Color borderColor,
}) : assert(textDirection != null),
_textDirection = textDirection,
_selectedIndex = selectedIndex,
_pressedIndex = pressedIndex,
_backgroundColors = backgroundColors,
_borderColor = borderColor {
}) : assert(textDirection != null),
_textDirection = textDirection,
_selectedIndex = selectedIndex,
_pressedIndex = pressedIndex,
_backgroundColors = backgroundColors,
_borderColor = borderColor {
addAll(children);
}

View File

@ -1753,7 +1753,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
_valueComputed = false,
_value = null,
_computeValue = computeValue,
_defaultLevel = level,
_defaultLevel = level,
ifNull = ifNull ?? (missingIfNull ? 'MISSING' : null),
super(
name: name,

View File

@ -21,7 +21,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
///
/// Consider assigning the [onLongPress] callback after creating this object.
LongPressGestureRecognizer({ Object debugOwner })
: super(deadline: kLongPressTimeout, debugOwner: debugOwner);
: super(deadline: kLongPressTimeout, debugOwner: debugOwner);
bool _longPressAccepted = false;

View File

@ -7,10 +7,15 @@ import 'dart:typed_data';
// TODO(abarth): Consider using vector_math.
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)
: _offset = offset, _length = length, _elements = values;
: _offset = offset,
_length = length,
_elements = values;
final int _offset;
@ -36,8 +41,8 @@ class _Vector {
// TODO(abarth): Consider using vector_math.
class _Matrix {
_Matrix(int rows, int cols)
: _columns = cols,
_elements = Float64List(rows * cols);
: _columns = cols,
_elements = Float64List(rows * cols);
final int _columns;
final List<double> _elements;

View File

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

View File

@ -439,8 +439,8 @@ class VerticalMultiDragGestureRecognizer extends MultiDragGestureRecognizer<_Ver
class _DelayedPointerState extends MultiDragPointerState {
_DelayedPointerState(Offset initialPosition, Duration delay)
: assert(delay != null),
super(initialPosition) {
: assert(delay != null),
super(initialPosition) {
_timer = Timer(delay, _delayPassed);
}

View File

@ -126,8 +126,8 @@ class VelocityEstimate {
class _PointAtTime {
const _PointAtTime(this.point, this.time)
: assert(point != null),
assert(time != null);
: assert(point != null),
assert(time != null);
final Duration time;
final Offset point;

View File

@ -220,16 +220,16 @@ class _RenderCheckbox extends RenderToggleable {
BoxConstraints additionalConstraints,
ValueChanged<bool> onChanged,
@required TickerProvider vsync,
}): _oldValue = value,
super(
value: value,
tristate: tristate,
activeColor: activeColor,
inactiveColor: inactiveColor,
onChanged: onChanged,
additionalConstraints: additionalConstraints,
vsync: vsync,
);
}) : _oldValue = value,
super(
value: value,
tristate: tristate,
activeColor: activeColor,
inactiveColor: inactiveColor,
onChanged: onChanged,
additionalConstraints: additionalConstraints,
vsync: vsync,
);
bool _oldValue;

View File

@ -476,9 +476,9 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri
this.backgroundColor,
this.padding,
this.materialTapTargetSize,
}) : assert(label != null),
assert(clipBehavior != null),
super(key: key);
}) : assert(label != null),
assert(clipBehavior != null),
super(key: key);
@override
final Widget avatar;
@ -613,11 +613,11 @@ class InputChip extends StatelessWidget
this.padding,
this.materialTapTargetSize,
this.avatarBorder = const CircleBorder(),
}) : assert(selected != null),
assert(isEnabled != null),
assert(label != null),
assert(clipBehavior != null),
super(key: key);
}) : assert(selected != null),
assert(isEnabled != null),
assert(label != null),
assert(clipBehavior != null),
super(key: key);
@override
final Widget avatar;
@ -775,10 +775,10 @@ class ChoiceChip extends StatelessWidget
this.padding,
this.materialTapTargetSize,
this.avatarBorder = const CircleBorder(),
}) : assert(selected != null),
assert(label != null),
assert(clipBehavior != null),
super(key: key);
}) : assert(selected != null),
assert(label != null),
assert(clipBehavior != null),
super(key: key);
@override
final Widget avatar;
@ -956,10 +956,10 @@ class FilterChip extends StatelessWidget
this.padding,
this.materialTapTargetSize,
this.avatarBorder = const CircleBorder(),
}) : assert(selected != null),
assert(label != null),
assert(clipBehavior != null),
super(key: key);
}) : assert(selected != null),
assert(label != null),
assert(clipBehavior != null),
super(key: key);
@override
final Widget avatar;
@ -1087,13 +1087,13 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
this.backgroundColor,
this.padding,
this.materialTapTargetSize,
}) : assert(label != null),
assert(
onPressed != null,
'Rather than disabling an ActionChip by setting onPressed to null, '
'remove it from the interface entirely.',
),
super(key: key);
}) : assert(label != null),
assert(
onPressed != null,
'Rather than disabling an ActionChip by setting onPressed to null, '
'remove it from the interface entirely.',
),
super(key: key);
@override
final Widget avatar;
@ -1211,12 +1211,12 @@ class RawChip extends StatefulWidget
this.backgroundColor,
this.materialTapTargetSize,
this.avatarBorder = const CircleBorder(),
}) : assert(label != null),
assert(isEnabled != null),
assert(clipBehavior != null),
assert(pressElevation != null && pressElevation >= 0.0),
deleteIcon = deleteIcon ?? _kDefaultDeleteIcon,
super(key: key);
}) : assert(label != null),
assert(isEnabled != null),
assert(clipBehavior != null),
assert(pressElevation != null && pressElevation >= 0.0),
deleteIcon = deleteIcon ?? _kDefaultDeleteIcon,
super(key: key);
@override
final Widget avatar;
@ -1649,8 +1649,8 @@ class _ChipRenderWidget extends RenderObjectWidget {
this.deleteDrawerAnimation,
this.enableAnimation,
this.avatarBorder,
}) : assert(theme != null),
super(key: key);
}) : assert(theme != null),
super(key: key);
final _ChipRenderTheme theme;
final bool value;
@ -1878,10 +1878,10 @@ class _RenderChip extends RenderBox {
this.deleteDrawerAnimation,
this.enableAnimation,
this.avatarBorder,
}) : assert(theme != null),
assert(textDirection != null),
_theme = theme,
_textDirection = textDirection {
}) : assert(theme != null),
assert(textDirection != null),
_theme = theme,
_textDirection = textDirection {
checkmarkAnimation.addListener(markNeedsPaint);
avatarDrawerAnimation.addListener(markNeedsLayout);
deleteDrawerAnimation.addListener(markNeedsLayout);

View File

@ -46,9 +46,9 @@ class ChipTheme extends InheritedWidget {
Key key,
@required this.data,
@required Widget child,
}) : assert(child != null),
assert(data != null),
super(key: key, child: child);
}) : assert(child != null),
assert(data != null),
super(key: key, child: child);
/// Specifies the color, shape, and text style values for descendant chip
/// widgets.
@ -178,16 +178,16 @@ class ChipThemeData extends Diagnosticable {
@required this.labelStyle,
@required this.secondaryLabelStyle,
@required this.brightness,
}) : assert(backgroundColor != null),
assert(disabledColor != null),
assert(selectedColor != null),
assert(secondarySelectedColor != null),
assert(labelPadding != null),
assert(padding != null),
assert(shape != null),
assert(labelStyle != null),
assert(secondaryLabelStyle != null),
assert(brightness != null);
}) : assert(backgroundColor != null),
assert(disabledColor != null),
assert(selectedColor != null),
assert(secondarySelectedColor != null),
assert(labelPadding != null),
assert(padding != null),
assert(shape != null),
assert(labelStyle != null),
assert(secondaryLabelStyle != null),
assert(brightness != null);
/// Generates a ChipThemeData from a brightness, a primary color, and a text
/// style.

View File

@ -61,8 +61,8 @@ class CircleAvatar extends StatelessWidget {
this.radius,
this.minRadius,
this.maxRadius,
}) : assert(radius == null || (minRadius == null && maxRadius == null)),
super(key: key);
}) : assert(radius == null || (minRadius == null && maxRadius == null)),
super(key: key);
/// The widget below this widget in the tree.
///

View File

@ -251,8 +251,8 @@ class FlexibleSpaceBarSettings extends InheritedWidget {
this.maxExtent,
@required this.currentExtent,
@required Widget child,
}) : assert(currentExtent != null),
super(key: key, child: child);
}) : assert(currentExtent != null),
super(key: key, child: child);
/// Affects how transparent the text within the toolbar appears.
final double toolbarOpacity;

View File

@ -82,15 +82,15 @@ class FloatingActionButton extends StatelessWidget {
this.clipBehavior = Clip.none,
this.materialTapTargetSize,
this.isExtended = false,
}) : assert(elevation != null && elevation >= 0.0),
assert(highlightElevation != null && highlightElevation >= 0.0),
assert(disabledElevation == null || disabledElevation >= 0.0),
assert(mini != null),
assert(shape != null),
assert(isExtended != null),
_sizeConstraints = mini ? _kMiniSizeConstraints : _kSizeConstraints,
disabledElevation = disabledElevation ?? elevation,
super(key: key);
}) : assert(elevation != null && elevation >= 0.0),
assert(highlightElevation != null && highlightElevation >= 0.0),
assert(disabledElevation == null || disabledElevation >= 0.0),
assert(mini != null),
assert(shape != null),
assert(isExtended != null),
_sizeConstraints = mini ? _kMiniSizeConstraints : _kSizeConstraints,
disabledElevation = disabledElevation ?? elevation,
super(key: key);
/// Creates a wider [StadiumBorder]-shaped floating action button with both
/// an [icon] and a [label].
@ -115,28 +115,28 @@ class FloatingActionButton extends StatelessWidget {
this.clipBehavior = Clip.none,
@required Widget icon,
@required Widget label,
}) : assert(elevation != null && elevation >= 0.0),
assert(highlightElevation != null && highlightElevation >= 0.0),
assert(disabledElevation == null || disabledElevation >= 0.0),
assert(shape != null),
assert(isExtended != null),
assert(clipBehavior != null),
_sizeConstraints = _kExtendedSizeConstraints,
disabledElevation = disabledElevation ?? elevation,
mini = false,
child = _ChildOverflowBox(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const SizedBox(width: 16.0),
icon,
const SizedBox(width: 8.0),
label,
const SizedBox(width: 20.0),
],
),
),
super(key: key);
}) : assert(elevation != null && elevation >= 0.0),
assert(highlightElevation != null && highlightElevation >= 0.0),
assert(disabledElevation == null || disabledElevation >= 0.0),
assert(shape != null),
assert(isExtended != null),
assert(clipBehavior != null),
_sizeConstraints = _kExtendedSizeConstraints,
disabledElevation = disabledElevation ?? elevation,
mini = false,
child = _ChildOverflowBox(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const SizedBox(width: 16.0),
icon,
const SizedBox(width: 8.0),
label,
const SizedBox(width: 20.0),
],
),
),
super(key: key);
/// The widget below this widget in the tree.
///

View File

@ -470,7 +470,7 @@ class _AnimationSwap<T> extends CompoundAnimation<T> {
///
/// Both arguments must be non-null. Either can be an [_AnimationSwap] itself
/// to combine multiple animations.
_AnimationSwap(Animation<T> first, Animation<T> next, this.parent, this.swapThreshold): super(first: first, next: next);
_AnimationSwap(Animation<T> first, Animation<T> next, this.parent, this.swapThreshold) : super(first: first, next: next);
final Animation<double> parent;
final double swapThreshold;

View File

@ -600,7 +600,7 @@ class ShapeBorderTween extends Tween<ShapeBorder> {
///
/// the [begin] and [end] properties may be null; see [ShapeBorder.lerp] for
/// the null handling semantics.
ShapeBorderTween({ShapeBorder begin, ShapeBorder end}): super(begin: begin, end: end);
ShapeBorderTween({ShapeBorder begin, ShapeBorder end}) : super(begin: begin, end: end);
/// Returns the value this tween has at the given animation clock value.
@override

View File

@ -200,15 +200,15 @@ class _RenderRadio extends RenderToggleable {
ValueChanged<bool> onChanged,
BoxConstraints additionalConstraints,
@required TickerProvider vsync,
}): super(
value: value,
tristate: false,
activeColor: activeColor,
inactiveColor: inactiveColor,
onChanged: onChanged,
additionalConstraints: additionalConstraints,
vsync: vsync,
);
}) : super(
value: value,
tristate: false,
activeColor: activeColor,
inactiveColor: inactiveColor,
onChanged: onChanged,
additionalConstraints: additionalConstraints,
vsync: vsync,
);
@override
void paint(PaintingContext context, Offset offset) {

View File

@ -60,13 +60,13 @@ class ReorderableListView extends StatefulWidget {
this.scrollDirection = Axis.vertical,
this.padding,
this.reverse = false,
}): assert(scrollDirection != null),
assert(onReorder != null),
assert(children != null),
assert(
children.every((Widget w) => w.key != null),
'All children of this widget must have a key.',
);
}) : assert(scrollDirection != null),
assert(onReorder != null),
assert(children != null),
assert(
children.every((Widget w) => w.key != null),
'All children of this widget must have a key.',
);
/// A non-reorderable header widget to show before the list.
///

View File

@ -35,9 +35,9 @@ class SliderTheme extends InheritedWidget {
Key key,
@required this.data,
@required Widget child,
}) : assert(child != null),
assert(data != null),
super(key: key, child: child);
}) : assert(child != null),
assert(data != null),
super(key: key, child: child);
/// Specifies the color and shape values for descendant slider widgets.
final SliderThemeData data;
@ -197,22 +197,22 @@ class SliderThemeData extends Diagnosticable {
@required this.valueIndicatorShape,
@required this.showValueIndicator,
@required this.valueIndicatorTextStyle,
}) : assert(activeTrackColor != null),
assert(inactiveTrackColor != null),
assert(disabledActiveTrackColor != null),
assert(disabledInactiveTrackColor != null),
assert(activeTickMarkColor != null),
assert(inactiveTickMarkColor != null),
assert(disabledActiveTickMarkColor != null),
assert(disabledInactiveTickMarkColor != null),
assert(thumbColor != null),
assert(disabledThumbColor != null),
assert(overlayColor != null),
assert(valueIndicatorColor != null),
assert(thumbShape != null),
assert(valueIndicatorShape != null),
assert(valueIndicatorTextStyle != null),
assert(showValueIndicator != null);
}) : assert(activeTrackColor != null),
assert(inactiveTrackColor != null),
assert(disabledActiveTrackColor != null),
assert(disabledInactiveTrackColor != null),
assert(activeTickMarkColor != null),
assert(inactiveTickMarkColor != null),
assert(disabledActiveTickMarkColor != null),
assert(disabledInactiveTickMarkColor != null),
assert(thumbColor != null),
assert(disabledThumbColor != null),
assert(overlayColor != null),
assert(valueIndicatorColor != null),
assert(thumbShape != null),
assert(valueIndicatorShape != null),
assert(valueIndicatorTextStyle != null),
assert(showValueIndicator != null);
/// Generates a SliderThemeData from three main colors.
///

View File

@ -22,7 +22,8 @@ class UnderlineTabIndicator extends Decoration {
const UnderlineTabIndicator({
this.borderSide = const BorderSide(width: 2.0, color: Colors.white),
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.
final BorderSide borderSide;
@ -64,7 +65,8 @@ class UnderlineTabIndicator extends Decoration {
class _UnderlinePainter extends BoxPainter {
_UnderlinePainter(this.decoration, VoidCallback onChanged)
: assert(decoration != null), super(onChanged);
: assert(decoration != null),
super(onChanged);
final UnderlineTabIndicator decoration;

View File

@ -1236,7 +1236,10 @@ class TabPageSelectorIndicator extends StatelessWidget {
@required this.backgroundColor,
@required this.borderColor,
@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.
final Color backgroundColor;
@ -1275,7 +1278,8 @@ class TabPageSelector extends StatelessWidget {
this.indicatorSize = 12.0,
this.color,
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.
///

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
/// 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.
///

View File

@ -112,8 +112,8 @@ class _TimePickerHeaderFragment {
@required this.widget,
this.startMargin = 0.0,
}) : assert(layoutId != null),
assert(widget != null),
assert(startMargin != null);
assert(widget != null),
assert(startMargin != null);
/// Identifier used by the custom layout to refer to the widget.
final _TimePickerHeaderId layoutId;
@ -140,9 +140,9 @@ class _TimePickerHeaderPiece {
/// All arguments must be non-null. If the piece does not contain a pivot
/// fragment, use the value -1 as a convention.
const _TimePickerHeaderPiece(this.pivotIndex, this.fragments, { this.bottomMargin = 0.0 })
: assert(pivotIndex != null),
assert(fragments != null),
assert(bottomMargin != null);
: assert(pivotIndex != null),
assert(fragments != null),
assert(bottomMargin != null);
/// Index into the [fragments] list, pointing at the fragment that's centered
/// horizontally.
@ -175,8 +175,8 @@ class _TimePickerHeaderPiece {
/// to the left or right of it.
class _TimePickerHeaderFormat {
const _TimePickerHeaderFormat(this.centrepieceIndex, this.pieces)
: assert(centrepieceIndex != null),
assert(pieces != null);
: assert(centrepieceIndex != null),
assert(pieces != null);
/// Index into the [pieces] list pointing at the piece that contains the
/// pivot fragment.

View File

@ -89,18 +89,18 @@ class HSVColor {
/// All the arguments must not be null and be in their respective ranges. See
/// the fields for each parameter for a description of their ranges.
const HSVColor.fromAHSV(this.alpha, this.hue, this.saturation, this.value)
: assert(alpha != null),
assert(hue != null),
assert(saturation != null),
assert(value != null),
assert(alpha >= 0.0),
assert(alpha <= 1.0),
assert(hue >= 0.0),
assert(hue <= 360.0),
assert(saturation >= 0.0),
assert(saturation <= 1.0),
assert(value >= 0.0),
assert(value <= 1.0);
: assert(alpha != null),
assert(hue != null),
assert(saturation != null),
assert(value != null),
assert(alpha >= 0.0),
assert(alpha <= 1.0),
assert(hue >= 0.0),
assert(hue <= 360.0),
assert(saturation >= 0.0),
assert(saturation <= 1.0),
assert(value >= 0.0),
assert(value <= 1.0);
/// Creates an [HSVColor] from an RGB [Color].
///

View File

@ -330,7 +330,10 @@ class EdgeInsets extends EdgeInsetsGeometry {
/// ```
/// {@end-tool}
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.
///
@ -359,9 +362,13 @@ class EdgeInsets extends EdgeInsetsGeometry {
/// const EdgeInsets.symmetric(vertical: 8.0)
/// ```
/// {@end-tool}
const EdgeInsets.symmetric({ double vertical = 0.0,
double horizontal = 0.0 })
: left = horizontal, top = vertical, right = horizontal, bottom = vertical;
const EdgeInsets.symmetric({
double vertical = 0.0,
double horizontal = 0.0,
}) : left = horizontal,
top = vertical,
right = horizontal,
bottom = vertical;
/// Creates insets that match the given window padding.
///

View File

@ -246,9 +246,9 @@ class FlutterLogoDecoration extends Decoration {
/// An object that paints a [BoxDecoration] into a canvas.
class _FlutterLogoPainter extends BoxPainter {
_FlutterLogoPainter(this._config)
: assert(_config != null),
assert(_config.debugAssertIsValid()),
super(null) {
: assert(_config != null),
assert(_config.debugAssertIsValid()),
super(null) {
_prepareText();
}

View File

@ -452,8 +452,8 @@ class NetworkImage extends ImageProvider<NetworkImage> {
///
/// The arguments must not be null.
const NetworkImage(this.url, { this.scale = 1.0 , this.headers })
: assert(url != null),
assert(scale != null);
: assert(url != null),
assert(scale != null);
/// The URL from which the image will be fetched.
final String url;
@ -529,8 +529,8 @@ class FileImage extends ImageProvider<FileImage> {
///
/// The arguments must not be null.
const FileImage(this.file, { this.scale = 1.0 })
: assert(file != null),
assert(scale != null);
: assert(file != null),
assert(scale != null);
/// The file to decode into an image.
final File file;
@ -597,8 +597,8 @@ class MemoryImage extends ImageProvider<MemoryImage> {
///
/// The arguments must not be null.
const MemoryImage(this.bytes, { this.scale = 1.0 })
: assert(bytes != null),
assert(scale != null);
: assert(bytes != null),
assert(scale != null);
/// The bytes to decode into an image.
final Uint8List bytes;

View File

@ -19,8 +19,8 @@ class ImageInfo {
///
/// Both the image and the scale must not be null.
const ImageInfo({ @required this.image, this.scale = 1.0 })
: assert(image != null),
assert(scale != null);
: assert(image != null),
assert(scale != null);
/// The raw image pixels.
///
@ -371,7 +371,7 @@ class OneFrameImageStreamCompleter extends ImageStreamCompleter {
/// message is only dumped to the console in debug mode (see [new
/// FlutterErrorDetails]).
OneFrameImageStreamCompleter(Future<ImageInfo> image, { InformationCollector informationCollector })
: assert(image != null) {
: assert(image != null) {
image.then<void>(setImage, onError: (dynamic error, StackTrace stack) {
reportError(
context: 'resolving a single-frame image stream',

View File

@ -94,8 +94,8 @@ class SpringSimulation extends Simulation {
double velocity, {
Tolerance tolerance = Tolerance.defaultTolerance,
}) : _endPosition = end,
_solution = _SpringSolution(spring, start - end, velocity),
super(tolerance: tolerance);
_solution = _SpringSolution(spring, start - end, velocity),
super(tolerance: tolerance);
final double _endPosition;
final _SpringSolution _solution;

View File

@ -109,10 +109,10 @@ class BoxConstraints extends Constraints {
const BoxConstraints.tightFor({
double width,
double height
}): minWidth = width != null ? width : 0.0,
maxWidth = width != null ? width : double.infinity,
minHeight = height != null ? height : 0.0,
maxHeight = height != null ? height : double.infinity;
}) : minWidth = width != null ? width : 0.0,
maxWidth = width != null ? width : double.infinity,
minHeight = height != null ? height : 0.0,
maxHeight = height != null ? height : double.infinity;
/// Creates box constraints that require the given width or height, except if
/// they are infinite.
@ -124,10 +124,10 @@ class BoxConstraints extends Constraints {
const BoxConstraints.tightForFinite({
double width = double.infinity,
double height = double.infinity
}): minWidth = width != double.infinity ? width : 0.0,
maxWidth = width != double.infinity ? width : double.infinity,
minHeight = height != double.infinity ? height : 0.0,
maxHeight = height != double.infinity ? height : double.infinity;
}) : minWidth = width != double.infinity ? width : 0.0,
maxWidth = width != double.infinity ? width : double.infinity,
minHeight = height != double.infinity ? height : 0.0,
maxHeight = height != double.infinity ? height : double.infinity;
/// Creates box constraints that forbid sizes larger than the given size.
BoxConstraints.loose(Size size)
@ -143,10 +143,10 @@ class BoxConstraints extends Constraints {
const BoxConstraints.expand({
double width,
double height
}): minWidth = width != null ? width : double.infinity,
maxWidth = width != null ? width : double.infinity,
minHeight = height != null ? height : double.infinity,
maxHeight = height != null ? height : double.infinity;
}) : minWidth = width != null ? width : double.infinity,
maxWidth = width != null ? width : double.infinity,
minHeight = height != null ? height : double.infinity,
maxHeight = height != null ? height : double.infinity;
/// The minimum width that satisfies the constraints.
final double minWidth;
@ -615,8 +615,8 @@ class BoxHitTestEntry extends HitTestEntry {
///
/// The [localPosition] argument must not be null.
const BoxHitTestEntry(RenderBox target, this.localPosition)
: assert(localPosition != null),
super(target);
: assert(localPosition != null),
super(target);
@override
RenderBox get target => super.target;

View File

@ -69,7 +69,7 @@ class TextSelectionPoint {
///
/// The [point] argument must not be null.
const TextSelectionPoint(this.point, this.direction)
: assert(point != null);
: assert(point != null);
/// Coordinates of the lower left or lower right corner of the selection,
/// relative to the top left of the [RenderEditable] object.

View File

@ -323,7 +323,8 @@ class TextureLayer extends Layer {
@required this.rect,
@required this.textureId,
this.freeze = false,
}): assert(rect != null), assert(textureId != null);
}) : assert(rect != null),
assert(textureId != null);
/// Bounding rectangle of this layer.
final Rect rect;
@ -366,7 +367,8 @@ class PlatformViewLayer extends Layer {
PlatformViewLayer({
@required this.rect,
@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.
final Rect rect;
@ -815,9 +817,13 @@ class ClipRectLayer extends ContainerLayer {
///
/// The [clipRect] property must be non-null before the compositing phase of
/// the pipeline.
ClipRectLayer({ @required Rect clipRect, Clip clipBehavior = Clip.hardEdge }) :
_clipRect = clipRect, _clipBehavior = clipBehavior,
assert(clipBehavior != null), assert(clipBehavior != Clip.none);
ClipRectLayer({
@required Rect clipRect,
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.
///
@ -887,9 +893,13 @@ class ClipRRectLayer extends ContainerLayer {
///
/// The [clipRRect] property must be non-null before the compositing phase of
/// the pipeline.
ClipRRectLayer({ @required RRect clipRRect, Clip clipBehavior = Clip.antiAlias }) :
_clipRRect = clipRRect, _clipBehavior = clipBehavior,
assert(clipBehavior != null), assert(clipBehavior != Clip.none);
ClipRRectLayer({
@required RRect clipRRect,
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.
///
@ -955,9 +965,13 @@ class ClipPathLayer extends ContainerLayer {
///
/// The [clipPath] property must be non-null before the compositing phase of
/// the pipeline.
ClipPathLayer({ @required Path clipPath, Clip clipBehavior = Clip.antiAlias }) :
_clipPath = clipPath, _clipBehavior = clipBehavior,
assert(clipBehavior != null), assert(clipBehavior != Clip.none);
ClipPathLayer({
@required Path clipPath,
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.
///
@ -1094,8 +1108,11 @@ class OpacityLayer extends ContainerLayer {
///
/// The [alpha] property must be non-null before the compositing phase of
/// the pipeline.
OpacityLayer({ @required int alpha, Offset offset = Offset.zero })
: _alpha = alpha, _offset = offset;
OpacityLayer({
@required int alpha,
Offset offset = Offset.zero,
}) : _alpha = alpha,
_offset = offset;
/// 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
/// before the compositing phase of the pipeline.
ShaderMaskLayer({ @required Shader shader, @required Rect maskRect, @required BlendMode blendMode })
: _shader = shader, _maskRect = maskRect, _blendMode = blendMode;
ShaderMaskLayer({
@required Shader shader,
@required Rect maskRect,
@required BlendMode blendMode,
}) : _shader = shader,
_maskRect = maskRect,
_blendMode = blendMode;
/// The shader to apply to the children.
///

View File

@ -612,7 +612,7 @@ typedef LayoutCallback<T extends Constraints> = void Function(T constraints);
/// You can obtain the [PipelineOwner] using the [RenderObject.owner] property.
class SemanticsHandle {
SemanticsHandle._(this._owner, this.listener)
: assert(_owner != null) {
: assert(_owner != null) {
if (listener != null)
_owner.semanticsOwner.addListener(listener);
}
@ -3122,7 +3122,7 @@ class FlutterErrorDetailsForRendering extends FlutterErrorDetails {
/// information of multiple [_InterestingSemanticsFragment] to a parent.
abstract class _SemanticsFragment {
_SemanticsFragment({@required this.dropsSemanticsOfPreviousSiblings })
: assert (dropsSemanticsOfPreviousSiblings != null);
: assert (dropsSemanticsOfPreviousSiblings != null);
/// Incorporate the fragments of children into this fragment.
void addAll(Iterable<_InterestingSemanticsFragment> fragments);
@ -3160,7 +3160,7 @@ abstract class _SemanticsFragment {
class _ContainerSemanticsFragment extends _SemanticsFragment {
_ContainerSemanticsFragment({ @required bool dropsSemanticsOfPreviousSiblings })
: super(dropsSemanticsOfPreviousSiblings: dropsSemanticsOfPreviousSiblings);
: super(dropsSemanticsOfPreviousSiblings: dropsSemanticsOfPreviousSiblings);
@override
void addAll(Iterable<_InterestingSemanticsFragment> fragments) {

View File

@ -1153,7 +1153,9 @@ abstract class _RenderCustomClip<T> extends RenderProxyBox {
RenderBox child,
CustomClipper<T> clipper,
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.
CustomClipper<T> get clipper => _clipper;
@ -1318,7 +1320,9 @@ class RenderClipRRect extends _RenderCustomClip<RRect> {
BorderRadius borderRadius = BorderRadius.zero,
CustomClipper<RRect> clipper,
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);
}
@ -1389,7 +1393,8 @@ class RenderClipOval extends _RenderCustomClip<Rect> {
RenderBox child,
CustomClipper<Rect> clipper,
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;
Path _cachedPath;
@ -1464,7 +1469,8 @@ class RenderClipPath extends _RenderCustomClip<Path> {
RenderBox child,
CustomClipper<Path> clipper,
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
Path get _defaultClip => Path()..addRect(Offset.zero & size);
@ -2878,7 +2884,9 @@ class RenderIgnorePointer extends RenderProxyBox {
RenderBox child,
bool ignoring = true,
bool ignoringSemantics
}) : _ignoring = ignoring, _ignoringSemantics = ignoringSemantics, super(child) {
}) : _ignoring = ignoring,
_ignoringSemantics = ignoringSemantics,
super(child) {
assert(_ignoring != null);
}
@ -4381,7 +4389,11 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
class RenderBlockSemantics extends RenderProxyBox {
/// Create a render object that blocks semantics for nodes below it in paint
/// 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
/// [RenderObject]s below a common semantics boundary from the semantic tree.
@ -4440,7 +4452,8 @@ class RenderExcludeSemantics extends RenderProxyBox {
RenderExcludeSemantics({
RenderBox child,
bool excluding = true,
}) : _excluding = excluding, super(child) {
}) : _excluding = excluding,
super(child) {
assert(_excluding != null);
}
@ -4485,8 +4498,8 @@ class RenderIndexedSemantics extends RenderProxyBox {
RenderBox child,
@required int index,
}) : assert(index != null),
_index = index,
super(child);
_index = index,
super(child);
/// The index used to annotated child semantics.
int get index => _index;

View File

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

View File

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

View File

@ -630,11 +630,12 @@ class RenderIndexedStack extends RenderStack {
AlignmentGeometry alignment = AlignmentDirectional.topStart,
TextDirection textDirection,
int index = 0,
}) : _index = index, super(
children: children,
alignment: alignment,
textDirection: textDirection,
);
}) : _index = index,
super(
children: children,
alignment: alignment,
textDirection: textDirection,
);
@override
void visitChildrenForSemantics(RenderObjectVisitor visitor) {

View File

@ -36,7 +36,9 @@ import 'object.dart';
/// for how to create and manage backend textures on iOS.
class TextureBox extends RenderBox {
/// 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.
int get textureId => _textureId;

View File

@ -90,7 +90,8 @@ class RevealedOffset {
const RevealedOffset({
@required this.offset,
@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.
///

View File

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

View File

@ -23,11 +23,11 @@ class RawKeyEventDataAndroid extends RawKeyEventData {
this.keyCode = 0,
this.scanCode = 0,
this.metaState = 0,
}) : assert(flags != null),
assert(codePoint != null),
assert(keyCode != null),
assert(scanCode != null),
assert(metaState != null);
}) : assert(flags != null),
assert(codePoint != null),
assert(keyCode != null),
assert(scanCode != null),
assert(metaState != null);
/// The current set of additional flags for this event.
///

View File

@ -20,9 +20,9 @@ class RawKeyEventDataFuchsia extends RawKeyEventData {
this.hidUsage = 0,
this.codePoint = 0,
this.modifiers = 0,
}) : assert(hidUsage != null),
assert(codePoint != null),
assert(modifiers != null);
}) : assert(hidUsage != null),
assert(codePoint != null),
assert(modifiers != null);
/// The USB HID usage.
///

View File

@ -119,7 +119,10 @@ class TextSelection extends TextRange {
const TextSelection.collapsed({
@required int offset,
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.
///

View File

@ -60,8 +60,8 @@ typedef TextInputFormatFunction = TextEditingValue Function(
/// Wiring for [TextInputFormatter.withFunction].
class _SimpleTextInputFormatter extends TextInputFormatter {
_SimpleTextInputFormatter(this.formatFunction) :
assert(formatFunction != null);
_SimpleTextInputFormatter(this.formatFunction)
: assert(formatFunction != null);
final TextInputFormatFunction formatFunction;
@ -215,8 +215,8 @@ class WhitelistingTextInputFormatter extends TextInputFormatter {
/// Creates a formatter that allows only the insertion of whitelisted characters patterns.
///
/// The [whitelistedPattern] must not be null.
WhitelistingTextInputFormatter(this.whitelistedPattern) :
assert(whitelistedPattern != null);
WhitelistingTextInputFormatter(this.whitelistedPattern)
: assert(whitelistedPattern != null);
/// 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
/// can specify whether it supports decimal numbers and/or signed numbers.
class TextInputType {
const TextInputType._(this.index) : signed = null, decimal = null;
const TextInputType._(this.index)
: signed = null,
decimal = null;
/// Optimize for numerical information.
///

View File

@ -26,7 +26,9 @@ const Duration _kDuration = Duration(milliseconds: 300);
class _ActiveItem implements Comparable<_ActiveItem> {
_ActiveItem.incoming(this.controller, this.itemIndex) : removedItemBuilder = null;
_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 AnimatedListRemovedItemBuilder removedItemBuilder;

View File

@ -22,9 +22,9 @@ class _ChildEntry {
@required this.animation,
@required this.transition,
@required this.widgetChild,
}) : assert(animation != null),
assert(transition != null),
assert(controller != null);
}) : assert(animation != null),
assert(transition != null),
assert(controller != null);
// The animation controller for the child's transition.
final AnimationController controller;
@ -156,12 +156,12 @@ class AnimatedSwitcher extends StatefulWidget {
this.switchOutCurve = Curves.linear,
this.transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder,
this.layoutBuilder = AnimatedSwitcher.defaultLayoutBuilder,
}) : assert(duration != null),
assert(switchInCurve != null),
assert(switchOutCurve != null),
assert(transitionBuilder != null),
assert(layoutBuilder != null),
super(key: key);
}) : assert(duration != null),
assert(switchInCurve != null),
assert(switchOutCurve != null),
assert(transitionBuilder != null),
assert(layoutBuilder != null),
super(key: key);
/// The current child widget to display. If there was a previous child, then
/// that child will be faded out using the [switchOutCurve], while the new

View File

@ -196,8 +196,8 @@ class AsyncSnapshot<T> {
/// Creates an [AsyncSnapshot] with the specified [connectionState],
/// and optionally either [data] or [error] (but not both).
const AsyncSnapshot._(this.connectionState, this.data, this.error)
: assert(connectionState != null),
assert(!(data != null && error != null));
: assert(connectionState != null),
assert(!(data != null && error != null));
/// Creates an [AsyncSnapshot] in [ConnectionState.none] with null data and error.
const AsyncSnapshot.nothing() : this._(ConnectionState.none, null, null);

View File

@ -5836,7 +5836,7 @@ class ExcludeSemantics extends SingleChildRenderObjectWidget {
this.excluding = true,
Widget child,
}) : assert(excluding != null),
super(key: key, child: child);
super(key: key, child: child);
/// Whether this widget is excluded in the semantics tree.
final bool excluding;

View File

@ -3590,7 +3590,8 @@ typedef ErrorWidgetBuilder = Widget Function(FlutterErrorDetails details);
/// information such as the stack trace for the exception.
class ErrorWidget extends LeafRenderObjectWidget {
/// Creates a widget that displays the given error message.
ErrorWidget(Object exception) : message = _stringify(exception),
ErrorWidget(Object exception)
: message = _stringify(exception),
super(key: UniqueKey());
/// The configurable factory for [ErrorWidget].
@ -3796,7 +3797,8 @@ class StatelessElement extends ComponentElement {
class StatefulElement extends ComponentElement {
/// Creates an element that uses the given widget as its configuration.
StatefulElement(StatefulWidget widget)
: _state = widget.createState(), super(widget) {
: _state = widget.createState(),
super(widget) {
assert(() {
if (!_state._debugTypesAreRight(widget)) {
throw FlutterError(
@ -4780,7 +4782,7 @@ abstract class RenderObjectElement extends Element {
/// elements inherit their owner from their parent.
abstract class RootRenderObjectElement extends RenderObjectElement {
/// Initializes fields for subclasses.
RootRenderObjectElement(RenderObjectWidget widget): super(widget);
RootRenderObjectElement(RenderObjectWidget widget) : super(widget);
/// Set the owner of the element. The owner will be propagated to all the
/// descendants of this element.
@ -4808,7 +4810,7 @@ abstract class RootRenderObjectElement extends RenderObjectElement {
/// An [Element] that uses a [LeafRenderObjectWidget] as its configuration.
class LeafRenderObjectElement extends RenderObjectElement {
/// Creates an element that uses the given widget as its configuration.
LeafRenderObjectElement(LeafRenderObjectWidget widget): super(widget);
LeafRenderObjectElement(LeafRenderObjectWidget widget) : super(widget);
@override
void forgetChild(Element child) {

View File

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

View File

@ -26,9 +26,9 @@ class IconThemeData extends Diagnosticable {
///
/// The [color] is black, the [opacity] is 1.0, and the [size] is 24.0.
const IconThemeData.fallback()
: color = const Color(0xFF000000),
_opacity = 1.0,
size = 24.0;
: color = const Color(0xFF000000),
_opacity = 1.0,
size = 24.0;
/// Creates a copy of this icon theme but with the given fields replaced with
/// the new values.

View File

@ -769,7 +769,7 @@ class AnimatedPositioned extends ImplicitlyAnimatedWidget {
@required Duration duration,
}) : assert(left == null || right == null || width == null),
assert(top == null || bottom == null || height == null),
super(key: key, curve: curve, duration: duration);
super(key: key, curve: curve, duration: duration);
/// Creates a widget that animates the rectangle it occupies implicitly.
///
@ -920,7 +920,7 @@ class AnimatedPositionedDirectional extends ImplicitlyAnimatedWidget {
@required Duration duration,
}) : assert(start == null || end == null || width == null),
assert(top == null || bottom == null || height == null),
super(key: key, curve: curve, duration: duration);
super(key: key, curve: curve, duration: duration);
/// The widget below this widget in the tree.
///

View File

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

View File

@ -212,9 +212,9 @@ class UiKitView extends StatefulWidget {
this.creationParamsCodec,
this.gestureRecognizers,
}) : assert(viewType != null),
assert(hitTestBehavior != null),
assert(creationParams == null || creationParamsCodec != null),
super(key: key);
assert(hitTestBehavior != null),
assert(creationParams == null || creationParamsCodec != null),
super(key: key);
// TODO(amirh): reference the iOS API doc once avaliable.
/// The unique identifier for iOS view type to be embedded by this widget.

View File

@ -1450,14 +1450,14 @@ class _DialogRoute<T> extends PopupRoute<T> {
Duration transitionDuration = const Duration(milliseconds: 200),
RouteTransitionsBuilder transitionBuilder,
RouteSettings settings,
}) : assert(barrierDismissible != null),
_pageBuilder = pageBuilder,
_barrierDismissible = barrierDismissible,
_barrierLabel = barrierLabel,
_barrierColor = barrierColor,
_transitionDuration = transitionDuration,
_transitionBuilder = transitionBuilder,
super(settings: settings);
}) : assert(barrierDismissible != null),
_pageBuilder = pageBuilder,
_barrierDismissible = barrierDismissible,
_barrierLabel = barrierLabel,
_barrierColor = barrierColor,
_transitionDuration = transitionDuration,
_transitionBuilder = transitionBuilder,
super(settings: settings);
final RoutePageBuilder _pageBuilder;

View File

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

View File

@ -756,19 +756,20 @@ class ListView extends BoxScrollView {
addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
), super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
cacheExtent: cacheExtent,
semanticChildCount: semanticChildCount ?? children.length,
dragStartBehavior: dragStartBehavior,
);
),
super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
cacheExtent: cacheExtent,
semanticChildCount: semanticChildCount ?? children.length,
dragStartBehavior: dragStartBehavior,
);
/// Creates a scrollable, linear array of widgets that are created on demand.
///
@ -820,19 +821,20 @@ class ListView extends BoxScrollView {
addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
), super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
cacheExtent: cacheExtent,
semanticChildCount: semanticChildCount ?? itemCount,
dragStartBehavior: dragStartBehavior,
);
),
super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
cacheExtent: cacheExtent,
semanticChildCount: semanticChildCount ?? itemCount,
dragStartBehavior: dragStartBehavior,
);
/// Creates a fixed-length scrollable linear array of list "items" separated
/// by list item "separators".
@ -925,18 +927,19 @@ class ListView extends BoxScrollView {
semanticIndexCallback: (Widget _, int index) {
return index.isEven ? index ~/ 2 : null;
}
), super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
cacheExtent: cacheExtent,
semanticChildCount: _computeSemanticChildCount(itemCount),
);
),
super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
cacheExtent: cacheExtent,
semanticChildCount: _computeSemanticChildCount(itemCount),
);
/// Creates a scrollable, linear array of widgets with a custom child model.
///
@ -1327,19 +1330,20 @@ class GridView extends BoxScrollView {
addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
), super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
cacheExtent: cacheExtent,
semanticChildCount: semanticChildCount ?? children.length,
dragStartBehavior: dragStartBehavior,
);
),
super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
cacheExtent: cacheExtent,
semanticChildCount: semanticChildCount ?? children.length,
dragStartBehavior: dragStartBehavior,
);
/// Creates a scrollable, 2D array of widgets with tiles that each have a
/// maximum cross-axis extent.
@ -1385,18 +1389,19 @@ class GridView extends BoxScrollView {
addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
), super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
semanticChildCount: semanticChildCount ?? children.length,
dragStartBehavior: dragStartBehavior,
);
),
super(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
shrinkWrap: shrinkWrap,
padding: padding,
semanticChildCount: semanticChildCount ?? children.length,
dragStartBehavior: dragStartBehavior,
);
/// A delegate that controls the layout of the children within the [GridView].
///

View File

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

View File

@ -39,7 +39,8 @@ class SliverPrototypeExtentList extends SliverMultiBoxAdaptorWidget {
Key key,
@required SliverChildDelegate delegate,
@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.
///

View File

@ -43,9 +43,9 @@ class Spacer extends StatelessWidget {
///
/// The [flex] parameter may not be null or less than one.
const Spacer({Key key, this.flex = 1})
: assert(flex != null),
assert(flex > 0),
super(key: key);
: assert(flex != null),
assert(flex > 0),
super(key: key);
/// The flex factor to use in determining how much space to take up.
///

View File

@ -248,9 +248,9 @@ class Text extends StatelessWidget {
this.textScaleFactor,
this.maxLines,
this.semanticsLabel,
}): assert(textSpan != null),
data = null,
super(key: key);
}) : assert(textSpan != null),
data = null,
super(key: key);
/// The text to display.
///

View File

@ -231,9 +231,9 @@ class TextSelectionOverlay {
this.selectionControls,
this.selectionDelegate,
this.dragStartBehavior = DragStartBehavior.down,
}): assert(value != null),
assert(context != null),
_value = value {
}) : assert(value != null),
assert(context != null),
_value = value {
final OverlayState overlay = Overlay.of(context);
assert(overlay != null);
_handleController = AnimationController(duration: _fadeDuration, vsync: overlay);

View File

@ -34,7 +34,11 @@ import 'framework.dart';
/// for how to create and manage backend textures on iOS.
class Texture extends LeafRenderObjectWidget {
/// 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.
final int textureId;

View File

@ -607,7 +607,12 @@ class _DiagnosticsPathNode {
/// [DiagnosticsNode] objects.
///
/// 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.
final DiagnosticsNode node;
@ -686,13 +691,12 @@ class _SerializeConfig {
_SerializeConfig base, {
int subtreeDepth,
Iterable<Diagnosticable> pathToInclude,
}) :
groupName = base.groupName,
summaryTree = base.summaryTree,
subtreeDepth = subtreeDepth ?? base.subtreeDepth,
pathToInclude = pathToInclude ?? base.pathToInclude,
includeProperties = base.includeProperties,
expandPropertyValues = base.expandPropertyValues;
}) : groupName = base.groupName,
summaryTree = base.summaryTree,
subtreeDepth = subtreeDepth ?? base.subtreeDepth,
pathToInclude = pathToInclude ?? base.pathToInclude,
includeProperties = base.includeProperties,
expandPropertyValues = base.expandPropertyValues;
/// Optional object group name used to manage manage lifetimes of object
/// references in the returned JSON.
@ -2443,7 +2447,9 @@ class _InspectorOverlay extends LeafRenderObjectWidget {
class _RenderInspectorOverlay extends RenderBox {
/// 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 _selection;
@ -2476,9 +2482,9 @@ class _RenderInspectorOverlay extends RenderBox {
}
class _TransformedRect {
_TransformedRect(RenderObject object) :
rect = object.semanticBounds,
transform = object.getTransformTo(null);
_TransformedRect(RenderObject object)
: rect = object.semanticBounds,
transform = object.getTransformTo(null);
final Rect rect;
final Matrix4 transform;
@ -2545,7 +2551,8 @@ class _InspectorOverlayLayer extends Layer {
_InspectorOverlayLayer({
@required this.overlayRect,
@required this.selection,
}) : assert(overlayRect != null), assert(selection != null) {
}) : assert(overlayRect != null),
assert(selection != null) {
bool inDebugMode = false;
assert(() {
inDebugMode = true;

View File

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

View File

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

View File

@ -27,8 +27,8 @@ abstract class CommandWithTarget extends Command {
/// Deserializes this command from the value generated by [serialize].
CommandWithTarget.deserialize(Map<String, String> json)
: finder = SerializableFinder.deserialize(json),
super.deserialize(json);
: finder = SerializableFinder.deserialize(json),
super.deserialize(json);
/// Locates the object or objects targeted by this command.
final SerializableFinder finder;
@ -53,7 +53,7 @@ class WaitFor extends CommandWithTarget {
///
/// If [timeout] is not specified the command times out after 5 seconds.
WaitFor(SerializableFinder finder, {Duration timeout})
: super(finder, timeout: timeout);
: super(finder, timeout: timeout);
/// Deserializes this command from the value generated by [serialize].
WaitFor.deserialize(Map<String, String> json) : super.deserialize(json);
@ -80,7 +80,7 @@ class WaitForAbsent extends CommandWithTarget {
///
/// If [timeout] is not specified the command times out after 5 seconds.
WaitForAbsent(SerializableFinder finder, {Duration timeout})
: super(finder, timeout: timeout);
: super(finder, timeout: timeout);
/// Deserializes this command from the value generated by [serialize].
WaitForAbsent.deserialize(Map<String, String> json) : super.deserialize(json);
@ -107,7 +107,7 @@ class WaitUntilNoTransientCallbacks extends Command {
/// Deserializes this command from the value generated by [serialize].
WaitUntilNoTransientCallbacks.deserialize(Map<String, String> json)
: super.deserialize(json);
: super.deserialize(json);
@override
final String kind = 'waitUntilNoTransientCallbacks';
@ -191,8 +191,8 @@ class ByText extends SerializableFinder {
class ByValueKey extends SerializableFinder {
/// Creates a finder given the key value.
ByValueKey(this.keyValue)
: keyValueString = '$keyValue',
keyValueType = '${keyValue.runtimeType}' {
: keyValueString = '$keyValue',
keyValueType = '${keyValue.runtimeType}' {
if (!_supportedKeyValueTypes.contains(keyValue.runtimeType))
throw _createInvalidKeyValueTypeError('$keyValue.runtimeType');
}
@ -284,7 +284,7 @@ class GetSemanticsId extends CommandWithTarget {
/// Creates a command from a json map.
GetSemanticsId.deserialize(Map<String, String> json)
: super.deserialize(json);
: super.deserialize(json);
@override
String get kind => 'get_semantics_id';

View File

@ -11,8 +11,8 @@ class SetFrameSync extends Command {
/// Deserializes this command from the value generated by [serialize].
SetFrameSync.deserialize(Map<String, String> params)
: enabled = params['enabled'].toLowerCase() == 'true',
super.deserialize(params);
: enabled = params['enabled'].toLowerCase() == 'true',
super.deserialize(params);
/// Whether frameSync should be enabled or disabled.
final bool enabled;

View File

@ -44,11 +44,11 @@ class Scroll extends CommandWithTarget {
/// Deserializes this command from the value generated by [serialize].
Scroll.deserialize(Map<String, String> json)
: dx = double.parse(json['dx']),
dy = double.parse(json['dy']),
duration = Duration(microseconds: int.parse(json['duration'])),
frequency = int.parse(json['frequency']),
super.deserialize(json);
: dx = double.parse(json['dx']),
dy = double.parse(json['dy']),
duration = Duration(microseconds: int.parse(json['duration'])),
frequency = int.parse(json['frequency']),
super.deserialize(json);
/// Delta X offset per move event.
final double dx;
@ -94,8 +94,8 @@ class ScrollIntoView extends CommandWithTarget {
/// Deserializes this command from the value generated by [serialize].
ScrollIntoView.deserialize(Map<String, String> json)
: alignment = double.parse(json['alignment']),
super.deserialize(json);
: alignment = double.parse(json['alignment']),
super.deserialize(json);
/// How the widget should be aligned.
///

View File

@ -13,7 +13,7 @@ abstract class Command {
/// Deserializes this command from the value generated by [serialize].
Command.deserialize(Map<String, String> json)
: timeout = _parseTimeout(json);
: timeout = _parseTimeout(json);
static Duration _parseTimeout(Map<String, String> json) {
final String timeout = json['timeout'];

View File

@ -12,8 +12,8 @@ class RequestData extends Command {
/// Deserializes this command from the value generated by [serialize].
RequestData.deserialize(Map<String, String> params)
: message = params['message'],
super.deserialize(params);
: message = params['message'],
super.deserialize(params);
/// The message being sent from the test to the application.
final String message;

View File

@ -11,8 +11,8 @@ class SetSemantics extends Command {
/// Deserializes this command from the value generated by [serialize].
SetSemantics.deserialize(Map<String, String> params)
: enabled = params['enabled'].toLowerCase() == 'true',
super.deserialize(params);
: enabled = params['enabled'].toLowerCase() == 'true',
super.deserialize(params);
/// Whether semantics should be enabled (true) or disabled (false).
final bool enabled;

View File

@ -43,8 +43,8 @@ class EnterText extends Command {
/// Deserializes this command from the value generated by [serialize].
EnterText.deserialize(Map<String, dynamic> json)
: text = json['text'],
super.deserialize(json);
: text = json['text'],
super.deserialize(json);
/// The text extracted by the [GetText] command.
final String text;
@ -79,8 +79,8 @@ class SetTextEntryEmulation extends Command {
/// Deserializes this command from the value generated by [serialize].
SetTextEntryEmulation.deserialize(Map<String, dynamic> json)
: enabled = json['enabled'] == 'true',
super.deserialize(json);
: enabled = json['enabled'] == 'true',
super.deserialize(json);
/// Whether text entry emulation should be enabled.
final bool enabled;

View File

@ -17,7 +17,9 @@ import 'widget_tester.dart';
/// The result of evaluating a semantics node by a [AccessibilityGuideline].
class 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
/// result.

View File

@ -576,8 +576,8 @@ class _WidgetFinder extends MatchFinder {
class _WidgetPredicateFinder extends MatchFinder {
_WidgetPredicateFinder(this.predicate, { String description, bool skipOffstage = true })
: _description = description,
super(skipOffstage: skipOffstage);
: _description = description,
super(skipOffstage: skipOffstage);
final WidgetPredicate predicate;
final String _description;
@ -593,8 +593,8 @@ class _WidgetPredicateFinder extends MatchFinder {
class _ElementPredicateFinder extends MatchFinder {
_ElementPredicateFinder(this.predicate, { String description, bool skipOffstage = true })
: _description = description,
super(skipOffstage: skipOffstage);
: _description = description,
super(skipOffstage: skipOffstage);
final ElementPredicate predicate;
final String _description;

View File

@ -149,8 +149,8 @@ class LocalFileComparator implements GoldenFileComparator {
///
/// The [testFile] URL must represent a file.
LocalFileComparator(Uri testFile, {path.Style pathStyle})
: basedir = _getBasedir(testFile, pathStyle),
_path = _getPath(pathStyle);
: basedir = _getBasedir(testFile, pathStyle),
_path = _getPath(pathStyle);
static path.Context _getPath(path.Style style) {
return path.Context(style: style ?? path.Style.platform);

View File

@ -304,12 +304,13 @@ void tearDownAll(Function body) {
/// fixed, this must not import `dart:io`.
class _Reporter {
_Reporter({bool color = true, bool printPath = true})
: _printPath = printPath,
_green = color ? '\u001b[32m' : '',
_red = color ? '\u001b[31m' : '',
_yellow = color ? '\u001b[33m' : '',
_bold = color ? '\u001b[1m' : '',
_noColor = color ? '\u001b[0m' : '';
: _printPath = printPath,
_green = color ? '\u001b[32m' : '',
_red = color ? '\u001b[31m' : '',
_yellow = color ? '\u001b[33m' : '',
_bold = color ? '\u001b[1m' : '',
_noColor = color ? '\u001b[0m' : '';
final List<LiveTest> passed = <LiveTest>[];
final List<LiveTest> failed = <LiveTest>[];
final List<Test> skipped = <Test>[];

View File

@ -27,7 +27,7 @@ class AndroidEmulators extends EmulatorDiscovery {
class AndroidEmulator extends Emulator {
AndroidEmulator(String id, [this._properties])
: super(id, _properties != null && _properties.isNotEmpty);
: super(id, _properties != null && _properties.isNotEmpty);
Map<String, String> _properties;

View File

@ -51,7 +51,7 @@ class AndroidWorkflow implements Workflow {
}
class AndroidValidator extends DoctorValidator {
AndroidValidator(): super('Android toolchain - develop for Android devices',);
AndroidValidator() : super('Android toolchain - develop for Android devices',);
@override
String get slowWarning => '${_task ?? 'This'} is taking a long time...';
@ -167,7 +167,7 @@ class AndroidValidator extends DoctorValidator {
}
class AndroidLicenseValidator extends DoctorValidator {
AndroidLicenseValidator(): super('Android license subvalidator',);
AndroidLicenseValidator() : super('Android license subvalidator',);
@override
String get slowWarning => 'Checking Android licenses is taking an unexpectedly long time...';

View File

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

View File

@ -361,7 +361,9 @@ class ProcessExit implements Exception {
}
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;

View File

@ -42,9 +42,9 @@ class OutputPreferences {
bool wrapText,
int wrapColumn,
bool showColor,
}) : wrapText = wrapText ?? io.stdio?.hasTerminal ?? const io.Stdio().hasTerminal,
_overrideWrapColumn = wrapColumn,
showColor = showColor ?? platform.stdoutSupportsAnsi ?? false;
}) : wrapText = wrapText ?? io.stdio?.hasTerminal ?? const io.Stdio().hasTerminal,
_overrideWrapColumn = wrapColumn,
showColor = showColor ?? platform.stdoutSupportsAnsi ?? false;
/// If [wrapText] is true, then any text sent to the context's [Logger]
/// instance (e.g. from the [printError] or [printStatus] functions) will be

View File

@ -348,7 +348,7 @@ void _maybeWarnAboutStorageOverride(String overrideUrl) {
/// A cached artifact containing fonts used for Material Design.
class MaterialFonts extends CachedArtifact {
MaterialFonts(Cache cache): super('material_fonts', cache);
MaterialFonts(Cache cache) : super('material_fonts', cache);
@override
Future<void> updateInner() {
@ -359,7 +359,7 @@ class MaterialFonts extends CachedArtifact {
/// A cached artifact containing the Flutter engine binaries.
class FlutterEngine extends CachedArtifact {
FlutterEngine(Cache cache): super('engine', cache);
FlutterEngine(Cache cache) : super('engine', cache);
List<String> _getPackageDirs() => const <String>['sky_engine'];
@ -574,7 +574,7 @@ class FlutterEngine extends CachedArtifact {
/// A cached artifact containing Gradle Wrapper scripts and binaries.
class GradleWrapper extends CachedArtifact {
GradleWrapper(Cache cache): super('gradle_wrapper', cache);
GradleWrapper(Cache cache) : super('gradle_wrapper', cache);
List<String> get _gradleScripts => <String>['gradlew', 'gradlew.bat'];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -111,7 +111,9 @@ class IOSDevices extends PollingDeviceDiscovery {
}
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');
_iproxyPath = _checkForCommand('iproxy');
}

View File

@ -31,9 +31,9 @@ import 'template.dart';
class FlutterProject {
@visibleForTesting
FlutterProject(this.directory, this.manifest, this._exampleManifest)
: assert(directory != null),
assert(manifest != null),
assert(_exampleManifest != null);
: assert(directory != null),
assert(manifest != null),
assert(_exampleManifest != null);
/// Returns a future that completes with a [FlutterProject] view of the given directory
/// or a ToolExit error, if `pubspec.yaml` or `example/pubspec.yaml` is invalid.

View File

@ -27,8 +27,8 @@ class FlutterTesterApp extends ApplicationPackage {
}
FlutterTesterApp._(Directory directory)
: _directory = directory,
super(id: directory.path);
: _directory = directory,
super(id: directory.path);
final Directory _directory;

View File

@ -540,7 +540,12 @@ String _shortGitRevision(String revision) {
class GitTagVersion {
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.
final int x;

Some files were not shown because too many files have changed in this diff Show More