Unverified Commit 671926db authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

add missing trailing commas (#79434)

parent 54c0e7a4
......@@ -454,7 +454,7 @@ class AnimationController extends Animation<double>
assert(
_ticker != null,
'AnimationController.forward() called after AnimationController.dispose()\n'
'AnimationController methods should not be used after calling dispose.'
'AnimationController methods should not be used after calling dispose.',
);
_direction = _AnimationDirection.forward;
if (from != null)
......@@ -487,7 +487,7 @@ class AnimationController extends Animation<double>
assert(
_ticker != null,
'AnimationController.reverse() called after AnimationController.dispose()\n'
'AnimationController methods should not be used after calling dispose.'
'AnimationController methods should not be used after calling dispose.',
);
_direction = _AnimationDirection.reverse;
if (from != null)
......@@ -526,7 +526,7 @@ class AnimationController extends Animation<double>
assert(
_ticker != null,
'AnimationController.animateTo() called after AnimationController.dispose()\n'
'AnimationController methods should not be used after calling dispose.'
'AnimationController methods should not be used after calling dispose.',
);
_direction = _AnimationDirection.forward;
return _animateToInternal(target, duration: duration, curve: curve);
......@@ -559,7 +559,7 @@ class AnimationController extends Animation<double>
assert(
_ticker != null,
'AnimationController.animateBack() called after AnimationController.dispose()\n'
'AnimationController methods should not be used after calling dispose.'
'AnimationController methods should not be used after calling dispose.',
);
_direction = _AnimationDirection.reverse;
return _animateToInternal(target, duration: duration, curve: curve);
......@@ -704,7 +704,7 @@ class AnimationController extends Animation<double>
assert(
simulation.type != SpringType.underDamped,
'The resulting spring simulation is of type SpringType.underDamped.\n'
'This can lead to unexpected look of the animation, please adjust the springDescription parameter'
'This can lead to unexpected look of the animation, please adjust the springDescription parameter',
);
stop();
return _startSimulation(simulation);
......@@ -728,7 +728,7 @@ class AnimationController extends Animation<double>
assert(
_ticker != null,
'AnimationController.animateWith() called after AnimationController.dispose()\n'
'AnimationController methods should not be used after calling dispose.'
'AnimationController methods should not be used after calling dispose.',
);
stop();
_direction = _AnimationDirection.forward;
......@@ -770,7 +770,7 @@ class AnimationController extends Animation<double>
assert(
_ticker != null,
'AnimationController.stop() called after AnimationController.dispose()\n'
'AnimationController methods should not be used after calling dispose.'
'AnimationController methods should not be used after calling dispose.',
);
_simulation = null;
_lastElapsedDuration = null;
......
......@@ -238,12 +238,12 @@ class CupertinoNavigationBar extends StatefulWidget implements ObstructingPrefer
assert(
heroTag != null,
'heroTag cannot be null. Use transitionBetweenRoutes = false to '
'disable Hero transition on this navigation bar.'
'disable Hero transition on this navigation bar.',
),
assert(
!transitionBetweenRoutes || identical(heroTag, _defaultHeroTag),
'Cannot specify a heroTag override if this navigation bar does not '
'transition due to transitionBetweenRoutes = false.'
'transition due to transitionBetweenRoutes = false.',
),
super(key: key);
......@@ -574,7 +574,7 @@ class CupertinoSliverNavigationBar extends StatefulWidget {
automaticallyImplyTitle == true || largeTitle != null,
'No largeTitle has been provided but automaticallyImplyTitle is also '
'false. Either provide a largeTitle or set automaticallyImplyTitle to '
'true.'
'true.',
),
super(key: key);
......
......@@ -351,7 +351,7 @@ class CupertinoSliverRefreshControl extends StatefulWidget {
assert(
refreshTriggerPullDistance >= refreshIndicatorExtent,
'The refresh indicator cannot take more space in its final state '
'than the amount initially created by overscrolling.'
'than the amount initially created by overscrolling.',
),
super(key: key);
......
......@@ -220,7 +220,7 @@ class CupertinoTabScaffold extends StatefulWidget {
assert(
controller == null || controller.index < tabBar.items.length,
"The CupertinoTabController's current index ${controller.index} is "
'out of bounds for the tab bar with ${tabBar.items.length} tabs'
'out of bounds for the tab bar with ${tabBar.items.length} tabs',
),
super(key: key);
......@@ -367,7 +367,7 @@ class _CupertinoTabScaffoldState extends State<CupertinoTabScaffold> with Restor
assert(
_controller.index >= 0 && _controller.index < widget.tabBar.items.length,
"The $runtimeType's current index ${_controller.index} is "
'out of bounds for the tab bar with ${widget.tabBar.items.length} tabs'
'out of bounds for the tab bar with ${widget.tabBar.items.length} tabs',
);
// The value of `_controller.index` has already been updated at this point.
......
......@@ -811,8 +811,8 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
'framework by filing a bug on GitHub:\n'
' https://github.com/flutter/flutter/issues/new?template=2_bug.md',
),
],
));
]),
);
assert(() {
final Iterable<DiagnosticsNode> summaries = diagnostics.where((DiagnosticsNode node) => node.level == DiagnosticLevel.summary);
if (summaries.length > 1) {
......
......@@ -1436,7 +1436,7 @@ abstract class DiagnosticsNode {
name == null || !name.endsWith(':'),
'Names of diagnostic nodes must not end with colons.\n'
'name:\n'
' "$name"'
' "$name"',
);
/// Diagnostics containing just a string `message` and not a concrete name or
......
......@@ -194,7 +194,7 @@ class StackFrame {
line != '===== asynchronous gap ===========================',
'Got a stack frame from package:stack_trace, where a vm or web frame was expected. '
'This can happen if FlutterError.demangleStackTrace was not set in an environment '
'that propagates non-standard stack traces to the framework, such as during tests.'
'that propagates non-standard stack traces to the framework, such as during tests.',
);
// Web frames.
......
......@@ -230,7 +230,7 @@ class ForcePressGestureRecognizer extends OneSequenceGestureRecognizer {
final double pressure = interpolation(event.pressureMin, event.pressureMax, event.pressure);
assert(
(pressure >= 0.0 && pressure <= 1.0) || // Interpolated pressure must be between 1.0 and 0.0...
pressure.isNaN // and interpolation may return NaN for values it doesn't want to support...
pressure.isNaN, // and interpolation may return NaN for values it doesn't want to support...
);
_lastPosition = OffsetPair.fromEventPosition(event);
......
......@@ -216,7 +216,7 @@ class HitTestResult {
'events must be Vector4(0, 0, 1, 0) to ensure that a transformed '
'point is directly under the pointing device. Did you forget to run the paint '
'matrix through PointerEvent.removePerspectiveTransform? '
'The provided matrix is:\n$transform'
'The provided matrix is:\n$transform',
);
_localTransforms.add(_MatrixTransformPart(transform));
}
......
......@@ -45,7 +45,8 @@ class AppBarTheme with Diagnosticable {
this.backwardsCompatibility,
}) : assert(
color == null || backgroundColor == null,
'The color and backgroundColor parameters mean the same thing. Only specify one.'),
'The color and backgroundColor parameters mean the same thing. Only specify one.',
),
backgroundColor = backgroundColor ?? color;
/// This property is obsolete, please use [systemOverlayStyle] instead.
......@@ -190,7 +191,8 @@ class AppBarTheme with Diagnosticable {
}) {
assert(
color == null || backgroundColor == null,
'The color and backgroundColor parameters mean the same thing. Only specify one.');
'The color and backgroundColor parameters mean the same thing. Only specify one.',
);
return AppBarTheme(
brightness: brightness ?? this.brightness,
backgroundColor: backgroundColor ?? color ?? this.backgroundColor,
......
......@@ -290,7 +290,7 @@ class BottomNavigationBar extends StatefulWidget {
assert(iconSize != null && iconSize >= 0.0),
assert(
selectedItemColor == null || fixedColor == null,
'Either selectedItemColor or fixedColor can be specified, but not both'
'Either selectedItemColor or fixedColor can be specified, but not both',
),
assert(selectedFontSize != null && selectedFontSize >= 0.0),
assert(unselectedFontSize != null && unselectedFontSize >= 0.0),
......
......@@ -105,19 +105,19 @@ class CalendarDatePicker extends StatefulWidget {
super(key: key) {
assert(
!this.lastDate.isBefore(this.firstDate),
'lastDate ${this.lastDate} must be on or after firstDate ${this.firstDate}.'
'lastDate ${this.lastDate} must be on or after firstDate ${this.firstDate}.',
);
assert(
!this.initialDate.isBefore(this.firstDate),
'initialDate ${this.initialDate} must be on or after firstDate ${this.firstDate}.'
'initialDate ${this.initialDate} must be on or after firstDate ${this.firstDate}.',
);
assert(
!this.initialDate.isAfter(this.lastDate),
'initialDate ${this.initialDate} must be on or before lastDate ${this.lastDate}.'
'initialDate ${this.initialDate} must be on or before lastDate ${this.lastDate}.',
);
assert(
selectableDayPredicate == null || selectableDayPredicate!(this.initialDate),
'Provided initialDate ${this.initialDate} must satisfy provided selectableDayPredicate.'
'Provided initialDate ${this.initialDate} must satisfy provided selectableDayPredicate.',
);
}
......
......@@ -2779,13 +2779,15 @@ class _RenderChip extends RenderBox {
);
size = constraints.constrain(paddedSize);
assert(
size.height == constraints.constrainHeight(paddedSize.height),
"Constrained height ${size.height} doesn't match expected height "
'${constraints.constrainWidth(paddedSize.height)}');
size.height == constraints.constrainHeight(paddedSize.height),
"Constrained height ${size.height} doesn't match expected height "
'${constraints.constrainWidth(paddedSize.height)}',
);
assert(
size.width == constraints.constrainWidth(paddedSize.width),
"Constrained width ${size.width} doesn't match expected width "
'${constraints.constrainWidth(paddedSize.width)}');
size.width == constraints.constrainWidth(paddedSize.width),
"Constrained width ${size.width} doesn't match expected width "
'${constraints.constrainWidth(paddedSize.width)}',
);
}
static final ColorTween selectionScrimTween = ColorTween(
......
......@@ -223,19 +223,19 @@ Future<DateTime?> showDatePicker({
lastDate = DateUtils.dateOnly(lastDate);
assert(
!lastDate.isBefore(firstDate),
'lastDate $lastDate must be on or after firstDate $firstDate.'
'lastDate $lastDate must be on or after firstDate $firstDate.',
);
assert(
!initialDate.isBefore(firstDate),
'initialDate $initialDate must be on or after firstDate $firstDate.'
'initialDate $initialDate must be on or after firstDate $firstDate.',
);
assert(
!initialDate.isAfter(lastDate),
'initialDate $initialDate must be on or before lastDate $lastDate.'
'initialDate $initialDate must be on or before lastDate $lastDate.',
);
assert(
selectableDayPredicate == null || selectableDayPredicate(initialDate),
'Provided initialDate $initialDate must satisfy provided selectableDayPredicate.'
'Provided initialDate $initialDate must satisfy provided selectableDayPredicate.',
);
assert(initialEntryMode != null);
assert(useRootNavigator != null);
......@@ -324,19 +324,19 @@ class DatePickerDialog extends StatefulWidget {
super(key: key) {
assert(
!this.lastDate.isBefore(this.firstDate),
'lastDate ${this.lastDate} must be on or after firstDate ${this.firstDate}.'
'lastDate ${this.lastDate} must be on or after firstDate ${this.firstDate}.',
);
assert(
!this.initialDate.isBefore(this.firstDate),
'initialDate ${this.initialDate} must be on or after firstDate ${this.firstDate}.'
'initialDate ${this.initialDate} must be on or after firstDate ${this.firstDate}.',
);
assert(
!this.initialDate.isAfter(this.lastDate),
'initialDate ${this.initialDate} must be on or before lastDate ${this.lastDate}.'
'initialDate ${this.initialDate} must be on or before lastDate ${this.lastDate}.',
);
assert(
selectableDayPredicate == null || selectableDayPredicate!(this.initialDate),
'Provided initialDate ${this.initialDate} must satisfy provided selectableDayPredicate'
'Provided initialDate ${this.initialDate} must satisfy provided selectableDayPredicate',
);
}
......@@ -1052,11 +1052,11 @@ Future<DateTimeRange?> showDateRangePicker({
assert(context != null);
assert(
initialDateRange == null || (initialDateRange.start != null && initialDateRange.end != null),
'initialDateRange must be null or have non-null start and end dates.'
'initialDateRange must be null or have non-null start and end dates.',
);
assert(
initialDateRange == null || !initialDateRange.start.isAfter(initialDateRange.end),
'initialDateRange\'s start date must not be after it\'s end date.'
'initialDateRange\'s start date must not be after it\'s end date.',
);
initialDateRange = initialDateRange == null ? null : DateUtils.datesOnly(initialDateRange);
assert(firstDate != null);
......@@ -1065,23 +1065,23 @@ Future<DateTimeRange?> showDateRangePicker({
lastDate = DateUtils.dateOnly(lastDate);
assert(
!lastDate.isBefore(firstDate),
'lastDate $lastDate must be on or after firstDate $firstDate.'
'lastDate $lastDate must be on or after firstDate $firstDate.',
);
assert(
initialDateRange == null || !initialDateRange.start.isBefore(firstDate),
'initialDateRange\'s start date must be on or after firstDate $firstDate.'
'initialDateRange\'s start date must be on or after firstDate $firstDate.',
);
assert(
initialDateRange == null || !initialDateRange.end.isBefore(firstDate),
'initialDateRange\'s end date must be on or after firstDate $firstDate.'
'initialDateRange\'s end date must be on or after firstDate $firstDate.',
);
assert(
initialDateRange == null || !initialDateRange.start.isAfter(lastDate),
'initialDateRange\'s start date must be on or before lastDate $lastDate.'
'initialDateRange\'s start date must be on or before lastDate $lastDate.',
);
assert(
initialDateRange == null || !initialDateRange.end.isAfter(lastDate),
'initialDateRange\'s end date must be on or before lastDate $lastDate.'
'initialDateRange\'s end date must be on or before lastDate $lastDate.',
);
currentDate = DateUtils.dateOnly(currentDate ?? DateTime.now());
assert(initialEntryMode != null);
......@@ -1703,11 +1703,11 @@ class _CalendarDateRangePicker extends StatefulWidget {
super(key: key) {
assert(
this.initialStartDate == null || this.initialEndDate == null || !this.initialStartDate!.isAfter(initialEndDate!),
'initialStartDate must be on or before initialEndDate.'
'initialStartDate must be on or before initialEndDate.',
);
assert(
!this.lastDate.isBefore(this.firstDate),
'firstDate must be on or before lastDate.'
'firstDate must be on or before lastDate.',
);
}
......
......@@ -1530,7 +1530,7 @@ class DropdownButtonFormField<T> extends FormField<T> {
assert(
autovalidate == false ||
autovalidate == true && autovalidateMode == null,
'autovalidate and autovalidateMode should not be used together.'
'autovalidate and autovalidateMode should not be used together.',
),
decoration = decoration ?? InputDecoration(focusColor: focusColor),
super(
......
......@@ -475,7 +475,7 @@ class _ExpansionPanelListState extends State<ExpansionPanelList> {
Widget build(BuildContext context) {
assert(kElevationToShadow.containsKey(widget.elevation),
'Invalid value for elevation. See the kElevationToShadow constant for'
' possible elevation values.'
' possible elevation values.',
);
final List<MergeableMaterialItem> items = <MergeableMaterialItem>[];
......
......@@ -136,7 +136,7 @@ class Ink extends StatefulWidget {
assert(decoration == null || decoration.debugAssertIsValid()),
assert(color == null || decoration == null,
'Cannot provide both a color and a decoration\n'
'The color argument is just a shorthand for "decoration: BoxDecoration(color: color)".'
'The color argument is just a shorthand for "decoration: BoxDecoration(color: color)".',
),
decoration = decoration ?? (color != null ? BoxDecoration(color: color) : null),
super(key: key);
......
......@@ -66,19 +66,19 @@ class InputDatePickerFormField extends StatefulWidget {
super(key: key) {
assert(
!this.lastDate.isBefore(this.firstDate),
'lastDate ${this.lastDate} must be on or after firstDate ${this.firstDate}.'
'lastDate ${this.lastDate} must be on or after firstDate ${this.firstDate}.',
);
assert(
initialDate == null || !this.initialDate!.isBefore(this.firstDate),
'initialDate ${this.initialDate} must be on or after firstDate ${this.firstDate}.'
'initialDate ${this.initialDate} must be on or after firstDate ${this.firstDate}.',
);
assert(
initialDate == null || !this.initialDate!.isAfter(this.lastDate),
'initialDate ${this.initialDate} must be on or before lastDate ${this.lastDate}.'
'initialDate ${this.initialDate} must be on or before lastDate ${this.lastDate}.',
);
assert(
selectableDayPredicate == null || initialDate == null || selectableDayPredicate!(this.initialDate!),
'Provided initialDate ${this.initialDate} must satisfy provided selectableDayPredicate.'
'Provided initialDate ${this.initialDate} must satisfy provided selectableDayPredicate.',
);
}
......
......@@ -1722,13 +1722,13 @@ class _RenderListTile extends RenderBox {
tileWidth != leadingSize.width || tileWidth == 0.0,
'Leading widget consumes entire tile width. Please use a sized widget, '
'or consider replacing ListTile with a custom widget '
'(see https://api.flutter.dev/flutter/material/ListTile-class.html#material.ListTile.4)'
'(see https://api.flutter.dev/flutter/material/ListTile-class.html#material.ListTile.4)',
);
assert(
tileWidth != trailingSize.width || tileWidth == 0.0,
'Trailing widget consumes entire tile width. Please use a sized widget, '
'or consider replacing ListTile with a custom widget '
'(see https://api.flutter.dev/flutter/material/ListTile-class.html#material.ListTile.4)'
'(see https://api.flutter.dev/flutter/material/ListTile-class.html#material.ListTile.4)',
);
final double titleStart = hasLeading
......
......@@ -363,7 +363,7 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
'If Material type is not MaterialType.transparency, a color must '
'either be passed in through the `color` property, or be defined '
'in the theme (ex. canvasColor != null if type is set to '
'MaterialType.canvas)'
'MaterialType.canvas)',
);
Widget? contents = widget.child;
if (contents != null) {
......
......@@ -3059,7 +3059,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
assert(
_snackBars.isEmpty || _messengerSnackBar == null,
'Only one API should be used to manage SnackBars. The ScaffoldMessenger is '
'the preferred API instead of the Scaffold methods.'
'the preferred API instead of the Scaffold methods.',
);
if (_currentBottomSheet != null || _dismissedBottomSheets.isNotEmpty) {
......
......@@ -207,7 +207,7 @@ class TextFormField extends FormField<String> {
assert(
autovalidate == false ||
autovalidate == true && autovalidateMode == null,
'autovalidate and autovalidateMode should not be used together.'
'autovalidate and autovalidateMode should not be used together.',
),
assert(maxLengthEnforced != null),
assert(
......
......@@ -180,7 +180,9 @@ class TextTheme with Diagnosticable {
bodyText1 == null && bodyText2 == null) ||
(display4 == null && display3 == null && display2 == null && display1 == null && headline == null && title == null &&
subhead == null && subtitle == null &&
body2 == null && body1 == null), 'Cannot mix 2014 and 2018 terms in call to TextTheme() constructor.'),
body2 == null && body1 == null),
'Cannot mix 2014 and 2018 terms in call to TextTheme() constructor.',
),
headline1 = headline1 ?? display4,
headline2 = headline2 ?? display3,
headline3 = headline3 ?? display2,
......@@ -451,7 +453,9 @@ class TextTheme with Diagnosticable {
bodyText1 == null && bodyText2 == null) ||
(display4 == null && display3 == null && display2 == null && display1 == null && headline == null && title == null &&
subhead == null && subtitle == null &&
body2 == null && body1 == null), 'Cannot mix 2014 and 2018 terms in call to TextTheme.copyWith().');
body2 == null && body1 == null),
'Cannot mix 2014 and 2018 terms in call to TextTheme.copyWith().',
);
return TextTheme(
headline1: headline1 ?? display4 ?? this.headline1,
headline2: headline2 ?? display3 ?? this.headline2,
......
......@@ -617,13 +617,13 @@ class ToggleButtons extends StatelessWidget {
!isSelected.any((bool val) => val == null),
'All elements of isSelected must be non-null.\n'
'The current list of isSelected values is as follows:\n'
'$isSelected'
'$isSelected',
);
assert(
focusNodes == null || !focusNodes!.any((FocusNode val) => val == null),
'All elements of focusNodes must be non-null.\n'
'The current list of focus node values is as follows:\n'
'$focusNodes'
'$focusNodes',
);
assert(
() {
......@@ -633,7 +633,7 @@ class ToggleButtons extends StatelessWidget {
}(),
'focusNodes.length must match children.length.\n'
'There are ${focusNodes!.length} focus nodes, while '
'there are ${children.length} children.'
'there are ${children.length} children.',
);
final ThemeData theme = Theme.of(context);
final ToggleButtonsThemeData toggleButtonsTheme = ToggleButtonsTheme.of(context);
......
......@@ -99,7 +99,7 @@ class BoxDecoration extends Decoration {
assert(
backgroundBlendMode == null || color != null || gradient != null,
"backgroundBlendMode applies to BoxDecoration's background color or "
'gradient, but no color or gradient was provided.'
'gradient, but no color or gradient was provided.',
);
/// Creates a copy of this object but with the given fields replaced with the
......
......@@ -440,7 +440,7 @@ void paintImage({
image.debugGetOpenHandleStackTraces()?.isNotEmpty ?? true,
'Cannot paint an image that is disposed.\n'
'The caller of paintImage is expected to wait to dispose the image until '
'after painting has completed.'
'after painting has completed.',
);
if (rect.isEmpty)
return;
......
......@@ -764,7 +764,7 @@ class ResizeImage extends ImageProvider<_SizeAwareCacheKey> {
assert(
cacheWidth == null && cacheHeight == null && allowUpscaling == null,
'ResizeImage cannot be composed with another ImageProvider that applies '
'cacheWidth, cacheHeight, or allowUpscaling.'
'cacheWidth, cacheHeight, or allowUpscaling.',
);
return decode(bytes, cacheWidth: width, cacheHeight: height, allowUpscaling: this.allowUpscaling);
}
......
......@@ -1940,7 +1940,7 @@ abstract class RenderBox extends RenderObject {
'otherwise, the only object that is allowed to read RenderBox.size '
'is its parent, if they have said they will. It you hit this assert '
'trying to access a child\'s size, pass "parentUsesSize: true" to '
'that child\'s layout().'
'that child\'s layout().',
);
}
assert(_size == this._size);
......
......@@ -521,7 +521,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
// on [RenderBox.computeMinIntrinsicWidth].
assert(
RenderObject.debugCheckingIntrinsics,
'Intrinsics are not available for CrossAxisAlignment.baseline.'
'Intrinsics are not available for CrossAxisAlignment.baseline.',
);
return 0.0;
}
......
......@@ -1885,7 +1885,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
assert(
config.platformViewId == null || childrenInInversePaintOrder == null || childrenInInversePaintOrder.isEmpty,
'SemanticsNodes with children must not specify a platformViewId.'
'SemanticsNodes with children must not specify a platformViewId.',
);
_label = config.label;
......
......@@ -857,7 +857,7 @@ class Actions extends StatefulWidget {
'The type passed to "find" resolved to "Intent": either a non-Intent '
'generic type argument or an example intent derived from Intent must be '
'specified. Intent may be used as the generic type as long as the optional '
'"intent" argument is passed.'
'"intent" argument is passed.',
);
_visitActionsAncestors(context, (InheritedElement element) {
......
......@@ -205,13 +205,13 @@ class WidgetsApp extends StatefulWidget {
home == null ||
onGenerateInitialRoutes == null,
'If onGenerateInitialRoutes is specified, the home argument will be '
'redundant.'
'redundant.',
),
assert(
home == null ||
!routes.containsKey(Navigator.defaultRouteName),
'If the home property is specified, the routes table '
'cannot include an entry for "/", since it would be redundant.'
'cannot include an entry for "/", since it would be redundant.',
),
assert(
builder != null ||
......@@ -225,7 +225,7 @@ class WidgetsApp extends StatefulWidget {
'or there must be an onUnknownRoute callback specified, '
'or the builder property must be specified, '
'because otherwise there is nothing to fall back on if the '
'app is started with an intent that specifies an unknown route.'
'app is started with an intent that specifies an unknown route.',
),
assert(
(home != null ||
......@@ -243,7 +243,7 @@ class WidgetsApp extends StatefulWidget {
'and the other navigator-related properties, '
'navigatorKey, initialRoute, and navigatorObservers, '
'must have their initial values '
'(null, null, and the empty list, respectively).'
'(null, null, and the empty list, respectively).',
),
assert(
builder != null ||
......@@ -251,7 +251,7 @@ class WidgetsApp extends StatefulWidget {
pageRouteBuilder != null,
'If neither builder nor onGenerateRoute are provided, the '
'pageRouteBuilder must be specified so that the default handler '
'will know what kind of PageRoute transition to build.'
'will know what kind of PageRoute transition to build.',
),
assert(title != null),
assert(color != null),
......@@ -298,7 +298,7 @@ class WidgetsApp extends StatefulWidget {
}) : assert(
routeInformationParser != null &&
routerDelegate != null,
'The routeInformationParser and routerDelegate cannot be null.'
'The routeInformationParser and routerDelegate cannot be null.',
),
assert(title != null),
assert(color != null),
......
......@@ -5990,7 +5990,7 @@ class RawImage extends LeafRenderObjectWidget {
assert(
image?.debugGetOpenHandleStackTraces()?.isNotEmpty ?? true,
'Creator of a RawImage disposed of the image when the RawImage still '
'needed it.'
'needed it.',
);
return RenderImage(
image: image?.clone(),
......@@ -6017,7 +6017,7 @@ class RawImage extends LeafRenderObjectWidget {
assert(
image?.debugGetOpenHandleStackTraces()?.isNotEmpty ?? true,
'Creator of a RawImage disposed of the image when the RawImage still '
'needed it.'
'needed it.',
);
renderObject
..image = image?.clone()
......
......@@ -273,7 +273,7 @@ class Container extends StatelessWidget {
assert(decoration != null || clipBehavior == Clip.none),
assert(color == null || decoration == null,
'Cannot provide both a color and a decoration\n'
'To provide both, use "decoration: BoxDecoration(color: color)".'
'To provide both, use "decoration: BoxDecoration(color: color)".',
),
constraints =
(width != null || height != null)
......
......@@ -729,10 +729,11 @@ class FocusNode with DiagnosticableTreeMixin, ChangeNotifier {
/// Offset is the offset of the transformed widget in global coordinates.
Offset get offset {
assert(
context != null,
"Tried to get the offset of a focus node that didn't have its context set yet.\n"
'The context needs to be set before trying to evaluate traversal policies. '
'Setting the context is typically done with the attach method.');
context != null,
"Tried to get the offset of a focus node that didn't have its context set yet.\n"
'The context needs to be set before trying to evaluate traversal policies. '
'Setting the context is typically done with the attach method.',
);
final RenderObject object = context!.findRenderObject()!;
return MatrixUtils.transformPoint(object.getTransformTo(null), object.semanticBounds.topLeft);
}
......@@ -743,10 +744,11 @@ class FocusNode with DiagnosticableTreeMixin, ChangeNotifier {
/// Rect is the rectangle of the transformed widget in global coordinates.
Rect get rect {
assert(
context != null,
"Tried to get the bounds of a focus node that didn't have its context set yet.\n"
'The context needs to be set before trying to evaluate traversal policies. '
'Setting the context is typically done with the attach method.');
context != null,
"Tried to get the bounds of a focus node that didn't have its context set yet.\n"
'The context needs to be set before trying to evaluate traversal policies. '
'Setting the context is typically done with the attach method.',
);
final RenderObject object = context!.findRenderObject()!;
final Offset topLeft = MatrixUtils.transformPoint(object.getTransformTo(null), object.semanticBounds.topLeft);
final Offset bottomRight = MatrixUtils.transformPoint(object.getTransformTo(null), object.semanticBounds.bottomRight);
......
......@@ -352,7 +352,7 @@ abstract class FocusTraversalPolicy with Diagnosticable {
assert(
sortedDescendants.length <= scope.traversalDescendants.length && sortedDescendants.toSet().difference(scope.traversalDescendants.toSet()).isEmpty,
'Sorted descendants contains different nodes than FocusScopeNode.traversalDescendants would. '
'These are the different nodes: ${sortedDescendants.toSet().difference(scope.traversalDescendants.toSet())}'
'These are the different nodes: ${sortedDescendants.toSet().difference(scope.traversalDescendants.toSet())}',
);
return sortedDescendants;
}
......@@ -1161,9 +1161,10 @@ abstract class FocusOrder with Diagnosticable implements Comparable<FocusOrder>
@nonVirtual
int compareTo(FocusOrder other) {
assert(
runtimeType == other.runtimeType,
"The sorting algorithm must not compare incomparable keys, since they don't "
'know how to order themselves relative to each other. Comparing $this with $other');
runtimeType == other.runtimeType,
"The sorting algorithm must not compare incomparable keys, since they don't "
'know how to order themselves relative to each other. Comparing $this with $other',
);
return doCompare(other);
}
......
......@@ -90,7 +90,7 @@ class Form extends StatefulWidget {
assert(
autovalidate == false ||
autovalidate == true && autovalidateMode == null,
'autovalidate and autovalidateMode should not be used together.'
'autovalidate and autovalidateMode should not be used together.',
),
autovalidateMode = autovalidateMode ??
(autovalidate ? AutovalidateMode.always : AutovalidateMode.disabled),
......@@ -335,7 +335,7 @@ class FormField<T> extends StatefulWidget {
assert(
autovalidate == false ||
autovalidate == true && autovalidateMode == null,
'autovalidate and autovalidateMode should not be used together.'
'autovalidate and autovalidateMode should not be used together.',
),
autovalidateMode = autovalidateMode ??
(autovalidate ? AutovalidateMode.always : AutovalidateMode.disabled),
......
......@@ -437,7 +437,7 @@ class _HeroState extends State<Hero> {
Widget build(BuildContext context) {
assert(
context.findAncestorWidgetOfExactType<Hero>() == null,
'A Hero widget cannot be the descendant of another Hero widget.'
'A Hero widget cannot be the descendant of another Hero widget.',
);
final bool showPlaceholder = _placeholderSize != null;
......
......@@ -646,7 +646,7 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget {
assert(constraints == null || constraints.debugAssertIsValid()),
assert(color == null || decoration == null,
'Cannot provide both a color and a decoration\n'
'The color argument is just a shorthand for "decoration: BoxDecoration(color: color)".'
'The color argument is just a shorthand for "decoration: BoxDecoration(color: color)".',
),
decoration = decoration ?? (color != null ? BoxDecoration(color: color) : null),
constraints =
......
......@@ -372,7 +372,7 @@ class _FixedExtentScrollPosition extends ScrollPositionWithSingleContext impleme
String? debugLabel,
}) : assert(
context is _FixedExtentScrollableState,
'FixedExtentScrollController can only be used with ListWheelScrollViews'
'FixedExtentScrollController can only be used with ListWheelScrollViews',
),
super(
physics: physics,
......@@ -480,7 +480,7 @@ class FixedExtentScrollPhysics extends ScrollPhysics {
assert(
position is _FixedExtentScrollPosition,
'FixedExtentScrollPhysics can only be used with Scrollables that uses '
'the FixedExtentScrollController'
'the FixedExtentScrollController',
);
final _FixedExtentScrollPosition metrics = position as _FixedExtentScrollPosition;
......
......@@ -878,7 +878,7 @@ abstract class TransitionDelegate<T> {
indexOfNextRouteInNewHistory == newPageRouteHistory.length &&
exitingPageRoutes.isEmpty,
'The merged result from the $runtimeType.resolve does not include all '
'required routes. Do you remember to merge all exiting routes?'
'required routes. Do you remember to merge all exiting routes?',
);
return true;
}());
......@@ -2941,7 +2941,7 @@ class _RouteEntry extends RouteTransitionRecord {
initialState == _RouteLifecycle.add ||
initialState == _RouteLifecycle.push ||
initialState == _RouteLifecycle.pushReplace ||
initialState == _RouteLifecycle.replace
initialState == _RouteLifecycle.replace,
),
currentState = initialState;
......@@ -3095,7 +3095,7 @@ class _RouteEntry extends RouteTransitionRecord {
assert(
!hasPage || isWaitingForExitingDecision,
'A page-based route cannot be completed using imperative api, provide a '
'new list without the corresponding Page to Navigator.pages instead. '
'new list without the corresponding Page to Navigator.pages instead. ',
);
if (currentState.index >= _RouteLifecycle.remove.index)
return;
......@@ -3109,7 +3109,7 @@ class _RouteEntry extends RouteTransitionRecord {
assert(
!hasPage || isWaitingForExitingDecision,
'A page-based route cannot be completed using imperative api, provide a '
'new list without the corresponding Page to Navigator.pages instead. '
'new list without the corresponding Page to Navigator.pages instead. ',
);
if (currentState.index >= _RouteLifecycle.remove.index)
return;
......@@ -3214,7 +3214,7 @@ class _RouteEntry extends RouteTransitionRecord {
assert(
isWaitingForEnteringDecision && !isWaitingForExitingDecision,
'This route cannot be marked for push. Either a decision has already been '
'made or it does not require an explicit decision on how to transition in.'
'made or it does not require an explicit decision on how to transition in.',
);
currentState = _RouteLifecycle.push;
}
......@@ -3224,7 +3224,7 @@ class _RouteEntry extends RouteTransitionRecord {
assert(
isWaitingForEnteringDecision && !isWaitingForExitingDecision,
'This route cannot be marked for add. Either a decision has already been '
'made or it does not require an explicit decision on how to transition in.'
'made or it does not require an explicit decision on how to transition in.',
);
currentState = _RouteLifecycle.add;
}
......@@ -3234,7 +3234,7 @@ class _RouteEntry extends RouteTransitionRecord {
assert(
!isWaitingForEnteringDecision && isWaitingForExitingDecision && isPresent,
'This route cannot be marked for pop. Either a decision has already been '
'made or it does not require an explicit decision on how to transition out.'
'made or it does not require an explicit decision on how to transition out.',
);
pop<dynamic>(result);
_isWaitingForExitingDecision = false;
......@@ -3246,7 +3246,7 @@ class _RouteEntry extends RouteTransitionRecord {
!isWaitingForEnteringDecision && isWaitingForExitingDecision && isPresent,
'This route cannot be marked for complete. Either a decision has already '
'been made or it does not require an explicit decision on how to transition '
'out.'
'out.',
);
complete<dynamic>(result);
_isWaitingForExitingDecision = false;
......@@ -3258,7 +3258,7 @@ class _RouteEntry extends RouteTransitionRecord {
!isWaitingForEnteringDecision && isWaitingForExitingDecision && isPresent,
'This route cannot be marked for remove. Either a decision has already '
'been made or it does not require an explicit decision on how to transition '
'out.'
'out.',
);
remove();
_isWaitingForExitingDecision = false;
......@@ -3422,7 +3422,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
assert(
entry.route.settings == page,
'The settings getter of a page-based Route must return a Page object. '
'Please set the settings to the Page in the Page.createRoute method.'
'Please set the settings to the Page in the Page.createRoute method.',
);
_history.add(entry);
_history.addAll(_serializableHistory.restoreEntriesForPage(entry, this));
......@@ -3768,7 +3768,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
oldEntriesBottomToScan += 1;
assert(
oldEntry != null &&
oldEntry.currentState != _RouteLifecycle.disposed
oldEntry.currentState != _RouteLifecycle.disposed,
);
// Pageless routes will be recorded when we update the middle of the old
// list.
......@@ -3805,7 +3805,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
assert(
newEntry.route.settings == nextPage,
'The settings getter of a page-based Route must return a Page object. '
'Please set the settings to the Page in the Page.createRoute method.'
'Please set the settings to the Page in the Page.createRoute method.',
);
newHistory.add(newEntry);
} else {
......
......@@ -364,11 +364,11 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin {
assert(_debugVerifyInsertPosition(above, below));
assert(
entries.every((OverlayEntry entry) => !_entries.contains(entry)),
'One or more of the specified entries are already present in the Overlay.'
'One or more of the specified entries are already present in the Overlay.',
);
assert(
entries.every((OverlayEntry entry) => entry._overlay == null),
'One or more of the specified entries are already present in another Overlay.'
'One or more of the specified entries are already present in another Overlay.',
);
if (entries.isEmpty)
return;
......@@ -419,11 +419,11 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin {
assert(_debugVerifyInsertPosition(above, below, newEntries: newEntriesList));
assert(
newEntriesList.every((OverlayEntry entry) => entry._overlay == null || entry._overlay == this),
'One or more of the specified entries are already present in another Overlay.'
'One or more of the specified entries are already present in another Overlay.',
);
assert(
newEntriesList.every((OverlayEntry entry) => _entries.indexOf(entry) == _entries.lastIndexOf(entry)),
'One or more of the specified entries are specified multiple times.'
'One or more of the specified entries are specified multiple times.',
);
if (newEntriesList.isEmpty)
return;
......
......@@ -842,7 +842,7 @@ mixin RestorationMixin<S extends StatefulWidget> on State<S> {
'Property is already registered under ${property._restorationId}.',
);
assert(_debugDoingRestore || !_properties.keys.map((RestorableProperty<Object?> r) => r._restorationId).contains(restorationId),
'"$restorationId" is already registered to another property.'
'"$restorationId" is already registered to another property.',
);
final bool hasSerializedValue = bucket?.contains(restorationId) == true;
final Object? initialValue = hasSerializedValue
......@@ -863,7 +863,7 @@ mixin RestorationMixin<S extends StatefulWidget> on State<S> {
assert(
property._restorationId == restorationId &&
property._owner == this &&
_properties.containsKey(property)
_properties.containsKey(property),
);
property.initWithValue(initialValue);
......
......@@ -247,7 +247,7 @@ class Router<T> extends StatefulWidget {
(routeInformationProvider == null) == (routeInformationParser == null),
'Both routeInformationProvider and routeInformationParser must be provided '
'if this router parses route information. Otherwise, they should both '
'be null.'
'be null.',
),
assert(routerDelegate != null),
super(key: key);
......
......@@ -240,7 +240,7 @@ class ScrollDragController implements Drag {
assert(details != null),
assert(
motionStartDistanceThreshold == null || motionStartDistanceThreshold > 0.0,
'motionStartDistanceThreshold must be a positive number or null'
'motionStartDistanceThreshold must be a positive number or null',
),
_delegate = delegate,
_lastDetails = details,
......
......@@ -99,7 +99,7 @@ abstract class ScrollView extends StatelessWidget {
assert(clipBehavior != null),
assert(!(controller != null && primary == true),
'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. '
'You cannot both set primary to true and pass an explicit controller.'
'You cannot both set primary to true and pass an explicit controller.',
),
assert(!shrinkWrap || center == null),
assert(anchor != null),
......
......@@ -232,7 +232,7 @@ class SingleChildScrollView extends StatelessWidget {
assert(clipBehavior != null),
assert(!(controller != null && primary == true),
'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. '
'You cannot both set primary to true and pass an explicit controller.'
'You cannot both set primary to true and pass an explicit controller.',
),
primary = primary ?? controller == null && identical(scrollDirection, Axis.vertical),
super(key: key);
......
......@@ -722,7 +722,7 @@ class SliverChildListDelegate extends SliverChildDelegate {
final Key? key = child.key != null? _SaltedValueKey(child.key!) : null;
assert(
child != null,
"The sliver's children must not contain null values, but a null value was found at index $index"
"The sliver's children must not contain null values, but a null value was found at index $index",
);
if (addRepaintBoundaries)
child = RepaintBoundary(child: child);
......
......@@ -70,7 +70,7 @@ class Visibility extends StatelessWidget {
assert(maintainSize != null),
assert(
maintainState == true || maintainAnimation == false,
'Cannot maintain animations if the state is not also maintained.'
'Cannot maintain animations if the state is not also maintained.',
),
assert(
maintainAnimation == true || maintainSize == false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment