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( child: GestureDetector(
// Blocks taps from propagating to the modal sheet and popping. // Blocks taps from propagating to the modal sheet and popping.
onTap: () {}, onTap: () { },
child: SafeArea( child: SafeArea(
top: false, top: false,
child: picker, child: picker,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -29,8 +29,8 @@ class EagerGestureRecognizer extends OneSequenceGestureRecognizer {
String get debugDescription => 'eager'; String get debugDescription => 'eager';
@override @override
void didStopTrackingLastPointer(int pointer) {} void didStopTrackingLastPointer(int pointer) { }
@override @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 /// CountdownZoned tracks whether the specified duration has elapsed since
/// creation, honoring [Zone]. /// creation, honoring [Zone].
class _CountdownZoned { class _CountdownZoned {
_CountdownZoned({ @required Duration duration }) _CountdownZoned({ @required Duration duration })
: assert(duration != null) { : assert(duration != null) {
_timer = Timer(duration, _onTimeout); _timer = Timer(duration, _onTimeout);
} }

View File

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

View File

@ -128,8 +128,7 @@ class InkRipple extends InteractiveInkFeature {
_textDirection = textDirection, _textDirection = textDirection,
_targetRadius = radius ?? _getTargetRadius(referenceBox, containedInkWell, rectCallback, position), _targetRadius = radius ?? _getTargetRadius(referenceBox, containedInkWell, rectCallback, position),
_clipCallback = _getClipCallback(referenceBox, containedInkWell, rectCallback), _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); assert(_borderRadius != null);
// Immediately begin fading-in the initial splash. // 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. // The returned list is ordered for hit testing.
Iterable<RenderBox> get _children sync *{ Iterable<RenderBox> get _children sync* {
if (icon != null) if (icon != null)
yield icon; yield icon;
if (input != null) if (input != null)

View File

@ -738,7 +738,7 @@ class _RenderListTile extends RenderBox {
} }
// The returned list is ordered for hit testing. // The returned list is ordered for hit testing.
Iterable<RenderBox> get _children sync *{ Iterable<RenderBox> get _children sync* {
if (leading != null) if (leading != null)
yield leading; yield leading;
if (title != null) 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. // If the target is not the original starting point, then we will accept the drop.
return _dragging == toAccept && toAccept != toWrap.key; return _dragging == toAccept && toAccept != toWrap.key;
}, },
onAccept: (Key accepted) {}, onAccept: (Key accepted) { },
onLeave: (Key leaving) {}, 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. /// This is only for debug and test purpose only.
@visibleForTesting @visibleForTesting
void debugMarkClean() { void debugMarkClean() {
assert((){ assert(() {
_needsAddToScene = false; _needsAddToScene = false;
return true; return true;
}()); }());
@ -77,7 +77,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
@visibleForTesting @visibleForTesting
bool get debugSubtreeNeedsAddToScene { bool get debugSubtreeNeedsAddToScene {
bool result; bool result;
assert((){ assert(() {
result = _subtreeNeedsAddToScene; result = _subtreeNeedsAddToScene;
return true; return true;
}()); }());

View File

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

View File

@ -242,7 +242,7 @@ abstract class WidgetsBindingObserver {
/// features. /// features.
/// ///
/// This method exposes notifications from [Window.onAccessibilityFeaturesChanged]. /// This method exposes notifications from [Window.onAccessibilityFeaturesChanged].
void didChangeAccessibilityFeatures() {} void didChangeAccessibilityFeatures() { }
} }
/// The glue between the widgets layer and the Flutter engine. /// 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 /// Any properties that depend upon tweens created by [forEachTween] should be
/// updated within [didUpdateTweens], not within [forEachTween]. /// updated within [didUpdateTweens], not within [forEachTween].
@protected @protected
void didUpdateTweens() {} void didUpdateTweens() { }
} }
/// A base class for widgets with implicit animations that need to rebuild their /// 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 /// Useful for subclasses that which to track which children are included in
/// the underlying render tree. /// 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 /// Called whenever a new instance of the child delegate class is
/// provided to the sliver. /// provided to the sliver.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@ void main() {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
home: Scaffold(appBar: AppBar( home: Scaffold(appBar: AppBar(
actions: <Widget>[ 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( home: Scaffold(appBar: AppBar(
title: const Text('App Bar Title'), title: const Text('App Bar Title'),
actions: <Widget>[ actions: <Widget>[
IconButton(icon: const Icon(Icons.share), onPressed: () {}), IconButton(icon: const Icon(Icons.share), onPressed: () { }),
], ],
)), )),
)); ));
@ -85,7 +85,7 @@ void main() {
actionsIconTheme: actionsIconThemeData, actionsIconTheme: actionsIconThemeData,
textTheme: textTheme, textTheme: textTheme,
actions: <Widget>[ actions: <Widget>[
IconButton(icon: const Icon(Icons.share), onPressed: () {}), IconButton(icon: const Icon(Icons.share), onPressed: () { }),
], ],
)), )),
)); ));
@ -118,7 +118,7 @@ void main() {
iconTheme: iconThemeData, iconTheme: iconThemeData,
actionsIconTheme: actionsIconThemeData, actionsIconTheme: actionsIconThemeData,
actions: <Widget>[ 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, theme: themeData,
home: Scaffold(appBar: AppBar( home: Scaffold(appBar: AppBar(
actions: <Widget>[ actions: <Widget>[
IconButton(icon: const Icon(Icons.share), onPressed: () {}), IconButton(icon: const Icon(Icons.share), onPressed: () { }),
], ],
)), )),
)); ));
@ -162,7 +162,7 @@ void main() {
theme: themeData, theme: themeData,
home: Scaffold(appBar: AppBar( home: Scaffold(appBar: AppBar(
actions: <Widget>[ 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( child: MaterialButton(
key: key1, key: key1,
child: const SizedBox(width: 50.0, height: 8.0), child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {}, onPressed: () { },
), ),
), ),
), ),
@ -509,7 +509,7 @@ void main() {
child: MaterialButton( child: MaterialButton(
key: key2, key: key2,
child: const SizedBox(width: 50.0, height: 8.0), child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {}, onPressed: () { },
), ),
), ),
), ),
@ -532,7 +532,7 @@ void main() {
child: FlatButton( child: FlatButton(
key: key1, key: key1,
child: const SizedBox(width: 50.0, height: 8.0), child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {}, onPressed: () { },
), ),
), ),
), ),
@ -553,7 +553,7 @@ void main() {
child: FlatButton( child: FlatButton(
key: key2, key: key2,
child: const SizedBox(width: 50.0, height: 8.0), child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {}, onPressed: () { },
), ),
), ),
), ),
@ -576,7 +576,7 @@ void main() {
child: RaisedButton( child: RaisedButton(
key: key1, key: key1,
child: const SizedBox(width: 50.0, height: 8.0), child: const SizedBox(width: 50.0, height: 8.0),
onPressed: () {}, onPressed: () { },
), ),
), ),
), ),
@ -597,7 +597,7 @@ void main() {
child: RaisedButton( child: RaisedButton(
key: key2, key: key2,
child: const SizedBox(width: 50.0, height: 8.0), 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)); 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( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@ void main() {
testWidgets('FlatButton implements debugFillDescription', (WidgetTester tester) async { testWidgets('FlatButton implements debugFillDescription', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
FlatButton( FlatButton(
onPressed: () {}, onPressed: () { },
textColor: const Color(0xFF00FF00), textColor: const Color(0xFF00FF00),
disabledTextColor: const Color(0xFFFF0000), disabledTextColor: const Color(0xFFFF0000),
color: const Color(0xFF000000), 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( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,

View File

@ -636,7 +636,7 @@ void main() {
child: RepaintBoundary( child: RepaintBoundary(
key: key, key: key,
child: FloatingActionButton( child: FloatingActionButton(
onPressed: () {}, onPressed: () { },
child: const Icon(Icons.add), 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( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -57,7 +57,7 @@ void main() {
child: Switch( child: Switch(
dragStartBehavior: DragStartBehavior.down, dragStartBehavior: DragStartBehavior.down,
value: true, value: true,
onChanged: (bool newValue) {}, onChanged: (bool newValue) { },
), ),
), ),
), ),
@ -77,7 +77,7 @@ void main() {
child: Switch( child: Switch(
dragStartBehavior: DragStartBehavior.down, dragStartBehavior: DragStartBehavior.down,
value: true, 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 { testWidgets('TextField passes onEditingComplete to EditableText', (WidgetTester tester) async {
final VoidCallback onEditingComplete = () {}; final VoidCallback onEditingComplete = () { };
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
@ -2443,7 +2443,7 @@ void main() {
}); });
} }
group('Keyboard Tests', (){ group('Keyboard Tests', () {
TextEditingController controller; TextEditingController controller;
setUp( () { 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()); await tester.pumpWidget(setupWidget());
const String testValue = 'a big house'; const String testValue = 'a big house';
@ -2484,7 +2484,7 @@ void main() {
expect(controller.selection.extentOffset - controller.selection.baseOffset, 1); 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()); await tester.pumpWidget(setupWidget());
const String testValue = 'their big house'; const String testValue = 'their big house';
await tester.enterText(find.byType(TextField), testValue); await tester.enterText(find.byType(TextField), testValue);
@ -2500,7 +2500,7 @@ void main() {
expect(controller.selection.extentOffset - controller.selection.baseOffset, 5); 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()); await tester.pumpWidget(setupWidget());
const String testValue = 'a big house'; const String testValue = 'a big house';
await tester.enterText(find.byType(TextField), testValue); await tester.enterText(find.byType(TextField), testValue);
@ -2522,7 +2522,7 @@ void main() {
expect(controller.selection.extentOffset - controller.selection.baseOffset, 0); 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()); await tester.pumpWidget(setupWidget());
const String testValue = 'a big house\njumped over a mouse\nOne more line yay'; // 11 \n 19 const String testValue = 'a big house\njumped over a mouse\nOne more line yay'; // 11 \n 19
await tester.enterText(find.byType(TextField), testValue); await tester.enterText(find.byType(TextField), testValue);
@ -2580,7 +2580,7 @@ void main() {
const int _kAKeyCode = 29; const int _kAKeyCode = 29;
const int _kDelKeyCode = 112; const int _kDelKeyCode = 112;
testWidgets('Copy paste test', (WidgetTester tester) async{ testWidgets('Copy paste test', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController(); final TextEditingController controller = TextEditingController();
final TextField textField = final TextField textField =
@ -2651,7 +2651,7 @@ void main() {
expect(find.text(expected), findsOneWidget); expect(find.text(expected), findsOneWidget);
}); });
testWidgets('Cut test', (WidgetTester tester) async{ testWidgets('Cut test', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController(); final TextEditingController controller = TextEditingController();
final TextField textField = final TextField textField =
@ -2723,7 +2723,7 @@ void main() {
expect(find.text(expected), findsOneWidget); expect(find.text(expected), findsOneWidget);
}); });
testWidgets('Select all test', (WidgetTester tester) async{ testWidgets('Select all test', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController(); final TextEditingController controller = TextEditingController();
final TextField textField = final TextField textField =
@ -2769,7 +2769,7 @@ void main() {
expect(find.text(expected), findsOneWidget); expect(find.text(expected), findsOneWidget);
}); });
testWidgets('Delete test', (WidgetTester tester) async{ testWidgets('Delete test', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController(); final TextEditingController controller = TextEditingController();
final TextField textField = final TextField textField =
@ -2823,7 +2823,7 @@ void main() {
expect(find.text(expected2), findsOneWidget); 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 FocusNode focusNode = FocusNode();
final List<RawKeyEvent> events = <RawKeyEvent>[]; final List<RawKeyEvent> events = <RawKeyEvent>[];

View File

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

View File

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

View File

@ -199,7 +199,7 @@ void main() {
test('failed image can successfully be removed from the cache\'s pending images', () async { test('failed image can successfully be removed from the cache\'s pending images', () async {
const TestImage testImage = TestImage(width: 8, height: 8); 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); final bool evicationResult = imageCache.evict(1);
expect(evicationResult, isTrue); expect(evicationResult, isTrue);
}); });

View File

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

View File

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

View File

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

View File

@ -39,16 +39,16 @@ void main() {
class TestRenderObject extends RenderObject { class TestRenderObject extends RenderObject {
@override @override
void debugAssertDoesMeetConstraints() {} void debugAssertDoesMeetConstraints() { }
@override @override
Rect get paintBounds => null; Rect get paintBounds => null;
@override @override
void performLayout() {} void performLayout() { }
@override @override
void performResize() {} void performResize() { }
@override @override
Rect get semanticBounds => Rect.fromLTWH(0.0, 0.0, 10.0, 20.0); 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', () { test('RenderSemanticsGestureHandler adds/removes correct semantic actions', () {
final RenderSemanticsGestureHandler renderObj = RenderSemanticsGestureHandler( final RenderSemanticsGestureHandler renderObj = RenderSemanticsGestureHandler(
onTap: () {}, onTap: () { },
onHorizontalDragUpdate: (DragUpdateDetails details) {}, onHorizontalDragUpdate: (DragUpdateDetails details) { },
); );
SemanticsConfiguration config = SemanticsConfiguration(); SemanticsConfiguration config = SemanticsConfiguration();
@ -287,7 +287,7 @@ class _FakeTicker implements Ticker {
bool muted; bool muted;
@override @override
void absorbTicker(Ticker originalTicker) {} void absorbTicker(Ticker originalTicker) { }
@override @override
String get debugLabel => null; String get debugLabel => null;
@ -305,10 +305,10 @@ class _FakeTicker implements Ticker {
bool get shouldScheduleTick => null; bool get shouldScheduleTick => null;
@override @override
void dispose() {} void dispose() { }
@override @override
void scheduleTick({ bool rescheduling = false }) {} void scheduleTick({ bool rescheduling = false }) { }
@override @override
TickerFuture start() { TickerFuture start() {
@ -316,10 +316,10 @@ class _FakeTicker implements Ticker {
} }
@override @override
void stop({ bool canceled = false }) {} void stop({ bool canceled = false }) { }
@override @override
void unscheduleTick() {} void unscheduleTick() { }
@override @override
String toString({ bool debugIncludeStack = false }) => super.toString(); String toString({ bool debugIncludeStack = false }) => super.toString();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -148,7 +148,7 @@ void main() {
TextSpan( TextSpan(
children: <TextSpan>[ children: <TextSpan>[
const TextSpan(text: 'hello '), 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: ' this is a '),
const TextSpan(text: 'cat-astrophe'), const TextSpan(text: 'cat-astrophe'),
], ],
@ -193,9 +193,9 @@ void main() {
style: textStyle, style: textStyle,
children: <TextSpan>[ children: <TextSpan>[
const TextSpan(text: 'hello world${Unicode.RLE}${Unicode.RLO} '), 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 '), 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'), const TextSpan(text: '${Unicode.PDF}${Unicode.PDF} good bye'),
], ],
), ),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -393,8 +393,8 @@ void main() {
namesRoute: true, namesRoute: true,
header: true, header: true,
button: true, button: true,
onTap: () {}, onTap: () { },
onLongPress: () {}, onLongPress: () { },
label: 'foo', label: 'foo',
hint: 'bar', hint: 'bar',
value: 'baz', value: 'baz',
@ -404,8 +404,8 @@ void main() {
onTapHint: 'scan', onTapHint: 'scan',
onLongPressHint: 'fill', onLongPressHint: 'fill',
customSemanticsActions: <CustomSemanticsAction, VoidCallback>{ customSemanticsActions: <CustomSemanticsAction, VoidCallback>{
const CustomSemanticsAction(label: 'foo'): () {}, const CustomSemanticsAction(label: 'foo'): () { },
const CustomSemanticsAction(label: 'bar'): () {}, 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 { testWidgets('fails when there are no back buttons', (WidgetTester tester) async {
await tester.pumpWidget(Container()); await tester.pumpWidget(Container());
@ -492,7 +492,7 @@ void main() {
testWidgets('disallows re-entry', (WidgetTester tester) async { testWidgets('disallows re-entry', (WidgetTester tester) async {
final Completer<void> completer = Completer<void>(); final Completer<void> completer = Completer<void>();
tester.runAsync<void>(() => completer.future); tester.runAsync<void>(() => completer.future);
expect(() => tester.runAsync(() async {}), throwsA(isInstanceOf<TestFailure>())); expect(() => tester.runAsync(() async { }), throwsA(isInstanceOf<TestFailure>()));
completer.complete(); completer.complete();
}); });
@ -573,7 +573,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: Container( body: Container(
child: OutlineButton( child: OutlineButton(
onPressed: () {}, onPressed: () { },
child: const Text('hello'), child: const Text('hello'),
), ),
), ),

View File

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

View File

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

View File

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

View File

@ -492,5 +492,5 @@ class NoOpDevicePortForwarder implements DevicePortForwarder {
List<ForwardedPort> get forwardedPorts => <ForwardedPort>[]; List<ForwardedPort> get forwardedPorts => <ForwardedPort>[];
@override @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...'; String _currentSlowWarning = 'Initializing...';
@override @override
Future<ValidationResult> validate() async { Future<ValidationResult> validate() async {
final List<ValidatorTask> tasks = <ValidatorTask>[]; final List<ValidatorTask> tasks = <ValidatorTask>[];
for (DoctorValidator validator in subValidators) { for (DoctorValidator validator in subValidators) {
tasks.add(ValidatorTask(validator, validator.validate())); 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({ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
BuildableIOSApp iosApp, BuildableIOSApp iosApp,
bool usesTerminalUi = true, bool usesTerminalUi = true,
}) async{ }) async {
final Map<String, String> buildSettings = iosApp.project.buildSettings; final Map<String, String> buildSettings = iosApp.project.buildSettings;
if (buildSettings == null) if (buildSettings == null)
return null; return null;

View File

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

View File

@ -20,7 +20,7 @@ class MacOSDevice extends Device {
MacOSDevice() : super('macOS'); MacOSDevice() : super('macOS');
@override @override
void clearLogs() {} void clearLogs() { }
@override @override
DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('macos'); 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 /// If startPaused was true, the caller needs to resume in Observatory to
/// start running the tests. /// start running the tests.
void handleStartedProcess(ProcessEvent event) {} void handleStartedProcess(ProcessEvent event) { }
/// Called after the tests finish but before the process exits. /// Called after the tests finish but before the process exits.
/// ///
/// The child process won't exit until this method completes. /// The child process won't exit until this method completes.
/// Not called if the process died. /// 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. /// 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 /// Called if we timed out waiting for the test process to connect to test
/// harness. /// harness.
Future<void> handleTestTimedOut(ProcessEvent event) async {} Future<void> handleTestTimedOut(ProcessEvent event) async { }
} }
/// Describes a child process started during testing. /// Describes a child process started during testing.

View File

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

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