Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions packages/flutter/lib/src/animation/curves.dart
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,11 @@ class CatmullRomSpline extends Curve2D {


static List<List<Offset>> _computeSegments(
List<Offset> controlPoints,
double tension, {
Offset? startHandle,
Offset? endHandle,
}) {
List<Offset> controlPoints,
double tension, {
Offset? startHandle,
Offset? endHandle,
}) {
// If not specified, select the first and last control points (which are
// handles: they are not intersected by the resulting curve) so that they
// extend the first and last segments, respectively.
Expand Down Expand Up @@ -989,10 +989,10 @@ class CatmullRomCurve extends Curve {
/// In release mode, this function can be used to decide if a proposed
/// modification to the curve will result in a valid curve.
static bool validateControlPoints(
List<Offset>? controlPoints, {
double tension = 0.0,
List<String>? reasons,
}) {
List<Offset>? controlPoints, {
double tension = 0.0,
List<String>? reasons,
}) {
assert(tension != null);
if (controlPoints == null) {
assert(() {
Expand Down
14 changes: 7 additions & 7 deletions packages/flutter/lib/src/foundation/collections.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ void _movingInsertionSort<T>(
/// Allows target to be the same list as `list`, as long as it's not overlapping
/// the `start..end` range.
void _mergeSort<T>(
List<T> list,
int Function(T, T) compare,
int start,
int end,
List<T> target,
int targetOffset,
) {
List<T> list,
int Function(T, T) compare,
int start,
int end,
List<T> target,
int targetOffset,
) {
final int length = end - start;
if (length < _kMergeSortLimit) {
_movingInsertionSort<T>(list, compare, start, end, target, targetOffset);
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/lib/src/gestures/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class _Resampler {

// Schedule periodic resampling if `_timer` is not already active.
if (_timer?.isActive != true) {
_timer = Timer.periodic(_samplingInterval, (_) => _onSampleTimeChanged());
_timer = Timer.periodic(_samplingInterval, (_) => _onSampleTimeChanged());
}

// Calculate the effective frame time by taking the number
Expand Down Expand Up @@ -185,7 +185,7 @@ class _Resampler {
assert(() {
if (debugPrintResamplingMargin) {
final Duration resamplingMargin = _lastEventTime - _lastSampleTime;
debugPrint('$resamplingMargin');
debugPrint('$resamplingMargin');
}
return true;
}());
Expand Down
10 changes: 5 additions & 5 deletions packages/flutter/lib/src/gestures/resampler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ class PointerEventResampler {
}

void _dequeueAndSampleNonHoverOrMovePointerEventsUntil(
Duration sampleTime,
Duration nextSampleTime,
HandleEventCallback callback,
Duration sampleTime,
Duration nextSampleTime,
HandleEventCallback callback,
) {
Duration endTime = sampleTime;
// Scan queued events to determine end time.
Expand Down Expand Up @@ -260,8 +260,8 @@ class PointerEventResampler {
}

void _samplePointerPosition(
Duration sampleTime,
HandleEventCallback callback,
Duration sampleTime,
HandleEventCallback callback,
) {
// Position at `sampleTime`.
final Offset position = _positionAt(sampleTime);
Expand Down
36 changes: 18 additions & 18 deletions packages/flutter/lib/src/material/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -675,23 +675,23 @@ class _PackagesViewState extends State<_PackagesView> {
.asMap()
.entries
.map<Widget>((MapEntry<int, String> entry) {
final String packageName = entry.value;
final int index = entry.key;
final List<int> bindings = data.packageLicenseBindings[packageName]!;
return _PackageListTile(
packageName: packageName,
index: index,
isSelected: drawSelection && entry.key == (selectedId ?? 0),
numberLicenses: bindings.length,
onTap: () {
widget.selectedId.value = index;
_MasterDetailFlow.of(context)!.openDetailPage(_DetailArguments(
packageName,
bindings.map((int i) => data.licenses[i]).toList(growable: false),
));
},
);
}),
final String packageName = entry.value;
final int index = entry.key;
final List<int> bindings = data.packageLicenseBindings[packageName]!;
return _PackageListTile(
packageName: packageName,
index: index,
isSelected: drawSelection && entry.key == (selectedId ?? 0),
numberLicenses: bindings.length,
onTap: () {
widget.selectedId.value = index;
_MasterDetailFlow.of(context)!.openDetailPage(_DetailArguments(
packageName,
bindings.map((int i) => data.licenses[i]).toList(growable: false),
));
},
);
}),
],
);
}
Expand Down Expand Up @@ -1419,7 +1419,7 @@ class _MasterPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Scaffold(
return Scaffold(
appBar: AppBar(
title: title,
leading: leading,
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,7 @@ class _RawChipState extends State<RawChip> with MaterialStateMixin, TickerProvid
? () {
Feedback.forTap(context);
widget.onDeleted!();
}
}
: null,
child: IconTheme(
data: theme.iconTheme.copyWith(
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/ink_well.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ abstract class InteractiveInkFeature extends InkFeature {
ShapeBorder? customBorder,
BorderRadius borderRadius = BorderRadius.zero,
RectCallback? clipCallback,
}) {
}) {
assert(canvas != null);
assert(transform != null);
assert(paint != null);
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/input_decorator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat

Color _getDefaultBorderColor(ThemeData themeData) {
if (isFocused) {
return themeData.colorScheme.primary;
return themeData.colorScheme.primary;
}
if (decoration!.filled!) {
return themeData.hintColor;
Expand Down
20 changes: 10 additions & 10 deletions packages/flutter/lib/src/material/range_slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1513,12 +1513,12 @@ class _RenderRangeSlider extends RenderBox with RelayoutWhenSystemFontsChangeMix

// Create the semantics configuration for a single value.
SemanticsConfiguration _createSemanticsConfiguration(
double value,
double increasedValue,
double decreasedValue,
String? label,
VoidCallback increaseAction,
VoidCallback decreaseAction,
double value,
double increasedValue,
double decreasedValue,
String? label,
VoidCallback increaseAction,
VoidCallback decreaseAction,
) {
final SemanticsConfiguration config = SemanticsConfiguration();
config.isEnabled = isEnabled;
Expand All @@ -1544,9 +1544,9 @@ class _RenderRangeSlider extends RenderBox with RelayoutWhenSystemFontsChangeMix

@override
void assembleSemanticsNode(
SemanticsNode node,
SemanticsConfiguration config,
Iterable<SemanticsNode> children,
SemanticsNode node,
SemanticsConfiguration config,
Iterable<SemanticsNode> children,
) {
assert(children.isEmpty);

Expand Down Expand Up @@ -1609,7 +1609,7 @@ class _RenderRangeSlider extends RenderBox with RelayoutWhenSystemFontsChangeMix

void _increaseStartAction() {
if (isEnabled) {
onChanged!(RangeValues(_increasedStartValue, values.end));
onChanged!(RangeValues(_increasedStartValue, values.end));
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/scrollbar_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class ScrollbarThemeData with Diagnosticable {
MaterialStateProperty<T>? b,
double t,
T Function(T?, T?, double) lerpFunction,
) {
) {
// Avoid creating a _LerpProperties object for a common case.
if (a == null && b == null)
return null;
Expand Down
14 changes: 7 additions & 7 deletions packages/flutter/lib/src/material/slider_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2549,14 +2549,14 @@ class RectangularSliderValueIndicatorShape extends SliderComponentShape {

@override
Size getPreferredSize(
bool isEnabled,
bool isDiscrete, {
TextPainter? labelPainter,
double? textScaleFactor,
bool isEnabled,
bool isDiscrete, {
TextPainter? labelPainter,
double? textScaleFactor,
}) {
assert(labelPainter != null);
assert(textScaleFactor != null && textScaleFactor >= 0);
return _pathPainter.getPreferredSize(labelPainter!, textScaleFactor!);
assert(labelPainter != null);
assert(textScaleFactor != null && textScaleFactor >= 0);
return _pathPainter.getPreferredSize(labelPainter!, textScaleFactor!);
}

@override
Expand Down
3 changes: 2 additions & 1 deletion packages/flutter/lib/src/painting/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ mixin PaintingBinding on BindingBase, ServicesBinding {
/// unnecessary memory usage for images. Callers that wish to display an image
/// above its native resolution should prefer scaling the canvas the image is
/// drawn into.
Future<ui.Codec> instantiateImageCodec(Uint8List bytes, {
Future<ui.Codec> instantiateImageCodec(
Uint8List bytes, {
int? cacheWidth,
int? cacheHeight,
bool allowUpscaling = false,
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/image_cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ImageCache {
return;
TimelineTask? timelineTask;
if (!kReleaseMode) {
timelineTask = TimelineTask()..start(
timelineTask = TimelineTask()..start(
'ImageCache.setMaximumSize',
arguments: <String, dynamic>{'value': value},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/rendering/box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2208,7 +2208,7 @@ abstract class RenderBox extends RenderObject {
DiagnosticsProperty<Size>('The exact size it was given was', _size, style: DiagnosticsTreeStyle.errorProperty),
ErrorHint('See https://flutter.dev/docs/development/ui/layout/box-constraints for more information.'),
]);
}
}
// verify that the size is within the constraints
if (!constraints.isSatisfiedBy(_size!)) {
throw FlutterError.fromParts(<DiagnosticsNode>[
Expand Down
6 changes: 4 additions & 2 deletions packages/flutter/lib/src/rendering/layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2282,8 +2282,10 @@ class FollowerLayer extends ContainerLayer {
/// Returns null if [a] [b] do not share a common ancestor, in which case the
/// results in [ancestorsA] and [ancestorsB] are undefined.
static Layer? _pathsToCommonAncestor(
Layer? a, Layer? b,
List<ContainerLayer?> ancestorsA, List<ContainerLayer?> ancestorsB,
Layer? a,
Layer? b,
List<ContainerLayer?> ancestorsA,
List<ContainerLayer?> ancestorsB,
) {
// No common ancestor found.
if (a == null || b == null)
Expand Down
15 changes: 8 additions & 7 deletions packages/flutter/lib/src/rendering/sliver_persistent_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import 'viewport_offset.dart';

// Trims the specified edges of the given `Rect` [original], so that they do not
// exceed the given values.
Rect? _trim(Rect? original, {
Rect? _trim(
Rect? original, {
double top = -double.infinity,
double right = double.infinity,
double bottom = double.infinity,
Expand Down Expand Up @@ -636,12 +637,12 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste

final AnimationController effectiveController =
_controller ??= AnimationController(vsync: vsync!, duration: duration)
..addListener(() {
if (_effectiveScrollOffset == _animation.value)
return;
_effectiveScrollOffset = _animation.value;
markNeedsLayout();
});
..addListener(() {
if (_effectiveScrollOffset == _animation.value)
return;
_effectiveScrollOffset = _animation.value;
markNeedsLayout();
});

_animation = effectiveController.drive(
Tween<double>(
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/widgets/framework.dart
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ abstract class Widget extends DiagnosticableTree {
return widget is StatefulWidget ? 1 :
widget is StatelessWidget ? 2 :
0;
}
}
}

/// A widget that does not require mutable state.
Expand Down
32 changes: 16 additions & 16 deletions packages/flutter/lib/src/widgets/navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ class Navigator extends StatefulWidget {
BuildContext context,
String routeName, {
Object? arguments,
}) {
}) {
return Navigator.of(context).pushNamed<T>(routeName, arguments: arguments);
}

Expand Down Expand Up @@ -1950,7 +1950,7 @@ class Navigator extends StatefulWidget {
String routeName, {
TO? result,
Object? arguments,
}) {
}) {
return Navigator.of(context).popAndPushNamed<T, TO>(routeName, arguments: arguments, result: result);
}

Expand Down Expand Up @@ -1981,11 +1981,11 @@ class Navigator extends StatefulWidget {
/// {@end-tool}
@optionalTypeArgs
static String restorablePopAndPushNamed<T extends Object?, TO extends Object?>(
BuildContext context,
String routeName, {
TO? result,
Object? arguments,
}) {
BuildContext context,
String routeName, {
TO? result,
Object? arguments,
}) {
return Navigator.of(context).restorablePopAndPushNamed<T, TO>(routeName, arguments: arguments, result: result);
}

Expand Down Expand Up @@ -2086,11 +2086,11 @@ class Navigator extends StatefulWidget {
/// {@end-tool}
@optionalTypeArgs
static String restorablePushNamedAndRemoveUntil<T extends Object?>(
BuildContext context,
String newRouteName,
RoutePredicate predicate, {
Object? arguments,
}) {
BuildContext context,
String newRouteName,
RoutePredicate predicate, {
Object? arguments,
}) {
return Navigator.of(context).restorablePushNamedAndRemoveUntil<T>(newRouteName, predicate, arguments: arguments);
}

Expand Down Expand Up @@ -2728,7 +2728,7 @@ class Navigator extends StatefulWidget {
// Handles the case where the input context is a navigator element.
NavigatorState? navigator;
if (context is StatefulElement && context.state is NavigatorState) {
navigator = context.state as NavigatorState;
navigator = context.state as NavigatorState;
}
if (rootNavigator) {
navigator = context.findRootAncestorStateOfType<NavigatorState>() ?? navigator;
Expand Down Expand Up @@ -2772,9 +2772,9 @@ class Navigator extends StatefulWidget {
///
/// This method can be expensive (it walks the element tree).
static NavigatorState? maybeOf(
BuildContext context, {
bool rootNavigator = false,
}) {
BuildContext context, {
bool rootNavigator = false,
}) {
// Handles the case where the input context is a navigator element.
NavigatorState? navigator;
if (context is StatefulElement && context.state is NavigatorState) {
Expand Down
Loading