fix block formatting (#29051)

This commit is contained in:
Alexandre Ardhuin 2019-03-09 09:03:11 +01:00 committed by GitHub
parent 0d3c150cfc
commit a0d1f93b07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
107 changed files with 412 additions and 418 deletions

View File

@ -67,7 +67,7 @@ class _CupertinoPickerDemoState extends State<CupertinoPickerDemo> {
),
child: GestureDetector(
// Blocks taps from propagating to the modal sheet and popping.
onTap: () {},
onTap: () { },
child: SafeArea(
top: false,
child: picker,

View File

@ -513,7 +513,7 @@ class _DiamondBorder extends ShapeBorder {
}
@override
void paint(Canvas canvas, Rect rect, { TextDirection textDirection }) {}
void paint(Canvas canvas, Rect rect, { TextDirection textDirection }) { }
// This border doesn't support scaling.
@override

View File

@ -60,7 +60,7 @@ class _SearchDemoState extends State<SearchDemo> {
? Icons.more_horiz
: Icons.more_vert,
),
onPressed: () {},
onPressed: () { },
),
],
),

View File

@ -361,7 +361,7 @@ class _RecipePageState extends State<RecipePage> {
backgroundColor: Colors.transparent,
actions: <Widget>[
PopupMenuButton<String>(
onSelected: (String item) {},
onSelected: (String item) { },
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
_buildMenuItem(Icons.share, 'Tweet recipe'),
_buildMenuItem(Icons.email, 'Email recipe'),

View File

@ -118,18 +118,16 @@ class CutCornersBorder extends OutlineInputBorder {
} else {
final double extent = lerpDouble(0.0, gapExtent + gapPadding * 2.0, gapPercentage);
switch (textDirection) {
case TextDirection.rtl:
{
final Path path = _notchedCornerPath(outer.middleRect, gapStart + gapPadding - extent, extent);
canvas.drawPath(path, paint);
break;
}
case TextDirection.ltr:
{
final Path path = _notchedCornerPath(outer.middleRect, gapStart - gapPadding, extent);
canvas.drawPath(path, paint);
break;
}
case TextDirection.rtl: {
final Path path = _notchedCornerPath(outer.middleRect, gapStart + gapPadding - extent, extent);
canvas.drawPath(path, paint);
break;
}
case TextDirection.ltr: {
final Path path = _notchedCornerPath(outer.middleRect, gapStart - gapPadding, extent);
canvas.drawPath(path, paint);
break;
}
}
}
}

View File

@ -144,7 +144,7 @@ class _VideoPlayPauseState extends State<VideoPlayPause> {
_VideoPlayPauseState() {
listener = () {
if (mounted)
setState(() {});
setState(() { });
};
}
@ -221,7 +221,7 @@ class _FadeAnimationState extends State<FadeAnimation> with SingleTickerProvider
);
animationController.addListener(() {
if (mounted) {
setState(() {});
setState(() { });
}
});
animationController.forward(from: 0.0);
@ -372,7 +372,7 @@ class _VideoDemoState extends State<VideoDemo> with SingleTickerProviderStateMix
await controller.initialize();
if (mounted) {
print('< VideoDemo initController "$name" done ${isDisposed ? "DISPOSED" : ""}');
setState(() {});
setState(() { });
}
}

View File

@ -631,13 +631,13 @@ void main() {
handle.dispose();
});
testWidgets('overscroll_demo', (WidgetTester tester) async {
tester.binding.addTime(const Duration(seconds: 3));
final SemanticsHandle handle = tester.ensureSemantics();
await tester.pumpWidget(const MaterialApp(home: OverscrollDemo()));
await expectLater(tester, meetsGuideline(textContrastGuideline));
handle.dispose();
});
testWidgets('overscroll_demo', (WidgetTester tester) async {
tester.binding.addTime(const Duration(seconds: 3));
final SemanticsHandle handle = tester.ensureSemantics();
await tester.pumpWidget(const MaterialApp(home: OverscrollDemo()));
await expectLater(tester, meetsGuideline(textContrastGuideline));
handle.dispose();
});
testWidgets('page_selector_demo $themeName', (WidgetTester tester) async {
tester.binding.addTime(const Duration(seconds: 3));

View File

@ -24,7 +24,7 @@ class Stock {
lastSale = 0.0;
try {
lastSale = double.parse(fields[2]);
} catch (_) {}
} catch (_) { }
symbol = fields[0];
name = fields[1];
marketCap = fields[4];

View File

@ -175,7 +175,7 @@ class _RenderCupertinoSliverRefresh extends RenderSliver
// Nothing special done here because this sliver always paints its child
// exactly between paintOrigin and paintExtent.
@override
void applyPaintTransform(RenderObject child, Matrix4 transform) {}
void applyPaintTransform(RenderObject child, Matrix4 transform) { }
}
/// The current state of the refresh control.
@ -427,7 +427,7 @@ class _CupertinoSliverRefreshControlState extends State<CupertinoSliverRefreshCo
if (SchedulerBinding.instance.schedulerPhase == SchedulerPhase.idle) {
setState(() => hasSliverLayoutExtent = false);
} else {
SchedulerBinding.instance.addPostFrameCallback((Duration timestamp){
SchedulerBinding.instance.addPostFrameCallback((Duration timestamp) {
setState(() => hasSliverLayoutExtent = false);
});
}

View File

@ -414,7 +414,7 @@ class _RenderCupertinoSwitch extends RenderConstrainedBox {
_reactionController.reverse();
}
void _emitVibration(){
void _emitVibration() {
switch(defaultTargetPlatform) {
case TargetPlatform.iOS:
HapticFeedback.lightImpact();

View File

@ -29,8 +29,8 @@ class EagerGestureRecognizer extends OneSequenceGestureRecognizer {
String get debugDescription => 'eager';
@override
void didStopTrackingLastPointer(int pointer) {}
void didStopTrackingLastPointer(int pointer) { }
@override
void handleEvent(PointerEvent event) {}
void handleEvent(PointerEvent event) { }
}

View File

@ -36,7 +36,7 @@ typedef GestureMultiTapCancelCallback = void Function(int pointer);
/// CountdownZoned tracks whether the specified duration has elapsed since
/// creation, honoring [Zone].
class _CountdownZoned {
_CountdownZoned({ @required Duration duration })
_CountdownZoned({ @required Duration duration })
: assert(duration != null) {
_timer = Timer(duration, _onTimeout);
}

View File

@ -240,7 +240,7 @@ class _ExpansionPanelListState extends State<ExpansionPanelList> {
}
_currentOpenPanel = isExpanded ? null : pressedChild;
}
setState((){});
setState(() { });
}
@override

View File

@ -128,8 +128,7 @@ class InkRipple extends InteractiveInkFeature {
_textDirection = textDirection,
_targetRadius = radius ?? _getTargetRadius(referenceBox, containedInkWell, rectCallback, position),
_clipCallback = _getClipCallback(referenceBox, containedInkWell, rectCallback),
super(controller: controller, referenceBox: referenceBox, color: color, onRemoved: onRemoved)
{
super(controller: controller, referenceBox: referenceBox, color: color, onRemoved: onRemoved) {
assert(_borderRadius != null);
// Immediately begin fading-in the initial splash.

View File

@ -647,7 +647,7 @@ class _RenderDecoration extends RenderBox {
}
// The returned list is ordered for hit testing.
Iterable<RenderBox> get _children sync *{
Iterable<RenderBox> get _children sync* {
if (icon != null)
yield icon;
if (input != null)

View File

@ -738,7 +738,7 @@ class _RenderListTile extends RenderBox {
}
// The returned list is ordered for hit testing.
Iterable<RenderBox> get _children sync *{
Iterable<RenderBox> get _children sync* {
if (leading != null)
yield leading;
if (title != null)

View File

@ -525,8 +525,8 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T
// If the target is not the original starting point, then we will accept the drop.
return _dragging == toAccept && toAccept != toWrap.key;
},
onAccept: (Key accepted) {},
onLeave: (Key leaving) {},
onAccept: (Key accepted) { },
onLeave: (Key leaving) { },
);
});
}

View File

@ -58,7 +58,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
/// This is only for debug and test purpose only.
@visibleForTesting
void debugMarkClean() {
assert((){
assert(() {
_needsAddToScene = false;
return true;
}());
@ -77,7 +77,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
@visibleForTesting
bool get debugSubtreeNeedsAddToScene {
bool result;
assert((){
assert(() {
result = _subtreeNeedsAddToScene;
return true;
}());

View File

@ -84,8 +84,7 @@ class RenderAndroidView extends RenderBox {
}) : assert(viewController != null),
assert(hitTestBehavior != null),
assert(gestureRecognizers != null),
_viewController = viewController
{
_viewController = viewController {
_motionEventsDispatcher = _MotionEventsDispatcher(globalToLocal, viewController);
updateGestureRecognizers(gestureRecognizers);
}
@ -430,7 +429,7 @@ class _UiKitViewGestureRecognizer extends OneSequenceGestureRecognizer {
String get debugDescription => 'UIKit view';
@override
void didStopTrackingLastPointer(int pointer) {}
void didStopTrackingLastPointer(int pointer) { }
@override
void handleEvent(PointerEvent event) {
@ -501,7 +500,7 @@ class _AndroidViewGestureRecognizer extends OneSequenceGestureRecognizer {
String get debugDescription => 'Android view';
@override
void didStopTrackingLastPointer(int pointer) {}
void didStopTrackingLastPointer(int pointer) { }
@override
void handleEvent(PointerEvent event) {

View File

@ -242,7 +242,7 @@ abstract class WidgetsBindingObserver {
/// features.
///
/// This method exposes notifications from [Window.onAccessibilityFeaturesChanged].
void didChangeAccessibilityFeatures() {}
void didChangeAccessibilityFeatures() { }
}
/// The glue between the widgets layer and the Flutter engine.

View File

@ -367,7 +367,7 @@ abstract class ImplicitlyAnimatedWidgetState<T extends ImplicitlyAnimatedWidget>
/// Any properties that depend upon tweens created by [forEachTween] should be
/// updated within [didUpdateTweens], not within [forEachTween].
@protected
void didUpdateTweens() {}
void didUpdateTweens() { }
}
/// A base class for widgets with implicit animations that need to rebuild their

View File

@ -161,7 +161,7 @@ abstract class SliverChildDelegate {
///
/// Useful for subclasses that which to track which children are included in
/// the underlying render tree.
void didFinishLayout(int firstIndex, int lastIndex) {}
void didFinishLayout(int firstIndex, int lastIndex) { }
/// Called whenever a new instance of the child delegate class is
/// provided to the sliver.

View File

@ -9,7 +9,7 @@ import 'package:flutter/widgets.dart';
void main() {
test('AnimationLocalStatusListenersMixin with AnimationLazyListenerMixin - removing unregistered listener is no-op', () {
final _TestAnimationLocalStatusListeners uut = _TestAnimationLocalStatusListeners();
final AnimationStatusListener fakeListener = (AnimationStatus status) {};
final AnimationStatusListener fakeListener = (AnimationStatus status) { };
uut.removeStatusListener(fakeListener);
expect(uut.callsToStart, 0);
expect(uut.callsToStop, 0);
@ -17,7 +17,7 @@ void main() {
test('AnimationLocalListenersMixin with AnimationLazyListenerMixin - removing unregistered listener is no-op', () {
final _TestAnimationLocalListeners uut = _TestAnimationLocalListeners();
final VoidCallback fakeListener = () {};
final VoidCallback fakeListener = () { };
uut.removeListener(fakeListener);
expect(uut.callsToStart, 0);
expect(uut.callsToStop, 0);

View File

@ -54,7 +54,7 @@ void main() {
CupertinoActionSheetAction(
isDestructiveAction: true,
child: const Text('Ok'),
onPressed: () {},
onPressed: () { },
),
),
);
@ -70,7 +70,7 @@ void main() {
CupertinoActionSheetAction(
isDefaultAction: true,
child: const Text('Ok'),
onPressed: () {},
onPressed: () { },
),
),
);
@ -181,11 +181,11 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
actionScrollController: actionScrollController,
@ -228,23 +228,23 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Three'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Four'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Five'),
onPressed: () {},
onPressed: () { },
),
],
actionScrollController: actionScrollController,
@ -295,11 +295,11 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
messageScrollController: messageScrollController,
@ -368,11 +368,11 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
),
@ -396,11 +396,11 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
),
@ -425,12 +425,12 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: () {},
onPressed: () { },
),
),
),
@ -452,16 +452,16 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: () {},
onPressed: () { },
),
),
),
@ -483,20 +483,20 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Three'),
onPressed: () {},
onPressed: () { },
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: () {},
onPressed: () { },
),
),
),
@ -518,24 +518,24 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Three'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Four'),
onPressed: () {},
onPressed: () { },
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: () {},
onPressed: () { },
),
),
),
@ -557,7 +557,7 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
],
),
@ -579,11 +579,11 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
),
@ -603,7 +603,7 @@ void main() {
CupertinoActionSheet(
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: (){},
onPressed: () { },
),
),
),
@ -661,16 +661,16 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: () {},
onPressed: () { },
),
),
),
@ -696,16 +696,16 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: () {},
onPressed: () { },
),
),
),
@ -773,16 +773,16 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: () {},
onPressed: () { },
),
),
),
@ -833,16 +833,16 @@ void main() {
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('One'),
onPressed: () {},
onPressed: () { },
),
CupertinoActionSheetAction(
child: const Text('Two'),
onPressed: () {},
onPressed: () { },
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
onPressed: () {},
onPressed: () { },
),
),
),

View File

@ -234,7 +234,7 @@ void main() {
await tester.pumpWidget(
CupertinoApp(
home: CupertinoButton(
onPressed: () {},
onPressed: () { },
child: Builder(builder: (BuildContext context) {
textStyle = DefaultTextStyle.of(context).style;
return const Placeholder();
@ -248,7 +248,7 @@ void main() {
await tester.pumpWidget(
CupertinoApp(
home: CupertinoButton.filled(
onPressed: () {},
onPressed: () { },
child: Builder(builder: (BuildContext context) {
textStyle = DefaultTextStyle.of(context).style;
return const Placeholder();
@ -270,7 +270,7 @@ void main() {
CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoButton(
onPressed: () {},
onPressed: () { },
child: Builder(builder: (BuildContext context) {
textStyle = DefaultTextStyle.of(context).style;
return const Placeholder();
@ -284,7 +284,7 @@ void main() {
CupertinoApp(
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoButton.filled(
onPressed: () {},
onPressed: () { },
child: Builder(builder: (BuildContext context) {
textStyle = DefaultTextStyle.of(context).style;
return const Placeholder();

View File

@ -25,7 +25,7 @@ void main() {
expect(
() {
CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
initialTimerDuration: const Duration(days: 1),
);
},
@ -35,7 +35,7 @@ void main() {
expect(
() {
CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
initialTimerDuration: const Duration(seconds: -1),
);
},
@ -47,7 +47,7 @@ void main() {
expect(
() {
CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
minuteInterval: 0,
);
},
@ -56,7 +56,7 @@ void main() {
expect(
() {
CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
minuteInterval: -1,
);
},
@ -65,7 +65,7 @@ void main() {
expect(
() {
CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
minuteInterval: 7,
);
},
@ -77,7 +77,7 @@ void main() {
expect(
() {
CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
secondInterval: 0,
);
},
@ -86,7 +86,7 @@ void main() {
expect(
() {
CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
secondInterval: -1,
);
},
@ -95,7 +95,7 @@ void main() {
expect(
() {
CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
secondInterval: 7,
);
},
@ -107,7 +107,7 @@ void main() {
await tester.pumpWidget(
CupertinoApp(
home: CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
initialTimerDuration: const Duration(hours: 12, minutes: 30, seconds: 59),
),
),
@ -136,7 +136,7 @@ void main() {
home: Directionality(
textDirection: TextDirection.rtl,
child: CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
initialTimerDuration: const Duration(hours: 12, minutes: 30, seconds: 59),
),
),
@ -167,7 +167,7 @@ void main() {
height: 400.0,
width: 400.0,
child: CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
initialTimerDuration: const Duration(hours: 12, minutes: 30, seconds: 59),
),
),
@ -184,7 +184,7 @@ void main() {
height: 400.0,
width: 800.0,
child: CupertinoTimerPicker(
onTimerDurationChanged: (_) {},
onTimerDurationChanged: (_) { },
initialTimerDuration: const Duration(hours: 12, minutes: 30, seconds: 59),
),
),
@ -237,7 +237,7 @@ void main() {
() {
CupertinoDatePicker(
mode: null,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime.now(),
);
},
@ -259,7 +259,7 @@ void main() {
testWidgets('initial date is set to default value', (WidgetTester tester) async {
final CupertinoDatePicker picker = CupertinoDatePicker(
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
);
expect(picker.initialDateTime, isNotNull);
});
@ -317,7 +317,7 @@ void main() {
width: 400.0,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime(2018, 9, 15, 0, 0),
),
),
@ -337,7 +337,7 @@ void main() {
width: 400.0,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.dateAndTime,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime(2018, 9, 15, 3, 14),
),
),
@ -357,7 +357,7 @@ void main() {
textDirection: TextDirection.ltr,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.dateAndTime,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime(2018, 1, 1, 10, 30),
),
),
@ -375,7 +375,7 @@ void main() {
width: 800.0,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.dateAndTime,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime(2018, 1, 1, 10, 30),
),
),
@ -397,7 +397,7 @@ void main() {
width: 400.0,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime(2018, 1, 1, 10, 30),
),
),
@ -415,7 +415,7 @@ void main() {
width: 800.0,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime(2018, 1, 1, 10, 30),
),
),
@ -437,7 +437,7 @@ void main() {
width: 400.0,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.time,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime(2018, 1, 1, 10, 30),
),
),
@ -455,7 +455,7 @@ void main() {
width: 800.0,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.time,
onDateTimeChanged: (_) {},
onDateTimeChanged: (_) { },
initialDateTime: DateTime(2018, 1, 1, 10, 30),
),
),

View File

@ -154,12 +154,12 @@ void main() {
CupertinoApp(
home: CupertinoNavigationBar(
leading: CupertinoButton(
onPressed: () {},
onPressed: () { },
child: const _ExpectStyles(color: CupertinoColors.activeBlue, index: 0x000001),
),
middle: const _ExpectStyles(color: CupertinoColors.black, index: 0x000100),
trailing: CupertinoButton(
onPressed: () {},
onPressed: () { },
child: const _ExpectStyles(color: CupertinoColors.activeBlue, index: 0x010000),
),
),
@ -175,12 +175,12 @@ void main() {
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoNavigationBar(
leading: CupertinoButton(
onPressed: () {},
onPressed: () { },
child: const _ExpectStyles(color: CupertinoColors.activeOrange, index: 0x000001),
),
middle: const _ExpectStyles(color: CupertinoColors.white, index: 0x000100),
trailing: CupertinoButton(
onPressed: () {},
onPressed: () { },
child: const _ExpectStyles(color: CupertinoColors.activeOrange, index: 0x010000),
),
),
@ -195,12 +195,12 @@ void main() {
CupertinoApp(
home: CupertinoNavigationBar(
leading: CupertinoButton(
onPressed: () {},
onPressed: () { },
child: const _ExpectStyles(color: Color(0xFF001122), index: 0x000001),
),
middle: const _ExpectStyles(color: Color(0xFF000000), index: 0x000100),
trailing: CupertinoButton(
onPressed: () {},
onPressed: () { },
child: const _ExpectStyles(color: Color(0xFF001122), index: 0x010000),
),
actionsForegroundColor: const Color(0xFF001122),

View File

@ -23,7 +23,7 @@ void main() {
child: CupertinoPicker(
scrollController: controller,
itemExtent: 50.0,
onSelectedItemChanged: (_) {},
onSelectedItemChanged: (_) { },
children: List<Widget>.generate(3, (int index) {
return Container(
height: 50.0,
@ -79,7 +79,7 @@ void main() {
Text('1'),
Text('1'),
],
onSelectedItemChanged: (int i) {},
onSelectedItemChanged: (int i) { },
),
),
),
@ -121,7 +121,7 @@ void main() {
Text('1'),
Text('1'),
],
onSelectedItemChanged: (int i) {},
onSelectedItemChanged: (int i) { },
),
),
),
@ -154,7 +154,7 @@ void main() {
Text('1'),
Text('1'),
],
onSelectedItemChanged: (int i) {},
onSelectedItemChanged: (int i) { },
),
),
),

View File

@ -94,7 +94,7 @@ void main() {
boilerplate(
child: CupertinoSegmentedControl<int>(
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
),
),
);
@ -109,7 +109,7 @@ void main() {
boilerplate(
child: CupertinoSegmentedControl<int>(
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
),
),
);
@ -129,7 +129,7 @@ void main() {
boilerplate(
child: CupertinoSegmentedControl<int>(
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
groupValue: 2,
),
),
@ -147,7 +147,7 @@ void main() {
boilerplate(
child: CupertinoSegmentedControl<int>(
children: null,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
),
),
);
@ -336,7 +336,7 @@ void main() {
height: 200.0,
child: CupertinoSegmentedControl<int>(
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
),
),
),
@ -390,7 +390,7 @@ void main() {
return boilerplate(
child: CupertinoSegmentedControl<int>(
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
groupValue: sharedValue,
),
);
@ -546,7 +546,7 @@ void main() {
child: CupertinoSegmentedControl<int>(
key: const ValueKey<String>('Segmented Control'),
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
),
);
},
@ -578,7 +578,7 @@ void main() {
child: CupertinoSegmentedControl<int>(
key: const ValueKey<String>('Segmented Control'),
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
),
);
},
@ -616,7 +616,7 @@ void main() {
CupertinoSegmentedControl<int>(
key: const ValueKey<String>('Segmented Control'),
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
),
],
),
@ -642,7 +642,7 @@ void main() {
child: Center(
child: CupertinoSegmentedControl<int>(
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
),
),
),
@ -1315,7 +1315,7 @@ void main() {
child: CupertinoSegmentedControl<int>(
key: const ValueKey<String>('Segmented Control'),
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
groupValue: currentValue,
),
),
@ -1349,7 +1349,7 @@ void main() {
child: CupertinoSegmentedControl<int>(
key: const ValueKey<String>('Segmented Control'),
children: children,
onValueChanged: (int newValue) {},
onValueChanged: (int newValue) { },
groupValue: currentValue,
),
),

View File

@ -281,7 +281,7 @@ void main() {
textDirection: TextDirection.ltr,
child: CupertinoSlider(
value: 0.5,
onChanged: (double v) {},
onChanged: (double v) { },
),
));
@ -366,7 +366,7 @@ void main() {
CupertinoApp(
home: Center(
child: CupertinoSlider(
onChanged: (double value) {},
onChanged: (double value) { },
value: 0.5,
),
),
@ -383,7 +383,7 @@ void main() {
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: Center(
child: CupertinoSlider(
onChanged: (double value) {},
onChanged: (double value) { },
value: 0.5,
),
),
@ -402,7 +402,7 @@ void main() {
home: Center(
child: CupertinoSlider(
activeColor: CupertinoColors.activeGreen,
onChanged: (double value) {},
onChanged: (double value) { },
value: 0.5,
),
),

View File

@ -211,7 +211,7 @@ void main() {
children: <Widget>[
CupertinoButton(
child: const Text('Button'),
onPressed: (){
onPressed: () {
setState(() {
value = !value;
});

View File

@ -261,7 +261,7 @@ void main() {
final TestNotifier source1 = TestNotifier();
final TestNotifier source2 = TestNotifier();
final VoidCallback fakeListener = () {};
final VoidCallback fakeListener = () { };
final Listenable listenableUnderTest = Listenable.merge(<Listenable>[source1, source2]);
expect(source1.isListenedTo, isFalse);

View File

@ -951,7 +951,7 @@ void main() {
});
test('callback property test', () {
final Function onClick = () {};
final Function onClick = () { };
final ObjectFlagProperty<Function> present = ObjectFlagProperty<Function>(
'onClick',
onClick,
@ -1385,7 +1385,7 @@ void main() {
});
test('has property test', () {
final Function onClick = () {};
final Function onClick = () { };
final ObjectFlagProperty<Function> has = ObjectFlagProperty<Function>.has(
'onClick',
onClick,

View File

@ -10,10 +10,10 @@ import 'gesture_tester.dart';
class TestGestureArenaMember extends GestureArenaMember {
@override
void acceptGesture(int key) {}
void acceptGesture(int key) { }
@override
void rejectGesture(int key) {}
void rejectGesture(int key) { }
}
void main() {

View File

@ -17,7 +17,7 @@ void main() {
await tester.pumpWidget(MaterialApp(
home: Scaffold(appBar: AppBar(
actions: <Widget>[
IconButton(icon: const Icon(Icons.share), onPressed: () {}),
IconButton(icon: const Icon(Icons.share), onPressed: () { }),
],
)),
));
@ -45,7 +45,7 @@ void main() {
home: Scaffold(appBar: AppBar(
title: const Text('App Bar Title'),
actions: <Widget>[
IconButton(icon: const Icon(Icons.share), onPressed: () {}),
IconButton(icon: const Icon(Icons.share), onPressed: () { }),
],
)),
));
@ -85,7 +85,7 @@ void main() {
actionsIconTheme: actionsIconThemeData,
textTheme: textTheme,
actions: <Widget>[
IconButton(icon: const Icon(Icons.share), onPressed: () {}),
IconButton(icon: const Icon(Icons.share), onPressed: () { }),
],
)),
));
@ -118,7 +118,7 @@ void main() {
iconTheme: iconThemeData,
actionsIconTheme: actionsIconThemeData,
actions: <Widget>[
IconButton(icon: const Icon(Icons.share), color: color, onPressed: () {}),
IconButton(icon: const Icon(Icons.share), color: color, onPressed: () { }),
],
)),
));
@ -135,7 +135,7 @@ void main() {
theme: themeData,
home: Scaffold(appBar: AppBar(
actions: <Widget>[
IconButton(icon: const Icon(Icons.share), onPressed: () {}),
IconButton(icon: const Icon(Icons.share), onPressed: () { }),
],
)),
));
@ -162,7 +162,7 @@ void main() {
theme: themeData,
home: Scaffold(appBar: AppBar(
actions: <Widget>[
IconButton(icon: const Icon(Icons.share), onPressed: () {}),
IconButton(icon: const Icon(Icons.share), onPressed: () { }),
],
)),
));

View File

@ -488,7 +488,7 @@ void main() {
child: MaterialButton(
key: key1,
child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {},
onPressed: () { },
),
),
),
@ -509,7 +509,7 @@ void main() {
child: MaterialButton(
key: key2,
child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {},
onPressed: () { },
),
),
),
@ -532,7 +532,7 @@ void main() {
child: FlatButton(
key: key1,
child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {},
onPressed: () { },
),
),
),
@ -553,7 +553,7 @@ void main() {
child: FlatButton(
key: key2,
child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {},
onPressed: () { },
),
),
),
@ -576,7 +576,7 @@ void main() {
child: RaisedButton(
key: key1,
child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {},
onPressed: () { },
),
),
),
@ -597,7 +597,7 @@ void main() {
child: RaisedButton(
key: key2,
child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {},
onPressed: () { },
),
),
),
@ -608,7 +608,7 @@ void main() {
expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0));
});
testWidgets('RaisedButton has no clip by default', (WidgetTester tester) async{
testWidgets('RaisedButton has no clip by default', (WidgetTester tester) async {
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,

View File

@ -27,7 +27,7 @@ void main() {
child: Center(
child: Checkbox(
value: true,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
),
@ -46,7 +46,7 @@ void main() {
child: Center(
child: Checkbox(
value: true,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
),
@ -192,7 +192,7 @@ void main() {
child: Checkbox(
tristate: true,
value: null,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
);
@ -211,7 +211,7 @@ void main() {
child: Checkbox(
tristate: true,
value: true,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
);
@ -231,7 +231,7 @@ void main() {
child: Checkbox(
tristate: true,
value: false,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
);

View File

@ -234,7 +234,7 @@ void main() {
'available space and the delete icon is present', (WidgetTester tester) async {
await _testConstrainedLabel(
tester,
onDeleted: () {},
onDeleted: () { },
);
});
@ -244,7 +244,7 @@ void main() {
await _testConstrainedLabel(
tester,
avatar: const CircleAvatar(child: Text('A')),
onDeleted: () {},
onDeleted: () { },
);
});
@ -294,7 +294,7 @@ void main() {
return Material(
child: Chip(
deleteIcon: Icon(Icons.delete, key: iconKey),
onDeleted: () {},
onDeleted: () { },
label: const Text('ABC'),
),
);
@ -467,7 +467,7 @@ void main() {
Chip(
deleteIcon: Container(key: keyA, width: 20.0, height: 20.0),
label: const Text('Chip A'),
onDeleted: () {},
onDeleted: () { },
),
],
),
@ -496,7 +496,7 @@ void main() {
width: 40.0,
height: 40.0,
),
onDeleted: () {},
onDeleted: () { },
),
),
);
@ -533,7 +533,7 @@ void main() {
width: 40.0,
height: 40.0,
),
onDeleted: () {},
onDeleted: () { },
),
),
);
@ -1089,7 +1089,7 @@ void main() {
child: StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
return RawChip(
showCheckmark: showCheckmark,
onDeleted: isDeletable ? () {} : null,
onDeleted: isDeletable ? () { } : null,
tapEnabled: true,
avatar: avatar,
deleteIcon: deleteIcon,
@ -1227,7 +1227,7 @@ void main() {
home: Material(
child: RawChip(
label: const Text('test'),
onPressed: () {},
onPressed: () { },
),
),
));
@ -1354,7 +1354,7 @@ void main() {
home: Material(
child: RawChip(
isEnabled: false,
onPressed: () {},
onPressed: () { },
label: const Text('test'),
),
),
@ -1445,7 +1445,7 @@ void main() {
MaterialApp(
home: Material(
child: ActionChip(
onPressed: (){},
onPressed: () { },
label: const Text('action chip'),
),
),
@ -1459,7 +1459,7 @@ void main() {
MaterialApp(
home: Material(
child: FilterChip(
onSelected: (bool valueChanged){},
onSelected: (bool valueChanged) { },
selected: false,
label: const Text('filter chip'),
),
@ -1568,7 +1568,7 @@ void main() {
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(0.0))),
avatar: const CircleAvatar(child: Text('A')),
label: const Text('Chip A'),
onPressed: () {},
onPressed: () { },
),
),
);
@ -1602,19 +1602,19 @@ void main() {
testWidgets('FilterChip clipBehavior properly passes through to the Material', (WidgetTester tester) async {
const Text label = Text('label');
await tester.pumpWidget(_wrapForChip(child: FilterChip(label: label, onSelected: (bool b){},)));
await tester.pumpWidget(_wrapForChip(child: FilterChip(label: label, onSelected: (bool b) { },)));
checkChipMaterialClipBehavior(tester, Clip.none);
await tester.pumpWidget(_wrapForChip(child: FilterChip(label: label, onSelected: (bool b){}, clipBehavior: Clip.antiAlias)));
await tester.pumpWidget(_wrapForChip(child: FilterChip(label: label, onSelected: (bool b) { }, clipBehavior: Clip.antiAlias)));
checkChipMaterialClipBehavior(tester, Clip.antiAlias);
});
testWidgets('ActionChip clipBehavior properly passes through to the Material', (WidgetTester tester) async {
const Text label = Text('label');
await tester.pumpWidget(_wrapForChip(child: ActionChip(label: label, onPressed: (){},)));
await tester.pumpWidget(_wrapForChip(child: ActionChip(label: label, onPressed: () { },)));
checkChipMaterialClipBehavior(tester, Clip.none);
await tester.pumpWidget(_wrapForChip(child: ActionChip(label: label, clipBehavior: Clip.antiAlias, onPressed: (){})));
await tester.pumpWidget(_wrapForChip(child: ActionChip(label: label, clipBehavior: Clip.antiAlias, onPressed: () { })));
checkChipMaterialClipBehavior(tester, Clip.antiAlias);
});
@ -1656,7 +1656,7 @@ void main() {
MaterialApp(
home: Material(
child: ActionChip(
onPressed: (){},
onPressed: () { },
label: const Text('action chip'),
),
),

View File

@ -85,14 +85,14 @@ void main() {
data: theme,
child: RawChip(
showCheckmark: true,
onDeleted: () {},
onDeleted: () { },
tapEnabled: true,
avatar: const Placeholder(),
deleteIcon: const Placeholder(),
isEnabled: true,
selected: value,
label: Text('$value'),
onSelected: (bool newValue) {},
onSelected: (bool newValue) { },
onPressed: null,
),
),
@ -137,14 +137,14 @@ void main() {
data: customTheme,
child: RawChip(
showCheckmark: true,
onDeleted: () {},
onDeleted: () { },
tapEnabled: true,
avatar: const Placeholder(),
deleteIcon: const Placeholder(),
isEnabled: true,
selected: value,
label: const Text('$value'),
onSelected: (bool newValue) {},
onSelected: (bool newValue) { },
onPressed: null,
),
),

View File

@ -13,7 +13,7 @@ import 'package:flutter/rendering.dart';
import '../widgets/semantics_tester.dart';
const List<String> menuItems = <String>['one', 'two', 'three', 'four'];
final ValueChanged<String> onChanged = (_) {};
final ValueChanged<String> onChanged = (_) { };
final Type dropdownButtonType = DropdownButton<String>(
onChanged: (_) { },
@ -299,7 +299,7 @@ void main() {
child: const Text(value),
),
],
onChanged: (_) {},
onChanged: (_) { },
),
],
),
@ -757,7 +757,7 @@ void main() {
buttonKey: key,
value: null,
items: menuItems,
onChanged: (String _) {},
onChanged: (String _) { },
hint: const Text('test'),
));
@ -895,7 +895,7 @@ void main() {
final DropdownButton<int> button = DropdownButton<int>(
value: 50,
onChanged: (int newValue){},
onChanged: (int newValue) { },
items: items,
);
@ -932,7 +932,7 @@ void main() {
final DropdownButton<int> button = DropdownButton<int>(
value: 99,
onChanged: (int newValue){},
onChanged: (int newValue) { },
items: items,
);
@ -969,7 +969,7 @@ void main() {
final DropdownButton<int> button = DropdownButton<int>(
value: 0,
onChanged: (int newValue){},
onChanged: (int newValue) { },
items: items,
);
@ -1006,7 +1006,7 @@ void main() {
final DropdownButton<int> button = DropdownButton<int>(
value: 99,
onChanged: (int newValue){},
onChanged: (int newValue) { },
items: items,
);

View File

@ -91,7 +91,7 @@ void main() {
await tester.pumpWidget(wrap(
child: ExpandIcon(
isExpanded: true,
onPressed: (bool _) {},
onPressed: (bool _) { },
)
));
@ -106,7 +106,7 @@ void main() {
await tester.pumpWidget(wrap(
child: ExpandIcon(
isExpanded: false,
onPressed: (bool _) {},
onPressed: (bool _) { },
)
));

View File

@ -12,7 +12,7 @@ void main() {
testWidgets('FlatButton implements debugFillDescription', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
FlatButton(
onPressed: () {},
onPressed: () { },
textColor: const Color(0xFF00FF00),
disabledTextColor: const Color(0xFFFF0000),
color: const Color(0xFF000000),
@ -32,7 +32,7 @@ void main() {
]);
});
testWidgets('FlatButton has no clip by default', (WidgetTester tester) async{
testWidgets('FlatButton has no clip by default', (WidgetTester tester) async {
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,

View File

@ -636,7 +636,7 @@ void main() {
child: RepaintBoundary(
key: key,
child: FloatingActionButton(
onPressed: () {},
onPressed: () { },
child: const Icon(Icons.add),
),
),
@ -655,7 +655,7 @@ void main() {
);
});
testWidgets('Floating Action Button has no clip by default', (WidgetTester tester) async{
testWidgets('Floating Action Button has no clip by default', (WidgetTester tester) async {
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,

View File

@ -14,7 +14,7 @@ void main() {
body: Center(
child: RaisedButton(
child: const Text('Test'),
onPressed: () {},
onPressed: () { },
shape: Border.all(
color: Colors.blue,
),

View File

@ -109,8 +109,8 @@ void main() {
textDirection: TextDirection.ltr,
child: Center(
child: InkWell(
onTap: () {},
onLongPress: () {},
onTap: () { },
onLongPress: () { },
),
),
),
@ -137,8 +137,8 @@ void main() {
textDirection: TextDirection.ltr,
child: Center(
child: InkWell(
onTap: () {},
onLongPress: () {},
onTap: () { },
onLongPress: () { },
enableFeedback: false,
),
),

View File

@ -297,7 +297,7 @@ void main() {
testWidgets('OutlineButton implements debugFillProperties', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
OutlineButton(
onPressed: () {},
onPressed: () { },
textColor: const Color(0xFF00FF00),
disabledTextColor: const Color(0xFFFF0000),
color: const Color(0xFF000000),
@ -326,7 +326,7 @@ void main() {
home: Scaffold(
body: Center(
child: OutlineButton(
onPressed: () {},
onPressed: () { },
// Causes the button to be filled with the theme's canvasColor
// instead of Colors.transparent before the button material's
// elevation is animated to 2.0.

View File

@ -77,7 +77,7 @@ void main() {
key: key1,
groupValue: true,
value: true,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
),
@ -99,7 +99,7 @@ void main() {
key: key2,
groupValue: true,
value: true,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
),

View File

@ -39,7 +39,7 @@ void main() {
textDirection: TextDirection.ltr,
child: Center(
child: RawMaterialButton(
onPressed: () {},
onPressed: () { },
constraints: BoxConstraints.tight(const Size(10.0, 10.0)),
materialTapTargetSize: MaterialTapTargetSize.padded,
child: const Text('+'),
@ -83,7 +83,7 @@ void main() {
child: Center(
child: RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.padded,
onPressed: () {},
onPressed: () { },
fillColor: fillColor,
highlightColor: highlightColor,
splashColor: splashColor,
@ -115,7 +115,7 @@ void main() {
child: Center(
child: RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.padded,
onPressed: () {},
onPressed: () { },
fillColor: fillColor,
highlightColor: highlightColor,
splashColor: splashColor,
@ -143,7 +143,7 @@ void main() {
children: <Widget>[
RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.padded,
onPressed: () {},
onPressed: () { },
child: Container(
width: 400.0,
height: 400.0,
@ -173,7 +173,7 @@ void main() {
children: <Widget>[
RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.padded,
onPressed: () {},
onPressed: () { },
child: SizedBox(
key: key,
width: 8.0,
@ -198,7 +198,7 @@ void main() {
children: <Widget>[
RawMaterialButton(
key: key,
onPressed: () {},
onPressed: () { },
child: const SizedBox(),
),
],

View File

@ -132,7 +132,7 @@ void main() {
),
],
scrollDirection: Axis.vertical,
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
);
await tester.pumpWidget(MaterialApp(
home: SizedBox(
@ -198,7 +198,7 @@ void main() {
_Stateful(key: const Key('B')),
_Stateful(key: const Key('C')),
],
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
),
));
await tester.tap(find.byKey(const Key('A')));
@ -215,7 +215,7 @@ void main() {
_Stateful(key: const Key('C')),
_Stateful(key: const Key('A')),
],
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
),
));
// Only the 'A' widget should be checked.
@ -232,7 +232,7 @@ void main() {
SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: Key('B')),
SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: Key('A')),
],
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
);
Widget buildWithScrollController(ScrollController controller) {
@ -270,7 +270,7 @@ void main() {
SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: Key('B')),
SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: Key('A')),
],
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
);
final Widget boilerplate = Localizations(
locale: const Locale('en'),
@ -441,7 +441,7 @@ void main() {
child: SwitchListTile(
title: const Text('Switch tile'),
value: true,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
),
@ -452,7 +452,7 @@ void main() {
),
],
scrollDirection: Axis.vertical,
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
);
await tester.pumpWidget(MaterialApp(
home: SizedBox(
@ -560,7 +560,7 @@ void main() {
),
],
scrollDirection: Axis.horizontal,
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
);
await tester.pumpWidget(MaterialApp(
home: SizedBox(
@ -627,7 +627,7 @@ void main() {
_Stateful(key: const Key('B')),
_Stateful(key: const Key('C')),
],
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
scrollDirection: Axis.horizontal,
),
));
@ -645,7 +645,7 @@ void main() {
_Stateful(key: const Key('C')),
_Stateful(key: const Key('A')),
],
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
scrollDirection: Axis.horizontal,
),
));
@ -917,7 +917,7 @@ void main() {
),
],
reverse: true,
onReorder: (int oldIndex, int newIndex) {},
onReorder: (int oldIndex, int newIndex) { },
);
await tester.pumpWidget(MaterialApp(
home: reorderableListView,

View File

@ -915,7 +915,7 @@ void main() {
floatingActionButton: FloatingActionButton(
key: key,
child: _GeometryListener(),
onPressed: () {},
onPressed: () { },
),
)));
@ -962,7 +962,7 @@ void main() {
floatingActionButton: FloatingActionButton(
key: key,
child: _GeometryListener(),
onPressed: () {},
onPressed: () { },
),
)));
@ -1030,7 +1030,7 @@ void main() {
floatingActionButton: FloatingActionButton(
key: key,
child: _GeometryListener(),
onPressed: () {},
onPressed: () { },
),
)));

View File

@ -72,7 +72,7 @@ void main() {
// Simulate system back button
final ByteData message = const JSONMethodCodec().encodeMethodCall(const MethodCall('popRoute'));
await BinaryMessages.handlePlatformMessage('flutter/navigation', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/navigation', message, (_) { });
await tester.pumpAndSettle();
expect(selectedResults, <void>[null]);

View File

@ -1167,7 +1167,7 @@ void main() {
child: Material(
child: Slider(
value: 0.5,
onChanged: (double v) {},
onChanged: (double v) { },
),
),
),
@ -1232,7 +1232,7 @@ void main() {
value: 100.0,
min: 0.0,
max: 200.0,
onChanged: (double v) {},
onChanged: (double v) { },
),
),
),
@ -1273,7 +1273,7 @@ void main() {
max: 200.0,
divisions: 10,
semanticFormatterCallback: (double value) => value.round().toString(),
onChanged: (double v) {},
onChanged: (double v) { },
),
),
),

View File

@ -299,7 +299,7 @@ void main() {
value: sliderValue,
label: '$value',
divisions: 3,
onChanged: (double d) {},
onChanged: (double d) { },
),
),
),

View File

@ -312,7 +312,7 @@ void main() {
textColor: Colors.lightBlue,
disabledTextColor: Colors.red,
label: 'ACTION',
onPressed: () {},
onPressed: () { },
),
),
);
@ -359,7 +359,7 @@ void main() {
Scaffold.of(context).showSnackBar(SnackBar(
content: const Text('I am a snack bar.'),
duration: const Duration(seconds: 2),
action: SnackBarAction(label: 'ACTION', onPressed: () {}),
action: SnackBarAction(label: 'ACTION', onPressed: () { }),
));
},
child: const Text('X'),
@ -416,7 +416,7 @@ void main() {
Scaffold.of(context).showSnackBar(SnackBar(
content: const Text('I am a snack bar.'),
duration: const Duration(seconds: 2),
action: SnackBarAction(label: 'ACTION', onPressed: () {}),
action: SnackBarAction(label: 'ACTION', onPressed: () { }),
));
},
child: const Text('X'),
@ -543,7 +543,7 @@ void main() {
duration: const Duration(seconds: 1),
action: SnackBarAction(
label: 'ACTION',
onPressed: () {},
onPressed: () { },
),
));
},
@ -585,7 +585,7 @@ void main() {
duration: const Duration(seconds: 1),
action: SnackBarAction(
label: 'ACTION',
onPressed: () {},
onPressed: () { },
),
));
},
@ -670,7 +670,7 @@ void main() {
onTap: () {
Scaffold.of(context).showSnackBar(SnackBar(
content: const Text('test'),
action: SnackBarAction(label: 'foo', onPressed: () {}),
action: SnackBarAction(label: 'foo', onPressed: () { }),
));
},
behavior: HitTestBehavior.opaque,

View File

@ -57,7 +57,7 @@ void main() {
child: Switch(
dragStartBehavior: DragStartBehavior.down,
value: true,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
),
@ -77,7 +77,7 @@ void main() {
child: Switch(
dragStartBehavior: DragStartBehavior.down,
value: true,
onChanged: (bool newValue) {},
onChanged: (bool newValue) { },
),
),
),

View File

@ -193,7 +193,7 @@ void main() {
}
testWidgets('TextField passes onEditingComplete to EditableText', (WidgetTester tester) async {
final VoidCallback onEditingComplete = () {};
final VoidCallback onEditingComplete = () { };
await tester.pumpWidget(
MaterialApp(
@ -2443,7 +2443,7 @@ void main() {
});
}
group('Keyboard Tests', (){
group('Keyboard Tests', () {
TextEditingController controller;
setUp( () {
@ -2470,7 +2470,7 @@ void main() {
);
}
testWidgets('Shift test 1', (WidgetTester tester) async{
testWidgets('Shift test 1', (WidgetTester tester) async {
await tester.pumpWidget(setupWidget());
const String testValue = 'a big house';
@ -2484,7 +2484,7 @@ void main() {
expect(controller.selection.extentOffset - controller.selection.baseOffset, 1);
});
testWidgets('Control Shift test', (WidgetTester tester) async{
testWidgets('Control Shift test', (WidgetTester tester) async {
await tester.pumpWidget(setupWidget());
const String testValue = 'their big house';
await tester.enterText(find.byType(TextField), testValue);
@ -2500,7 +2500,7 @@ void main() {
expect(controller.selection.extentOffset - controller.selection.baseOffset, 5);
});
testWidgets('Down and up test', (WidgetTester tester) async{
testWidgets('Down and up test', (WidgetTester tester) async {
await tester.pumpWidget(setupWidget());
const String testValue = 'a big house';
await tester.enterText(find.byType(TextField), testValue);
@ -2522,7 +2522,7 @@ void main() {
expect(controller.selection.extentOffset - controller.selection.baseOffset, 0);
});
testWidgets('Down and up test 2', (WidgetTester tester) async{
testWidgets('Down and up test 2', (WidgetTester tester) async {
await tester.pumpWidget(setupWidget());
const String testValue = 'a big house\njumped over a mouse\nOne more line yay'; // 11 \n 19
await tester.enterText(find.byType(TextField), testValue);
@ -2580,7 +2580,7 @@ void main() {
const int _kAKeyCode = 29;
const int _kDelKeyCode = 112;
testWidgets('Copy paste test', (WidgetTester tester) async{
testWidgets('Copy paste test', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController();
final TextField textField =
@ -2651,7 +2651,7 @@ void main() {
expect(find.text(expected), findsOneWidget);
});
testWidgets('Cut test', (WidgetTester tester) async{
testWidgets('Cut test', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController();
final TextField textField =
@ -2723,7 +2723,7 @@ void main() {
expect(find.text(expected), findsOneWidget);
});
testWidgets('Select all test', (WidgetTester tester) async{
testWidgets('Select all test', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController();
final TextField textField =
@ -2769,7 +2769,7 @@ void main() {
expect(find.text(expected), findsOneWidget);
});
testWidgets('Delete test', (WidgetTester tester) async{
testWidgets('Delete test', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController();
final TextField textField =
@ -2823,7 +2823,7 @@ void main() {
expect(find.text(expected2), findsOneWidget);
});
testWidgets('Changing positions of text fields', (WidgetTester tester) async{
testWidgets('Changing positions of text fields', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode();
final List<RawKeyEvent> events = <RawKeyEvent>[];

View File

@ -50,7 +50,7 @@ void main() {
});
testWidgets('Passes onEditingComplete to underlying TextField', (WidgetTester tester) async {
final VoidCallback onEditingComplete = () {};
final VoidCallback onEditingComplete = () { };
await tester.pumpWidget(
MaterialApp(

View File

@ -32,7 +32,7 @@ Future<void> pumpTestWidget(
child: Material(
child: Center(
child: UserAccountsDrawerHeader(
onDetailsPressed: withOnDetailsPressedHandler ? () {} : null,
onDetailsPressed: withOnDetailsPressedHandler ? () { } : null,
currentAccountPicture: const ExcludeSemantics(
child: CircleAvatar(
key: avatarA,

View File

@ -199,7 +199,7 @@ void main() {
test('failed image can successfully be removed from the cache\'s pending images', () async {
const TestImage testImage = TestImage(width: 8, height: 8);
const FailingTestImageProvider(1, 1, image: testImage).resolve(ImageConfiguration.empty).addListener((ImageInfo image, bool synchronousCall){}, onError: (dynamic exception, StackTrace stackTrace) {
const FailingTestImageProvider(1, 1, image: testImage).resolve(ImageConfiguration.empty).addListener((ImageInfo image, bool synchronousCall) { }, onError: (dynamic exception, StackTrace stackTrace) {
final bool evicationResult = imageCache.evict(1);
expect(evicationResult, isTrue);
});

View File

@ -37,7 +37,7 @@ class FakeImage implements Image {
int get height => _height;
@override
void dispose() {}
void dispose() { }
@override
Future<ByteData> toByteData({ ImageByteFormat format = ImageByteFormat.rawRgba }) async {
@ -73,7 +73,7 @@ class MockCodec implements Codec {
}
@override
void dispose() {}
void dispose() { }
}
@ -293,7 +293,7 @@ void main() {
scale: 1.0,
);
final ImageListener listener = (ImageInfo image, bool synchronousCall) {};
final ImageListener listener = (ImageInfo image, bool synchronousCall) { };
imageStream.addListener(listener);
codecCompleter.complete(mockCodec);
@ -377,7 +377,7 @@ void main() {
scale: 1.0,
);
final ImageListener listener = (ImageInfo image, bool synchronousCall) {};
final ImageListener listener = (ImageInfo image, bool synchronousCall) { };
imageStream.addListener(listener);
codecCompleter.complete(mockCodec);
@ -410,7 +410,7 @@ void main() {
scale: 1.0,
);
final ImageListener listener = (ImageInfo image, bool synchronousCall) {};
final ImageListener listener = (ImageInfo image, bool synchronousCall) { };
imageStream.addListener(listener);
codecCompleter.complete(mockCodec);
@ -451,7 +451,7 @@ void main() {
};
streamUnderTest.addListener(
(ImageInfo image, bool synchronousCall) {},
(ImageInfo image, bool synchronousCall) { },
onError: errorListener,
);

View File

@ -74,7 +74,7 @@ class TestImage implements ui.Image {
final int width;
@override
void dispose() {}
void dispose() { }
@override
Future<ByteData> toByteData({ ImageByteFormat format = ImageByteFormat.rawRgba }) {

View File

@ -17,13 +17,13 @@ class FakeEditableTextState extends TextSelectionDelegate {
TextEditingValue get textEditingValue { return const TextEditingValue(); }
@override
set textEditingValue(TextEditingValue value) {}
set textEditingValue(TextEditingValue value) { }
@override
void hideToolbar() {}
void hideToolbar() { }
@override
void bringIntoView(TextPosition position) {}
void bringIntoView(TextPosition position) { }
}
void main() {

View File

@ -39,16 +39,16 @@ void main() {
class TestRenderObject extends RenderObject {
@override
void debugAssertDoesMeetConstraints() {}
void debugAssertDoesMeetConstraints() { }
@override
Rect get paintBounds => null;
@override
void performLayout() {}
void performLayout() { }
@override
void performResize() {}
void performResize() { }
@override
Rect get semanticBounds => Rect.fromLTWH(0.0, 0.0, 10.0, 20.0);

View File

@ -78,8 +78,8 @@ void main() {
test('RenderSemanticsGestureHandler adds/removes correct semantic actions', () {
final RenderSemanticsGestureHandler renderObj = RenderSemanticsGestureHandler(
onTap: () {},
onHorizontalDragUpdate: (DragUpdateDetails details) {},
onTap: () { },
onHorizontalDragUpdate: (DragUpdateDetails details) { },
);
SemanticsConfiguration config = SemanticsConfiguration();
@ -287,7 +287,7 @@ class _FakeTicker implements Ticker {
bool muted;
@override
void absorbTicker(Ticker originalTicker) {}
void absorbTicker(Ticker originalTicker) { }
@override
String get debugLabel => null;
@ -305,10 +305,10 @@ class _FakeTicker implements Ticker {
bool get shouldScheduleTick => null;
@override
void dispose() {}
void dispose() { }
@override
void scheduleTick({ bool rescheduling = false }) {}
void scheduleTick({ bool rescheduling = false }) { }
@override
TickerFuture start() {
@ -316,10 +316,10 @@ class _FakeTicker implements Ticker {
}
@override
void stop({ bool canceled = false }) {}
void stop({ bool canceled = false }) { }
@override
void unscheduleTick() {}
void unscheduleTick() { }
@override
String toString({ bool debugIncludeStack = false }) => super.toString();

View File

@ -129,7 +129,7 @@ void main() {
expect(tickCount, equals(0));
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.paused');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(ticker.isTicking, isFalse);
expect(ticker.isActive, isTrue);
@ -138,7 +138,7 @@ void main() {
testWidgets('Ticker can be created before application unpauses', (WidgetTester tester) async {
final ByteData pausedMessage = const StringCodec().encodeMessage('AppLifecycleState.paused');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', pausedMessage, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', pausedMessage, (_) { });
int tickCount = 0;
void handleTick(Duration duration) {
@ -157,7 +157,7 @@ void main() {
expect(ticker.isTicking, isFalse);
final ByteData resumedMessage = const StringCodec().encodeMessage('AppLifecycleState.resumed');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', resumedMessage, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', resumedMessage, (_) { });
await tester.pump(const Duration(milliseconds: 10));

View File

@ -413,9 +413,9 @@ void main() {
const CustomSemanticsAction action2 = CustomSemanticsAction(label: 'action2');
const CustomSemanticsAction action3 = CustomSemanticsAction(label: 'action3');
configuration.customSemanticsActions = <CustomSemanticsAction, VoidCallback>{
action1: () {},
action2: () {},
action3: () {},
action1: () { },
action2: () { },
action3: () { },
};
final SemanticsNode actionNode = SemanticsNode();
actionNode.updateWith(config: configuration);
@ -499,7 +499,7 @@ void main() {
final MoveCursorHandler onMoveCursorForwardByCharacter = (bool _) { };
final MoveCursorHandler onMoveCursorBackwardByCharacter = (bool _) { };
final VoidCallback onTap = () { };
final VoidCallback onCustomAction = () {};
final VoidCallback onCustomAction = () { };
config.onShowOnScreen = onShowOnScreen;
config.onScrollDown = onScrollDown;

View File

@ -199,7 +199,7 @@ void main() {
BinaryMessages.handlePlatformMessage(
'ch',
event,
(ByteData reply) {},
(ByteData reply) { },
);
}
test('can receive event stream', () async {

View File

@ -147,8 +147,7 @@ void main() {
});
});
group('iOS', ()
{
group('iOS', () {
FakeIosPlatformViewsController viewsController;
setUp(() {
viewsController = FakeIosPlatformViewsController();

View File

@ -376,7 +376,7 @@ class _TickerWatchingWidgetState extends State<_TickerWatchingWidget> with Singl
@override
void initState() {
super.initState();
ticker = createTicker((_) {})..start();
ticker = createTicker((_) { })..start();
}
@override

View File

@ -480,7 +480,7 @@ void main() {
dragStartBehavior: DragStartBehavior.down,
addSemanticIndexes: false,
itemCount: 50,
itemBuilder: (BuildContext context, int index){
itemBuilder: (BuildContext context, int index) {
if (index == 0){
return const _AlwaysKeepAlive(
key: GlobalObjectKey<_AlwaysKeepAliveState>(0),
@ -514,7 +514,7 @@ void main() {
child: ListView.builder(
addSemanticIndexes: false,
itemCount: 250,
itemBuilder: (BuildContext context, int index){
itemBuilder: (BuildContext context, int index) {
if (index % 2 == 0){
return _AlwaysKeepAlive(
key: GlobalObjectKey<_AlwaysKeepAliveState>(index),
@ -631,5 +631,5 @@ class RenderSliverMultiBoxAdaptorAlt extends RenderSliver with
}
@override
void performLayout() {}
void performLayout() { }
}

View File

@ -46,7 +46,7 @@ void main() {
WidgetsBinding.instance.addObserver(observer);
final ByteData message = const JSONMessageCodec().encodeMessage(
<String, dynamic>{'type': 'memoryPressure'});
await BinaryMessages.handlePlatformMessage('flutter/system', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/system', message, (_) { });
expect(observer.sawMemoryPressure, true);
WidgetsBinding.instance.removeObserver(observer);
});
@ -56,19 +56,19 @@ void main() {
WidgetsBinding.instance.addObserver(observer);
ByteData message = const StringCodec().encodeMessage('AppLifecycleState.paused');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(observer.lifecycleState, AppLifecycleState.paused);
message = const StringCodec().encodeMessage('AppLifecycleState.resumed');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(observer.lifecycleState, AppLifecycleState.resumed);
message = const StringCodec().encodeMessage('AppLifecycleState.inactive');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(observer.lifecycleState, AppLifecycleState.inactive);
message = const StringCodec().encodeMessage('AppLifecycleState.suspending');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(observer.lifecycleState, AppLifecycleState.suspending);
});
@ -79,7 +79,7 @@ void main() {
const String testRouteName = 'testRouteName';
final ByteData message = const JSONMethodCodec().encodeMethodCall(
const MethodCall('pushRoute', testRouteName));
await BinaryMessages.handlePlatformMessage('flutter/navigation', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/navigation', message, (_) { });
expect(observer.pushedRoute, testRouteName);
WidgetsBinding.instance.removeObserver(observer);
@ -90,31 +90,31 @@ void main() {
expect(tester.binding.hasScheduledFrame, isFalse);
message = const StringCodec().encodeMessage('AppLifecycleState.paused');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(tester.binding.hasScheduledFrame, isFalse);
message = const StringCodec().encodeMessage('AppLifecycleState.resumed');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(tester.binding.hasScheduledFrame, isTrue);
await tester.pump();
expect(tester.binding.hasScheduledFrame, isFalse);
message = const StringCodec().encodeMessage('AppLifecycleState.inactive');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(tester.binding.hasScheduledFrame, isFalse);
message = const StringCodec().encodeMessage('AppLifecycleState.suspending');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(tester.binding.hasScheduledFrame, isFalse);
message = const StringCodec().encodeMessage('AppLifecycleState.inactive');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(tester.binding.hasScheduledFrame, isTrue);
await tester.pump();
expect(tester.binding.hasScheduledFrame, isFalse);
message = const StringCodec().encodeMessage('AppLifecycleState.paused');
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) {});
await BinaryMessages.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(tester.binding.hasScheduledFrame, isFalse);
tester.binding.scheduleFrame();

View File

@ -18,18 +18,18 @@ class ProbeWidgetState extends State<ProbeWidget> {
@override
void initState() {
super.initState();
setState(() {});
setState(() { });
}
@override
void didUpdateWidget(ProbeWidget oldWidget) {
super.didUpdateWidget(oldWidget);
setState(() {});
setState(() { });
}
@override
Widget build(BuildContext context) {
setState(() {});
setState(() { });
buildCount++;
return Container();
}

View File

@ -234,14 +234,14 @@ void _defineTests() {
decreasedValue: 'decrease-after',
hint: 'hint-after',
textDirection: TextDirection.ltr,
onScrollDown: () {},
onLongPress: () {},
onDecrease: () {},
onIncrease: () {},
onScrollLeft: () {},
onScrollRight: () {},
onScrollUp: () {},
onTap: () {},
onScrollDown: () { },
onLongPress: () { },
onDecrease: () { },
onIncrease: () { },
onScrollLeft: () { },
onScrollRight: () { },
onScrollUp: () { },
onTap: () { },
),
),
),

View File

@ -784,7 +784,7 @@ void main() {
cursorColor: Colors.blue,
selectionControls: materialTextSelectionControls,
keyboardType: TextInputType.text,
onChanged: (String value) {},
onChanged: (String value) { },
),
),
),

View File

@ -137,7 +137,7 @@ Future<void> main() async {
fadeOutDuration: animationDuration,
fadeInDuration: animationDuration,
imageSemanticLabel: imageSemanticText,
placeholderSemanticLabel: placeholderSemanticText
placeholderSemanticLabel: placeholderSemanticText,
));
placeholderProvider.complete(); // load the placeholder
@ -164,7 +164,7 @@ Future<void> main() async {
image: imageProvider,
fadeOutDuration: animationDuration,
fadeInDuration: animationDuration,
placeholderSemanticLabel: placeholderSemanticText
placeholderSemanticLabel: placeholderSemanticText,
));
placeholderProvider.complete(); // load the placeholder

View File

@ -225,7 +225,7 @@ void main() {
});
testWidgets('cache unchanged callbacks', (WidgetTester tester) async {
final GestureTapCallback inputCallback = () {};
final GestureTapCallback inputCallback = () { };
await tester.pumpWidget(
Center(

View File

@ -79,7 +79,7 @@ void main() {
child: ListWheelScrollView.useDelegate(
controller: controller,
itemExtent: 100.0,
onSelectedItemChanged: (_) {},
onSelectedItemChanged: (_) { },
childDelegate: ListWheelChildLoopingListDelegate(
children: List<Widget>.generate(10, (int index) {
return Container(
@ -125,7 +125,7 @@ void main() {
child: ListWheelScrollView.useDelegate(
controller: controller,
itemExtent: 100.0,
onSelectedItemChanged: (_) {},
onSelectedItemChanged: (_) { },
childDelegate: ListWheelChildBuilderDelegate(
builder: (BuildContext context, int index) {
return Container(
@ -168,7 +168,7 @@ void main() {
child: ListWheelScrollView.useDelegate(
controller: controller,
itemExtent: 100.0,
onSelectedItemChanged: (_) {},
onSelectedItemChanged: (_) { },
childDelegate: ListWheelChildBuilderDelegate(
builder: (BuildContext context, int index) {
if (index < -15 || index > -5)
@ -287,7 +287,7 @@ void main() {
child: ListWheelScrollView.useDelegate(
controller: controller,
itemExtent: 100.0,
onSelectedItemChanged: (_) {},
onSelectedItemChanged: (_) { },
childDelegate: ListWheelChildBuilderDelegate(
builder: (BuildContext context, int index) {
expect(builtChildren.contains(index), false);
@ -323,7 +323,7 @@ void main() {
child: ListWheelScrollView(
controller: controller,
itemExtent: 100.0,
onSelectedItemChanged: (_) {},
onSelectedItemChanged: (_) { },
children: List<Widget>.generate(16, (int index) {
return Text(index.toString());
}),

View File

@ -635,7 +635,7 @@ void main() {
onVerticalDragStart: (DragStartDetails d) {
verticalDragAcceptedByParent = true;
},
onLongPress: () {},
onLongPress: () { },
child: const SizedBox(
width: 200.0,
height: 100.0,
@ -721,7 +721,7 @@ void main() {
Align(
alignment: Alignment.topLeft,
child: GestureDetector(
onVerticalDragStart: (DragStartDetails d) {},
onVerticalDragStart: (DragStartDetails d) { },
child: SizedBox(
width: 200.0,
height: 100.0,
@ -1253,7 +1253,7 @@ void main() {
onVerticalDragStart: (DragStartDetails d) {
verticalDragAcceptedByParent = true;
},
onLongPress: () {},
onLongPress: () { },
child: const SizedBox(
width: 200.0,
height: 100.0,
@ -1332,7 +1332,7 @@ void main() {
Align(
alignment: Alignment.topLeft,
child: GestureDetector(
onVerticalDragStart: (DragStartDetails d) {},
onVerticalDragStart: (DragStartDetails d) { },
child: SizedBox(
width: 200.0,
height: 100.0,

View File

@ -639,7 +639,7 @@ void main() {
final SemanticsHandle semantics = tester.ensureSemantics();
await tester.pumpWidget(Semantics(
container: true,
onTap: () {},
onTap: () { },
onTapHint: 'test',
));
@ -650,7 +650,7 @@ void main() {
await tester.pumpWidget(Semantics(
container: true,
onLongPress: () {},
onLongPress: () { },
onLongPressHint: 'foo',
));
@ -666,8 +666,8 @@ void main() {
await tester.pumpWidget(Semantics(
container: true,
customSemanticsActions: <CustomSemanticsAction, VoidCallback>{
const CustomSemanticsAction(label: 'foo'): () {},
const CustomSemanticsAction(label: 'bar'): () {},
const CustomSemanticsAction(label: 'foo'): () { },
const CustomSemanticsAction(label: 'bar'): () { },
},
));
@ -691,8 +691,8 @@ void main() {
value: '10s',
increasedValue: '11s',
decreasedValue: '9s',
onIncrease: () => () {},
onDecrease: () => () {},
onIncrease: () => () { },
onDecrease: () => () { },
),
),
);

View File

@ -30,8 +30,8 @@ void _tests() {
Semantics(
selected: true,
checked: true,
onTap: () {},
onDecrease: () {},
onTap: () { },
onDecrease: () { },
value: 'test-value',
increasedValue: 'test-increasedValue',
decreasedValue: 'test-decreasedValue',

View File

@ -148,7 +148,7 @@ void main() {
TextSpan(
children: <TextSpan>[
const TextSpan(text: 'hello '),
TextSpan(text: 'world', recognizer: TapGestureRecognizer()..onTap = () {}),
TextSpan(text: 'world', recognizer: TapGestureRecognizer()..onTap = () { }),
const TextSpan(text: ' this is a '),
const TextSpan(text: 'cat-astrophe'),
],
@ -193,9 +193,9 @@ void main() {
style: textStyle,
children: <TextSpan>[
const TextSpan(text: 'hello world${Unicode.RLE}${Unicode.RLO} '),
TextSpan(text: 'BOY', recognizer: LongPressGestureRecognizer()..onLongPress = () {}),
TextSpan(text: 'BOY', recognizer: LongPressGestureRecognizer()..onLongPress = () { }),
const TextSpan(text: ' HOW DO${Unicode.PDF} you ${Unicode.RLO} DO '),
TextSpan(text: 'SIR', recognizer: TapGestureRecognizer()..onTap = () {}),
TextSpan(text: 'SIR', recognizer: TapGestureRecognizer()..onTap = () { }),
const TextSpan(text: '${Unicode.PDF}${Unicode.PDF} good bye'),
],
),

View File

@ -26,7 +26,7 @@ class _DummyPortForwarder implements PortForwarder {
int get remotePort => _remotePort;
@override
Future<void> stop() async {}
Future<void> stop() async { }
}
class _DummySshCommandRunner implements SshCommandRunner {

View File

@ -416,7 +416,7 @@ class FlutterDriver {
return response['response'];
}
void _logCommunication(String message) {
void _logCommunication(String message) {
if (_printCommunication)
_log.info(message);
if (_logCommunicationToFile) {

View File

@ -62,7 +62,7 @@ void main() {
await _pumpBoilerplate(tester, DayPicker(
selectedDate: baseDate,
currentDate: baseDate,
onChanged: (DateTime newValue) {},
onChanged: (DateTime newValue) { },
firstDate: baseDate.subtract(const Duration(days: 90)),
lastDate: baseDate.add(const Duration(days: 90)),
displayedMonth: baseDate,

View File

@ -197,7 +197,7 @@ class MinimumTextContrastGuideline extends AccessibilityGuideline {
final RenderView renderView = tester.binding.renderView;
final OffsetLayer layer = renderView.layer;
ui.Image image;
final ByteData byteData = await tester.binding.runAsync<ByteData>(() async {
final ByteData byteData = await tester.binding.runAsync<ByteData>(() async {
// Needs to be the same pixel ratio otherwise our dimensions won't match the
// last transform layer.
image = await layer.toImage(renderView.paintBounds, pixelRatio: 1.0);

View File

@ -1530,22 +1530,22 @@ class _MockHttpClient implements HttpClient {
String userAgent;
@override
void addCredentials(Uri url, String realm, HttpClientCredentials credentials) {}
void addCredentials(Uri url, String realm, HttpClientCredentials credentials) { }
@override
void addProxyCredentials(String host, int port, String realm, HttpClientCredentials credentials) {}
void addProxyCredentials(String host, int port, String realm, HttpClientCredentials credentials) { }
@override
set authenticate(Future<bool> Function(Uri url, String scheme, String realm) f) {}
set authenticate(Future<bool> Function(Uri url, String scheme, String realm) f) { }
@override
set authenticateProxy(Future<bool> Function(String host, int port, String scheme, String realm) f) {}
set authenticateProxy(Future<bool> Function(String host, int port, String scheme, String realm) f) { }
@override
set badCertificateCallback(bool Function(X509Certificate cert, String host, int port) callback) {}
set badCertificateCallback(bool Function(X509Certificate cert, String host, int port) callback) { }
@override
void close({ bool force = false }) {}
void close({ bool force = false }) { }
@override
Future<HttpClientRequest> delete(String host, int port, String path) {
@ -1558,7 +1558,7 @@ class _MockHttpClient implements HttpClient {
}
@override
set findProxy(String Function(Uri url) f) {}
set findProxy(String Function(Uri url) f) { }
@override
Future<HttpClientRequest> get(String host, int port, String path) {
@ -1630,10 +1630,10 @@ class _MockHttpRequest extends HttpClientRequest {
final HttpHeaders headers = _MockHttpHeaders();
@override
void add(List<int> data) {}
void add(List<int> data) { }
@override
void addError(Object error, [ StackTrace stackTrace ]) {}
void addError(Object error, [ StackTrace stackTrace ]) { }
@override
Future<void> addStream(Stream<List<int>> stream) {
@ -1666,16 +1666,16 @@ class _MockHttpRequest extends HttpClientRequest {
Uri get uri => null;
@override
void write(Object obj) {}
void write(Object obj) { }
@override
void writeAll(Iterable<Object> objects, [ String separator = '' ]) {}
void writeAll(Iterable<Object> objects, [ String separator = '' ]) { }
@override
void writeCharCode(int charCode) {}
void writeCharCode(int charCode) { }
@override
void writeln([ Object obj = '' ]) {}
void writeln([ Object obj = '' ]) { }
}
/// A mocked [HttpClientResponse] which is empty and has a [statusCode] of 400.
@ -1732,25 +1732,25 @@ class _MockHttpHeaders extends HttpHeaders {
List<String> operator [](String name) => <String>[];
@override
void add(String name, Object value) {}
void add(String name, Object value) { }
@override
void clear() {}
void clear() { }
@override
void forEach(void Function(String name, List<String> values) f) {}
void forEach(void Function(String name, List<String> values) f) { }
@override
void noFolding(String name) {}
void noFolding(String name) { }
@override
void remove(String name, Object value) {}
void remove(String name, Object value) { }
@override
void removeAll(String name) {}
void removeAll(String name) { }
@override
void set(String name, Object value) {}
void set(String name, Object value) { }
@override
String value(String name) => null;

View File

@ -92,7 +92,7 @@ Future<void> _runLiveTest(Suite suiteConfig, LiveTest liveTest, _Reporter report
}
Future<void> _runSkippedTest(Suite suiteConfig, Test test, List<Group> parents, _Reporter reporter) async {
final LocalTest skipped = LocalTest(test.name, test.metadata, () {}, trace: test.trace);
final LocalTest skipped = LocalTest(test.name, test.metadata, () { }, trace: test.trace);
if (skipped.metadata.skipReason != null) {
print('Skip: ${skipped.metadata.skipReason}');
}

View File

@ -182,7 +182,7 @@ void main() {
width: 48.0,
height: 48.0,
child: GestureDetector(
onTap: () {},
onTap: () { },
),
),
));
@ -197,7 +197,7 @@ void main() {
width: 47.0,
height: 48.0,
child: GestureDetector(
onTap: () {},
onTap: () { },
),
),
));
@ -212,7 +212,7 @@ void main() {
width: 48.0,
height: 47.0,
child: GestureDetector(
onTap: () {},
onTap: () { },
),
),
));
@ -229,7 +229,7 @@ void main() {
width: 48.0,
height: 48.0,
child: GestureDetector(
onTap: () {},
onTap: () { },
),
),
),
@ -245,7 +245,7 @@ void main() {
width: 48.0,
height: 47.0,
child: GestureDetector(
onTap: () {},
onTap: () { },
),
),
));
@ -264,7 +264,7 @@ void main() {
width: 48.0,
height: 47.0,
child: GestureDetector(
onTap: () {},
onTap: () { },
),
);
await tester.pumpWidget(
@ -347,7 +347,7 @@ void main() {
child: Semantics(
container: true,
child: GestureDetector(
onTap: () {},
onTap: () { },
child: const SizedBox(width: 4.0, height: 4.0),
),
),
@ -368,7 +368,7 @@ void main() {
await tester.pumpWidget(_boilerplate(Semantics(
container: true,
child: const SizedBox(width: 10.0, height: 10.0),
onTap: () {},
onTap: () { },
label: 'test',
)));
final Evaluation result = await labeledTapTargetGuideline.evaluate(tester);
@ -380,7 +380,7 @@ void main() {
await tester.pumpWidget(_boilerplate(Semantics(
container: true,
child: const SizedBox(width: 10.0, height: 10.0),
onLongPress: () {},
onLongPress: () { },
label: '',
)));
final Evaluation result = await labeledTapTargetGuideline.evaluate(tester);
@ -393,7 +393,7 @@ void main() {
await tester.pumpWidget(_boilerplate(Semantics(
container: true,
child: const SizedBox(width: 10.0, height: 10.0),
onTap: () {},
onTap: () { },
label: '',
)));
final Evaluation result = await labeledTapTargetGuideline.evaluate(tester);
@ -405,7 +405,7 @@ void main() {
final SemanticsHandle handle = tester.ensureSemantics();
await tester.pumpWidget(_boilerplate(Semantics(
container: true,
onLongPress: () {},
onLongPress: () { },
label: '',
child: Semantics(
label: 'test',

View File

@ -393,8 +393,8 @@ void main() {
namesRoute: true,
header: true,
button: true,
onTap: () {},
onLongPress: () {},
onTap: () { },
onLongPress: () { },
label: 'foo',
hint: 'bar',
value: 'baz',
@ -404,8 +404,8 @@ void main() {
onTapHint: 'scan',
onLongPressHint: 'fill',
customSemanticsActions: <CustomSemanticsAction, VoidCallback>{
const CustomSemanticsAction(label: 'foo'): () {},
const CustomSemanticsAction(label: 'bar'): () {},
const CustomSemanticsAction(label: 'foo'): () { },
const CustomSemanticsAction(label: 'bar'): () { },
},
));

View File

@ -330,7 +330,7 @@ void main() {
});
});
group('pageBack', (){
group('pageBack', () {
testWidgets('fails when there are no back buttons', (WidgetTester tester) async {
await tester.pumpWidget(Container());
@ -492,7 +492,7 @@ void main() {
testWidgets('disallows re-entry', (WidgetTester tester) async {
final Completer<void> completer = Completer<void>();
tester.runAsync<void>(() => completer.future);
expect(() => tester.runAsync(() async {}), throwsA(isInstanceOf<TestFailure>()));
expect(() => tester.runAsync(() async { }), throwsA(isInstanceOf<TestFailure>()));
completer.complete();
});
@ -573,7 +573,7 @@ void main() {
home: Scaffold(
body: Container(
child: OutlineButton(
onPressed: () {},
onPressed: () { },
child: const Text('hello'),
),
),

View File

@ -184,7 +184,7 @@ class StdoutLogger extends Logger {
}
@override
void printTrace(String message) {}
void printTrace(String message) { }
@override
Status startProgress(

View File

@ -272,7 +272,7 @@ class AttachCommand extends FlutterCommand {
return null;
}
Future<void> _validateArguments() async {}
Future<void> _validateArguments() async { }
}
class HotRunnerFactory {

View File

@ -79,7 +79,7 @@ class StdoutHandler {
void handler(String message) {
const String kResultPrefix = 'result ';
if (boundaryKey == null && message.startsWith(kResultPrefix)) {
boundaryKey = message.substring(kResultPrefix.length);
boundaryKey = message.substring(kResultPrefix.length);
} else if (message.startsWith(boundaryKey)) {
if (message.length <= boundaryKey.length) {
compilerOutput.complete(null);

View File

@ -492,5 +492,5 @@ class NoOpDevicePortForwarder implements DevicePortForwarder {
List<ForwardedPort> get forwardedPorts => <ForwardedPort>[];
@override
Future<void> unforward(ForwardedPort forwardedPort) async {}
Future<void> unforward(ForwardedPort forwardedPort) async { }
}

View File

@ -312,7 +312,7 @@ class GroupedValidator extends DoctorValidator {
String _currentSlowWarning = 'Initializing...';
@override
Future<ValidationResult> validate() async {
Future<ValidationResult> validate() async {
final List<ValidatorTask> tasks = <ValidatorTask>[];
for (DoctorValidator validator in subValidators) {
tasks.add(ValidatorTask(validator, validator.validate()));

View File

@ -95,7 +95,7 @@ final RegExp _certificateOrganizationalUnitExtractionPattern = RegExp(r'OU=([a-z
Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
BuildableIOSApp iosApp,
bool usesTerminalUi = true,
}) async{
}) async {
final Map<String, String> buildSettings = iosApp.project.buildSettings;
if (buildSettings == null)
return null;

View File

@ -14,7 +14,7 @@ class LinuxDevice extends Device {
LinuxDevice() : super('Linux');
@override
void clearLogs() {}
void clearLogs() { }
@override
DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('linux');

View File

@ -20,7 +20,7 @@ class MacOSDevice extends Device {
MacOSDevice() : super('macOS');
@override
void clearLogs() {}
void clearLogs() { }
@override
DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('macos');

View File

@ -11,20 +11,20 @@ abstract class TestWatcher {
///
/// If startPaused was true, the caller needs to resume in Observatory to
/// start running the tests.
void handleStartedProcess(ProcessEvent event) {}
void handleStartedProcess(ProcessEvent event) { }
/// Called after the tests finish but before the process exits.
///
/// The child process won't exit until this method completes.
/// Not called if the process died.
Future<void> handleFinishedTest(ProcessEvent event) async {}
Future<void> handleFinishedTest(ProcessEvent event) async { }
/// Called when the test process crashed before connecting to test harness.
Future<void> handleTestCrashed(ProcessEvent event) async {}
Future<void> handleTestCrashed(ProcessEvent event) async { }
/// Called if we timed out waiting for the test process to connect to test
/// harness.
Future<void> handleTestTimedOut(ProcessEvent event) async {}
Future<void> handleTestTimedOut(ProcessEvent event) async { }
}
/// Describes a child process started during testing.

View File

@ -65,7 +65,7 @@ class FlutterTesterDevice extends Device {
Future<TargetPlatform> get targetPlatform async => TargetPlatform.tester;
@override
void clearLogs() {}
void clearLogs() { }
final _FlutterTesterDeviceLogReader _logReader =
_FlutterTesterDeviceLogReader();

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