Unverified Commit a6832d4d authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

add missing trailing commas (#79299)

parent 8a3c09af
...@@ -128,7 +128,7 @@ Future<void> run(List<String> arguments) async { ...@@ -128,7 +128,7 @@ Future<void> run(List<String> arguments) async {
final RegExp _findDeprecationPattern = RegExp(r'@[Dd]eprecated'); final RegExp _findDeprecationPattern = RegExp(r'@[Dd]eprecated');
final RegExp _deprecationPattern1 = RegExp(r'^( *)@Deprecated\($'); // flutter_ignore: deprecation_syntax (see analyze.dart) final RegExp _deprecationPattern1 = RegExp(r'^( *)@Deprecated\($'); // flutter_ignore: deprecation_syntax (see analyze.dart)
final RegExp _deprecationPattern2 = RegExp(r"^ *'(.+) '$"); final RegExp _deprecationPattern2 = RegExp(r"^ *'(.+) '$");
final RegExp _deprecationPattern3 = RegExp(r"^ *'This feature was deprecated after v([0-9]+)\.([0-9]+)\.([0-9]+)(\-[0-9]+\.[0-9]+\.pre)?\.'$"); final RegExp _deprecationPattern3 = RegExp(r"^ *'This feature was deprecated after v([0-9]+)\.([0-9]+)\.([0-9]+)(\-[0-9]+\.[0-9]+\.pre)?\.',?$");
final RegExp _deprecationPattern4 = RegExp(r'^ *\)$'); final RegExp _deprecationPattern4 = RegExp(r'^ *\)$');
/// Some deprecation notices are special, for example they're used to annotate members that /// Some deprecation notices are special, for example they're used to annotate members that
......
...@@ -446,7 +446,7 @@ class AnimationController extends Animation<double> ...@@ -446,7 +446,7 @@ class AnimationController extends Animation<double>
throw FlutterError( throw FlutterError(
'AnimationController.forward() called with no default duration.\n' 'AnimationController.forward() called with no default duration.\n'
'The "duration" property should be set, either in the constructor or later, before ' 'The "duration" property should be set, either in the constructor or later, before '
'calling the forward() function.' 'calling the forward() function.',
); );
} }
return true; return true;
...@@ -479,7 +479,7 @@ class AnimationController extends Animation<double> ...@@ -479,7 +479,7 @@ class AnimationController extends Animation<double>
throw FlutterError( throw FlutterError(
'AnimationController.reverse() called with no default duration or reverseDuration.\n' 'AnimationController.reverse() called with no default duration or reverseDuration.\n'
'The "duration" or "reverseDuration" property should be set, either in the constructor or later, before ' 'The "duration" or "reverseDuration" property should be set, either in the constructor or later, before '
'calling the reverse() function.' 'calling the reverse() function.',
); );
} }
return true; return true;
...@@ -518,7 +518,7 @@ class AnimationController extends Animation<double> ...@@ -518,7 +518,7 @@ class AnimationController extends Animation<double>
'AnimationController.animateTo() called with no explicit duration and no default duration.\n' 'AnimationController.animateTo() called with no explicit duration and no default duration.\n'
'Either the "duration" argument to the animateTo() method should be provided, or the ' 'Either the "duration" argument to the animateTo() method should be provided, or the '
'"duration" property should be set, either in the constructor or later, before ' '"duration" property should be set, either in the constructor or later, before '
'calling the animateTo() function.' 'calling the animateTo() function.',
); );
} }
return true; return true;
...@@ -551,7 +551,7 @@ class AnimationController extends Animation<double> ...@@ -551,7 +551,7 @@ class AnimationController extends Animation<double>
'AnimationController.animateBack() called with no explicit duration and no default duration or reverseDuration.\n' 'AnimationController.animateBack() called with no explicit duration and no default duration or reverseDuration.\n'
'Either the "duration" argument to the animateBack() method should be provided, or the ' 'Either the "duration" argument to the animateBack() method should be provided, or the '
'"duration" or "reverseDuration" property should be set, either in the constructor or later, before ' '"duration" or "reverseDuration" property should be set, either in the constructor or later, before '
'calling the animateBack() function.' 'calling the animateBack() function.',
); );
} }
return true; return true;
...@@ -642,7 +642,7 @@ class AnimationController extends Animation<double> ...@@ -642,7 +642,7 @@ class AnimationController extends Animation<double>
'AnimationController.repeat() called without an explicit period and with no default Duration.\n' 'AnimationController.repeat() called without an explicit period and with no default Duration.\n'
'Either the "period" argument to the repeat() method should be provided, or the ' 'Either the "period" argument to the repeat() method should be provided, or the '
'"duration" property should be set, either in the constructor or later, before ' '"duration" property should be set, either in the constructor or later, before '
'calling the repeat() function.' 'calling the repeat() function.',
); );
} }
return true; return true;
......
...@@ -443,7 +443,7 @@ class CurvedAnimation extends Animation<double> with AnimationWithParentMixin<do ...@@ -443,7 +443,7 @@ class CurvedAnimation extends Animation<double> with AnimationWithParentMixin<do
'Invalid curve endpoint at $t.\n' 'Invalid curve endpoint at $t.\n'
'Curves must map 0.0 to near zero and 1.0 to near one but ' 'Curves must map 0.0 to near zero and 1.0 to near one but '
'${activeCurve.runtimeType} mapped $t to $transformedValue, which ' '${activeCurve.runtimeType} mapped $t to $transformedValue, which '
'is near $roundedTransformedValue.' 'is near $roundedTransformedValue.',
); );
} }
return true; return true;
......
...@@ -214,7 +214,7 @@ mixin AnimationLocalStatusListenersMixin { ...@@ -214,7 +214,7 @@ mixin AnimationLocalStatusListenersMixin {
stack: stack, stack: stack,
library: 'animation library', library: 'animation library',
context: ErrorDescription('while notifying status listeners for $runtimeType'), context: ErrorDescription('while notifying status listeners for $runtimeType'),
informationCollector: collector informationCollector: collector,
)); ));
} }
} }
......
...@@ -279,7 +279,7 @@ class Tween<T extends dynamic> extends Animatable<T> { ...@@ -279,7 +279,7 @@ class Tween<T extends dynamic> extends Animatable<T> {
else else
ErrorHint( ErrorHint(
'There may be a dedicated "${begin.runtimeType}Tween" for this type, ' 'There may be a dedicated "${begin.runtimeType}Tween" for this type, '
'or you may need to create one.' 'or you may need to create one.',
), ),
]); ]);
} on TypeError { } on TypeError {
...@@ -296,7 +296,7 @@ class Tween<T extends dynamic> extends Animatable<T> { ...@@ -296,7 +296,7 @@ class Tween<T extends dynamic> extends Animatable<T> {
else else
ErrorHint( ErrorHint(
'There may be a dedicated "${begin.runtimeType}Tween" for this type, ' 'There may be a dedicated "${begin.runtimeType}Tween" for this type, '
'or you may need to create one.' 'or you may need to create one.',
), ),
]); ]);
} }
......
...@@ -1334,7 +1334,7 @@ class _RenderCupertinoAlertActions extends RenderBox ...@@ -1334,7 +1334,7 @@ class _RenderCupertinoAlertActions extends RenderBox
} }
return constraints.constrain( return constraints.constrain(
Size(constraints.maxWidth, verticalOffset) Size(constraints.maxWidth, verticalOffset),
); );
} }
......
...@@ -65,7 +65,7 @@ void _animateColumnControllerToItem(FixedExtentScrollController controller, int ...@@ -65,7 +65,7 @@ void _animateColumnControllerToItem(FixedExtentScrollController controller, int
} }
const Widget _leftSelectionOverlay = CupertinoPickerDefaultSelectionOverlay(capRightEdge: false); const Widget _leftSelectionOverlay = CupertinoPickerDefaultSelectionOverlay(capRightEdge: false);
const Widget _centerSelectionOverlay = CupertinoPickerDefaultSelectionOverlay(capLeftEdge: false, capRightEdge: false,); const Widget _centerSelectionOverlay = CupertinoPickerDefaultSelectionOverlay(capLeftEdge: false, capRightEdge: false);
const Widget _rightSelectionOverlay = CupertinoPickerDefaultSelectionOverlay(capLeftEdge: false); const Widget _rightSelectionOverlay = CupertinoPickerDefaultSelectionOverlay(capLeftEdge: false);
// Lays out the date picker based on how much space each single column needs. // Lays out the date picker based on how much space each single column needs.
...@@ -803,7 +803,7 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> { ...@@ -803,7 +803,7 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
}), }),
looping: true, looping: true,
selectionOverlay: selectionOverlay, selectionOverlay: selectionOverlay,
) ),
); );
} }
...@@ -1757,10 +1757,12 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -1757,10 +1757,12 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
setState(() { setState(() {
selectedHour = index; selectedHour = index;
widget.onTimerDurationChanged( widget.onTimerDurationChanged(
Duration( Duration(
hours: selectedHour!, hours: selectedHour!,
minutes: selectedMinute, minutes: selectedMinute,
seconds: selectedSecond ?? 0)); seconds: selectedSecond ?? 0,
),
);
}); });
}, },
children: List<Widget>.generate(24, (int index) { children: List<Widget>.generate(24, (int index) {
...@@ -1810,7 +1812,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -1810,7 +1812,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
magnification: _kMagnification, magnification: _kMagnification,
offAxisFraction: _calculateOffAxisFraction( offAxisFraction: _calculateOffAxisFraction(
additionalPadding.start, additionalPadding.start,
widget.mode == CupertinoTimerPickerMode.ms ? 0 : 1 widget.mode == CupertinoTimerPickerMode.ms ? 0 : 1,
), ),
itemExtent: _kItemExtent, itemExtent: _kItemExtent,
backgroundColor: widget.backgroundColor, backgroundColor: widget.backgroundColor,
...@@ -1820,10 +1822,12 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -1820,10 +1822,12 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
setState(() { setState(() {
selectedMinute = index * widget.minuteInterval; selectedMinute = index * widget.minuteInterval;
widget.onTimerDurationChanged( widget.onTimerDurationChanged(
Duration( Duration(
hours: selectedHour ?? 0, hours: selectedHour ?? 0,
minutes: selectedMinute, minutes: selectedMinute,
seconds: selectedSecond ?? 0)); seconds: selectedSecond ?? 0,
),
);
}); });
}, },
children: List<Widget>.generate(60 ~/ widget.minuteInterval, (int index) { children: List<Widget>.generate(60 ~/ widget.minuteInterval, (int index) {
...@@ -1874,7 +1878,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -1874,7 +1878,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
magnification: _kMagnification, magnification: _kMagnification,
offAxisFraction: _calculateOffAxisFraction( offAxisFraction: _calculateOffAxisFraction(
additionalPadding.start, additionalPadding.start,
widget.mode == CupertinoTimerPickerMode.ms ? 1 : 2 widget.mode == CupertinoTimerPickerMode.ms ? 1 : 2,
), ),
itemExtent: _kItemExtent, itemExtent: _kItemExtent,
backgroundColor: widget.backgroundColor, backgroundColor: widget.backgroundColor,
...@@ -1884,10 +1888,12 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -1884,10 +1888,12 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
setState(() { setState(() {
selectedSecond = index * widget.secondInterval; selectedSecond = index * widget.secondInterval;
widget.onTimerDurationChanged( widget.onTimerDurationChanged(
Duration( Duration(
hours: selectedHour ?? 0, hours: selectedHour ?? 0,
minutes: selectedMinute, minutes: selectedMinute,
seconds: selectedSecond!)); seconds: selectedSecond!,
),
);
}); });
}, },
children: List<Widget>.generate(60 ~/ widget.secondInterval, (int index) { children: List<Widget>.generate(60 ~/ widget.secondInterval, (int index) {
...@@ -1935,7 +1941,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -1935,7 +1941,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
TextStyle _textStyleFrom(BuildContext context, [double magnification = 1.0]) { TextStyle _textStyleFrom(BuildContext context, [double magnification = 1.0]) {
final TextStyle textStyle = CupertinoTheme.of(context).textTheme.pickerTextStyle; final TextStyle textStyle = CupertinoTheme.of(context).textTheme.pickerTextStyle;
return textStyle.copyWith( return textStyle.copyWith(
fontSize: textStyle.fontSize! * magnification fontSize: textStyle.fontSize! * magnification,
); );
} }
...@@ -2000,16 +2006,16 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -2000,16 +2006,16 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
_buildHourColumn( _buildHourColumn(
EdgeInsetsDirectional.only( EdgeInsetsDirectional.only(
start: hourColumnStartPadding, start: hourColumnStartPadding,
end: pickerColumnWidth - hourColumnStartPadding - hourLabelContentWidth end: pickerColumnWidth - hourColumnStartPadding - hourLabelContentWidth,
), ),
_leftSelectionOverlay _leftSelectionOverlay,
), ),
_buildMinuteColumn( _buildMinuteColumn(
EdgeInsetsDirectional.only( EdgeInsetsDirectional.only(
start: pickerColumnWidth - minuteColumnEndPadding - minuteLabelContentWidth, start: pickerColumnWidth - minuteColumnEndPadding - minuteLabelContentWidth,
end: minuteColumnEndPadding end: minuteColumnEndPadding,
), ),
_rightSelectionOverlay _rightSelectionOverlay,
), ),
]; ];
break; break;
...@@ -2029,16 +2035,16 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -2029,16 +2035,16 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
_buildMinuteColumn( _buildMinuteColumn(
EdgeInsetsDirectional.only( EdgeInsetsDirectional.only(
start: minuteColumnStartPadding, start: minuteColumnStartPadding,
end: pickerColumnWidth - minuteColumnStartPadding - minuteLabelContentWidth end: pickerColumnWidth - minuteColumnStartPadding - minuteLabelContentWidth,
), ),
_leftSelectionOverlay _leftSelectionOverlay,
), ),
_buildSecondColumn( _buildSecondColumn(
EdgeInsetsDirectional.only( EdgeInsetsDirectional.only(
start: pickerColumnWidth - secondColumnEndPadding - minuteLabelContentWidth, start: pickerColumnWidth - secondColumnEndPadding - minuteLabelContentWidth,
end: secondColumnEndPadding end: secondColumnEndPadding,
), ),
_rightSelectionOverlay _rightSelectionOverlay,
), ),
]; ];
break; break;
...@@ -2054,23 +2060,23 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> { ...@@ -2054,23 +2060,23 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
_buildHourColumn( _buildHourColumn(
EdgeInsetsDirectional.only( EdgeInsetsDirectional.only(
start: _kTimerPickerMinHorizontalPadding, start: _kTimerPickerMinHorizontalPadding,
end: math.max(hourColumnEndPadding, 0) end: math.max(hourColumnEndPadding, 0),
), ),
_leftSelectionOverlay _leftSelectionOverlay,
), ),
_buildMinuteColumn( _buildMinuteColumn(
EdgeInsetsDirectional.only( EdgeInsetsDirectional.only(
start: minuteColumnPadding, start: minuteColumnPadding,
end: minuteColumnPadding end: minuteColumnPadding,
), ),
_centerSelectionOverlay _centerSelectionOverlay,
), ),
_buildSecondColumn( _buildSecondColumn(
EdgeInsetsDirectional.only( EdgeInsetsDirectional.only(
start: math.max(secondColumnStartPadding, 0), start: math.max(secondColumnStartPadding, 0),
end: _kTimerPickerMinHorizontalPadding end: _kTimerPickerMinHorizontalPadding,
), ),
_rightSelectionOverlay _rightSelectionOverlay,
), ),
]; ];
break; break;
......
...@@ -24,19 +24,19 @@ bool debugCheckHasCupertinoLocalizations(BuildContext context) { ...@@ -24,19 +24,19 @@ bool debugCheckHasCupertinoLocalizations(BuildContext context) {
ErrorSummary('No CupertinoLocalizations found.'), ErrorSummary('No CupertinoLocalizations found.'),
ErrorDescription( ErrorDescription(
'${context.widget.runtimeType} widgets require CupertinoLocalizations ' '${context.widget.runtimeType} widgets require CupertinoLocalizations '
'to be provided by a Localizations widget ancestor.' 'to be provided by a Localizations widget ancestor.',
), ),
ErrorDescription( ErrorDescription(
'The cupertino library uses Localizations to generate messages, ' 'The cupertino library uses Localizations to generate messages, '
'labels, and abbreviations.' 'labels, and abbreviations.',
), ),
ErrorHint( ErrorHint(
'To introduce a CupertinoLocalizations, either use a ' 'To introduce a CupertinoLocalizations, either use a '
'CupertinoApp at the root of your application to include them ' 'CupertinoApp at the root of your application to include them '
'automatically, or add a Localization widget with a ' 'automatically, or add a Localization widget with a '
'CupertinoLocalizations delegate.' 'CupertinoLocalizations delegate.',
), ),
...context.describeMissingAncestor(expectedAncestorType: CupertinoLocalizations) ...context.describeMissingAncestor(expectedAncestorType: CupertinoLocalizations),
]); ]);
} }
return true; return true;
......
...@@ -1537,7 +1537,7 @@ class _RenderCupertinoDialogActions extends RenderBox ...@@ -1537,7 +1537,7 @@ class _RenderCupertinoDialogActions extends RenderBox
); );
return constraints.constrain( return constraints.constrain(
Size(dialogWidth, childSize.height) Size(dialogWidth, childSize.height),
); );
} else { } else {
// Each button gets half the available width, minus a single divider. // Each button gets half the available width, minus a single divider.
...@@ -1609,7 +1609,7 @@ class _RenderCupertinoDialogActions extends RenderBox ...@@ -1609,7 +1609,7 @@ class _RenderCupertinoDialogActions extends RenderBox
// Our height is the accumulated height of all buttons and dividers. // Our height is the accumulated height of all buttons and dividers.
return constraints.constrain( return constraints.constrain(
Size(dialogWidth, verticalOffset) Size(dialogWidth, verticalOffset),
); );
} }
} }
......
...@@ -259,14 +259,13 @@ class CupertinoFormSection extends StatelessWidget { ...@@ -259,14 +259,13 @@ class CupertinoFormSection extends StatelessWidget {
// Refactored the decorate children group in one place to avoid repeating it // Refactored the decorate children group in one place to avoid repeating it
// twice down bellow in the returned widget. // twice down bellow in the returned widget.
final DecoratedBox decoratedChildrenGroup = DecoratedBox( final DecoratedBox decoratedChildrenGroup = DecoratedBox(
decoration: decoration ?? decoration: decoration ?? BoxDecoration(
BoxDecoration( color: CupertinoDynamicColor.resolve(
color: CupertinoDynamicColor.resolve( decoration?.color ?? CupertinoColors.secondarySystemGroupedBackground,
decoration?.color ?? context,
CupertinoColors.secondarySystemGroupedBackground, ),
context), borderRadius: childrenGroupBorderRadius,
borderRadius: childrenGroupBorderRadius, ),
),
child: Column( child: Column(
children: childrenWithDividers, children: childrenWithDividers,
), ),
...@@ -295,11 +294,12 @@ class CupertinoFormSection extends StatelessWidget { ...@@ -295,11 +294,12 @@ class CupertinoFormSection extends StatelessWidget {
Padding( Padding(
padding: margin, padding: margin,
child: clipBehavior == Clip.none child: clipBehavior == Clip.none
? decoratedChildrenGroup ? decoratedChildrenGroup
: ClipRRect( : ClipRRect(
borderRadius: childrenGroupBorderRadius, borderRadius: childrenGroupBorderRadius,
clipBehavior: clipBehavior, clipBehavior: clipBehavior,
child: decoratedChildrenGroup), child: decoratedChildrenGroup,
),
), ),
if (footer != null) if (footer != null)
Align( Align(
......
...@@ -76,7 +76,7 @@ class CupertinoUserInterfaceLevel extends InheritedWidget { ...@@ -76,7 +76,7 @@ class CupertinoUserInterfaceLevel extends InheritedWidget {
'MaterialApp widget (those widgets introduce a CupertinoUserInterfaceLevel), or it can happen ' 'MaterialApp widget (those widgets introduce a CupertinoUserInterfaceLevel), or it can happen '
'if the context you use comes from a widget above those widgets.\n' 'if the context you use comes from a widget above those widgets.\n'
'The context used was:\n' 'The context used was:\n'
' $context' ' $context',
); );
} }
......
...@@ -848,7 +848,7 @@ class _CupertinoEdgeShadowDecoration extends Decoration { ...@@ -848,7 +848,7 @@ class _CupertinoEdgeShadowDecoration extends Decoration {
<Color>[ <Color>[
for (int i = 0; i < b._colors!.length; i += 1) for (int i = 0; i < b._colors!.length; i += 1)
Color.lerp(a._colors?[i], b._colors?[i], t)!, Color.lerp(a._colors?[i], b._colors?[i], t)!,
] ],
); );
} }
......
...@@ -365,12 +365,15 @@ class _CupertinoSearchTextFieldState extends State<CupertinoSearchTextField> ...@@ -365,12 +365,15 @@ class _CupertinoSearchTextFieldState extends State<CupertinoSearchTextField>
); );
final IconThemeData iconThemeData = IconThemeData( final IconThemeData iconThemeData = IconThemeData(
color: CupertinoDynamicColor.resolve(widget.itemColor, context), color: CupertinoDynamicColor.resolve(widget.itemColor, context),
size: scaledIconSize); size: scaledIconSize,
);
final Widget prefix = Padding( final Widget prefix = Padding(
child: IconTheme( child: IconTheme(
child: const Icon(CupertinoIcons.search), data: iconThemeData), data: iconThemeData,
child: const Icon(CupertinoIcons.search),
),
padding: widget.prefixInsets, padding: widget.prefixInsets,
); );
......
...@@ -130,7 +130,7 @@ class _SegmentState<T> extends State<_Segment<T>> with TickerProviderStateMixin< ...@@ -130,7 +130,7 @@ class _SegmentState<T> extends State<_Segment<T>> with TickerProviderStateMixin<
highlightPressScaleAnimation = highlightPressScaleController.drive( highlightPressScaleAnimation = highlightPressScaleController.drive(
Tween<double>( Tween<double>(
begin: highlightPressScaleAnimation.value, begin: highlightPressScaleAnimation.value,
end: widget.shouldScaleContent ? _kMinThumbScale : 1.0 end: widget.shouldScaleContent ? _kMinThumbScale : 1.0,
), ),
); );
highlightPressScaleController.animateWith(_kThumbSpringAnimationSimulation); highlightPressScaleController.animateWith(_kThumbSpringAnimationSimulation);
...@@ -166,7 +166,7 @@ class _SegmentState<T> extends State<_Segment<T>> with TickerProviderStateMixin< ...@@ -166,7 +166,7 @@ class _SegmentState<T> extends State<_Segment<T>> with TickerProviderStateMixin<
scale: highlightPressScaleAnimation, scale: highlightPressScaleAnimation,
child: widget.child, child: widget.child,
), ),
) ),
), ),
// The entire widget will assume the size of this widget, so when a // The entire widget will assume the size of this widget, so when a
// segment's "highlight" animation plays the size of the parent stays // segment's "highlight" animation plays the size of the parent stays
...@@ -520,7 +520,7 @@ class _SegmentedControlState<T> extends State<CupertinoSlidingSegmentedControl<T ...@@ -520,7 +520,7 @@ class _SegmentedControlState<T> extends State<CupertinoSlidingSegmentedControl<T
Tween<double>( Tween<double>(
begin: thumbScaleAnimation.value, begin: thumbScaleAnimation.value,
end: isExpanding ? 1 : _kMinThumbScale, end: isExpanding ? 1 : _kMinThumbScale,
) ),
); );
thumbScaleController.animateWith(_kThumbSpringAnimationSimulation); thumbScaleController.animateWith(_kThumbSpringAnimationSimulation);
} }
......
...@@ -209,7 +209,7 @@ class _CupertinoTabViewState extends State<CupertinoTabView> { ...@@ -209,7 +209,7 @@ class _CupertinoTabViewState extends State<CupertinoTabView> {
' 3. Otherwise, onGenerateRoute is called. It should return a ' ' 3. Otherwise, onGenerateRoute is called. It should return a '
'non-null value for any valid route not handled by "builder" and "routes".\n' 'non-null value for any valid route not handled by "builder" and "routes".\n'
' 4. Finally if all else fails onUnknownRoute is called.\n' ' 4. Finally if all else fails onUnknownRoute is called.\n'
'Unfortunately, onUnknownRoute was not set.' 'Unfortunately, onUnknownRoute was not set.',
); );
} }
return true; return true;
...@@ -221,7 +221,7 @@ class _CupertinoTabViewState extends State<CupertinoTabView> { ...@@ -221,7 +221,7 @@ class _CupertinoTabViewState extends State<CupertinoTabView> {
'The onUnknownRoute callback returned null.\n' 'The onUnknownRoute callback returned null.\n'
'When the $runtimeType requested the route $settings from its ' 'When the $runtimeType requested the route $settings from its '
'onUnknownRoute callback, the callback returned null. Such callbacks ' 'onUnknownRoute callback, the callback returned null. Such callbacks '
'must never return null.' 'must never return null.',
); );
} }
return true; return true;
......
...@@ -268,7 +268,7 @@ class CupertinoTextField extends StatefulWidget { ...@@ -268,7 +268,7 @@ class CupertinoTextField extends StatefulWidget {
@Deprecated( @Deprecated(
'Use maxLengthEnforcement parameter which provides more specific ' 'Use maxLengthEnforcement parameter which provides more specific '
'behavior related to the maxLength limit. ' 'behavior related to the maxLength limit. '
'This feature was deprecated after v1.25.0-5.0.pre.' 'This feature was deprecated after v1.25.0-5.0.pre.',
) )
this.maxLengthEnforced = true, this.maxLengthEnforced = true,
this.maxLengthEnforcement, this.maxLengthEnforcement,
...@@ -419,7 +419,7 @@ class CupertinoTextField extends StatefulWidget { ...@@ -419,7 +419,7 @@ class CupertinoTextField extends StatefulWidget {
@Deprecated( @Deprecated(
'Use maxLengthEnforcement parameter which provides more specific ' 'Use maxLengthEnforcement parameter which provides more specific '
'behavior related to the maxLength limit. ' 'behavior related to the maxLength limit. '
'This feature was deprecated after v1.25.0-5.0.pre.' 'This feature was deprecated after v1.25.0-5.0.pre.',
) )
this.maxLengthEnforced = true, this.maxLengthEnforced = true,
this.maxLengthEnforcement, this.maxLengthEnforcement,
...@@ -668,7 +668,7 @@ class CupertinoTextField extends StatefulWidget { ...@@ -668,7 +668,7 @@ class CupertinoTextField extends StatefulWidget {
@Deprecated( @Deprecated(
'Use maxLengthEnforcement parameter which provides more specific ' 'Use maxLengthEnforcement parameter which provides more specific '
'behavior related to the maxLength limit. ' 'behavior related to the maxLength limit. '
'This feature was deprecated after v1.25.0-5.0.pre.' 'This feature was deprecated after v1.25.0-5.0.pre.',
) )
final bool maxLengthEnforced; final bool maxLengthEnforced;
......
...@@ -295,7 +295,7 @@ class _RenderCupertinoTextSelectionToolbarShape extends RenderShiftedBox { ...@@ -295,7 +295,7 @@ class _RenderCupertinoTextSelectionToolbarShape extends RenderShiftedBox {
Offset.zero & child!.size, Offset.zero & child!.size,
_clipPath(), _clipPath(),
(PaintingContext innerContext, Offset innerOffset) => innerContext.paintChild(child!, innerOffset), (PaintingContext innerContext, Offset innerOffset) => innerContext.paintChild(child!, innerOffset),
oldLayer: _clipPathLayer oldLayer: _clipPathLayer,
); );
} }
......
...@@ -33,7 +33,7 @@ platform.TargetPlatform get defaultTargetPlatform { ...@@ -33,7 +33,7 @@ platform.TargetPlatform get defaultTargetPlatform {
throw FlutterError( throw FlutterError(
'Unknown platform.\n' 'Unknown platform.\n'
'${Platform.operatingSystem} was not recognized as a target platform. ' '${Platform.operatingSystem} was not recognized as a target platform. '
'Consider updating the list of TargetPlatforms to include this platform.' 'Consider updating the list of TargetPlatforms to include this platform.',
); );
} }
return result!; return result!;
......
...@@ -676,7 +676,7 @@ class FlutterErrorDetails with Diagnosticable { ...@@ -676,7 +676,7 @@ class FlutterErrorDetails with Diagnosticable {
'provide substantially more information in this error message to help you determine ' 'provide substantially more information in this error message to help you determine '
'and fix the underlying cause.\n' 'and fix the underlying cause.\n'
'In either case, please report this assertion by filing a bug on GitHub:\n' 'In either case, please report this assertion by filing a bug on GitHub:\n'
' https://github.com/flutter/flutter/issues/new?template=2_bug.md' ' https://github.com/flutter/flutter/issues/new?template=2_bug.md',
)); ));
} }
} }
...@@ -802,14 +802,14 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti ...@@ -802,14 +802,14 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
ErrorSummary('FlutterError is missing a summary.'), ErrorSummary('FlutterError is missing a summary.'),
ErrorDescription( ErrorDescription(
'All FlutterError objects should start with a short (one line) ' 'All FlutterError objects should start with a short (one line) '
'summary description of the problem that was detected.' 'summary description of the problem that was detected.',
), ),
DiagnosticsProperty<FlutterError>('Malformed', this, expandableValue: true, showSeparator: false, style: DiagnosticsTreeStyle.whitespace), DiagnosticsProperty<FlutterError>('Malformed', this, expandableValue: true, showSeparator: false, style: DiagnosticsTreeStyle.whitespace),
ErrorDescription( ErrorDescription(
'\nThis error should still help you solve your problem, ' '\nThis error should still help you solve your problem, '
'however please also report this malformed error in the ' 'however please also report this malformed error in the '
'framework by filing a bug on GitHub:\n' 'framework by filing a bug on GitHub:\n'
' https://github.com/flutter/flutter/issues/new?template=2_bug.md' ' https://github.com/flutter/flutter/issues/new?template=2_bug.md',
), ),
], ],
)); ));
...@@ -821,7 +821,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti ...@@ -821,7 +821,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
ErrorDescription( ErrorDescription(
'All FlutterError objects should have only a single short ' 'All FlutterError objects should have only a single short '
'(one line) summary description of the problem that was ' '(one line) summary description of the problem that was '
'detected.' 'detected.',
), ),
DiagnosticsProperty<FlutterError>('Malformed', this, expandableValue: true, showSeparator: false, style: DiagnosticsTreeStyle.whitespace), DiagnosticsProperty<FlutterError>('Malformed', this, expandableValue: true, showSeparator: false, style: DiagnosticsTreeStyle.whitespace),
ErrorDescription('\nThe malformed error has ${summaries.length} summaries.'), ErrorDescription('\nThe malformed error has ${summaries.length} summaries.'),
...@@ -835,7 +835,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti ...@@ -835,7 +835,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
'\nThis error should still help you solve your problem, ' '\nThis error should still help you solve your problem, '
'however please also report this malformed error in the ' 'however please also report this malformed error in the '
'framework by filing a bug on GitHub:\n' 'framework by filing a bug on GitHub:\n'
' https://github.com/flutter/flutter/issues/new?template=2_bug.md' ' https://github.com/flutter/flutter/issues/new?template=2_bug.md',
)); ));
throw FlutterError.fromParts(message); throw FlutterError.fromParts(message);
} }
...@@ -1065,7 +1065,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti ...@@ -1065,7 +1065,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
final List<String> where = <String>[ final List<String> where = <String>[
for (MapEntry<String, int> entry in removedPackagesAndClasses.entries) for (MapEntry<String, int> entry in removedPackagesAndClasses.entries)
if (entry.value > 0) if (entry.value > 0)
entry.key entry.key,
]..sort(); ]..sort();
if (skipped == 1) { if (skipped == 1) {
result.add('(elided one frame from ${where.single})'); result.add('(elided one frame from ${where.single})');
......
...@@ -116,7 +116,7 @@ class ChangeNotifier implements Listenable { ...@@ -116,7 +116,7 @@ class ChangeNotifier implements Listenable {
if (_listeners == null) { if (_listeners == null) {
throw FlutterError( throw FlutterError(
'A $runtimeType was used after being disposed.\n' 'A $runtimeType was used after being disposed.\n'
'Once you have called dispose() on a $runtimeType, it can no longer be used.' 'Once you have called dispose() on a $runtimeType, it can no longer be used.',
); );
} }
return true; return true;
......
...@@ -786,8 +786,8 @@ class _PrefixedStringBuilder { ...@@ -786,8 +786,8 @@ class _PrefixedStringBuilder {
_PrefixedStringBuilder({ _PrefixedStringBuilder({
required this.prefixLineOne, required this.prefixLineOne,
required String? prefixOtherLines, required String? prefixOtherLines,
this.wrapWidth}) : this.wrapWidth,
_prefixOtherLines = prefixOtherLines; }) : _prefixOtherLines = prefixOtherLines;
/// Prefix to add to the first line. /// Prefix to add to the first line.
final String prefixLineOne; final String prefixLineOne;
...@@ -1124,10 +1124,11 @@ class TextTreeRenderer { ...@@ -1124,10 +1124,11 @@ class TextTreeRenderer {
return ''; return '';
} else { } else {
return _debugRender( return _debugRender(
node, node,
prefixLineOne: prefixLineOne, prefixLineOne: prefixLineOne,
prefixOtherLines: prefixOtherLines, prefixOtherLines: prefixOtherLines,
parentConfiguration: parentConfiguration); parentConfiguration: parentConfiguration,
);
} }
} }
...@@ -1246,7 +1247,7 @@ class TextTreeRenderer { ...@@ -1246,7 +1247,7 @@ class TextTreeRenderer {
} }
final Iterable<DiagnosticsNode> propertiesIterable = node.getProperties().where( final Iterable<DiagnosticsNode> propertiesIterable = node.getProperties().where(
(DiagnosticsNode n) => !n.isFiltered(_minLevel) (DiagnosticsNode n) => !n.isFiltered(_minLevel),
); );
List<DiagnosticsNode> properties; List<DiagnosticsNode> properties;
if (_maxDescendentsTruncatableNode >= 0 && node.allowTruncate) { if (_maxDescendentsTruncatableNode >= 0 && node.allowTruncate) {
...@@ -1657,8 +1658,7 @@ abstract class DiagnosticsNode { ...@@ -1657,8 +1658,7 @@ abstract class DiagnosticsNode {
assert(minLevel != null); assert(minLevel != null);
assert(() { assert(() {
if (_isSingleLine(style)) { if (_isSingleLine(style)) {
result = toStringDeep( result = toStringDeep(parentConfiguration: parentConfiguration, minLevel: minLevel);
parentConfiguration: parentConfiguration, minLevel: minLevel);
} else { } else {
final String description = toDescription(parentConfiguration: parentConfiguration)!; final String description = toDescription(parentConfiguration: parentConfiguration)!;
......
...@@ -429,8 +429,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer { ...@@ -429,8 +429,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
globalPosition: _longPressOrigin!.global, globalPosition: _longPressOrigin!.global,
localPosition: _longPressOrigin!.local, localPosition: _longPressOrigin!.local,
); );
invokeCallback<void>( invokeCallback<void>('onSecondaryLongPressStart', () => onSecondaryLongPressStart!(details));
'onSecondaryLongPressStart', () => onSecondaryLongPressStart!(details));
} }
if (onSecondaryLongPress != null) { if (onSecondaryLongPress != null) {
invokeCallback<void>('onSecondaryLongPress', onSecondaryLongPress!); invokeCallback<void>('onSecondaryLongPress', onSecondaryLongPress!);
...@@ -442,8 +441,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer { ...@@ -442,8 +441,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
globalPosition: _longPressOrigin!.global, globalPosition: _longPressOrigin!.global,
localPosition: _longPressOrigin!.local, localPosition: _longPressOrigin!.local,
); );
invokeCallback<void>( invokeCallback<void>('onTertiaryLongPressStart', () => onTertiaryLongPressStart!(details));
'onTertiaryLongPressStart', () => onTertiaryLongPressStart!(details));
} }
if (onTertiaryLongPress != null) { if (onTertiaryLongPress != null) {
invokeCallback<void>('onTertiaryLongPress', onTertiaryLongPress!); invokeCallback<void>('onTertiaryLongPress', onTertiaryLongPress!);
......
...@@ -106,7 +106,7 @@ class PointerRouter { ...@@ -106,7 +106,7 @@ class PointerRouter {
stack: stack, stack: stack,
library: 'gesture library', library: 'gesture library',
context: ErrorDescription('while routing a pointer event'), context: ErrorDescription('while routing a pointer event'),
informationCollector: collector informationCollector: collector,
)); ));
} }
} }
......
...@@ -210,7 +210,7 @@ class PointerSignalResolver { ...@@ -210,7 +210,7 @@ class PointerSignalResolver {
stack: stack, stack: stack,
library: 'gesture library', library: 'gesture library',
context: ErrorDescription('while resolving a PointerSignalEvent'), context: ErrorDescription('while resolving a PointerSignalEvent'),
informationCollector: collector informationCollector: collector,
)); ));
} }
_firstRegisteredCallback = null; _firstRegisteredCallback = null;
......
...@@ -194,7 +194,7 @@ abstract class GestureRecognizer extends GestureArenaMember with DiagnosticableT ...@@ -194,7 +194,7 @@ abstract class GestureRecognizer extends GestureArenaMember with DiagnosticableT
stack: stack, stack: stack,
library: 'gesture', library: 'gesture',
context: ErrorDescription('while handling a gesture'), context: ErrorDescription('while handling a gesture'),
informationCollector: collector informationCollector: collector,
)); ));
} }
return result; return result;
......
...@@ -141,7 +141,9 @@ class GestureArenaTeam { ...@@ -141,7 +141,9 @@ class GestureArenaTeam {
/// [OneSequenceGestureRecognizer.team]. /// [OneSequenceGestureRecognizer.team].
GestureArenaEntry add(int pointer, GestureArenaMember member) { GestureArenaEntry add(int pointer, GestureArenaMember member) {
final _CombiningGestureArenaMember combiner = _combiners.putIfAbsent( final _CombiningGestureArenaMember combiner = _combiners.putIfAbsent(
pointer, () => _CombiningGestureArenaMember(this, pointer)); pointer,
() => _CombiningGestureArenaMember(this, pointer),
);
return combiner._add(pointer, member); return combiner._add(pointer, member);
} }
} }
...@@ -31,14 +31,12 @@ class Velocity { ...@@ -31,14 +31,12 @@ class Velocity {
/// Return the difference of two velocities. /// Return the difference of two velocities.
Velocity operator -(Velocity other) { Velocity operator -(Velocity other) {
return Velocity( return Velocity(pixelsPerSecond: pixelsPerSecond - other.pixelsPerSecond);
pixelsPerSecond: pixelsPerSecond - other.pixelsPerSecond);
} }
/// Return the sum of two velocities. /// Return the sum of two velocities.
Velocity operator +(Velocity other) { Velocity operator +(Velocity other) {
return Velocity( return Velocity(pixelsPerSecond: pixelsPerSecond + other.pixelsPerSecond);
pixelsPerSecond: pixelsPerSecond + other.pixelsPerSecond);
} }
/// Return a velocity whose magnitude has been clamped to [minValue] /// Return a velocity whose magnitude has been clamped to [minValue]
...@@ -149,7 +147,7 @@ class VelocityTracker { ...@@ -149,7 +147,7 @@ class VelocityTracker {
/// Create a new velocity tracker for a pointer [kind]. /// Create a new velocity tracker for a pointer [kind].
@Deprecated( @Deprecated(
'Use VelocityTracker.withKind and provide the PointerDeviceKind associated with the gesture being tracked. ' 'Use VelocityTracker.withKind and provide the PointerDeviceKind associated with the gesture being tracked. '
'This feature was deprecated after v1.22.0-12.1.pre.' 'This feature was deprecated after v1.22.0-12.1.pre.',
) )
VelocityTracker([this.kind = PointerDeviceKind.touch]); VelocityTracker([this.kind = PointerDeviceKind.touch]);
...@@ -304,7 +302,7 @@ class IOSScrollViewFlingVelocityTracker extends VelocityTracker { ...@@ -304,7 +302,7 @@ class IOSScrollViewFlingVelocityTracker extends VelocityTracker {
return true; return true;
throw FlutterError( throw FlutterError(
'The position being added ($position) has a smaller timestamp ($time) ' 'The position being added ($position) has a smaller timestamp ($time) '
'than its predecessor: $previousPoint.' 'than its predecessor: $previousPoint.',
); );
}()); }());
_index = (_index + 1) % _sampleSize; _index = (_index + 1) % _sampleSize;
......
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