diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart index c279f32a4c..a3b7d068fa 100644 --- a/packages/flutter/lib/src/animation/animation_controller.dart +++ b/packages/flutter/lib/src/animation/animation_controller.dart @@ -797,8 +797,8 @@ class _InterpolationSimulation extends Simulation { class _RepeatingSimulation extends Simulation { _RepeatingSimulation(double initialValue, this.min, this.max, this.reverse, Duration period) - : _periodInSeconds = period.inMicroseconds / Duration.microsecondsPerSecond, - _initialT = (max == min) ? 0.0 : (initialValue / (max - min)) * (period.inMicroseconds / Duration.microsecondsPerSecond) { + : _periodInSeconds = period.inMicroseconds / Duration.microsecondsPerSecond, + _initialT = (max == min) ? 0.0 : (initialValue / (max - min)) * (period.inMicroseconds / Duration.microsecondsPerSecond) { assert(_periodInSeconds > 0.0); assert(_initialT >= 0.0); } diff --git a/packages/flutter/lib/src/animation/animations.dart b/packages/flutter/lib/src/animation/animations.dart index 531bfbafc1..2187219743 100644 --- a/packages/flutter/lib/src/animation/animations.dart +++ b/packages/flutter/lib/src/animation/animations.dart @@ -493,7 +493,7 @@ class TrainHoppingAnimation extends Animation /// can be null. If the next train is null, then this object will just proxy /// the first animation and never hop. TrainHoppingAnimation(this._currentTrain, this._nextTrain, { this.onSwitchedTrain }) - : assert(_currentTrain != null) { + : assert(_currentTrain != null) { if (_nextTrain != null) { if (_currentTrain.value == _nextTrain.value) { _currentTrain = _nextTrain; @@ -701,7 +701,7 @@ class AnimationMax extends CompoundAnimation { /// /// Both arguments must be non-null. Either can be an [AnimationMax] itself /// to combine multiple animations. - AnimationMax(Animation first, Animation next): super(first: first, next: next); + AnimationMax(Animation first, Animation next) : super(first: first, next: next); @override T get value => math.max(first.value, next.value); @@ -716,7 +716,7 @@ class AnimationMin extends CompoundAnimation { /// /// Both arguments must be non-null. Either can be an [AnimationMin] itself /// to combine multiple animations. - AnimationMin(Animation first, Animation next): super(first: first, next: next); + AnimationMin(Animation first, Animation next) : super(first: first, next: next); @override T get value => math.min(first.value, next.value); diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index 237833b042..d5aac3d00a 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -110,9 +110,9 @@ class Interval extends Curve { /// /// The arguments must not be null. const Interval(this.begin, this.end, { this.curve = Curves.linear }) - : assert(begin != null), - assert(end != null), - assert(curve != null); + : assert(begin != null), + assert(end != null), + assert(curve != null); /// The largest value for which this interval is 0.0. /// @@ -199,10 +199,10 @@ class Cubic extends Curve { /// /// The [a], [b], [c], and [d] arguments must not be null. const Cubic(this.a, this.b, this.c, this.d) - : assert(a != null), - assert(b != null), - assert(c != null), - assert(d != null); + : assert(a != null), + assert(b != null), + assert(c != null), + assert(d != null); /// The x coordinate of the first control point. /// diff --git a/packages/flutter/lib/src/animation/tween.dart b/packages/flutter/lib/src/animation/tween.dart index dc378237fa..37274d81a3 100644 --- a/packages/flutter/lib/src/animation/tween.dart +++ b/packages/flutter/lib/src/animation/tween.dart @@ -267,7 +267,9 @@ class Tween extends Animatable { /// A [Tween] that evaluates its [parent] in reverse. class ReverseTween extends Tween { /// 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. /// diff --git a/packages/flutter/lib/src/animation/tween_sequence.dart b/packages/flutter/lib/src/animation/tween_sequence.dart index 83aef41e5d..79ed0eb2ac 100644 --- a/packages/flutter/lib/src/animation/tween_sequence.dart +++ b/packages/flutter/lib/src/animation/tween_sequence.dart @@ -44,7 +44,9 @@ class TweenSequence extends Animatable { /// There's a small cost associated with building a `TweenSequence` so /// it's best to reuse one, rather than rebuilding it on every frame, /// when that's possible. - TweenSequence(List> items) : assert(items != null), assert(items.isNotEmpty) { + TweenSequence(List> items) + : assert(items != null), + assert(items.isNotEmpty) { _items.addAll(items); double totalWeight = 0.0; @@ -95,7 +97,9 @@ class TweenSequenceItem { const TweenSequenceItem({ @required this.tween, @required this.weight, - }) : assert(tween != null), assert(weight != null), assert(weight > 0.0); + }) : assert(tween != null), + assert(weight != null), + assert(weight > 0.0); /// Defines the value of the [TweenSequence] for the interval within the /// animation's duration indicated by [weight] and this item's position diff --git a/packages/flutter/lib/src/cupertino/action_sheet.dart b/packages/flutter/lib/src/cupertino/action_sheet.dart index 2cbbfc07fd..1158dbead6 100644 --- a/packages/flutter/lib/src/cupertino/action_sheet.dart +++ b/packages/flutter/lib/src/cupertino/action_sheet.dart @@ -107,10 +107,10 @@ class CupertinoActionSheet extends StatelessWidget { this.messageScrollController, this.actionScrollController, this.cancelButton, - }) : assert(actions != null || title != null || message != null || cancelButton != null, + }) : assert(actions != null || title != null || message != null || cancelButton != null, 'An action sheet must have a non-null value for at least one of the following arguments: ' 'actions, title, message, or cancelButton'), - super(key: key); + super(key: key); /// An optional title of the action sheet. When the [message] is non-null, /// the font of the [title] is bold. @@ -266,8 +266,8 @@ class CupertinoActionSheetAction extends StatelessWidget { this.isDefaultAction = false, this.isDestructiveAction = false, @required this.child, - }) : assert(child != null), - assert(onPressed != null); + }) : assert(child != null), + assert(onPressed != null); /// The callback that is called when the button is tapped. /// @@ -514,9 +514,9 @@ class _RenderCupertinoAlert extends RenderBox { RenderBox contentSection, RenderBox actionsSection, double dividerThickness = 0.0, - }) : _contentSection = contentSection, - _actionsSection = actionsSection, - _dividerThickness = dividerThickness; + }) : _contentSection = contentSection, + _actionsSection = actionsSection, + _dividerThickness = dividerThickness; RenderBox get contentSection => _contentSection; RenderBox _contentSection; @@ -843,8 +843,8 @@ class _CupertinoAlertActionSection extends StatefulWidget { @required this.children, this.scrollController, this.hasCancelButton, - }) : assert(children != null), - super(key: key); + }) : assert(children != null), + super(key: key); final List children; @@ -975,9 +975,9 @@ class _CupertinoAlertActionsRenderWidget extends MultiChildRenderObjectWidget { @required List actionButtons, double dividerThickness = 0.0, bool hasCancelButton = false, - }) : _dividerThickness = dividerThickness, - _hasCancelButton = hasCancelButton, - super(key: key, children: actionButtons); + }) : _dividerThickness = dividerThickness, + _hasCancelButton = hasCancelButton, + super(key: key, children: actionButtons); final double _dividerThickness; final bool _hasCancelButton; @@ -1022,8 +1022,8 @@ class _RenderCupertinoAlertActions extends RenderBox List children, double dividerThickness = 0.0, bool hasCancelButton = false, - }) : _dividerThickness = dividerThickness, - _hasCancelButton = hasCancelButton { + }) : _dividerThickness = dividerThickness, + _hasCancelButton = hasCancelButton { addAll(children); } diff --git a/packages/flutter/lib/src/cupertino/dialog.dart b/packages/flutter/lib/src/cupertino/dialog.dart index 9ed6a7006f..a9d40fba62 100644 --- a/packages/flutter/lib/src/cupertino/dialog.dart +++ b/packages/flutter/lib/src/cupertino/dialog.dart @@ -137,8 +137,8 @@ class CupertinoAlertDialog extends StatelessWidget { this.actions = const [], this.scrollController, this.actionScrollController, - }) : assert(actions != null), - super(key: key); + }) : assert(actions != null), + super(key: key); /// The (optional) title of the dialog is displayed in a large font at the top /// of the dialog. @@ -893,8 +893,8 @@ class _CupertinoAlertActionSection extends StatefulWidget { Key key, @required this.children, this.scrollController, - }) : assert(children != null), - super(key: key); + }) : assert(children != null), + super(key: key); final List children; diff --git a/packages/flutter/lib/src/cupertino/nav_bar.dart b/packages/flutter/lib/src/cupertino/nav_bar.dart index ef352a4644..e7029dd596 100644 --- a/packages/flutter/lib/src/cupertino/nav_bar.dart +++ b/packages/flutter/lib/src/cupertino/nav_bar.dart @@ -910,13 +910,13 @@ class _PersistentNavigationBar extends StatelessWidget { @immutable class _NavigationBarStaticComponentsKeys { _NavigationBarStaticComponentsKeys() - : navBarBoxKey = GlobalKey(debugLabel: 'Navigation bar render box'), - leadingKey = GlobalKey(debugLabel: 'Leading'), - backChevronKey = GlobalKey(debugLabel: 'Back chevron'), - backLabelKey = GlobalKey(debugLabel: 'Back label'), - middleKey = GlobalKey(debugLabel: 'Middle'), - trailingKey = GlobalKey(debugLabel: 'Trailing'), - largeTitleKey = GlobalKey(debugLabel: 'Large title'); + : navBarBoxKey = GlobalKey(debugLabel: 'Navigation bar render box'), + leadingKey = GlobalKey(debugLabel: 'Leading'), + backChevronKey = GlobalKey(debugLabel: 'Back chevron'), + backLabelKey = GlobalKey(debugLabel: 'Back label'), + middleKey = GlobalKey(debugLabel: 'Middle'), + trailingKey = GlobalKey(debugLabel: 'Trailing'), + largeTitleKey = GlobalKey(debugLabel: 'Large title'); final GlobalKey navBarBoxKey; final GlobalKey leadingKey; diff --git a/packages/flutter/lib/src/cupertino/segmented_control.dart b/packages/flutter/lib/src/cupertino/segmented_control.dart index 17b7321702..720618e893 100644 --- a/packages/flutter/lib/src/cupertino/segmented_control.dart +++ b/packages/flutter/lib/src/cupertino/segmented_control.dart @@ -87,14 +87,14 @@ class CupertinoSegmentedControl extends StatefulWidget { this.selectedColor, this.borderColor, this.pressedColor, - }) : assert(children != null), - assert(children.length >= 2), - assert(onValueChanged != null), - assert( - groupValue == null || children.keys.any((T child) => child == groupValue), - 'The groupValue must be either null or one of the keys in the children map.', - ), - super(key: key); + }) : assert(children != null), + assert(children.length >= 2), + assert(onValueChanged != null), + assert( + groupValue == null || children.keys.any((T child) => child == groupValue), + 'The groupValue must be either null or one of the keys in the children map.', + ), + super(key: key); /// The identifying keys and corresponding widget values in the /// segmented control. @@ -472,12 +472,12 @@ class _RenderSegmentedControl extends RenderBox @required TextDirection textDirection, @required List backgroundColors, @required Color borderColor, - }) : assert(textDirection != null), - _textDirection = textDirection, - _selectedIndex = selectedIndex, - _pressedIndex = pressedIndex, - _backgroundColors = backgroundColors, - _borderColor = borderColor { + }) : assert(textDirection != null), + _textDirection = textDirection, + _selectedIndex = selectedIndex, + _pressedIndex = pressedIndex, + _backgroundColors = backgroundColors, + _borderColor = borderColor { addAll(children); } diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart index d533f4c150..8a68ff9080 100644 --- a/packages/flutter/lib/src/foundation/diagnostics.dart +++ b/packages/flutter/lib/src/foundation/diagnostics.dart @@ -1753,7 +1753,7 @@ class DiagnosticsProperty extends DiagnosticsNode { _valueComputed = false, _value = null, _computeValue = computeValue, - _defaultLevel = level, + _defaultLevel = level, ifNull = ifNull ?? (missingIfNull ? 'MISSING' : null), super( name: name, diff --git a/packages/flutter/lib/src/gestures/long_press.dart b/packages/flutter/lib/src/gestures/long_press.dart index 61de7a6d75..f9f723989a 100644 --- a/packages/flutter/lib/src/gestures/long_press.dart +++ b/packages/flutter/lib/src/gestures/long_press.dart @@ -21,7 +21,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer { /// /// Consider assigning the [onLongPress] callback after creating this object. LongPressGestureRecognizer({ Object debugOwner }) - : super(deadline: kLongPressTimeout, debugOwner: debugOwner); + : super(deadline: kLongPressTimeout, debugOwner: debugOwner); bool _longPressAccepted = false; diff --git a/packages/flutter/lib/src/gestures/lsq_solver.dart b/packages/flutter/lib/src/gestures/lsq_solver.dart index 1a540c2d43..509d7ea697 100644 --- a/packages/flutter/lib/src/gestures/lsq_solver.dart +++ b/packages/flutter/lib/src/gestures/lsq_solver.dart @@ -7,10 +7,15 @@ import 'dart:typed_data'; // TODO(abarth): Consider using vector_math. class _Vector { - _Vector(int size) : _offset = 0, _length = size, _elements = Float64List(size); + _Vector(int size) + : _offset = 0, + _length = size, + _elements = Float64List(size); _Vector.fromVOL(List values, int offset, int length) - : _offset = offset, _length = length, _elements = values; + : _offset = offset, + _length = length, + _elements = values; final int _offset; @@ -36,8 +41,8 @@ class _Vector { // TODO(abarth): Consider using vector_math. class _Matrix { _Matrix(int rows, int cols) - : _columns = cols, - _elements = Float64List(rows * cols); + : _columns = cols, + _elements = Float64List(rows * cols); final int _columns; final List _elements; diff --git a/packages/flutter/lib/src/gestures/monodrag.dart b/packages/flutter/lib/src/gestures/monodrag.dart index 8f7522e82b..494655d6fe 100644 --- a/packages/flutter/lib/src/gestures/monodrag.dart +++ b/packages/flutter/lib/src/gestures/monodrag.dart @@ -330,8 +330,7 @@ class VerticalDragGestureRecognizer extends DragGestureRecognizer { /// track each touch point independently. class HorizontalDragGestureRecognizer extends DragGestureRecognizer { /// Create a gesture recognizer for interactions in the horizontal axis. - HorizontalDragGestureRecognizer({ Object debugOwner }) : - super(debugOwner: debugOwner); + HorizontalDragGestureRecognizer({ Object debugOwner }) : super(debugOwner: debugOwner); @override bool _isFlingGesture(VelocityEstimate estimate) { diff --git a/packages/flutter/lib/src/gestures/multidrag.dart b/packages/flutter/lib/src/gestures/multidrag.dart index 1b115f6566..ca028a7b0b 100644 --- a/packages/flutter/lib/src/gestures/multidrag.dart +++ b/packages/flutter/lib/src/gestures/multidrag.dart @@ -439,8 +439,8 @@ class VerticalMultiDragGestureRecognizer extends MultiDragGestureRecognizer<_Ver class _DelayedPointerState extends MultiDragPointerState { _DelayedPointerState(Offset initialPosition, Duration delay) - : assert(delay != null), - super(initialPosition) { + : assert(delay != null), + super(initialPosition) { _timer = Timer(delay, _delayPassed); } diff --git a/packages/flutter/lib/src/gestures/velocity_tracker.dart b/packages/flutter/lib/src/gestures/velocity_tracker.dart index 4f548d408e..ea84344d32 100644 --- a/packages/flutter/lib/src/gestures/velocity_tracker.dart +++ b/packages/flutter/lib/src/gestures/velocity_tracker.dart @@ -126,8 +126,8 @@ class VelocityEstimate { class _PointAtTime { const _PointAtTime(this.point, this.time) - : assert(point != null), - assert(time != null); + : assert(point != null), + assert(time != null); final Duration time; final Offset point; diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart index d471735194..849ebd0fbd 100644 --- a/packages/flutter/lib/src/material/checkbox.dart +++ b/packages/flutter/lib/src/material/checkbox.dart @@ -220,16 +220,16 @@ class _RenderCheckbox extends RenderToggleable { BoxConstraints additionalConstraints, ValueChanged onChanged, @required TickerProvider vsync, - }): _oldValue = value, - super( - value: value, - tristate: tristate, - activeColor: activeColor, - inactiveColor: inactiveColor, - onChanged: onChanged, - additionalConstraints: additionalConstraints, - vsync: vsync, - ); + }) : _oldValue = value, + super( + value: value, + tristate: tristate, + activeColor: activeColor, + inactiveColor: inactiveColor, + onChanged: onChanged, + additionalConstraints: additionalConstraints, + vsync: vsync, + ); bool _oldValue; diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index af83b4e2c8..237bd4c5aa 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -476,9 +476,9 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri this.backgroundColor, this.padding, this.materialTapTargetSize, - }) : assert(label != null), - assert(clipBehavior != null), - super(key: key); + }) : assert(label != null), + assert(clipBehavior != null), + super(key: key); @override final Widget avatar; @@ -613,11 +613,11 @@ class InputChip extends StatelessWidget this.padding, this.materialTapTargetSize, this.avatarBorder = const CircleBorder(), - }) : assert(selected != null), - assert(isEnabled != null), - assert(label != null), - assert(clipBehavior != null), - super(key: key); + }) : assert(selected != null), + assert(isEnabled != null), + assert(label != null), + assert(clipBehavior != null), + super(key: key); @override final Widget avatar; @@ -775,10 +775,10 @@ class ChoiceChip extends StatelessWidget this.padding, this.materialTapTargetSize, this.avatarBorder = const CircleBorder(), - }) : assert(selected != null), - assert(label != null), - assert(clipBehavior != null), - super(key: key); + }) : assert(selected != null), + assert(label != null), + assert(clipBehavior != null), + super(key: key); @override final Widget avatar; @@ -956,10 +956,10 @@ class FilterChip extends StatelessWidget this.padding, this.materialTapTargetSize, this.avatarBorder = const CircleBorder(), - }) : assert(selected != null), - assert(label != null), - assert(clipBehavior != null), - super(key: key); + }) : assert(selected != null), + assert(label != null), + assert(clipBehavior != null), + super(key: key); @override final Widget avatar; @@ -1087,13 +1087,13 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip this.backgroundColor, this.padding, this.materialTapTargetSize, - }) : assert(label != null), - assert( - onPressed != null, - 'Rather than disabling an ActionChip by setting onPressed to null, ' - 'remove it from the interface entirely.', - ), - super(key: key); + }) : assert(label != null), + assert( + onPressed != null, + 'Rather than disabling an ActionChip by setting onPressed to null, ' + 'remove it from the interface entirely.', + ), + super(key: key); @override final Widget avatar; @@ -1211,12 +1211,12 @@ class RawChip extends StatefulWidget this.backgroundColor, this.materialTapTargetSize, this.avatarBorder = const CircleBorder(), - }) : assert(label != null), - assert(isEnabled != null), - assert(clipBehavior != null), - assert(pressElevation != null && pressElevation >= 0.0), - deleteIcon = deleteIcon ?? _kDefaultDeleteIcon, - super(key: key); + }) : assert(label != null), + assert(isEnabled != null), + assert(clipBehavior != null), + assert(pressElevation != null && pressElevation >= 0.0), + deleteIcon = deleteIcon ?? _kDefaultDeleteIcon, + super(key: key); @override final Widget avatar; @@ -1649,8 +1649,8 @@ class _ChipRenderWidget extends RenderObjectWidget { this.deleteDrawerAnimation, this.enableAnimation, this.avatarBorder, - }) : assert(theme != null), - super(key: key); + }) : assert(theme != null), + super(key: key); final _ChipRenderTheme theme; final bool value; @@ -1878,10 +1878,10 @@ class _RenderChip extends RenderBox { this.deleteDrawerAnimation, this.enableAnimation, this.avatarBorder, - }) : assert(theme != null), - assert(textDirection != null), - _theme = theme, - _textDirection = textDirection { + }) : assert(theme != null), + assert(textDirection != null), + _theme = theme, + _textDirection = textDirection { checkmarkAnimation.addListener(markNeedsPaint); avatarDrawerAnimation.addListener(markNeedsLayout); deleteDrawerAnimation.addListener(markNeedsLayout); diff --git a/packages/flutter/lib/src/material/chip_theme.dart b/packages/flutter/lib/src/material/chip_theme.dart index 048ec3eb3f..b4d076e7f4 100644 --- a/packages/flutter/lib/src/material/chip_theme.dart +++ b/packages/flutter/lib/src/material/chip_theme.dart @@ -46,9 +46,9 @@ class ChipTheme extends InheritedWidget { Key key, @required this.data, @required Widget child, - }) : assert(child != null), - assert(data != null), - super(key: key, child: child); + }) : assert(child != null), + assert(data != null), + super(key: key, child: child); /// Specifies the color, shape, and text style values for descendant chip /// widgets. @@ -178,16 +178,16 @@ class ChipThemeData extends Diagnosticable { @required this.labelStyle, @required this.secondaryLabelStyle, @required this.brightness, - }) : assert(backgroundColor != null), - assert(disabledColor != null), - assert(selectedColor != null), - assert(secondarySelectedColor != null), - assert(labelPadding != null), - assert(padding != null), - assert(shape != null), - assert(labelStyle != null), - assert(secondaryLabelStyle != null), - assert(brightness != null); + }) : assert(backgroundColor != null), + assert(disabledColor != null), + assert(selectedColor != null), + assert(secondarySelectedColor != null), + assert(labelPadding != null), + assert(padding != null), + assert(shape != null), + assert(labelStyle != null), + assert(secondaryLabelStyle != null), + assert(brightness != null); /// Generates a ChipThemeData from a brightness, a primary color, and a text /// style. diff --git a/packages/flutter/lib/src/material/circle_avatar.dart b/packages/flutter/lib/src/material/circle_avatar.dart index 7461eb1da5..12a60c84e2 100644 --- a/packages/flutter/lib/src/material/circle_avatar.dart +++ b/packages/flutter/lib/src/material/circle_avatar.dart @@ -61,8 +61,8 @@ class CircleAvatar extends StatelessWidget { this.radius, this.minRadius, this.maxRadius, - }) : assert(radius == null || (minRadius == null && maxRadius == null)), - super(key: key); + }) : assert(radius == null || (minRadius == null && maxRadius == null)), + super(key: key); /// The widget below this widget in the tree. /// diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart index c550f04a0e..8fe7f5dd7d 100644 --- a/packages/flutter/lib/src/material/flexible_space_bar.dart +++ b/packages/flutter/lib/src/material/flexible_space_bar.dart @@ -251,8 +251,8 @@ class FlexibleSpaceBarSettings extends InheritedWidget { this.maxExtent, @required this.currentExtent, @required Widget child, - }) : assert(currentExtent != null), - super(key: key, child: child); + }) : assert(currentExtent != null), + super(key: key, child: child); /// Affects how transparent the text within the toolbar appears. final double toolbarOpacity; diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart index fe28efe5bf..9f820a9ad9 100644 --- a/packages/flutter/lib/src/material/floating_action_button.dart +++ b/packages/flutter/lib/src/material/floating_action_button.dart @@ -82,15 +82,15 @@ class FloatingActionButton extends StatelessWidget { this.clipBehavior = Clip.none, this.materialTapTargetSize, this.isExtended = false, - }) : assert(elevation != null && elevation >= 0.0), - assert(highlightElevation != null && highlightElevation >= 0.0), - assert(disabledElevation == null || disabledElevation >= 0.0), - assert(mini != null), - assert(shape != null), - assert(isExtended != null), - _sizeConstraints = mini ? _kMiniSizeConstraints : _kSizeConstraints, - disabledElevation = disabledElevation ?? elevation, - super(key: key); + }) : assert(elevation != null && elevation >= 0.0), + assert(highlightElevation != null && highlightElevation >= 0.0), + assert(disabledElevation == null || disabledElevation >= 0.0), + assert(mini != null), + assert(shape != null), + assert(isExtended != null), + _sizeConstraints = mini ? _kMiniSizeConstraints : _kSizeConstraints, + disabledElevation = disabledElevation ?? elevation, + super(key: key); /// Creates a wider [StadiumBorder]-shaped floating action button with both /// an [icon] and a [label]. @@ -115,28 +115,28 @@ class FloatingActionButton extends StatelessWidget { this.clipBehavior = Clip.none, @required Widget icon, @required Widget label, - }) : assert(elevation != null && elevation >= 0.0), - assert(highlightElevation != null && highlightElevation >= 0.0), - assert(disabledElevation == null || disabledElevation >= 0.0), - assert(shape != null), - assert(isExtended != null), - assert(clipBehavior != null), - _sizeConstraints = _kExtendedSizeConstraints, - disabledElevation = disabledElevation ?? elevation, - mini = false, - child = _ChildOverflowBox( - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - const SizedBox(width: 16.0), - icon, - const SizedBox(width: 8.0), - label, - const SizedBox(width: 20.0), - ], - ), - ), - super(key: key); + }) : assert(elevation != null && elevation >= 0.0), + assert(highlightElevation != null && highlightElevation >= 0.0), + assert(disabledElevation == null || disabledElevation >= 0.0), + assert(shape != null), + assert(isExtended != null), + assert(clipBehavior != null), + _sizeConstraints = _kExtendedSizeConstraints, + disabledElevation = disabledElevation ?? elevation, + mini = false, + child = _ChildOverflowBox( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const SizedBox(width: 16.0), + icon, + const SizedBox(width: 8.0), + label, + const SizedBox(width: 20.0), + ], + ), + ), + super(key: key); /// The widget below this widget in the tree. /// diff --git a/packages/flutter/lib/src/material/floating_action_button_location.dart b/packages/flutter/lib/src/material/floating_action_button_location.dart index 188a6f4f30..af7a97c3c3 100644 --- a/packages/flutter/lib/src/material/floating_action_button_location.dart +++ b/packages/flutter/lib/src/material/floating_action_button_location.dart @@ -470,7 +470,7 @@ class _AnimationSwap extends CompoundAnimation { /// /// Both arguments must be non-null. Either can be an [_AnimationSwap] itself /// to combine multiple animations. - _AnimationSwap(Animation first, Animation next, this.parent, this.swapThreshold): super(first: first, next: next); + _AnimationSwap(Animation first, Animation next, this.parent, this.swapThreshold) : super(first: first, next: next); final Animation parent; final double swapThreshold; diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index 02fb410d84..02e6a6c84a 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -600,7 +600,7 @@ class ShapeBorderTween extends Tween { /// /// the [begin] and [end] properties may be null; see [ShapeBorder.lerp] for /// the null handling semantics. - ShapeBorderTween({ShapeBorder begin, ShapeBorder end}): super(begin: begin, end: end); + ShapeBorderTween({ShapeBorder begin, ShapeBorder end}) : super(begin: begin, end: end); /// Returns the value this tween has at the given animation clock value. @override diff --git a/packages/flutter/lib/src/material/radio.dart b/packages/flutter/lib/src/material/radio.dart index 5658ca12cb..33ca07cba6 100644 --- a/packages/flutter/lib/src/material/radio.dart +++ b/packages/flutter/lib/src/material/radio.dart @@ -200,15 +200,15 @@ class _RenderRadio extends RenderToggleable { ValueChanged onChanged, BoxConstraints additionalConstraints, @required TickerProvider vsync, - }): super( - value: value, - tristate: false, - activeColor: activeColor, - inactiveColor: inactiveColor, - onChanged: onChanged, - additionalConstraints: additionalConstraints, - vsync: vsync, - ); + }) : super( + value: value, + tristate: false, + activeColor: activeColor, + inactiveColor: inactiveColor, + onChanged: onChanged, + additionalConstraints: additionalConstraints, + vsync: vsync, + ); @override void paint(PaintingContext context, Offset offset) { diff --git a/packages/flutter/lib/src/material/reorderable_list.dart b/packages/flutter/lib/src/material/reorderable_list.dart index 17a38ac663..81dc9c3023 100644 --- a/packages/flutter/lib/src/material/reorderable_list.dart +++ b/packages/flutter/lib/src/material/reorderable_list.dart @@ -60,13 +60,13 @@ class ReorderableListView extends StatefulWidget { this.scrollDirection = Axis.vertical, this.padding, this.reverse = false, - }): assert(scrollDirection != null), - assert(onReorder != null), - assert(children != null), - assert( - children.every((Widget w) => w.key != null), - 'All children of this widget must have a key.', - ); + }) : assert(scrollDirection != null), + assert(onReorder != null), + assert(children != null), + assert( + children.every((Widget w) => w.key != null), + 'All children of this widget must have a key.', + ); /// A non-reorderable header widget to show before the list. /// diff --git a/packages/flutter/lib/src/material/slider_theme.dart b/packages/flutter/lib/src/material/slider_theme.dart index aa22e6a235..efa9788ad4 100644 --- a/packages/flutter/lib/src/material/slider_theme.dart +++ b/packages/flutter/lib/src/material/slider_theme.dart @@ -35,9 +35,9 @@ class SliderTheme extends InheritedWidget { Key key, @required this.data, @required Widget child, - }) : assert(child != null), - assert(data != null), - super(key: key, child: child); + }) : assert(child != null), + assert(data != null), + super(key: key, child: child); /// Specifies the color and shape values for descendant slider widgets. final SliderThemeData data; @@ -197,22 +197,22 @@ class SliderThemeData extends Diagnosticable { @required this.valueIndicatorShape, @required this.showValueIndicator, @required this.valueIndicatorTextStyle, - }) : assert(activeTrackColor != null), - assert(inactiveTrackColor != null), - assert(disabledActiveTrackColor != null), - assert(disabledInactiveTrackColor != null), - assert(activeTickMarkColor != null), - assert(inactiveTickMarkColor != null), - assert(disabledActiveTickMarkColor != null), - assert(disabledInactiveTickMarkColor != null), - assert(thumbColor != null), - assert(disabledThumbColor != null), - assert(overlayColor != null), - assert(valueIndicatorColor != null), - assert(thumbShape != null), - assert(valueIndicatorShape != null), - assert(valueIndicatorTextStyle != null), - assert(showValueIndicator != null); + }) : assert(activeTrackColor != null), + assert(inactiveTrackColor != null), + assert(disabledActiveTrackColor != null), + assert(disabledInactiveTrackColor != null), + assert(activeTickMarkColor != null), + assert(inactiveTickMarkColor != null), + assert(disabledActiveTickMarkColor != null), + assert(disabledInactiveTickMarkColor != null), + assert(thumbColor != null), + assert(disabledThumbColor != null), + assert(overlayColor != null), + assert(valueIndicatorColor != null), + assert(thumbShape != null), + assert(valueIndicatorShape != null), + assert(valueIndicatorTextStyle != null), + assert(showValueIndicator != null); /// Generates a SliderThemeData from three main colors. /// diff --git a/packages/flutter/lib/src/material/tab_indicator.dart b/packages/flutter/lib/src/material/tab_indicator.dart index 51d1ee6de2..d0ca571526 100644 --- a/packages/flutter/lib/src/material/tab_indicator.dart +++ b/packages/flutter/lib/src/material/tab_indicator.dart @@ -22,7 +22,8 @@ class UnderlineTabIndicator extends Decoration { const UnderlineTabIndicator({ this.borderSide = const BorderSide(width: 2.0, color: Colors.white), this.insets = EdgeInsets.zero, - }) : assert(borderSide != null), assert(insets != null); + }) : assert(borderSide != null), + assert(insets != null); /// The color and weight of the horizontal line drawn below the selected tab. final BorderSide borderSide; @@ -64,7 +65,8 @@ class UnderlineTabIndicator extends Decoration { class _UnderlinePainter extends BoxPainter { _UnderlinePainter(this.decoration, VoidCallback onChanged) - : assert(decoration != null), super(onChanged); + : assert(decoration != null), + super(onChanged); final UnderlineTabIndicator decoration; diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 7c71b7812a..5c132ee831 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -1236,7 +1236,10 @@ class TabPageSelectorIndicator extends StatelessWidget { @required this.backgroundColor, @required this.borderColor, @required this.size, - }) : assert(backgroundColor != null), assert(borderColor != null), assert(size != null), super(key: key); + }) : assert(backgroundColor != null), + assert(borderColor != null), + assert(size != null), + super(key: key); /// The indicator circle's background color. final Color backgroundColor; @@ -1275,7 +1278,8 @@ class TabPageSelector extends StatelessWidget { this.indicatorSize = 12.0, this.color, this.selectedColor, - }) : assert(indicatorSize != null && indicatorSize > 0.0), super(key: key); + }) : assert(indicatorSize != null && indicatorSize > 0.0), + super(key: key); /// This widget's selection and animation state. /// diff --git a/packages/flutter/lib/src/material/time.dart b/packages/flutter/lib/src/material/time.dart index 6e82b747e8..ca9d1ba0e1 100644 --- a/packages/flutter/lib/src/material/time.dart +++ b/packages/flutter/lib/src/material/time.dart @@ -57,7 +57,9 @@ class TimeOfDay { /// /// The [hour] is set to the time's hour and the [minute] is set to the time's /// minute in the timezone of the given [DateTime]. - TimeOfDay.fromDateTime(DateTime time) : hour = time.hour, minute = time.minute; + TimeOfDay.fromDateTime(DateTime time) + : hour = time.hour, + minute = time.minute; /// Creates a time of day based on the current time. /// diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart index 650bed5019..526dd54ea8 100644 --- a/packages/flutter/lib/src/material/time_picker.dart +++ b/packages/flutter/lib/src/material/time_picker.dart @@ -112,8 +112,8 @@ class _TimePickerHeaderFragment { @required this.widget, this.startMargin = 0.0, }) : assert(layoutId != null), - assert(widget != null), - assert(startMargin != null); + assert(widget != null), + assert(startMargin != null); /// Identifier used by the custom layout to refer to the widget. final _TimePickerHeaderId layoutId; @@ -140,9 +140,9 @@ class _TimePickerHeaderPiece { /// All arguments must be non-null. If the piece does not contain a pivot /// fragment, use the value -1 as a convention. const _TimePickerHeaderPiece(this.pivotIndex, this.fragments, { this.bottomMargin = 0.0 }) - : assert(pivotIndex != null), - assert(fragments != null), - assert(bottomMargin != null); + : assert(pivotIndex != null), + assert(fragments != null), + assert(bottomMargin != null); /// Index into the [fragments] list, pointing at the fragment that's centered /// horizontally. @@ -175,8 +175,8 @@ class _TimePickerHeaderPiece { /// to the left or right of it. class _TimePickerHeaderFormat { const _TimePickerHeaderFormat(this.centrepieceIndex, this.pieces) - : assert(centrepieceIndex != null), - assert(pieces != null); + : assert(centrepieceIndex != null), + assert(pieces != null); /// Index into the [pieces] list pointing at the piece that contains the /// pivot fragment. diff --git a/packages/flutter/lib/src/painting/colors.dart b/packages/flutter/lib/src/painting/colors.dart index e38f1adeee..4eba576a9f 100644 --- a/packages/flutter/lib/src/painting/colors.dart +++ b/packages/flutter/lib/src/painting/colors.dart @@ -89,18 +89,18 @@ class HSVColor { /// All the arguments must not be null and be in their respective ranges. See /// the fields for each parameter for a description of their ranges. const HSVColor.fromAHSV(this.alpha, this.hue, this.saturation, this.value) - : assert(alpha != null), - assert(hue != null), - assert(saturation != null), - assert(value != null), - assert(alpha >= 0.0), - assert(alpha <= 1.0), - assert(hue >= 0.0), - assert(hue <= 360.0), - assert(saturation >= 0.0), - assert(saturation <= 1.0), - assert(value >= 0.0), - assert(value <= 1.0); + : assert(alpha != null), + assert(hue != null), + assert(saturation != null), + assert(value != null), + assert(alpha >= 0.0), + assert(alpha <= 1.0), + assert(hue >= 0.0), + assert(hue <= 360.0), + assert(saturation >= 0.0), + assert(saturation <= 1.0), + assert(value >= 0.0), + assert(value <= 1.0); /// Creates an [HSVColor] from an RGB [Color]. /// diff --git a/packages/flutter/lib/src/painting/edge_insets.dart b/packages/flutter/lib/src/painting/edge_insets.dart index a485334c2e..9ff3269e48 100644 --- a/packages/flutter/lib/src/painting/edge_insets.dart +++ b/packages/flutter/lib/src/painting/edge_insets.dart @@ -330,7 +330,10 @@ class EdgeInsets extends EdgeInsetsGeometry { /// ``` /// {@end-tool} const EdgeInsets.all(double value) - : left = value, top = value, right = value, bottom = value; + : left = value, + top = value, + right = value, + bottom = value; /// Creates insets with only the given values non-zero. /// @@ -359,9 +362,13 @@ class EdgeInsets extends EdgeInsetsGeometry { /// const EdgeInsets.symmetric(vertical: 8.0) /// ``` /// {@end-tool} - const EdgeInsets.symmetric({ double vertical = 0.0, - double horizontal = 0.0 }) - : left = horizontal, top = vertical, right = horizontal, bottom = vertical; + const EdgeInsets.symmetric({ + double vertical = 0.0, + double horizontal = 0.0, + }) : left = horizontal, + top = vertical, + right = horizontal, + bottom = vertical; /// Creates insets that match the given window padding. /// diff --git a/packages/flutter/lib/src/painting/flutter_logo.dart b/packages/flutter/lib/src/painting/flutter_logo.dart index 44a67b66b4..2b7bddd2c8 100644 --- a/packages/flutter/lib/src/painting/flutter_logo.dart +++ b/packages/flutter/lib/src/painting/flutter_logo.dart @@ -246,9 +246,9 @@ class FlutterLogoDecoration extends Decoration { /// An object that paints a [BoxDecoration] into a canvas. class _FlutterLogoPainter extends BoxPainter { _FlutterLogoPainter(this._config) - : assert(_config != null), - assert(_config.debugAssertIsValid()), - super(null) { + : assert(_config != null), + assert(_config.debugAssertIsValid()), + super(null) { _prepareText(); } diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart index c8564b6fb7..161517d713 100644 --- a/packages/flutter/lib/src/painting/image_provider.dart +++ b/packages/flutter/lib/src/painting/image_provider.dart @@ -452,8 +452,8 @@ class NetworkImage extends ImageProvider { /// /// The arguments must not be null. const NetworkImage(this.url, { this.scale = 1.0 , this.headers }) - : assert(url != null), - assert(scale != null); + : assert(url != null), + assert(scale != null); /// The URL from which the image will be fetched. final String url; @@ -529,8 +529,8 @@ class FileImage extends ImageProvider { /// /// The arguments must not be null. const FileImage(this.file, { this.scale = 1.0 }) - : assert(file != null), - assert(scale != null); + : assert(file != null), + assert(scale != null); /// The file to decode into an image. final File file; @@ -597,8 +597,8 @@ class MemoryImage extends ImageProvider { /// /// The arguments must not be null. const MemoryImage(this.bytes, { this.scale = 1.0 }) - : assert(bytes != null), - assert(scale != null); + : assert(bytes != null), + assert(scale != null); /// The bytes to decode into an image. final Uint8List bytes; diff --git a/packages/flutter/lib/src/painting/image_stream.dart b/packages/flutter/lib/src/painting/image_stream.dart index b529eb730d..2a20a328f5 100644 --- a/packages/flutter/lib/src/painting/image_stream.dart +++ b/packages/flutter/lib/src/painting/image_stream.dart @@ -19,8 +19,8 @@ class ImageInfo { /// /// Both the image and the scale must not be null. const ImageInfo({ @required this.image, this.scale = 1.0 }) - : assert(image != null), - assert(scale != null); + : assert(image != null), + assert(scale != null); /// The raw image pixels. /// @@ -371,7 +371,7 @@ class OneFrameImageStreamCompleter extends ImageStreamCompleter { /// message is only dumped to the console in debug mode (see [new /// FlutterErrorDetails]). OneFrameImageStreamCompleter(Future image, { InformationCollector informationCollector }) - : assert(image != null) { + : assert(image != null) { image.then(setImage, onError: (dynamic error, StackTrace stack) { reportError( context: 'resolving a single-frame image stream', diff --git a/packages/flutter/lib/src/physics/spring_simulation.dart b/packages/flutter/lib/src/physics/spring_simulation.dart index d33154c048..f6622813dd 100644 --- a/packages/flutter/lib/src/physics/spring_simulation.dart +++ b/packages/flutter/lib/src/physics/spring_simulation.dart @@ -94,8 +94,8 @@ class SpringSimulation extends Simulation { double velocity, { Tolerance tolerance = Tolerance.defaultTolerance, }) : _endPosition = end, - _solution = _SpringSolution(spring, start - end, velocity), - super(tolerance: tolerance); + _solution = _SpringSolution(spring, start - end, velocity), + super(tolerance: tolerance); final double _endPosition; final _SpringSolution _solution; diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 89f1b5c826..947ab1f050 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -109,10 +109,10 @@ class BoxConstraints extends Constraints { const BoxConstraints.tightFor({ double width, double height - }): minWidth = width != null ? width : 0.0, - maxWidth = width != null ? width : double.infinity, - minHeight = height != null ? height : 0.0, - maxHeight = height != null ? height : double.infinity; + }) : minWidth = width != null ? width : 0.0, + maxWidth = width != null ? width : double.infinity, + minHeight = height != null ? height : 0.0, + maxHeight = height != null ? height : double.infinity; /// Creates box constraints that require the given width or height, except if /// they are infinite. @@ -124,10 +124,10 @@ class BoxConstraints extends Constraints { const BoxConstraints.tightForFinite({ double width = double.infinity, double height = double.infinity - }): minWidth = width != double.infinity ? width : 0.0, - maxWidth = width != double.infinity ? width : double.infinity, - minHeight = height != double.infinity ? height : 0.0, - maxHeight = height != double.infinity ? height : double.infinity; + }) : minWidth = width != double.infinity ? width : 0.0, + maxWidth = width != double.infinity ? width : double.infinity, + minHeight = height != double.infinity ? height : 0.0, + maxHeight = height != double.infinity ? height : double.infinity; /// Creates box constraints that forbid sizes larger than the given size. BoxConstraints.loose(Size size) @@ -143,10 +143,10 @@ class BoxConstraints extends Constraints { const BoxConstraints.expand({ double width, double height - }): minWidth = width != null ? width : double.infinity, - maxWidth = width != null ? width : double.infinity, - minHeight = height != null ? height : double.infinity, - maxHeight = height != null ? height : double.infinity; + }) : minWidth = width != null ? width : double.infinity, + maxWidth = width != null ? width : double.infinity, + minHeight = height != null ? height : double.infinity, + maxHeight = height != null ? height : double.infinity; /// The minimum width that satisfies the constraints. final double minWidth; @@ -615,8 +615,8 @@ class BoxHitTestEntry extends HitTestEntry { /// /// The [localPosition] argument must not be null. const BoxHitTestEntry(RenderBox target, this.localPosition) - : assert(localPosition != null), - super(target); + : assert(localPosition != null), + super(target); @override RenderBox get target => super.target; diff --git a/packages/flutter/lib/src/rendering/editable.dart b/packages/flutter/lib/src/rendering/editable.dart index 054e763985..dbc5f89919 100644 --- a/packages/flutter/lib/src/rendering/editable.dart +++ b/packages/flutter/lib/src/rendering/editable.dart @@ -69,7 +69,7 @@ class TextSelectionPoint { /// /// The [point] argument must not be null. const TextSelectionPoint(this.point, this.direction) - : assert(point != null); + : assert(point != null); /// Coordinates of the lower left or lower right corner of the selection, /// relative to the top left of the [RenderEditable] object. diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index f3db290c28..b79933e472 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -323,7 +323,8 @@ class TextureLayer extends Layer { @required this.rect, @required this.textureId, this.freeze = false, - }): assert(rect != null), assert(textureId != null); + }) : assert(rect != null), + assert(textureId != null); /// Bounding rectangle of this layer. final Rect rect; @@ -366,7 +367,8 @@ class PlatformViewLayer extends Layer { PlatformViewLayer({ @required this.rect, @required this.viewId, - }): assert(rect != null), assert(viewId != null); + }) : assert(rect != null), + assert(viewId != null); /// Bounding rectangle of this layer in the global coordinate space. final Rect rect; @@ -815,9 +817,13 @@ class ClipRectLayer extends ContainerLayer { /// /// The [clipRect] property must be non-null before the compositing phase of /// the pipeline. - ClipRectLayer({ @required Rect clipRect, Clip clipBehavior = Clip.hardEdge }) : - _clipRect = clipRect, _clipBehavior = clipBehavior, - assert(clipBehavior != null), assert(clipBehavior != Clip.none); + ClipRectLayer({ + @required Rect clipRect, + Clip clipBehavior = Clip.hardEdge, + }) : _clipRect = clipRect, + _clipBehavior = clipBehavior, + assert(clipBehavior != null), + assert(clipBehavior != Clip.none); /// The rectangle to clip in the parent's coordinate system. /// @@ -887,9 +893,13 @@ class ClipRRectLayer extends ContainerLayer { /// /// The [clipRRect] property must be non-null before the compositing phase of /// the pipeline. - ClipRRectLayer({ @required RRect clipRRect, Clip clipBehavior = Clip.antiAlias }) : - _clipRRect = clipRRect, _clipBehavior = clipBehavior, - assert(clipBehavior != null), assert(clipBehavior != Clip.none); + ClipRRectLayer({ + @required RRect clipRRect, + Clip clipBehavior = Clip.antiAlias, + }) : _clipRRect = clipRRect, + _clipBehavior = clipBehavior, + assert(clipBehavior != null), + assert(clipBehavior != Clip.none); /// The rounded-rect to clip in the parent's coordinate system. /// @@ -955,9 +965,13 @@ class ClipPathLayer extends ContainerLayer { /// /// The [clipPath] property must be non-null before the compositing phase of /// the pipeline. - ClipPathLayer({ @required Path clipPath, Clip clipBehavior = Clip.antiAlias }) : - _clipPath = clipPath, _clipBehavior = clipBehavior, - assert(clipBehavior != null), assert(clipBehavior != Clip.none); + ClipPathLayer({ + @required Path clipPath, + Clip clipBehavior = Clip.antiAlias, + }) : _clipPath = clipPath, + _clipBehavior = clipBehavior, + assert(clipBehavior != null), + assert(clipBehavior != Clip.none); /// The path to clip in the parent's coordinate system. /// @@ -1094,8 +1108,11 @@ class OpacityLayer extends ContainerLayer { /// /// The [alpha] property must be non-null before the compositing phase of /// the pipeline. - OpacityLayer({ @required int alpha, Offset offset = Offset.zero }) - : _alpha = alpha, _offset = offset; + OpacityLayer({ + @required int alpha, + Offset offset = Offset.zero, + }) : _alpha = alpha, + _offset = offset; /// The amount to multiply into the alpha channel. /// @@ -1152,8 +1169,13 @@ class ShaderMaskLayer extends ContainerLayer { /// /// The [shader], [maskRect], and [blendMode] properties must be non-null /// before the compositing phase of the pipeline. - ShaderMaskLayer({ @required Shader shader, @required Rect maskRect, @required BlendMode blendMode }) - : _shader = shader, _maskRect = maskRect, _blendMode = blendMode; + ShaderMaskLayer({ + @required Shader shader, + @required Rect maskRect, + @required BlendMode blendMode, + }) : _shader = shader, + _maskRect = maskRect, + _blendMode = blendMode; /// The shader to apply to the children. /// diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index 4c2928c165..a96ae36d18 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -612,7 +612,7 @@ typedef LayoutCallback = void Function(T constraints); /// You can obtain the [PipelineOwner] using the [RenderObject.owner] property. class SemanticsHandle { SemanticsHandle._(this._owner, this.listener) - : assert(_owner != null) { + : assert(_owner != null) { if (listener != null) _owner.semanticsOwner.addListener(listener); } @@ -3122,7 +3122,7 @@ class FlutterErrorDetailsForRendering extends FlutterErrorDetails { /// information of multiple [_InterestingSemanticsFragment] to a parent. abstract class _SemanticsFragment { _SemanticsFragment({@required this.dropsSemanticsOfPreviousSiblings }) - : assert (dropsSemanticsOfPreviousSiblings != null); + : assert (dropsSemanticsOfPreviousSiblings != null); /// Incorporate the fragments of children into this fragment. void addAll(Iterable<_InterestingSemanticsFragment> fragments); @@ -3160,7 +3160,7 @@ abstract class _SemanticsFragment { class _ContainerSemanticsFragment extends _SemanticsFragment { _ContainerSemanticsFragment({ @required bool dropsSemanticsOfPreviousSiblings }) - : super(dropsSemanticsOfPreviousSiblings: dropsSemanticsOfPreviousSiblings); + : super(dropsSemanticsOfPreviousSiblings: dropsSemanticsOfPreviousSiblings); @override void addAll(Iterable<_InterestingSemanticsFragment> fragments) { diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index d081d42e8e..516d32b6c6 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -1153,7 +1153,9 @@ abstract class _RenderCustomClip extends RenderProxyBox { RenderBox child, CustomClipper clipper, this.clipBehavior = Clip.antiAlias, - }) : _clipper = clipper, assert(clipBehavior != null), super(child); + }) : _clipper = clipper, + assert(clipBehavior != null), + super(child); /// If non-null, determines which clip to use on the child. CustomClipper get clipper => _clipper; @@ -1318,7 +1320,9 @@ class RenderClipRRect extends _RenderCustomClip { BorderRadius borderRadius = BorderRadius.zero, CustomClipper clipper, Clip clipBehavior = Clip.antiAlias, - }) : assert(clipBehavior != Clip.none), _borderRadius = borderRadius, super(child: child, clipper: clipper, clipBehavior: clipBehavior) { + }) : assert(clipBehavior != Clip.none), + _borderRadius = borderRadius, + super(child: child, clipper: clipper, clipBehavior: clipBehavior) { assert(_borderRadius != null || clipper != null); } @@ -1389,7 +1393,8 @@ class RenderClipOval extends _RenderCustomClip { RenderBox child, CustomClipper clipper, Clip clipBehavior = Clip.antiAlias, - }) : assert(clipBehavior != Clip.none), super(child: child, clipper: clipper, clipBehavior: clipBehavior); + }) : assert(clipBehavior != Clip.none), + super(child: child, clipper: clipper, clipBehavior: clipBehavior); Rect _cachedRect; Path _cachedPath; @@ -1464,7 +1469,8 @@ class RenderClipPath extends _RenderCustomClip { RenderBox child, CustomClipper clipper, Clip clipBehavior = Clip.antiAlias, - }) : assert(clipBehavior != Clip.none), super(child: child, clipper: clipper, clipBehavior: clipBehavior); + }) : assert(clipBehavior != Clip.none), + super(child: child, clipper: clipper, clipBehavior: clipBehavior); @override Path get _defaultClip => Path()..addRect(Offset.zero & size); @@ -2878,7 +2884,9 @@ class RenderIgnorePointer extends RenderProxyBox { RenderBox child, bool ignoring = true, bool ignoringSemantics - }) : _ignoring = ignoring, _ignoringSemantics = ignoringSemantics, super(child) { + }) : _ignoring = ignoring, + _ignoringSemantics = ignoringSemantics, + super(child) { assert(_ignoring != null); } @@ -4381,7 +4389,11 @@ class RenderSemanticsAnnotations extends RenderProxyBox { class RenderBlockSemantics extends RenderProxyBox { /// Create a render object that blocks semantics for nodes below it in paint /// order. - RenderBlockSemantics({ RenderBox child, bool blocking = true, }) : _blocking = blocking, super(child); + RenderBlockSemantics({ + RenderBox child, + bool blocking = true, + }) : _blocking = blocking, + super(child); /// Whether this render object is blocking semantics of previously painted /// [RenderObject]s below a common semantics boundary from the semantic tree. @@ -4440,7 +4452,8 @@ class RenderExcludeSemantics extends RenderProxyBox { RenderExcludeSemantics({ RenderBox child, bool excluding = true, - }) : _excluding = excluding, super(child) { + }) : _excluding = excluding, + super(child) { assert(_excluding != null); } @@ -4485,8 +4498,8 @@ class RenderIndexedSemantics extends RenderProxyBox { RenderBox child, @required int index, }) : assert(index != null), - _index = index, - super(child); + _index = index, + super(child); /// The index used to annotated child semantics. int get index => _index; diff --git a/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart b/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart index 3627302dfb..48a71a82a9 100644 --- a/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart +++ b/packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart @@ -297,7 +297,8 @@ class RenderSliverFixedExtentList extends RenderSliverFixedExtentBoxAdaptor { RenderSliverFixedExtentList({ @required RenderSliverBoxChildManager childManager, double itemExtent, - }) : _itemExtent = itemExtent, super(childManager: childManager); + }) : _itemExtent = itemExtent, + super(childManager: childManager); @override double get itemExtent => _itemExtent; diff --git a/packages/flutter/lib/src/rendering/sliver_persistent_header.dart b/packages/flutter/lib/src/rendering/sliver_persistent_header.dart index dbffe0f25c..a00a684cb4 100644 --- a/packages/flutter/lib/src/rendering/sliver_persistent_header.dart +++ b/packages/flutter/lib/src/rendering/sliver_persistent_header.dart @@ -356,7 +356,8 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste RenderSliverFloatingPersistentHeader({ RenderBox child, FloatingHeaderSnapConfiguration snapConfiguration, - }) : _snapConfiguration = snapConfiguration, super(child: child); + }) : _snapConfiguration = snapConfiguration, + super(child: child); AnimationController _controller; Animation _animation; diff --git a/packages/flutter/lib/src/rendering/stack.dart b/packages/flutter/lib/src/rendering/stack.dart index c039eee8ad..360d32ed2a 100644 --- a/packages/flutter/lib/src/rendering/stack.dart +++ b/packages/flutter/lib/src/rendering/stack.dart @@ -630,11 +630,12 @@ class RenderIndexedStack extends RenderStack { AlignmentGeometry alignment = AlignmentDirectional.topStart, TextDirection textDirection, int index = 0, - }) : _index = index, super( - children: children, - alignment: alignment, - textDirection: textDirection, - ); + }) : _index = index, + super( + children: children, + alignment: alignment, + textDirection: textDirection, + ); @override void visitChildrenForSemantics(RenderObjectVisitor visitor) { diff --git a/packages/flutter/lib/src/rendering/texture.dart b/packages/flutter/lib/src/rendering/texture.dart index bf9d1c3b3e..32f594e8f6 100644 --- a/packages/flutter/lib/src/rendering/texture.dart +++ b/packages/flutter/lib/src/rendering/texture.dart @@ -36,7 +36,9 @@ import 'object.dart'; /// for how to create and manage backend textures on iOS. class TextureBox extends RenderBox { /// Creates a box backed by the texture identified by [textureId]. - TextureBox({ @required int textureId }) : assert(textureId != null), _textureId = textureId; + TextureBox({ @required int textureId }) + : assert(textureId != null), + _textureId = textureId; /// The identity of the backend texture. int get textureId => _textureId; diff --git a/packages/flutter/lib/src/rendering/viewport.dart b/packages/flutter/lib/src/rendering/viewport.dart index 2fc43a44dd..69c06a2c4f 100644 --- a/packages/flutter/lib/src/rendering/viewport.dart +++ b/packages/flutter/lib/src/rendering/viewport.dart @@ -90,7 +90,8 @@ class RevealedOffset { const RevealedOffset({ @required this.offset, @required this.rect, - }) : assert(offset != null), assert(rect != null); + }) : assert(offset != null), + assert(rect != null); /// Offset for the viewport to reveal a specific element in the viewport. /// diff --git a/packages/flutter/lib/src/semantics/semantics_event.dart b/packages/flutter/lib/src/semantics/semantics_event.dart index dddc52d7fa..8dd69e3f7d 100644 --- a/packages/flutter/lib/src/semantics/semantics_event.dart +++ b/packages/flutter/lib/src/semantics/semantics_event.dart @@ -65,10 +65,10 @@ abstract class SemanticsEvent { class AnnounceSemanticsEvent extends SemanticsEvent { /// Constructs an event that triggers an announcement by the platform. - const AnnounceSemanticsEvent(this.message, this.textDirection) : - assert(message != null), - assert(textDirection != null), - super('announce'); + const AnnounceSemanticsEvent(this.message, this.textDirection) + : assert(message != null), + assert(textDirection != null), + super('announce'); /// The message to announce. /// diff --git a/packages/flutter/lib/src/services/raw_keyboard_android.dart b/packages/flutter/lib/src/services/raw_keyboard_android.dart index fbcf168e1c..cc3cb57653 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_android.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_android.dart @@ -23,11 +23,11 @@ class RawKeyEventDataAndroid extends RawKeyEventData { this.keyCode = 0, this.scanCode = 0, this.metaState = 0, - }) : assert(flags != null), - assert(codePoint != null), - assert(keyCode != null), - assert(scanCode != null), - assert(metaState != null); + }) : assert(flags != null), + assert(codePoint != null), + assert(keyCode != null), + assert(scanCode != null), + assert(metaState != null); /// The current set of additional flags for this event. /// diff --git a/packages/flutter/lib/src/services/raw_keyboard_fuschia.dart b/packages/flutter/lib/src/services/raw_keyboard_fuschia.dart index 52d2638f5a..e62dab9890 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_fuschia.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_fuschia.dart @@ -20,9 +20,9 @@ class RawKeyEventDataFuchsia extends RawKeyEventData { this.hidUsage = 0, this.codePoint = 0, this.modifiers = 0, - }) : assert(hidUsage != null), - assert(codePoint != null), - assert(modifiers != null); + }) : assert(hidUsage != null), + assert(codePoint != null), + assert(modifiers != null); /// The USB HID usage. /// diff --git a/packages/flutter/lib/src/services/text_editing.dart b/packages/flutter/lib/src/services/text_editing.dart index 3ca883a6d9..a1798be727 100644 --- a/packages/flutter/lib/src/services/text_editing.dart +++ b/packages/flutter/lib/src/services/text_editing.dart @@ -119,7 +119,10 @@ class TextSelection extends TextRange { const TextSelection.collapsed({ @required int offset, this.affinity = TextAffinity.downstream - }) : baseOffset = offset, extentOffset = offset, isDirectional = false, super.collapsed(offset); + }) : baseOffset = offset, + extentOffset = offset, + isDirectional = false, + super.collapsed(offset); /// Creates a collapsed selection at the given text position. /// diff --git a/packages/flutter/lib/src/services/text_formatter.dart b/packages/flutter/lib/src/services/text_formatter.dart index f64f6d583e..cb9e4e1a74 100644 --- a/packages/flutter/lib/src/services/text_formatter.dart +++ b/packages/flutter/lib/src/services/text_formatter.dart @@ -60,8 +60,8 @@ typedef TextInputFormatFunction = TextEditingValue Function( /// Wiring for [TextInputFormatter.withFunction]. class _SimpleTextInputFormatter extends TextInputFormatter { - _SimpleTextInputFormatter(this.formatFunction) : - assert(formatFunction != null); + _SimpleTextInputFormatter(this.formatFunction) + : assert(formatFunction != null); final TextInputFormatFunction formatFunction; @@ -215,8 +215,8 @@ class WhitelistingTextInputFormatter extends TextInputFormatter { /// Creates a formatter that allows only the insertion of whitelisted characters patterns. /// /// The [whitelistedPattern] must not be null. - WhitelistingTextInputFormatter(this.whitelistedPattern) : - assert(whitelistedPattern != null); + WhitelistingTextInputFormatter(this.whitelistedPattern) + : assert(whitelistedPattern != null); /// A [Pattern] to extract all instances of allowed characters. /// diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart index 20b36d2ddd..b5917938cb 100644 --- a/packages/flutter/lib/src/services/text_input.dart +++ b/packages/flutter/lib/src/services/text_input.dart @@ -23,7 +23,9 @@ export 'dart:ui' show TextAffinity; /// for additional flags for some input types. For example, numeric input /// can specify whether it supports decimal numbers and/or signed numbers. class TextInputType { - const TextInputType._(this.index) : signed = null, decimal = null; + const TextInputType._(this.index) + : signed = null, + decimal = null; /// Optimize for numerical information. /// diff --git a/packages/flutter/lib/src/widgets/animated_list.dart b/packages/flutter/lib/src/widgets/animated_list.dart index 037f358314..2d55174bc7 100644 --- a/packages/flutter/lib/src/widgets/animated_list.dart +++ b/packages/flutter/lib/src/widgets/animated_list.dart @@ -26,7 +26,9 @@ const Duration _kDuration = Duration(milliseconds: 300); class _ActiveItem implements Comparable<_ActiveItem> { _ActiveItem.incoming(this.controller, this.itemIndex) : removedItemBuilder = null; _ActiveItem.outgoing(this.controller, this.itemIndex, this.removedItemBuilder); - _ActiveItem.index(this.itemIndex) : controller = null, removedItemBuilder = null; + _ActiveItem.index(this.itemIndex) + : controller = null, + removedItemBuilder = null; final AnimationController controller; final AnimatedListRemovedItemBuilder removedItemBuilder; diff --git a/packages/flutter/lib/src/widgets/animated_switcher.dart b/packages/flutter/lib/src/widgets/animated_switcher.dart index 6cf4ad62af..45c1fbe47c 100644 --- a/packages/flutter/lib/src/widgets/animated_switcher.dart +++ b/packages/flutter/lib/src/widgets/animated_switcher.dart @@ -22,9 +22,9 @@ class _ChildEntry { @required this.animation, @required this.transition, @required this.widgetChild, - }) : assert(animation != null), - assert(transition != null), - assert(controller != null); + }) : assert(animation != null), + assert(transition != null), + assert(controller != null); // The animation controller for the child's transition. final AnimationController controller; @@ -156,12 +156,12 @@ class AnimatedSwitcher extends StatefulWidget { this.switchOutCurve = Curves.linear, this.transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder, this.layoutBuilder = AnimatedSwitcher.defaultLayoutBuilder, - }) : assert(duration != null), - assert(switchInCurve != null), - assert(switchOutCurve != null), - assert(transitionBuilder != null), - assert(layoutBuilder != null), - super(key: key); + }) : assert(duration != null), + assert(switchInCurve != null), + assert(switchOutCurve != null), + assert(transitionBuilder != null), + assert(layoutBuilder != null), + super(key: key); /// The current child widget to display. If there was a previous child, then /// that child will be faded out using the [switchOutCurve], while the new diff --git a/packages/flutter/lib/src/widgets/async.dart b/packages/flutter/lib/src/widgets/async.dart index 703e797b2a..1e025ec67b 100644 --- a/packages/flutter/lib/src/widgets/async.dart +++ b/packages/flutter/lib/src/widgets/async.dart @@ -196,8 +196,8 @@ class AsyncSnapshot { /// Creates an [AsyncSnapshot] with the specified [connectionState], /// and optionally either [data] or [error] (but not both). const AsyncSnapshot._(this.connectionState, this.data, this.error) - : assert(connectionState != null), - assert(!(data != null && error != null)); + : assert(connectionState != null), + assert(!(data != null && error != null)); /// Creates an [AsyncSnapshot] in [ConnectionState.none] with null data and error. const AsyncSnapshot.nothing() : this._(ConnectionState.none, null, null); diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 0fbe2fb019..f938f69069 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -5836,7 +5836,7 @@ class ExcludeSemantics extends SingleChildRenderObjectWidget { this.excluding = true, Widget child, }) : assert(excluding != null), - super(key: key, child: child); + super(key: key, child: child); /// Whether this widget is excluded in the semantics tree. final bool excluding; diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 8d6d57504e..07ab8058c1 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -3590,7 +3590,8 @@ typedef ErrorWidgetBuilder = Widget Function(FlutterErrorDetails details); /// information such as the stack trace for the exception. class ErrorWidget extends LeafRenderObjectWidget { /// Creates a widget that displays the given error message. - ErrorWidget(Object exception) : message = _stringify(exception), + ErrorWidget(Object exception) + : message = _stringify(exception), super(key: UniqueKey()); /// The configurable factory for [ErrorWidget]. @@ -3796,7 +3797,8 @@ class StatelessElement extends ComponentElement { class StatefulElement extends ComponentElement { /// Creates an element that uses the given widget as its configuration. StatefulElement(StatefulWidget widget) - : _state = widget.createState(), super(widget) { + : _state = widget.createState(), + super(widget) { assert(() { if (!_state._debugTypesAreRight(widget)) { throw FlutterError( @@ -4780,7 +4782,7 @@ abstract class RenderObjectElement extends Element { /// elements inherit their owner from their parent. abstract class RootRenderObjectElement extends RenderObjectElement { /// Initializes fields for subclasses. - RootRenderObjectElement(RenderObjectWidget widget): super(widget); + RootRenderObjectElement(RenderObjectWidget widget) : super(widget); /// Set the owner of the element. The owner will be propagated to all the /// descendants of this element. @@ -4808,7 +4810,7 @@ abstract class RootRenderObjectElement extends RenderObjectElement { /// An [Element] that uses a [LeafRenderObjectWidget] as its configuration. class LeafRenderObjectElement extends RenderObjectElement { /// Creates an element that uses the given widget as its configuration. - LeafRenderObjectElement(LeafRenderObjectWidget widget): super(widget); + LeafRenderObjectElement(LeafRenderObjectWidget widget) : super(widget); @override void forgetChild(Element child) { diff --git a/packages/flutter/lib/src/widgets/gesture_detector.dart b/packages/flutter/lib/src/widgets/gesture_detector.dart index be01b3f89d..1c50ee1c4b 100644 --- a/packages/flutter/lib/src/widgets/gesture_detector.dart +++ b/packages/flutter/lib/src/widgets/gesture_detector.dart @@ -83,9 +83,9 @@ class GestureRecognizerFactoryWithHandlers extends /// Creates a gesture recognizer factory with the given callbacks. /// /// The arguments must not be null. - const GestureRecognizerFactoryWithHandlers(this._constructor, this._initializer) : - assert(_constructor != null), - assert(_initializer != null); + const GestureRecognizerFactoryWithHandlers(this._constructor, this._initializer) + : assert(_constructor != null), + assert(_initializer != null); final GestureRecognizerFactoryConstructor _constructor; diff --git a/packages/flutter/lib/src/widgets/icon_theme_data.dart b/packages/flutter/lib/src/widgets/icon_theme_data.dart index e5e462eaae..61247ec777 100644 --- a/packages/flutter/lib/src/widgets/icon_theme_data.dart +++ b/packages/flutter/lib/src/widgets/icon_theme_data.dart @@ -26,9 +26,9 @@ class IconThemeData extends Diagnosticable { /// /// The [color] is black, the [opacity] is 1.0, and the [size] is 24.0. const IconThemeData.fallback() - : color = const Color(0xFF000000), - _opacity = 1.0, - size = 24.0; + : color = const Color(0xFF000000), + _opacity = 1.0, + size = 24.0; /// Creates a copy of this icon theme but with the given fields replaced with /// the new values. diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 37ea40f6f1..4c0357bd98 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -769,7 +769,7 @@ class AnimatedPositioned extends ImplicitlyAnimatedWidget { @required Duration duration, }) : assert(left == null || right == null || width == null), assert(top == null || bottom == null || height == null), - super(key: key, curve: curve, duration: duration); + super(key: key, curve: curve, duration: duration); /// Creates a widget that animates the rectangle it occupies implicitly. /// @@ -920,7 +920,7 @@ class AnimatedPositionedDirectional extends ImplicitlyAnimatedWidget { @required Duration duration, }) : assert(start == null || end == null || width == null), assert(top == null || bottom == null || height == null), - super(key: key, curve: curve, duration: duration); + super(key: key, curve: curve, duration: duration); /// The widget below this widget in the tree. /// diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart index 570e1039b5..839cbe4b8e 100644 --- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart @@ -1377,7 +1377,8 @@ class RenderSliverOverlapAbsorber extends RenderSliver with RenderObjectWithChil RenderSliverOverlapAbsorber({ @required SliverOverlapAbsorberHandle handle, RenderSliver child, - }) : assert(handle != null), _handle = handle { + }) : assert(handle != null), + _handle = handle { this.child = child; } @@ -1522,7 +1523,8 @@ class RenderSliverOverlapInjector extends RenderSliver { /// The [handle] must not be null. RenderSliverOverlapInjector({ @required SliverOverlapAbsorberHandle handle, - }) : assert(handle != null), _handle = handle; + }) : assert(handle != null), + _handle = handle; double _currentLayoutExtent; double _currentMaxExtent; diff --git a/packages/flutter/lib/src/widgets/platform_view.dart b/packages/flutter/lib/src/widgets/platform_view.dart index d698a6fa97..a946533422 100644 --- a/packages/flutter/lib/src/widgets/platform_view.dart +++ b/packages/flutter/lib/src/widgets/platform_view.dart @@ -212,9 +212,9 @@ class UiKitView extends StatefulWidget { this.creationParamsCodec, this.gestureRecognizers, }) : assert(viewType != null), - assert(hitTestBehavior != null), - assert(creationParams == null || creationParamsCodec != null), - super(key: key); + assert(hitTestBehavior != null), + assert(creationParams == null || creationParamsCodec != null), + super(key: key); // TODO(amirh): reference the iOS API doc once avaliable. /// The unique identifier for iOS view type to be embedded by this widget. diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 067542cfc5..8479791cf9 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -1450,14 +1450,14 @@ class _DialogRoute extends PopupRoute { Duration transitionDuration = const Duration(milliseconds: 200), RouteTransitionsBuilder transitionBuilder, RouteSettings settings, - }) : assert(barrierDismissible != null), - _pageBuilder = pageBuilder, - _barrierDismissible = barrierDismissible, - _barrierLabel = barrierLabel, - _barrierColor = barrierColor, - _transitionDuration = transitionDuration, - _transitionBuilder = transitionBuilder, - super(settings: settings); + }) : assert(barrierDismissible != null), + _pageBuilder = pageBuilder, + _barrierDismissible = barrierDismissible, + _barrierLabel = barrierLabel, + _barrierColor = barrierColor, + _transitionDuration = transitionDuration, + _transitionBuilder = transitionBuilder, + super(settings: settings); final RoutePageBuilder _pageBuilder; diff --git a/packages/flutter/lib/src/widgets/scroll_activity.dart b/packages/flutter/lib/src/widgets/scroll_activity.dart index eb5630290d..c60a5e000a 100644 --- a/packages/flutter/lib/src/widgets/scroll_activity.dart +++ b/packages/flutter/lib/src/widgets/scroll_activity.dart @@ -425,7 +425,8 @@ class DragScrollActivity extends ScrollActivity { DragScrollActivity( ScrollActivityDelegate delegate, ScrollDragController controller, - ) : _controller = controller, super(delegate); + ) : _controller = controller, + super(delegate); ScrollDragController _controller; diff --git a/packages/flutter/lib/src/widgets/scroll_view.dart b/packages/flutter/lib/src/widgets/scroll_view.dart index 3f485005d6..7424562f7d 100644 --- a/packages/flutter/lib/src/widgets/scroll_view.dart +++ b/packages/flutter/lib/src/widgets/scroll_view.dart @@ -756,19 +756,20 @@ class ListView extends BoxScrollView { addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries, addSemanticIndexes: addSemanticIndexes, - ), super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, - shrinkWrap: shrinkWrap, - padding: padding, - cacheExtent: cacheExtent, - semanticChildCount: semanticChildCount ?? children.length, - dragStartBehavior: dragStartBehavior, - ); + ), + super( + key: key, + scrollDirection: scrollDirection, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + cacheExtent: cacheExtent, + semanticChildCount: semanticChildCount ?? children.length, + dragStartBehavior: dragStartBehavior, + ); /// Creates a scrollable, linear array of widgets that are created on demand. /// @@ -820,19 +821,20 @@ class ListView extends BoxScrollView { addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries, addSemanticIndexes: addSemanticIndexes, - ), super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, - shrinkWrap: shrinkWrap, - padding: padding, - cacheExtent: cacheExtent, - semanticChildCount: semanticChildCount ?? itemCount, - dragStartBehavior: dragStartBehavior, - ); + ), + super( + key: key, + scrollDirection: scrollDirection, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + cacheExtent: cacheExtent, + semanticChildCount: semanticChildCount ?? itemCount, + dragStartBehavior: dragStartBehavior, + ); /// Creates a fixed-length scrollable linear array of list "items" separated /// by list item "separators". @@ -925,18 +927,19 @@ class ListView extends BoxScrollView { semanticIndexCallback: (Widget _, int index) { return index.isEven ? index ~/ 2 : null; } - ), super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, - shrinkWrap: shrinkWrap, - padding: padding, - cacheExtent: cacheExtent, - semanticChildCount: _computeSemanticChildCount(itemCount), - ); + ), + super( + key: key, + scrollDirection: scrollDirection, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + cacheExtent: cacheExtent, + semanticChildCount: _computeSemanticChildCount(itemCount), + ); /// Creates a scrollable, linear array of widgets with a custom child model. /// @@ -1327,19 +1330,20 @@ class GridView extends BoxScrollView { addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries, addSemanticIndexes: addSemanticIndexes, - ), super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, - shrinkWrap: shrinkWrap, - padding: padding, - cacheExtent: cacheExtent, - semanticChildCount: semanticChildCount ?? children.length, - dragStartBehavior: dragStartBehavior, - ); + ), + super( + key: key, + scrollDirection: scrollDirection, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + cacheExtent: cacheExtent, + semanticChildCount: semanticChildCount ?? children.length, + dragStartBehavior: dragStartBehavior, + ); /// Creates a scrollable, 2D array of widgets with tiles that each have a /// maximum cross-axis extent. @@ -1385,18 +1389,19 @@ class GridView extends BoxScrollView { addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries, addSemanticIndexes: addSemanticIndexes, - ), super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, - shrinkWrap: shrinkWrap, - padding: padding, - semanticChildCount: semanticChildCount ?? children.length, - dragStartBehavior: dragStartBehavior, - ); + ), + super( + key: key, + scrollDirection: scrollDirection, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + semanticChildCount: semanticChildCount ?? children.length, + dragStartBehavior: dragStartBehavior, + ); /// A delegate that controls the layout of the children within the [GridView]. /// diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index 4af767fbec..f0f723dcc0 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -595,7 +595,8 @@ class _ScrollSemantics extends SingleChildRenderObjectWidget { @required this.allowImplicitScrolling, @required this.semanticChildCount, Widget child - }) : assert(position != null), super(key: key, child: child); + }) : assert(position != null), + super(key: key, child: child); final ScrollPosition position; final bool allowImplicitScrolling; @@ -628,7 +629,8 @@ class _RenderScrollSemantics extends RenderProxyBox { }) : _position = position, _allowImplicitScrolling = allowImplicitScrolling, _semanticChildCount = semanticChildCount, - assert(position != null), super(child) { + assert(position != null), + super(child) { position.addListener(markNeedsSemanticsUpdate); } diff --git a/packages/flutter/lib/src/widgets/sliver_prototype_extent_list.dart b/packages/flutter/lib/src/widgets/sliver_prototype_extent_list.dart index 2cfab2a5c7..77455eeae5 100644 --- a/packages/flutter/lib/src/widgets/sliver_prototype_extent_list.dart +++ b/packages/flutter/lib/src/widgets/sliver_prototype_extent_list.dart @@ -39,7 +39,8 @@ class SliverPrototypeExtentList extends SliverMultiBoxAdaptorWidget { Key key, @required SliverChildDelegate delegate, @required this.prototypeItem, - }) : assert(prototypeItem != null), super(key: key, delegate: delegate); + }) : assert(prototypeItem != null), + super(key: key, delegate: delegate); /// Defines the main axis extent of all of this sliver's children. /// diff --git a/packages/flutter/lib/src/widgets/spacer.dart b/packages/flutter/lib/src/widgets/spacer.dart index 2f88dd9ae8..0d94071e39 100644 --- a/packages/flutter/lib/src/widgets/spacer.dart +++ b/packages/flutter/lib/src/widgets/spacer.dart @@ -43,9 +43,9 @@ class Spacer extends StatelessWidget { /// /// The [flex] parameter may not be null or less than one. const Spacer({Key key, this.flex = 1}) - : assert(flex != null), - assert(flex > 0), - super(key: key); + : assert(flex != null), + assert(flex > 0), + super(key: key); /// The flex factor to use in determining how much space to take up. /// diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart index 683e80eb8b..d85b6700ef 100644 --- a/packages/flutter/lib/src/widgets/text.dart +++ b/packages/flutter/lib/src/widgets/text.dart @@ -248,9 +248,9 @@ class Text extends StatelessWidget { this.textScaleFactor, this.maxLines, this.semanticsLabel, - }): assert(textSpan != null), - data = null, - super(key: key); + }) : assert(textSpan != null), + data = null, + super(key: key); /// The text to display. /// diff --git a/packages/flutter/lib/src/widgets/text_selection.dart b/packages/flutter/lib/src/widgets/text_selection.dart index de99d16b6f..0351213261 100644 --- a/packages/flutter/lib/src/widgets/text_selection.dart +++ b/packages/flutter/lib/src/widgets/text_selection.dart @@ -231,9 +231,9 @@ class TextSelectionOverlay { this.selectionControls, this.selectionDelegate, this.dragStartBehavior = DragStartBehavior.down, - }): assert(value != null), - assert(context != null), - _value = value { + }) : assert(value != null), + assert(context != null), + _value = value { final OverlayState overlay = Overlay.of(context); assert(overlay != null); _handleController = AnimationController(duration: _fadeDuration, vsync: overlay); diff --git a/packages/flutter/lib/src/widgets/texture.dart b/packages/flutter/lib/src/widgets/texture.dart index 03d2cc3ccc..2e97f8eaed 100644 --- a/packages/flutter/lib/src/widgets/texture.dart +++ b/packages/flutter/lib/src/widgets/texture.dart @@ -34,7 +34,11 @@ import 'framework.dart'; /// for how to create and manage backend textures on iOS. class Texture extends LeafRenderObjectWidget { /// Creates a widget backed by the texture identified by [textureId]. - const Texture({ Key key, @required this.textureId }): assert(textureId != null), super(key: key); + const Texture({ + Key key, + @required this.textureId, + }) : assert(textureId != null), + super(key: key); /// The identity of the backend texture. final int textureId; diff --git a/packages/flutter/lib/src/widgets/widget_inspector.dart b/packages/flutter/lib/src/widgets/widget_inspector.dart index 312fbe61d2..3d65db87e7 100644 --- a/packages/flutter/lib/src/widgets/widget_inspector.dart +++ b/packages/flutter/lib/src/widgets/widget_inspector.dart @@ -607,7 +607,12 @@ class _DiagnosticsPathNode { /// [DiagnosticsNode] objects. /// /// The [node] and [child] arguments must not be null. - _DiagnosticsPathNode({ @required this.node, @required this.children, this.childIndex }) : assert(node != null), assert(children != null); + _DiagnosticsPathNode({ + @required this.node, + @required this.children, + this.childIndex, + }) : assert(node != null), + assert(children != null); /// Node at the point in the path this [_DiagnosticsPathNode] is describing. final DiagnosticsNode node; @@ -686,13 +691,12 @@ class _SerializeConfig { _SerializeConfig base, { int subtreeDepth, Iterable pathToInclude, - }) : - groupName = base.groupName, - summaryTree = base.summaryTree, - subtreeDepth = subtreeDepth ?? base.subtreeDepth, - pathToInclude = pathToInclude ?? base.pathToInclude, - includeProperties = base.includeProperties, - expandPropertyValues = base.expandPropertyValues; + }) : groupName = base.groupName, + summaryTree = base.summaryTree, + subtreeDepth = subtreeDepth ?? base.subtreeDepth, + pathToInclude = pathToInclude ?? base.pathToInclude, + includeProperties = base.includeProperties, + expandPropertyValues = base.expandPropertyValues; /// Optional object group name used to manage manage lifetimes of object /// references in the returned JSON. @@ -2443,7 +2447,9 @@ class _InspectorOverlay extends LeafRenderObjectWidget { class _RenderInspectorOverlay extends RenderBox { /// The arguments must not be null. - _RenderInspectorOverlay({ @required InspectorSelection selection }) : _selection = selection, assert(selection != null); + _RenderInspectorOverlay({ @required InspectorSelection selection }) + : _selection = selection, + assert(selection != null); InspectorSelection get selection => _selection; InspectorSelection _selection; @@ -2476,9 +2482,9 @@ class _RenderInspectorOverlay extends RenderBox { } class _TransformedRect { - _TransformedRect(RenderObject object) : - rect = object.semanticBounds, - transform = object.getTransformTo(null); + _TransformedRect(RenderObject object) + : rect = object.semanticBounds, + transform = object.getTransformTo(null); final Rect rect; final Matrix4 transform; @@ -2545,7 +2551,8 @@ class _InspectorOverlayLayer extends Layer { _InspectorOverlayLayer({ @required this.overlayRect, @required this.selection, - }) : assert(overlayRect != null), assert(selection != null) { + }) : assert(overlayRect != null), + assert(selection != null) { bool inDebugMode = false; assert(() { inDebugMode = true; diff --git a/packages/flutter/test/painting/image_stream_test.dart b/packages/flutter/test/painting/image_stream_test.dart index bc3f30adac..e78843a9bd 100644 --- a/packages/flutter/test/painting/image_stream_test.dart +++ b/packages/flutter/test/painting/image_stream_test.dart @@ -11,8 +11,8 @@ import 'package:flutter/scheduler.dart' show timeDilation; import 'package:flutter_test/flutter_test.dart'; class FakeFrameInfo implements FrameInfo { - FakeFrameInfo(int width, int height, this._duration) : - _image = FakeImage(width, height); + FakeFrameInfo(int width, int height, this._duration) + : _image = FakeImage(width, height); final Duration _duration; final Image _image; diff --git a/packages/flutter/test/rendering/mock_canvas.dart b/packages/flutter/test/rendering/mock_canvas.dart index 805232a92c..d51378010a 100644 --- a/packages/flutter/test/rendering/mock_canvas.dart +++ b/packages/flutter/test/rendering/mock_canvas.dart @@ -559,7 +559,8 @@ abstract class _TestRecordingCanvasMatcher extends Matcher { class _TestRecordingCanvasPaintsCountMatcher extends _TestRecordingCanvasMatcher { _TestRecordingCanvasPaintsCountMatcher(Symbol methodName, int count) - : _methodName = methodName, _count = count; + : _methodName = methodName, + _count = count; final Symbol _methodName; final int _count; diff --git a/packages/flutter_driver/lib/src/common/find.dart b/packages/flutter_driver/lib/src/common/find.dart index b24b569fa9..690437174c 100644 --- a/packages/flutter_driver/lib/src/common/find.dart +++ b/packages/flutter_driver/lib/src/common/find.dart @@ -27,8 +27,8 @@ abstract class CommandWithTarget extends Command { /// Deserializes this command from the value generated by [serialize]. CommandWithTarget.deserialize(Map json) - : finder = SerializableFinder.deserialize(json), - super.deserialize(json); + : finder = SerializableFinder.deserialize(json), + super.deserialize(json); /// Locates the object or objects targeted by this command. final SerializableFinder finder; @@ -53,7 +53,7 @@ class WaitFor extends CommandWithTarget { /// /// If [timeout] is not specified the command times out after 5 seconds. WaitFor(SerializableFinder finder, {Duration timeout}) - : super(finder, timeout: timeout); + : super(finder, timeout: timeout); /// Deserializes this command from the value generated by [serialize]. WaitFor.deserialize(Map json) : super.deserialize(json); @@ -80,7 +80,7 @@ class WaitForAbsent extends CommandWithTarget { /// /// If [timeout] is not specified the command times out after 5 seconds. WaitForAbsent(SerializableFinder finder, {Duration timeout}) - : super(finder, timeout: timeout); + : super(finder, timeout: timeout); /// Deserializes this command from the value generated by [serialize]. WaitForAbsent.deserialize(Map json) : super.deserialize(json); @@ -107,7 +107,7 @@ class WaitUntilNoTransientCallbacks extends Command { /// Deserializes this command from the value generated by [serialize]. WaitUntilNoTransientCallbacks.deserialize(Map json) - : super.deserialize(json); + : super.deserialize(json); @override final String kind = 'waitUntilNoTransientCallbacks'; @@ -191,8 +191,8 @@ class ByText extends SerializableFinder { class ByValueKey extends SerializableFinder { /// Creates a finder given the key value. ByValueKey(this.keyValue) - : keyValueString = '$keyValue', - keyValueType = '${keyValue.runtimeType}' { + : keyValueString = '$keyValue', + keyValueType = '${keyValue.runtimeType}' { if (!_supportedKeyValueTypes.contains(keyValue.runtimeType)) throw _createInvalidKeyValueTypeError('$keyValue.runtimeType'); } @@ -284,7 +284,7 @@ class GetSemanticsId extends CommandWithTarget { /// Creates a command from a json map. GetSemanticsId.deserialize(Map json) - : super.deserialize(json); + : super.deserialize(json); @override String get kind => 'get_semantics_id'; diff --git a/packages/flutter_driver/lib/src/common/frame_sync.dart b/packages/flutter_driver/lib/src/common/frame_sync.dart index 114a55a113..add70fb455 100644 --- a/packages/flutter_driver/lib/src/common/frame_sync.dart +++ b/packages/flutter_driver/lib/src/common/frame_sync.dart @@ -11,8 +11,8 @@ class SetFrameSync extends Command { /// Deserializes this command from the value generated by [serialize]. SetFrameSync.deserialize(Map params) - : enabled = params['enabled'].toLowerCase() == 'true', - super.deserialize(params); + : enabled = params['enabled'].toLowerCase() == 'true', + super.deserialize(params); /// Whether frameSync should be enabled or disabled. final bool enabled; diff --git a/packages/flutter_driver/lib/src/common/gesture.dart b/packages/flutter_driver/lib/src/common/gesture.dart index 6da0b1dd52..7dabd3f57a 100644 --- a/packages/flutter_driver/lib/src/common/gesture.dart +++ b/packages/flutter_driver/lib/src/common/gesture.dart @@ -44,11 +44,11 @@ class Scroll extends CommandWithTarget { /// Deserializes this command from the value generated by [serialize]. Scroll.deserialize(Map json) - : dx = double.parse(json['dx']), - dy = double.parse(json['dy']), - duration = Duration(microseconds: int.parse(json['duration'])), - frequency = int.parse(json['frequency']), - super.deserialize(json); + : dx = double.parse(json['dx']), + dy = double.parse(json['dy']), + duration = Duration(microseconds: int.parse(json['duration'])), + frequency = int.parse(json['frequency']), + super.deserialize(json); /// Delta X offset per move event. final double dx; @@ -94,8 +94,8 @@ class ScrollIntoView extends CommandWithTarget { /// Deserializes this command from the value generated by [serialize]. ScrollIntoView.deserialize(Map json) - : alignment = double.parse(json['alignment']), - super.deserialize(json); + : alignment = double.parse(json['alignment']), + super.deserialize(json); /// How the widget should be aligned. /// diff --git a/packages/flutter_driver/lib/src/common/message.dart b/packages/flutter_driver/lib/src/common/message.dart index f66d14804e..0b510103e2 100644 --- a/packages/flutter_driver/lib/src/common/message.dart +++ b/packages/flutter_driver/lib/src/common/message.dart @@ -13,7 +13,7 @@ abstract class Command { /// Deserializes this command from the value generated by [serialize]. Command.deserialize(Map json) - : timeout = _parseTimeout(json); + : timeout = _parseTimeout(json); static Duration _parseTimeout(Map json) { final String timeout = json['timeout']; diff --git a/packages/flutter_driver/lib/src/common/request_data.dart b/packages/flutter_driver/lib/src/common/request_data.dart index d9b6598a30..d6d64e2777 100644 --- a/packages/flutter_driver/lib/src/common/request_data.dart +++ b/packages/flutter_driver/lib/src/common/request_data.dart @@ -12,8 +12,8 @@ class RequestData extends Command { /// Deserializes this command from the value generated by [serialize]. RequestData.deserialize(Map params) - : message = params['message'], - super.deserialize(params); + : message = params['message'], + super.deserialize(params); /// The message being sent from the test to the application. final String message; diff --git a/packages/flutter_driver/lib/src/common/semantics.dart b/packages/flutter_driver/lib/src/common/semantics.dart index 048c3d0857..d44c42089c 100644 --- a/packages/flutter_driver/lib/src/common/semantics.dart +++ b/packages/flutter_driver/lib/src/common/semantics.dart @@ -11,8 +11,8 @@ class SetSemantics extends Command { /// Deserializes this command from the value generated by [serialize]. SetSemantics.deserialize(Map params) - : enabled = params['enabled'].toLowerCase() == 'true', - super.deserialize(params); + : enabled = params['enabled'].toLowerCase() == 'true', + super.deserialize(params); /// Whether semantics should be enabled (true) or disabled (false). final bool enabled; diff --git a/packages/flutter_driver/lib/src/common/text.dart b/packages/flutter_driver/lib/src/common/text.dart index 328c92d0c3..b5ee236bee 100644 --- a/packages/flutter_driver/lib/src/common/text.dart +++ b/packages/flutter_driver/lib/src/common/text.dart @@ -43,8 +43,8 @@ class EnterText extends Command { /// Deserializes this command from the value generated by [serialize]. EnterText.deserialize(Map json) - : text = json['text'], - super.deserialize(json); + : text = json['text'], + super.deserialize(json); /// The text extracted by the [GetText] command. final String text; @@ -79,8 +79,8 @@ class SetTextEntryEmulation extends Command { /// Deserializes this command from the value generated by [serialize]. SetTextEntryEmulation.deserialize(Map json) - : enabled = json['enabled'] == 'true', - super.deserialize(json); + : enabled = json['enabled'] == 'true', + super.deserialize(json); /// Whether text entry emulation should be enabled. final bool enabled; diff --git a/packages/flutter_test/lib/src/accessibility.dart b/packages/flutter_test/lib/src/accessibility.dart index 97a269d5c3..9676c585c6 100644 --- a/packages/flutter_test/lib/src/accessibility.dart +++ b/packages/flutter_test/lib/src/accessibility.dart @@ -17,7 +17,9 @@ import 'widget_tester.dart'; /// The result of evaluating a semantics node by a [AccessibilityGuideline]. class Evaluation { /// Create a passing evaluation. - const Evaluation.pass() : passed = true, reason = null; + const Evaluation.pass() + : passed = true, + reason = null; /// Create a failing evaluation, with an optional [reason] explaining the /// result. diff --git a/packages/flutter_test/lib/src/finders.dart b/packages/flutter_test/lib/src/finders.dart index 2d41b0334c..a2fda53ded 100644 --- a/packages/flutter_test/lib/src/finders.dart +++ b/packages/flutter_test/lib/src/finders.dart @@ -576,8 +576,8 @@ class _WidgetFinder extends MatchFinder { class _WidgetPredicateFinder extends MatchFinder { _WidgetPredicateFinder(this.predicate, { String description, bool skipOffstage = true }) - : _description = description, - super(skipOffstage: skipOffstage); + : _description = description, + super(skipOffstage: skipOffstage); final WidgetPredicate predicate; final String _description; @@ -593,8 +593,8 @@ class _WidgetPredicateFinder extends MatchFinder { class _ElementPredicateFinder extends MatchFinder { _ElementPredicateFinder(this.predicate, { String description, bool skipOffstage = true }) - : _description = description, - super(skipOffstage: skipOffstage); + : _description = description, + super(skipOffstage: skipOffstage); final ElementPredicate predicate; final String _description; diff --git a/packages/flutter_test/lib/src/goldens.dart b/packages/flutter_test/lib/src/goldens.dart index dd63f6fe04..fb2a208943 100644 --- a/packages/flutter_test/lib/src/goldens.dart +++ b/packages/flutter_test/lib/src/goldens.dart @@ -149,8 +149,8 @@ class LocalFileComparator implements GoldenFileComparator { /// /// The [testFile] URL must represent a file. LocalFileComparator(Uri testFile, {path.Style pathStyle}) - : basedir = _getBasedir(testFile, pathStyle), - _path = _getPath(pathStyle); + : basedir = _getBasedir(testFile, pathStyle), + _path = _getPath(pathStyle); static path.Context _getPath(path.Style style) { return path.Context(style: style ?? path.Style.platform); diff --git a/packages/flutter_test/lib/src/test_compat.dart b/packages/flutter_test/lib/src/test_compat.dart index 7334274269..d1688b7759 100644 --- a/packages/flutter_test/lib/src/test_compat.dart +++ b/packages/flutter_test/lib/src/test_compat.dart @@ -304,12 +304,13 @@ void tearDownAll(Function body) { /// fixed, this must not import `dart:io`. class _Reporter { _Reporter({bool color = true, bool printPath = true}) - : _printPath = printPath, - _green = color ? '\u001b[32m' : '', - _red = color ? '\u001b[31m' : '', - _yellow = color ? '\u001b[33m' : '', - _bold = color ? '\u001b[1m' : '', - _noColor = color ? '\u001b[0m' : ''; + : _printPath = printPath, + _green = color ? '\u001b[32m' : '', + _red = color ? '\u001b[31m' : '', + _yellow = color ? '\u001b[33m' : '', + _bold = color ? '\u001b[1m' : '', + _noColor = color ? '\u001b[0m' : ''; + final List passed = []; final List failed = []; final List skipped = []; diff --git a/packages/flutter_tools/lib/src/android/android_emulator.dart b/packages/flutter_tools/lib/src/android/android_emulator.dart index bce406251a..5d6daf854f 100644 --- a/packages/flutter_tools/lib/src/android/android_emulator.dart +++ b/packages/flutter_tools/lib/src/android/android_emulator.dart @@ -27,7 +27,7 @@ class AndroidEmulators extends EmulatorDiscovery { class AndroidEmulator extends Emulator { AndroidEmulator(String id, [this._properties]) - : super(id, _properties != null && _properties.isNotEmpty); + : super(id, _properties != null && _properties.isNotEmpty); Map _properties; diff --git a/packages/flutter_tools/lib/src/android/android_workflow.dart b/packages/flutter_tools/lib/src/android/android_workflow.dart index 00431f0ab4..2ac566f163 100644 --- a/packages/flutter_tools/lib/src/android/android_workflow.dart +++ b/packages/flutter_tools/lib/src/android/android_workflow.dart @@ -51,7 +51,7 @@ class AndroidWorkflow implements Workflow { } class AndroidValidator extends DoctorValidator { - AndroidValidator(): super('Android toolchain - develop for Android devices',); + AndroidValidator() : super('Android toolchain - develop for Android devices',); @override String get slowWarning => '${_task ?? 'This'} is taking a long time...'; @@ -167,7 +167,7 @@ class AndroidValidator extends DoctorValidator { } class AndroidLicenseValidator extends DoctorValidator { - AndroidLicenseValidator(): super('Android license subvalidator',); + AndroidLicenseValidator() : super('Android license subvalidator',); @override String get slowWarning => 'Checking Android licenses is taking an unexpectedly long time...'; diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart index 371a04244d..6cfb8bcd9a 100644 --- a/packages/flutter_tools/lib/src/artifacts.dart +++ b/packages/flutter_tools/lib/src/artifacts.dart @@ -76,9 +76,11 @@ String _artifactToFileName(Artifact artifact, [TargetPlatform platform, BuildMod } class EngineBuildPaths { - const EngineBuildPaths({ @required this.targetEngine, @required this.hostEngine }): - assert(targetEngine != null), - assert(hostEngine != null); + const EngineBuildPaths({ + @required this.targetEngine, + @required this.hostEngine, + }) : assert(targetEngine != null), + assert(hostEngine != null); final String targetEngine; final String hostEngine; diff --git a/packages/flutter_tools/lib/src/base/process.dart b/packages/flutter_tools/lib/src/base/process.dart index 40e085e69b..077b32e893 100644 --- a/packages/flutter_tools/lib/src/base/process.dart +++ b/packages/flutter_tools/lib/src/base/process.dart @@ -361,7 +361,9 @@ class ProcessExit implements Exception { } class RunResult { - RunResult(this.processResult, this._command) : assert(_command != null), assert(_command.isNotEmpty); + RunResult(this.processResult, this._command) + : assert(_command != null), + assert(_command.isNotEmpty); final ProcessResult processResult; diff --git a/packages/flutter_tools/lib/src/base/terminal.dart b/packages/flutter_tools/lib/src/base/terminal.dart index de7f012940..8f9eb45e7e 100644 --- a/packages/flutter_tools/lib/src/base/terminal.dart +++ b/packages/flutter_tools/lib/src/base/terminal.dart @@ -42,9 +42,9 @@ class OutputPreferences { bool wrapText, int wrapColumn, bool showColor, - }) : wrapText = wrapText ?? io.stdio?.hasTerminal ?? const io.Stdio().hasTerminal, - _overrideWrapColumn = wrapColumn, - showColor = showColor ?? platform.stdoutSupportsAnsi ?? false; + }) : wrapText = wrapText ?? io.stdio?.hasTerminal ?? const io.Stdio().hasTerminal, + _overrideWrapColumn = wrapColumn, + showColor = showColor ?? platform.stdoutSupportsAnsi ?? false; /// If [wrapText] is true, then any text sent to the context's [Logger] /// instance (e.g. from the [printError] or [printStatus] functions) will be diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index dd1db595d1..fe5089ecb8 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart @@ -348,7 +348,7 @@ void _maybeWarnAboutStorageOverride(String overrideUrl) { /// A cached artifact containing fonts used for Material Design. class MaterialFonts extends CachedArtifact { - MaterialFonts(Cache cache): super('material_fonts', cache); + MaterialFonts(Cache cache) : super('material_fonts', cache); @override Future updateInner() { @@ -359,7 +359,7 @@ class MaterialFonts extends CachedArtifact { /// A cached artifact containing the Flutter engine binaries. class FlutterEngine extends CachedArtifact { - FlutterEngine(Cache cache): super('engine', cache); + FlutterEngine(Cache cache) : super('engine', cache); List _getPackageDirs() => const ['sky_engine']; @@ -574,7 +574,7 @@ class FlutterEngine extends CachedArtifact { /// A cached artifact containing Gradle Wrapper scripts and binaries. class GradleWrapper extends CachedArtifact { - GradleWrapper(Cache cache): super('gradle_wrapper', cache); + GradleWrapper(Cache cache) : super('gradle_wrapper', cache); List get _gradleScripts => ['gradlew', 'gradlew.bat']; diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index efe4d91d48..f1f9d3d8a1 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -903,7 +903,8 @@ class PubspecDependency extends PubspecLine { DependencyKind kind, this.version, this.sourcePath, - }) : _kind = kind, super(line); + }) : _kind = kind, + super(line); static PubspecDependency parse(String line, { @required String filename }) { // We recognize any line that: diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 29fa0c6b75..3a24d54209 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -286,9 +286,13 @@ abstract class _CompilationRequest { } class _RecompileRequest extends _CompilationRequest { - _RecompileRequest(Completer completer, this.mainPath, - this.invalidatedFiles, this.outputPath, this.packagesFilePath) : - super(completer); + _RecompileRequest( + Completer completer, + this.mainPath, + this.invalidatedFiles, + this.outputPath, + this.packagesFilePath, + ) : super(completer); String mainPath; List invalidatedFiles; @@ -301,9 +305,15 @@ class _RecompileRequest extends _CompilationRequest { } class _CompileExpressionRequest extends _CompilationRequest { - _CompileExpressionRequest(Completer completer, this.expression, this.definitions, - this.typeDefinitions, this.libraryUri, this.klass, this.isStatic) : - super(completer); + _CompileExpressionRequest( + Completer completer, + this.expression, + this.definitions, + this.typeDefinitions, + this.libraryUri, + this.klass, + this.isStatic + ) : super(completer); String expression; List definitions; diff --git a/packages/flutter_tools/lib/src/dart/dependencies.dart b/packages/flutter_tools/lib/src/dart/dependencies.dart index 0b7fa12077..f931b0936a 100644 --- a/packages/flutter_tools/lib/src/dart/dependencies.dart +++ b/packages/flutter_tools/lib/src/dart/dependencies.dart @@ -26,10 +26,10 @@ String _dottedNameToString(analyzer.DottedName dottedName) { } class DartDependencySetBuilder { - DartDependencySetBuilder(String mainScriptPath, String packagesFilePath) : - _mainScriptPath = canonicalizePath(mainScriptPath), - _mainScriptUri = fs.path.toUri(mainScriptPath), - _packagesFilePath = canonicalizePath(packagesFilePath); + DartDependencySetBuilder(String mainScriptPath, String packagesFilePath) + : _mainScriptPath = canonicalizePath(mainScriptPath), + _mainScriptUri = fs.path.toUri(mainScriptPath), + _packagesFilePath = canonicalizePath(packagesFilePath); final String _mainScriptPath; final String _packagesFilePath; diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 75ebec8abc..dece8571cb 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -193,7 +193,9 @@ class DevFSByteContent extends DevFSContent { /// String content to be copied to the device. class DevFSStringContent extends DevFSByteContent { - DevFSStringContent(String string) : _string = string, super(utf8.encode(string)); + DevFSStringContent(String string) + : _string = string, + super(utf8.encode(string)); String _string; @@ -274,7 +276,7 @@ class DevFSException implements Exception { class _DevFSHttpWriter { _DevFSHttpWriter(this.fsName, VMService serviceProtocol) - : httpAddress = serviceProtocol.httpAddress; + : httpAddress = serviceProtocol.httpAddress; final String fsName; final Uri httpAddress; @@ -377,25 +379,25 @@ class UpdateFSReport { class DevFS { /// Create a [DevFS] named [fsName] for the local files in [rootDirectory]. - DevFS(VMService serviceProtocol, - this.fsName, - this.rootDirectory, { - String packagesFilePath - }) - : _operations = ServiceProtocolDevFSOperations(serviceProtocol), - _httpWriter = _DevFSHttpWriter(fsName, serviceProtocol) { + DevFS( + VMService serviceProtocol, + this.fsName, + this.rootDirectory, { + String packagesFilePath + }) : _operations = ServiceProtocolDevFSOperations(serviceProtocol), + _httpWriter = _DevFSHttpWriter(fsName, serviceProtocol) { _packagesFilePath = packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName); } - DevFS.operations(this._operations, - this.fsName, - this.rootDirectory, { - String packagesFilePath, - }) - : _httpWriter = null { - _packagesFilePath = - packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName); + DevFS.operations( + this._operations, + this.fsName, + this.rootDirectory, { + String packagesFilePath, + }) : _httpWriter = null { + _packagesFilePath = + packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName); } final DevFSOperations _operations; diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index 9d46ffe2f9..d932fd469d 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -361,15 +361,15 @@ class DebuggingOptions { this.observatoryPort, }) : debuggingEnabled = true; - DebuggingOptions.disabled(this.buildInfo) : - debuggingEnabled = false, - useTestFonts = false, - startPaused = false, - enableSoftwareRendering = false, - skiaDeterministicRendering = false, - traceSkia = false, - traceSystrace = false, - observatoryPort = null; + DebuggingOptions.disabled(this.buildInfo) + : debuggingEnabled = false, + useTestFonts = false, + startPaused = false, + enableSoftwareRendering = false, + skiaDeterministicRendering = false, + traceSkia = false, + traceSystrace = false, + observatoryPort = null; final bool debuggingEnabled; @@ -387,7 +387,9 @@ class DebuggingOptions { class LaunchResult { LaunchResult.succeeded({ this.observatoryUri }) : started = true; - LaunchResult.failed() : started = false, observatoryUri = null; + LaunchResult.failed() + : started = false, + observatoryUri = null; bool get hasObservatory => observatoryUri != null; diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index d250ea0292..a68bcfbb93 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -111,7 +111,9 @@ class IOSDevices extends PollingDeviceDiscovery { } class IOSDevice extends Device { - IOSDevice(String id, { this.name, String sdkVersion }) : _sdkVersion = sdkVersion, super(id) { + IOSDevice(String id, { this.name, String sdkVersion }) + : _sdkVersion = sdkVersion, + super(id) { _installerPath = _checkForCommand('ideviceinstaller'); _iproxyPath = _checkForCommand('iproxy'); } diff --git a/packages/flutter_tools/lib/src/project.dart b/packages/flutter_tools/lib/src/project.dart index 5ac90fba6a..4c5496bea2 100644 --- a/packages/flutter_tools/lib/src/project.dart +++ b/packages/flutter_tools/lib/src/project.dart @@ -31,9 +31,9 @@ import 'template.dart'; class FlutterProject { @visibleForTesting FlutterProject(this.directory, this.manifest, this._exampleManifest) - : assert(directory != null), - assert(manifest != null), - assert(_exampleManifest != null); + : assert(directory != null), + assert(manifest != null), + assert(_exampleManifest != null); /// Returns a future that completes with a [FlutterProject] view of the given directory /// or a ToolExit error, if `pubspec.yaml` or `example/pubspec.yaml` is invalid. diff --git a/packages/flutter_tools/lib/src/tester/flutter_tester.dart b/packages/flutter_tools/lib/src/tester/flutter_tester.dart index de296008e8..30861beae1 100644 --- a/packages/flutter_tools/lib/src/tester/flutter_tester.dart +++ b/packages/flutter_tools/lib/src/tester/flutter_tester.dart @@ -27,8 +27,8 @@ class FlutterTesterApp extends ApplicationPackage { } FlutterTesterApp._(Directory directory) - : _directory = directory, - super(id: directory.path); + : _directory = directory, + super(id: directory.path); final Directory _directory; diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index 29dbc5ed40..bd65cc3151 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -540,7 +540,12 @@ String _shortGitRevision(String revision) { class GitTagVersion { const GitTagVersion(this.x, this.y, this.z, this.commits, this.hash); - const GitTagVersion.unknown() : x = null, y = null, z = null, commits = 0, hash = ''; + const GitTagVersion.unknown() + : x = null, + y = null, + z = null, + commits = 0, + hash = ''; /// The X in vX.Y.Z. final int x; diff --git a/packages/flutter_tools/lib/src/vmservice_record_replay.dart b/packages/flutter_tools/lib/src/vmservice_record_replay.dart index 0061fd4209..086868222e 100644 --- a/packages/flutter_tools/lib/src/vmservice_record_replay.dart +++ b/packages/flutter_tools/lib/src/vmservice_record_replay.dart @@ -195,7 +195,7 @@ class _RecordingSink implements StreamSink { /// replays the corresponding responses back from the recording. class ReplayVMServiceChannel extends StreamChannelMixin { ReplayVMServiceChannel(Directory location) - : _transactions = _loadTransactions(location); + : _transactions = _loadTransactions(location); final Map _transactions; final StreamController _controller = StreamController(); diff --git a/packages/flutter_tools/test/commands/doctor_test.dart b/packages/flutter_tools/test/commands/doctor_test.dart index 95c9141ffc..0a403cc4cd 100644 --- a/packages/flutter_tools/test/commands/doctor_test.dart +++ b/packages/flutter_tools/test/commands/doctor_test.dart @@ -477,7 +477,7 @@ class PassingValidator extends DoctorValidator { } class MissingValidator extends DoctorValidator { - MissingValidator(): super('Missing Validator'); + MissingValidator() : super('Missing Validator'); @override Future validate() async { @@ -490,7 +490,7 @@ class MissingValidator extends DoctorValidator { } class NotAvailableValidator extends DoctorValidator { - NotAvailableValidator(): super('Not Available Validator'); + NotAvailableValidator() : super('Not Available Validator'); @override Future validate() async { @@ -622,7 +622,7 @@ class PassingGroupedValidator extends DoctorValidator { } class MissingGroupedValidator extends DoctorValidator { - MissingGroupedValidator(String name): super(name); + MissingGroupedValidator(String name) : super(name); @override Future validate() async { @@ -633,7 +633,7 @@ class MissingGroupedValidator extends DoctorValidator { } class PartialGroupedValidator extends DoctorValidator { - PartialGroupedValidator(String name): super(name); + PartialGroupedValidator(String name) : super(name); @override Future validate() async { @@ -702,7 +702,7 @@ class FakeSmallGroupDoctor extends Doctor { class VsCodeValidatorTestTargets extends VsCodeValidator { VsCodeValidatorTestTargets._(String installDirectory, String extensionDirectory, {String edition}) - : super(VsCode.fromDirectory(installDirectory, extensionDirectory, edition: edition)); + : super(VsCode.fromDirectory(installDirectory, extensionDirectory, edition: edition)); static VsCodeValidatorTestTargets get installedWithExtension => VsCodeValidatorTestTargets._(validInstall, validExtensions); diff --git a/packages/flutter_tools/test/emulator_test.dart b/packages/flutter_tools/test/emulator_test.dart index 7a7c5b4bd1..71469fb357 100644 --- a/packages/flutter_tools/test/emulator_test.dart +++ b/packages/flutter_tools/test/emulator_test.dart @@ -164,7 +164,7 @@ class TestEmulatorManager extends EmulatorManager { class _MockEmulator extends Emulator { _MockEmulator(String id, this.name, this.manufacturer, this.label) - : super(id, true); + : super(id, true); @override final String name; diff --git a/packages/flutter_tools/test/integration/test_driver.dart b/packages/flutter_tools/test/integration/test_driver.dart index 01482961ca..b95e2c20ab 100644 --- a/packages/flutter_tools/test/integration/test_driver.dart +++ b/packages/flutter_tools/test/integration/test_driver.dart @@ -590,8 +590,8 @@ class FlutterRunTestDriver extends FlutterTestDriver { } class FlutterTestTestDriver extends FlutterTestDriver { - FlutterTestTestDriver(Directory _projectFolder, {String logPrefix}): - super(_projectFolder, logPrefix: logPrefix); + FlutterTestTestDriver(Directory _projectFolder, {String logPrefix}) + : super(_projectFolder, logPrefix: logPrefix); Future test({ String testFile = 'test/test.dart', diff --git a/packages/flutter_tools/test/resident_runner_test.dart b/packages/flutter_tools/test/resident_runner_test.dart index 815de9309b..2a20530991 100644 --- a/packages/flutter_tools/test/resident_runner_test.dart +++ b/packages/flutter_tools/test/resident_runner_test.dart @@ -12,7 +12,7 @@ import 'src/context.dart'; class TestRunner extends ResidentRunner { TestRunner(List devices) - : super(devices); + : super(devices); bool hasHelpBeenPrinted = false; String receivedCommand; diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/common/logging.dart b/packages/fuchsia_remote_debug_protocol/lib/src/common/logging.dart index 8a1e6662ae..230ad3fbcd 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/common/logging.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/common/logging.dart @@ -69,9 +69,8 @@ class LogMessage { /// /// When this message is created, it sets its [time] to [DateTime.now]. LogMessage(this.message, this.tag, this.level) - : levelName = - level.toString().substring(level.toString().indexOf('.') + 1), - time = DateTime.now(); + : levelName = level.toString().substring(level.toString().indexOf('.') + 1), + time = DateTime.now(); /// The actual log message. final String message; diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart index 1965752ac4..d44308c14d 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart @@ -101,7 +101,7 @@ class DartVmEvent { /// Dart VM at any given time. class FuchsiaRemoteConnection { FuchsiaRemoteConnection._(this._useIpV6Loopback, this._sshCommandRunner) - : _pollDartVms = false; + : _pollDartVms = false; bool _pollDartVms; final List _forwardedVmServicePorts = [];