Unverified Commit 8de7020a authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

remove unnecessary trailing commas (#79562)

parent 88f2db62
......@@ -17,7 +17,10 @@ void main() {
await tester.pumpWidget(
const CupertinoApp(
home: CupertinoNavigationBar(
leading: CupertinoButton(child: Text('Something'), onPressed: null,),
leading: CupertinoButton(
child: Text('Something'),
onPressed: null,
),
middle: Text('Title'),
),
),
......
......@@ -879,7 +879,7 @@ void main() {
expect(mockHelper.invocations.last, matchesBuilder(
refreshState: RefreshIndicatorMode.done,
pulledExtent: moreOrLessEquals(148.6463892921364,),
pulledExtent: moreOrLessEquals(148.6463892921364),
refreshTriggerPullDistance: 100.0, // Default value.
refreshIndicatorExtent: 60.0, // Default value.
));
......
......@@ -131,7 +131,7 @@ void main() {
key: painterKey,
child: Center(
child: Card(
child: SizedBox.fromSize(size: const Size(200, 300),),
child: SizedBox.fromSize(size: const Size(200, 300)),
),
),
),
......
......@@ -2280,7 +2280,7 @@ void main() {
testWidgets('FilterChip clipBehavior properly passes through to the Material', (WidgetTester tester) async {
const Text label = Text('label');
await tester.pumpWidget(_wrapForChip(child: FilterChip(label: label, onSelected: (bool b) { },)));
await tester.pumpWidget(_wrapForChip(child: FilterChip(label: label, onSelected: (bool b) { })));
checkChipMaterialClipBehavior(tester, Clip.none);
await tester.pumpWidget(_wrapForChip(child: FilterChip(label: label, onSelected: (bool b) { }, clipBehavior: Clip.antiAlias)));
......@@ -2289,7 +2289,7 @@ void main() {
testWidgets('ActionChip clipBehavior properly passes through to the Material', (WidgetTester tester) async {
const Text label = Text('label');
await tester.pumpWidget(_wrapForChip(child: ActionChip(label: label, onPressed: () { },)));
await tester.pumpWidget(_wrapForChip(child: ActionChip(label: label, onPressed: () { })));
checkChipMaterialClipBehavior(tester, Clip.none);
await tester.pumpWidget(_wrapForChip(child: ActionChip(label: label, clipBehavior: Clip.antiAlias, onPressed: () { })));
......
......@@ -148,11 +148,13 @@ void main() {
}
if (deltas.where((double delta) => delta < maxDeltaRotation).isEmpty) {
fail("The Floating Action Button's rotation should not change "
'faster than $maxDeltaRotation per animation step.\n'
'Detected deltas were: $deltas\n'
'Previous values: $previousRotations, current values: $currentRotations\n'
'Previous rect: $previousRect, current rect: $currentRect',);
fail(
"The Floating Action Button's rotation should not change "
'faster than $maxDeltaRotation per animation step.\n'
'Detected deltas were: $deltas\n'
'Previous values: $previousRotations, current values: $currentRotations\n'
'Previous rect: $previousRect, current rect: $currentRect',
);
}
}
previousRotations = currentRotations;
......
......@@ -1869,7 +1869,7 @@ void main() {
leading: Builder(
builder: (BuildContext context) {
animation = NavigationRail.extendedAnimation(context);
return FloatingActionButton(onPressed: () { },);
return FloatingActionButton(onPressed: () { });
},
),
destinations: _destinations(),
......
......@@ -1683,7 +1683,7 @@ void main() {
);
expect(find.byType(Tooltip), findsNWidgets(3));
expect(find.byTooltip('Test tooltip',), findsNWidgets(3));
expect(find.byTooltip('Test tooltip'), findsNWidgets(3));
});
testWidgets('Allow Widget for PopupMenuButton.icon', (WidgetTester tester) async {
......
......@@ -1867,8 +1867,8 @@ void main() {
// right inactive track RRect
..rrect(rrect: RRect.fromLTRBAndCorners(0.0, 3.0, 24.0, 7.0, topRight: const Radius.circular(2.0), bottomRight: const Radius.circular(2.0)))
// thumbs
..circle(x: -12.0, y: 5.0, radius: 10.0,)
..circle(x: 0.0, y: 5.0, radius: 10.0,)
..circle(x: -12.0, y: 5.0, radius: 10.0)
..circle(x: 0.0, y: 5.0, radius: 10.0)
);
});
......@@ -1911,8 +1911,8 @@ void main() {
// right inactive track RRect
..rect(rect: const Rect.fromLTRB(0.0, 3.0, 24.0, 7.0))
// thumbs
..circle(x: -12.0, y: 5.0, radius: 10.0,)
..circle(x: 0.0, y: 5.0, radius: 10.0,)
..circle(x: -12.0, y: 5.0, radius: 10.0)
..circle(x: 0.0, y: 5.0, radius: 10.0)
);
});
......
......@@ -713,7 +713,7 @@ void main() {
},
),
bottomNavigationBar: const BottomAppBar(
child: SizedBox(height: 48.0,),
child: SizedBox(height: 48.0),
),
),
),
......@@ -1854,7 +1854,7 @@ void main() {
),
),
);
},);
});
} on FlutterError catch (e) {
error = e;
} finally {
......
......@@ -1233,7 +1233,7 @@ void main() {
testWidgets('Floating SnackBar button text alignment', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
theme: ThemeData(
snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.floating,)
snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.floating)
),
home: MediaQuery(
data: const MediaQueryData(
......
......@@ -189,7 +189,7 @@ void main() {
testWidgets('SnackBar theme behavior is correct for floating', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
theme: ThemeData(
snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.floating,)
snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.floating)
),
home: Scaffold(
floatingActionButton: FloatingActionButton(
......@@ -231,7 +231,7 @@ void main() {
testWidgets('SnackBar theme behavior is correct for fixed', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
theme: ThemeData(
snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.fixed,)
snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.fixed)
),
home: Scaffold(
floatingActionButton: FloatingActionButton(
......
......@@ -2617,7 +2617,7 @@ void main() {
length: 1,
child: TabBar(
tabs: <Tab>[
Tab(text: 'A',)
Tab(text: 'A')
],
)
)
......@@ -2641,7 +2641,7 @@ void main() {
length: 1,
child: TabBar(
tabs: <Tab>[
Tab(text: 'A',)
Tab(text: 'A')
],
enableFeedback: false,
),
......@@ -2669,7 +2669,7 @@ void main() {
length: 1,
child: TabBar(
tabs: const <Tab>[
Tab(text: 'A',)
Tab(text: 'A')
],
overlayColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
......@@ -2702,7 +2702,7 @@ void main() {
length: 1,
child: TabBar(
tabs: const <Tab>[
Tab(text: 'A',)
Tab(text: 'A')
],
overlayColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
......@@ -3165,8 +3165,8 @@ void main() {
Tab(icon: Icon(Icons.notifications), child: Text('Test')),
];
const TabBar tabBarWithText = TabBar(tabs: tabListWithText, indicatorWeight: indicatorWeight,);
const TabBar tabBarWithTextChild = TabBar(tabs: tabListWithTextChild, indicatorWeight: indicatorWeight,);
const TabBar tabBarWithText = TabBar(tabs: tabListWithText, indicatorWeight: indicatorWeight);
const TabBar tabBarWithTextChild = TabBar(tabs: tabListWithTextChild, indicatorWeight: indicatorWeight);
expect(tabBarWithText.preferredSize, tabBarWithTextChild.preferredSize);
});
......
......@@ -7949,7 +7949,13 @@ void main() {
pressureMin: 0.0,
),
);
await gesture.updateWithCustomEvent(PointerMoveEvent(pointer: pointerValue, position: offset + const Offset(150.0, 9.0), pressure: 0.5, pressureMin: 0, pressureMax: 1,),);
await gesture.updateWithCustomEvent(PointerMoveEvent(
pointer: pointerValue,
position: offset + const Offset(150.0, 9.0),
pressure: 0.5,
pressureMin: 0,
pressureMax: 1,
));
// We don't want this gesture to select any word on Android.
expect(controller.selection, const TextSelection.collapsed(offset: -1));
......@@ -9056,7 +9062,7 @@ void main() {
),
),
),
),);
));
focusNode3.requestFocus();
await tester.pump();
......
......@@ -231,7 +231,7 @@ void main() {
testWidgets('Time picker uses values from TimePickerThemeData', (WidgetTester tester) async {
final TimePickerThemeData timePickerTheme = _timePickerTheme();
final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme);
await tester.pumpWidget(_TimePickerLauncher(themeData: theme,));
await tester.pumpWidget(_TimePickerLauncher(themeData: theme));
await tester.tap(find.text('X'));
await tester.pumpAndSettle(const Duration(seconds: 1));
......
......@@ -1235,7 +1235,7 @@ void main() {
testWidgets('default Tooltip debugFillProperties', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
const Tooltip(message: 'message',).debugFillProperties(builder);
const Tooltip(message: 'message').debugFillProperties(builder);
final List<String> description = builder.properties
.where((DiagnosticsNode node) => !node.isFiltered(DiagnosticLevel.info))
......
......@@ -1242,7 +1242,7 @@ void main() {
testWidgets('default Tooltip debugFillProperties', (WidgetTester tester) async {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
const Tooltip(message: 'message',).debugFillProperties(builder);
const Tooltip(message: 'message').debugFillProperties(builder);
final List<String> description = builder.properties
.where((DiagnosticsNode node) => !node.isFiltered(DiagnosticLevel.info))
......
......@@ -320,7 +320,7 @@ void main() {
test('UnconstrainedBox toString', () {
expect(
const UnconstrainedBox(constrainedAxis: Axis.vertical,).toString(),
const UnconstrainedBox(constrainedAxis: Axis.vertical).toString(),
equals('UnconstrainedBox(alignment: Alignment.center, constrainedAxis: vertical)'),
);
......
......@@ -5971,9 +5971,9 @@ void main() {
expect(log.length, 2);
MethodCall methodCall = log[0];
// Close the InputConnection.
expect(methodCall, isMethodCall('TextInput.clearClient', arguments: null),);
expect(methodCall, isMethodCall('TextInput.clearClient', arguments: null));
methodCall = log[1];
expect(methodCall, isMethodCall('TextInput.hide', arguments: null),);
expect(methodCall, isMethodCall('TextInput.hide', arguments: null));
// The keyboard loses focus.
expect(focusNode.hasFocus, false);
......
......@@ -232,7 +232,7 @@ void main() {
(int y) => Row(
children: List<SizedBox>.generate(
7,
(int x) => SizedBox(key: ValueKey<String>('$x, $y'), width: 200.0, height: 200.0,),
(int x) => SizedBox(key: ValueKey<String>('$x, $y'), width: 200.0, height: 200.0),
),
),
);
......
......@@ -74,7 +74,10 @@ void main() {
padding: const EdgeInsets.all(8.0),
child: Column(
children: <Widget>[
Focus(focusNode: focusNode1, child: const SizedBox(width: 200, height: 100),),
Focus(
focusNode: focusNode1,
child: const SizedBox(width: 200, height: 100),
),
Transform.translate(
offset: const Offset(10, 20),
child: Transform.scale(
......
......@@ -1067,7 +1067,7 @@ void main() {
const Key key2 = GlobalObjectKey('key2');
late StateSetter setState;
int tabBarViewCnt = 2;
TabController tabController = TabController(length: tabBarViewCnt, vsync: const TestVSync(),);
TabController tabController = TabController(length: tabBarViewCnt, vsync: const TestVSync());
await tester.pumpWidget(Directionality(
textDirection: TextDirection.ltr,
......@@ -1077,8 +1077,8 @@ void main() {
return TabBarView(
controller: tabController,
children: <Widget>[
if (tabBarViewCnt > 0) const Text('key1', key: key1,),
if (tabBarViewCnt > 1) const Text('key2', key: key2,),
if (tabBarViewCnt > 0) const Text('key1', key: key1),
if (tabBarViewCnt > 1) const Text('key2', key: key2),
],
);
},
......@@ -1099,7 +1099,7 @@ void main() {
// rebuild TabBarView that only have the 1st page with GlobalKey 'key1'
setState((){
tabBarViewCnt = 1;
tabController = TabController(length: tabBarViewCnt, vsync: const TestVSync(),);
tabController = TabController(length: tabBarViewCnt, vsync: const TestVSync());
});
await tester.pump(const Duration(seconds: 1)); // finish the animation
......
......@@ -806,7 +806,7 @@ void main() {
test('constructor redundant pan and scale', () {
late FlutterError error;
try {
GestureDetector(onScaleStart: (_) {}, onPanStart: (_) {},);
GestureDetector(onScaleStart: (_) {}, onPanStart: (_) {});
} on FlutterError catch (e) {
error = e;
} finally {
......
......@@ -736,7 +736,7 @@ void main() {
});
testWidgets('Image.memory control test', (WidgetTester tester) async {
await tester.pumpWidget(Image.memory(Uint8List.fromList(kTransparentImage), excludeFromSemantics: true,));
await tester.pumpWidget(Image.memory(Uint8List.fromList(kTransparentImage), excludeFromSemantics: true));
});
testWidgets('Image color and colorBlend parameters', (WidgetTester tester) async {
......
......@@ -288,7 +288,8 @@ void main() {
return false;
},
),
],),
],
),
};
await tester.pumpWidget(MaterialApp(routes: routes));
......@@ -328,7 +329,8 @@ void main() {
return true;
},
),
],),
],
),
};
await tester.pumpWidget(MaterialApp(routes: routes));
......
......@@ -2380,7 +2380,7 @@ class _TestLayoutExtentIsNegative extends StatelessWidget {
margin:const EdgeInsets.all(20),
),
);
},),
}),
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
sliver: SliverAppBar(
......@@ -2407,7 +2407,7 @@ class _TestLayoutExtentIsNegative extends StatelessWidget {
height: 200,
margin: const EdgeInsets.all(20),
);
},),
}),
),
),
),
......
......@@ -333,14 +333,14 @@ void main() {
slivers: <Widget>[
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => Text('First sliver $index',),
(BuildContext context, int index) => Text('First sliver $index'),
childCount: 2,
),
),
SliverList(
key: centerKey,
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => Text('Second sliver $index',),
(BuildContext context, int index) => Text('Second sliver $index'),
childCount: 5,
),
),
......@@ -379,14 +379,14 @@ void main() {
slivers: <Widget>[
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => Text('First sliver $index',),
(BuildContext context, int index) => Text('First sliver $index'),
childCount: 2,
),
),
SliverList(
key: centerKey,
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => Text('Second sliver $index',),
(BuildContext context, int index) => Text('Second sliver $index'),
childCount: 5,
),
),
......
......@@ -257,7 +257,7 @@ void main() {
child: SizedBox(
width: 200.0,
height: 100.0,
child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr,),
child: AndroidView(viewType: 'webview', layoutDirection: TextDirection.ltr),
),
),
);
......@@ -1196,7 +1196,8 @@ void main() {
final AndroidViewSurface surface = AndroidViewSurface(
controller: controller,
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},);
gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
);
await tester.pumpWidget(surface);
expect(controller.pointTransformer, isNotNull);
});
......@@ -1400,7 +1401,7 @@ void main() {
child: SizedBox(
width: 200.0,
height: 100.0,
child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr,),
child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr),
),
),
);
......@@ -1890,14 +1891,17 @@ void main() {
child: const SizedBox(
width: 300,
height: 500,
child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr)),),
child: UiKitView(viewType: 'webview', layoutDirection: TextDirection.ltr),
),
),
Transform.translate(
offset: const Offset(0, 500),
child: Container(
color: const Color.fromARGB(255, 255, 255, 255),
width: 300,
height: 100,
),),
),
),
],
),
),
......@@ -1998,7 +2002,8 @@ void main() {
final PlatformViewSurface surface = PlatformViewSurface(
controller: controller,
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},);
gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
);
await tester.pumpWidget(surface);
expect(() => tester.layers.whereType<PlatformViewLayer>().first, returnsNormally);
});
......@@ -2467,7 +2472,7 @@ void main() {
Center(
child: Column(
children: <Widget>[
SizedBox(child: platformViewLink, width: 300, height: 300,),
SizedBox(child: platformViewLink, width: 300, height: 300),
Focus(
debugLabel: 'container',
child: Container(key: containerKey),
......
......@@ -64,7 +64,7 @@ void main() {
WidgetSpan(
child: Row(
children: const <Widget>[
SizedBox(height: 16, width: 16,),
SizedBox(height: 16, width: 16),
],
),
),
......@@ -114,7 +114,7 @@ void main() {
contains('textWidthBasis: longestLine'),
contains('text: "rich text"'),
contains('locale: zh_HK'),
allOf(startsWith('strutStyle: StrutStyle('), contains('size: 16.0'),),
allOf(startsWith('strutStyle: StrutStyle('), contains('size: 16.0')),
allOf(
startsWith('textHeightBehavior: TextHeightBehavior('),
contains('applyHeightToFirstAscent: false'),
......
......@@ -126,7 +126,7 @@ void main() {
child: Navigator(
pages: const <Page<void>>[
TestPage(name: '/'),
TestPage(name: '/abc',),
TestPage(name: '/abc'),
],
onPopPage: (Route<void> route, void result) => false,
)
......
......@@ -13,7 +13,7 @@ void main() {
child: Material(
child: ElevatedButton(
onPressed: () {
runApp(const Center(child: Text('Done', textDirection: TextDirection.ltr,)));
runApp(const Center(child: Text('Done', textDirection: TextDirection.ltr)));
},
child: const Text('GO'),
),
......
......@@ -376,7 +376,7 @@ void main() {
slivers: <Widget>[SliverToBoxAdapter(
child: SizedBox(
height: 2000,
child: GestureDetector(onTap: () {},),
child: GestureDetector(onTap: () {}),
),
)],
),
......
......@@ -44,9 +44,9 @@ void main() {
textDirection: TextDirection.ltr,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Container(height: 600.0,)
)
)
child: Container(height: 600.0)
),
),
);
// 1st, check that the render object has received the default clip behavior.
......@@ -64,9 +64,9 @@ void main() {
textDirection: TextDirection.ltr,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Container(height: 600.1,)
)
)
child: Container(height: 600.1),
),
),
);
renderObject.paint(context, Offset.zero);
expect(context.clipBehavior, equals(Clip.hardEdge));
......@@ -79,9 +79,9 @@ void main() {
textDirection: TextDirection.ltr,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(width: 800.0,)
)
)
child: Container(width: 800.0),
),
),
);
renderObject.paint(context, Offset.zero);
expect(context.clipBehavior, equals(Clip.none));
......@@ -92,9 +92,9 @@ void main() {
textDirection: TextDirection.ltr,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(width: 800.1,)
)
)
child: Container(width: 800.1),
),
),
);
renderObject.paint(context, Offset.zero);
expect(context.clipBehavior, equals(Clip.hardEdge));
......
......@@ -1331,11 +1331,11 @@ void main() {
children: const <Widget>[
Text('Hello\nLine 2\nLine 3',
textDirection: TextDirection.ltr,
style: TextStyle(height: 5,),
style: TextStyle(height: 5),
),
Text('Hello\nLine 2\nLine 3',
textDirection: TextDirection.ltr,
style: TextStyle(height: 5,),
style: TextStyle(height: 5),
textHeightBehavior: TextHeightBehavior(
applyHeightToFirstAscent: false,
applyHeightToLastDescent: false,
......@@ -1343,7 +1343,7 @@ void main() {
),
Text('Hello',
textDirection: TextDirection.ltr,
style: TextStyle(height: 5,),
style: TextStyle(height: 5),
textHeightBehavior: TextHeightBehavior(
applyHeightToFirstAscent: false,
),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment