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 { class _RepeatingSimulation extends Simulation {
_RepeatingSimulation(double initialValue, this.min, this.max, this.reverse, Duration period) _RepeatingSimulation(double initialValue, this.min, this.max, this.reverse, Duration period)
: _periodInSeconds = period.inMicroseconds / Duration.microsecondsPerSecond, : _periodInSeconds = period.inMicroseconds / Duration.microsecondsPerSecond,
_initialT = (max == min) ? 0.0 : (initialValue / (max - min)) * (period.inMicroseconds / Duration.microsecondsPerSecond) { _initialT = (max == min) ? 0.0 : (initialValue / (max - min)) * (period.inMicroseconds / Duration.microsecondsPerSecond) {
assert(_periodInSeconds > 0.0); assert(_periodInSeconds > 0.0);
assert(_initialT >= 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 /// can be null. If the next train is null, then this object will just proxy
/// the first animation and never hop. /// the first animation and never hop.
TrainHoppingAnimation(this._currentTrain, this._nextTrain, { this.onSwitchedTrain }) TrainHoppingAnimation(this._currentTrain, this._nextTrain, { this.onSwitchedTrain })
: assert(_currentTrain != null) { : assert(_currentTrain != null) {
if (_nextTrain != null) { if (_nextTrain != null) {
if (_currentTrain.value == _nextTrain.value) { if (_currentTrain.value == _nextTrain.value) {
_currentTrain = _nextTrain; _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 /// Both arguments must be non-null. Either can be an [AnimationMax] itself
/// to combine multiple animations. /// 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 @override
T get value => math.max(first.value, next.value); 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 /// Both arguments must be non-null. Either can be an [AnimationMin] itself
/// to combine multiple animations. /// 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 @override
T get value => math.min(first.value, next.value); 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. /// The arguments must not be null.
const Interval(this.begin, this.end, { this.curve = Curves.linear }) const Interval(this.begin, this.end, { this.curve = Curves.linear })
: assert(begin != null), : assert(begin != null),
assert(end != null), assert(end != null),
assert(curve != null); assert(curve != null);
/// The largest value for which this interval is 0.0. /// 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. /// The [a], [b], [c], and [d] arguments must not be null.
const Cubic(this.a, this.b, this.c, this.d) const Cubic(this.a, this.b, this.c, this.d)
: assert(a != null), : assert(a != null),
assert(b != null), assert(b != null),
assert(c != null), assert(c != null),
assert(d != null); assert(d != null);
/// The x coordinate of the first control point. /// 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. /// 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

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

View File

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

View File

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

View File

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

View File

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

View File

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

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;
@ -36,8 +41,8 @@ class _Vector {
// TODO(abarth): Consider using vector_math. // TODO(abarth): Consider using vector_math.
class _Matrix { class _Matrix {
_Matrix(int rows, int cols) _Matrix(int rows, int cols)
: _columns = cols, : _columns = cols,
_elements = Float64List(rows * cols); _elements = Float64List(rows * cols);
final int _columns; final int _columns;
final List<double> _elements; final List<double> _elements;

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -82,15 +82,15 @@ class FloatingActionButton extends StatelessWidget {
this.clipBehavior = Clip.none, this.clipBehavior = Clip.none,
this.materialTapTargetSize, this.materialTapTargetSize,
this.isExtended = false, this.isExtended = false,
}) : assert(elevation != null && elevation >= 0.0), }) : assert(elevation != null && elevation >= 0.0),
assert(highlightElevation != null && highlightElevation >= 0.0), assert(highlightElevation != null && highlightElevation >= 0.0),
assert(disabledElevation == null || disabledElevation >= 0.0), assert(disabledElevation == null || disabledElevation >= 0.0),
assert(mini != null), assert(mini != null),
assert(shape != null), assert(shape != null),
assert(isExtended != null), assert(isExtended != null),
_sizeConstraints = mini ? _kMiniSizeConstraints : _kSizeConstraints, _sizeConstraints = mini ? _kMiniSizeConstraints : _kSizeConstraints,
disabledElevation = disabledElevation ?? elevation, disabledElevation = disabledElevation ?? elevation,
super(key: key); super(key: key);
/// Creates a wider [StadiumBorder]-shaped floating action button with both /// Creates a wider [StadiumBorder]-shaped floating action button with both
/// an [icon] and a [label]. /// an [icon] and a [label].
@ -115,28 +115,28 @@ class FloatingActionButton extends StatelessWidget {
this.clipBehavior = Clip.none, this.clipBehavior = Clip.none,
@required Widget icon, @required Widget icon,
@required Widget label, @required Widget label,
}) : assert(elevation != null && elevation >= 0.0), }) : assert(elevation != null && elevation >= 0.0),
assert(highlightElevation != null && highlightElevation >= 0.0), assert(highlightElevation != null && highlightElevation >= 0.0),
assert(disabledElevation == null || disabledElevation >= 0.0), assert(disabledElevation == null || disabledElevation >= 0.0),
assert(shape != null), assert(shape != null),
assert(isExtended != null), assert(isExtended != null),
assert(clipBehavior != null), assert(clipBehavior != null),
_sizeConstraints = _kExtendedSizeConstraints, _sizeConstraints = _kExtendedSizeConstraints,
disabledElevation = disabledElevation ?? elevation, disabledElevation = disabledElevation ?? elevation,
mini = false, mini = false,
child = _ChildOverflowBox( child = _ChildOverflowBox(
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
const SizedBox(width: 16.0), const SizedBox(width: 16.0),
icon, icon,
const SizedBox(width: 8.0), const SizedBox(width: 8.0),
label, label,
const SizedBox(width: 20.0), const SizedBox(width: 20.0),
], ],
), ),
), ),
super(key: key); super(key: key);
/// The widget below this widget in the tree. /// 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 /// Both arguments must be non-null. Either can be an [_AnimationSwap] itself
/// to combine multiple animations. /// 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 Animation<double> parent;
final double swapThreshold; 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 [begin] and [end] properties may be null; see [ShapeBorder.lerp] for
/// the null handling semantics. /// 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. /// Returns the value this tween has at the given animation clock value.
@override @override

View File

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

View File

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

View File

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

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

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

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);
} }
@ -4485,8 +4498,8 @@ class RenderIndexedSemantics extends RenderProxyBox {
RenderBox child, RenderBox child,
@required int index, @required int index,
}) : assert(index != null), }) : assert(index != null),
_index = index, _index = index,
super(child); super(child);
/// The index used to annotated child semantics. /// The index used to annotated child semantics.
int get index => _index; int get index => _index;

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,11 +630,12 @@ 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,
children: children, super(
alignment: alignment, children: children,
textDirection: textDirection, alignment: alignment,
); textDirection: textDirection,
);
@override @override
void visitChildrenForSemantics(RenderObjectVisitor visitor) { void visitChildrenForSemantics(RenderObjectVisitor visitor) {

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,10 +65,10 @@ 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');
/// The message to announce. /// The message to announce.
/// ///

View File

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

View File

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

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

@ -22,9 +22,9 @@ class _ChildEntry {
@required this.animation, @required this.animation,
@required this.transition, @required this.transition,
@required this.widgetChild, @required this.widgetChild,
}) : assert(animation != null), }) : assert(animation != null),
assert(transition != null), assert(transition != null),
assert(controller != null); assert(controller != null);
// The animation controller for the child's transition. // The animation controller for the child's transition.
final AnimationController controller; final AnimationController controller;
@ -156,12 +156,12 @@ class AnimatedSwitcher extends StatefulWidget {
this.switchOutCurve = Curves.linear, this.switchOutCurve = Curves.linear,
this.transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder, this.transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder,
this.layoutBuilder = AnimatedSwitcher.defaultLayoutBuilder, this.layoutBuilder = AnimatedSwitcher.defaultLayoutBuilder,
}) : assert(duration != null), }) : assert(duration != null),
assert(switchInCurve != null), assert(switchInCurve != null),
assert(switchOutCurve != null), assert(switchOutCurve != null),
assert(transitionBuilder != null), assert(transitionBuilder != null),
assert(layoutBuilder != null), assert(layoutBuilder != null),
super(key: key); super(key: key);
/// The current child widget to display. If there was a previous child, then /// 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 /// 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], /// Creates an [AsyncSnapshot] with the specified [connectionState],
/// and optionally either [data] or [error] (but not both). /// and optionally either [data] or [error] (but not both).
const AsyncSnapshot._(this.connectionState, this.data, this.error) const AsyncSnapshot._(this.connectionState, this.data, this.error)
: assert(connectionState != null), : assert(connectionState != null),
assert(!(data != null && error != null)); assert(!(data != null && error != null));
/// Creates an [AsyncSnapshot] in [ConnectionState.none] with null data and error. /// Creates an [AsyncSnapshot] in [ConnectionState.none] with null data and error.
const AsyncSnapshot.nothing() : this._(ConnectionState.none, null, null); const AsyncSnapshot.nothing() : this._(ConnectionState.none, null, null);

View File

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

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(
@ -4780,7 +4782,7 @@ abstract class RenderObjectElement extends Element {
/// elements inherit their owner from their parent. /// elements inherit their owner from their parent.
abstract class RootRenderObjectElement extends RenderObjectElement { abstract class RootRenderObjectElement extends RenderObjectElement {
/// Initializes fields for subclasses. /// 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 /// Set the owner of the element. The owner will be propagated to all the
/// descendants of this element. /// descendants of this element.
@ -4808,7 +4810,7 @@ abstract class RootRenderObjectElement extends RenderObjectElement {
/// An [Element] that uses a [LeafRenderObjectWidget] as its configuration. /// An [Element] that uses a [LeafRenderObjectWidget] as its configuration.
class LeafRenderObjectElement extends RenderObjectElement { class LeafRenderObjectElement extends RenderObjectElement {
/// Creates an element that uses the given widget as its configuration. /// Creates an element that uses the given widget as its configuration.
LeafRenderObjectElement(LeafRenderObjectWidget widget): super(widget); LeafRenderObjectElement(LeafRenderObjectWidget widget) : super(widget);
@override @override
void forgetChild(Element child) { 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. /// 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

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

View File

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

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

@ -212,9 +212,9 @@ class UiKitView extends StatefulWidget {
this.creationParamsCodec, this.creationParamsCodec,
this.gestureRecognizers, this.gestureRecognizers,
}) : assert(viewType != null), }) : assert(viewType != null),
assert(hitTestBehavior != null), assert(hitTestBehavior != null),
assert(creationParams == null || creationParamsCodec != null), assert(creationParams == null || creationParamsCodec != null),
super(key: key); super(key: key);
// TODO(amirh): reference the iOS API doc once avaliable. // TODO(amirh): reference the iOS API doc once avaliable.
/// The unique identifier for iOS view type to be embedded by this widget. /// 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), Duration transitionDuration = const Duration(milliseconds: 200),
RouteTransitionsBuilder transitionBuilder, RouteTransitionsBuilder transitionBuilder,
RouteSettings settings, RouteSettings settings,
}) : assert(barrierDismissible != null), }) : assert(barrierDismissible != null),
_pageBuilder = pageBuilder, _pageBuilder = pageBuilder,
_barrierDismissible = barrierDismissible, _barrierDismissible = barrierDismissible,
_barrierLabel = barrierLabel, _barrierLabel = barrierLabel,
_barrierColor = barrierColor, _barrierColor = barrierColor,
_transitionDuration = transitionDuration, _transitionDuration = transitionDuration,
_transitionBuilder = transitionBuilder, _transitionBuilder = transitionBuilder,
super(settings: settings); super(settings: settings);
final RoutePageBuilder _pageBuilder; final RoutePageBuilder _pageBuilder;

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

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

View File

@ -231,9 +231,9 @@ class TextSelectionOverlay {
this.selectionControls, this.selectionControls,
this.selectionDelegate, this.selectionDelegate,
this.dragStartBehavior = DragStartBehavior.down, this.dragStartBehavior = DragStartBehavior.down,
}): assert(value != null), }) : assert(value != null),
assert(context != null), assert(context != null),
_value = value { _value = value {
final OverlayState overlay = Overlay.of(context); final OverlayState overlay = Overlay.of(context);
assert(overlay != null); assert(overlay != null);
_handleController = AnimationController(duration: _fadeDuration, vsync: overlay); _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. /// 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,13 +691,12 @@ 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, includeProperties = base.includeProperties,
includeProperties = base.includeProperties, expandPropertyValues = base.expandPropertyValues;
expandPropertyValues = base.expandPropertyValues;
/// Optional object group name used to manage manage lifetimes of object /// Optional object group name used to manage manage lifetimes of object
/// references in the returned JSON. /// references in the returned JSON.
@ -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,9 +2482,9 @@ 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;
final Matrix4 transform; final Matrix4 transform;
@ -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

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

@ -149,8 +149,8 @@ class LocalFileComparator implements GoldenFileComparator {
/// ///
/// The [testFile] URL must represent a file. /// The [testFile] URL must represent a file.
LocalFileComparator(Uri testFile, {path.Style pathStyle}) LocalFileComparator(Uri testFile, {path.Style pathStyle})
: basedir = _getBasedir(testFile, pathStyle), : basedir = _getBasedir(testFile, pathStyle),
_path = _getPath(pathStyle); _path = _getPath(pathStyle);
static path.Context _getPath(path.Style style) { static path.Context _getPath(path.Style style) {
return path.Context(style: style ?? path.Style.platform); 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`. /// fixed, this must not import `dart:io`.
class _Reporter { class _Reporter {
_Reporter({bool color = true, bool printPath = true}) _Reporter({bool color = true, bool printPath = true})
: _printPath = printPath, : _printPath = printPath,
_green = color ? '\u001b[32m' : '', _green = color ? '\u001b[32m' : '',
_red = color ? '\u001b[31m' : '', _red = color ? '\u001b[31m' : '',
_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

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

View File

@ -51,7 +51,7 @@ class AndroidWorkflow implements Workflow {
} }
class AndroidValidator extends DoctorValidator { class AndroidValidator extends DoctorValidator {
AndroidValidator(): super('Android toolchain - develop for Android devices',); AndroidValidator() : super('Android toolchain - develop for Android devices',);
@override @override
String get slowWarning => '${_task ?? 'This'} is taking a long time...'; String get slowWarning => '${_task ?? 'This'} is taking a long time...';
@ -167,7 +167,7 @@ class AndroidValidator extends DoctorValidator {
} }
class AndroidLicenseValidator extends DoctorValidator { class AndroidLicenseValidator extends DoctorValidator {
AndroidLicenseValidator(): super('Android license subvalidator',); AndroidLicenseValidator() : super('Android license subvalidator',);
@override @override
String get slowWarning => 'Checking Android licenses is taking an unexpectedly long time...'; 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 { class EngineBuildPaths {
const EngineBuildPaths({ @required this.targetEngine, @required this.hostEngine }): const EngineBuildPaths({
assert(targetEngine != null), @required this.targetEngine,
assert(hostEngine != null); @required this.hostEngine,
}) : assert(targetEngine != null),
assert(hostEngine != null);
final String targetEngine; final String targetEngine;
final String hostEngine; final String hostEngine;

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

@ -42,9 +42,9 @@ class OutputPreferences {
bool wrapText, bool wrapText,
int wrapColumn, int wrapColumn,
bool showColor, bool showColor,
}) : wrapText = wrapText ?? io.stdio?.hasTerminal ?? const io.Stdio().hasTerminal, }) : wrapText = wrapText ?? io.stdio?.hasTerminal ?? const io.Stdio().hasTerminal,
_overrideWrapColumn = wrapColumn, _overrideWrapColumn = wrapColumn,
showColor = showColor ?? platform.stdoutSupportsAnsi ?? false; showColor = showColor ?? platform.stdoutSupportsAnsi ?? false;
/// If [wrapText] is true, then any text sent to the context's [Logger] /// If [wrapText] is true, then any text sent to the context's [Logger]
/// instance (e.g. from the [printError] or [printStatus] functions) will be /// 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. /// A cached artifact containing fonts used for Material Design.
class MaterialFonts extends CachedArtifact { class MaterialFonts extends CachedArtifact {
MaterialFonts(Cache cache): super('material_fonts', cache); MaterialFonts(Cache cache) : super('material_fonts', cache);
@override @override
Future<void> updateInner() { Future<void> updateInner() {
@ -359,7 +359,7 @@ class MaterialFonts extends CachedArtifact {
/// A cached artifact containing the Flutter engine binaries. /// A cached artifact containing the Flutter engine binaries.
class FlutterEngine extends CachedArtifact { class FlutterEngine extends CachedArtifact {
FlutterEngine(Cache cache): super('engine', cache); FlutterEngine(Cache cache) : super('engine', cache);
List<String> _getPackageDirs() => const <String>['sky_engine']; List<String> _getPackageDirs() => const <String>['sky_engine'];
@ -574,7 +574,7 @@ class FlutterEngine extends CachedArtifact {
/// A cached artifact containing Gradle Wrapper scripts and binaries. /// A cached artifact containing Gradle Wrapper scripts and binaries.
class GradleWrapper extends CachedArtifact { 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']; List<String> get _gradleScripts => <String>['gradlew', 'gradlew.bat'];

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,10 +26,10 @@ 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);
final String _mainScriptPath; final String _mainScriptPath;
final String _packagesFilePath; final String _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;
@ -274,7 +276,7 @@ class DevFSException implements Exception {
class _DevFSHttpWriter { class _DevFSHttpWriter {
_DevFSHttpWriter(this.fsName, VMService serviceProtocol) _DevFSHttpWriter(this.fsName, VMService serviceProtocol)
: httpAddress = serviceProtocol.httpAddress; : httpAddress = serviceProtocol.httpAddress;
final String fsName; final String fsName;
final Uri httpAddress; final Uri httpAddress;
@ -377,25 +379,25 @@ 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(
this.fsName, VMService serviceProtocol,
this.rootDirectory, { this.fsName,
String packagesFilePath this.rootDirectory, {
}) 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.fsName, this._operations,
this.rootDirectory, { this.fsName,
String packagesFilePath, this.rootDirectory, {
}) String packagesFilePath,
: _httpWriter = null { }) : _httpWriter = null {
_packagesFilePath = _packagesFilePath =
packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName); packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName);
} }
final DevFSOperations _operations; final DevFSOperations _operations;

View File

@ -361,15 +361,15 @@ 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,
skiaDeterministicRendering = false, skiaDeterministicRendering = false,
traceSkia = false, traceSkia = false,
traceSystrace = false, traceSystrace = false,
observatoryPort = null; observatoryPort = null;
final bool debuggingEnabled; final bool debuggingEnabled;
@ -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

@ -31,9 +31,9 @@ import 'template.dart';
class FlutterProject { class FlutterProject {
@visibleForTesting @visibleForTesting
FlutterProject(this.directory, this.manifest, this._exampleManifest) FlutterProject(this.directory, this.manifest, this._exampleManifest)
: assert(directory != null), : assert(directory != null),
assert(manifest != null), assert(manifest != null),
assert(_exampleManifest != null); assert(_exampleManifest != null);
/// Returns a future that completes with a [FlutterProject] view of the given directory /// 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. /// 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) FlutterTesterApp._(Directory directory)
: _directory = directory, : _directory = directory,
super(id: directory.path); super(id: directory.path);
final Directory _directory; final Directory _directory;

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;

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