Add missing trailing commas (#28673)
* add trailing commas on list/map/parameters
* add trailing commas on Invocation with nb of arg>1
* add commas for widget containing widgets
* add trailing commas if instantiation contains trailing comma
* revert bad change
diff --git a/examples/layers/raw/hello_world.dart b/examples/layers/raw/hello_world.dart
index 7a9294a..230bc67 100644
--- a/examples/layers/raw/hello_world.dart
+++ b/examples/layers/raw/hello_world.dart
@@ -24,7 +24,7 @@
canvas.scale(devicePixelRatio, devicePixelRatio);
canvas.drawParagraph(paragraph, ui.Offset(
(logicalSize.width - paragraph.maxIntrinsicWidth) / 2.0,
- (logicalSize.height - paragraph.height) / 2.0
+ (logicalSize.height - paragraph.height) / 2.0,
));
final ui.Picture picture = recorder.endRecording();
diff --git a/examples/layers/raw/touch_input.dart b/examples/layers/raw/touch_input.dart
index 52932b1..25984d5 100644
--- a/examples/layers/raw/touch_input.dart
+++ b/examples/layers/raw/touch_input.dart
@@ -28,7 +28,7 @@
canvas.drawCircle(
size.center(ui.Offset.zero),
size.shortestSide * 0.45,
- ui.Paint()..color = color
+ ui.Paint()..color = color,
);
// When we're done issuing painting commands, we end the recording an receive
diff --git a/examples/layers/rendering/hello_world.dart b/examples/layers/rendering/hello_world.dart
index 1f49ca7..f6164d0 100644
--- a/examples/layers/rendering/hello_world.dart
+++ b/examples/layers/rendering/hello_world.dart
@@ -24,6 +24,6 @@
// particular text direction.
textDirection: TextDirection.ltr,
),
- )
+ ),
);
}
diff --git a/examples/layers/rendering/spinning_square.dart b/examples/layers/rendering/spinning_square.dart
index 52f6afb..9d6d1f0 100644
--- a/examples/layers/rendering/spinning_square.dart
+++ b/examples/layers/rendering/spinning_square.dart
@@ -26,7 +26,7 @@
// to have a specific size.
final RenderBox square = RenderConstrainedBox(
additionalConstraints: const BoxConstraints.tightFor(width: 200.0, height: 200.0),
- child: green
+ child: green,
);
// Third, we wrap the sized green square in a render object that applies rotation
// transform before painting its child. Each frame of the animation, we'll
@@ -35,12 +35,12 @@
final RenderTransform spin = RenderTransform(
transform: Matrix4.identity(),
alignment: Alignment.center,
- child: square
+ child: square,
);
// Finally, we center the spinning green square...
final RenderBox root = RenderPositionedBox(
alignment: Alignment.center,
- child: spin
+ child: spin,
);
// and attach it to the window.
RenderingFlutterBinding(root: root);
diff --git a/examples/layers/rendering/src/sector_layout.dart b/examples/layers/rendering/src/sector_layout.dart
index 0cbf123..a9e288e 100644
--- a/examples/layers/rendering/src/sector_layout.dart
+++ b/examples/layers/rendering/src/sector_layout.dart
@@ -14,7 +14,7 @@
this.minDeltaRadius = 0.0,
this.maxDeltaRadius = double.infinity,
this.minDeltaTheta = 0.0,
- this.maxDeltaTheta = kTwoPi
+ this.maxDeltaTheta = kTwoPi,
}) : assert(maxDeltaRadius >= minDeltaRadius),
assert(maxDeltaTheta >= minDeltaTheta);
@@ -46,7 +46,7 @@
@override
bool debugAssertIsValid({
bool isAppliedConstraint = false,
- InformationCollector informationCollector
+ InformationCollector informationCollector,
}) {
assert(isNormalized);
return isNormalized;
@@ -58,11 +58,11 @@
factory SectorDimensions.withConstraints(
SectorConstraints constraints,
- { double deltaRadius = 0.0, double deltaTheta = 0.0 }
+ { double deltaRadius = 0.0, double deltaTheta = 0.0, }
) {
return SectorDimensions(
deltaRadius: constraints.constrainDeltaRadius(deltaRadius),
- deltaTheta: constraints.constrainDeltaTheta(deltaTheta)
+ deltaTheta: constraints.constrainDeltaTheta(deltaTheta),
);
}
@@ -216,7 +216,7 @@
RenderSectorRing({
BoxDecoration decoration,
double deltaRadius = double.infinity,
- double padding = 0.0
+ double padding = 0.0,
}) : _padding = padding,
assert(deltaRadius >= 0.0),
_desiredDeltaRadius = deltaRadius,
@@ -263,7 +263,7 @@
while (child != null) {
final SectorConstraints innerConstraints = SectorConstraints(
maxDeltaRadius: innerDeltaRadius,
- maxDeltaTheta: remainingDeltaTheta
+ maxDeltaTheta: remainingDeltaTheta,
);
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
innerTheta += childDimensions.deltaTheta;
@@ -294,7 +294,7 @@
while (child != null) {
final SectorConstraints innerConstraints = SectorConstraints(
maxDeltaRadius: innerDeltaRadius,
- maxDeltaTheta: remainingDeltaTheta
+ maxDeltaTheta: remainingDeltaTheta,
);
assert(child.parentData is SectorParentData);
child.parentData.theta = innerTheta;
@@ -334,7 +334,7 @@
RenderSectorSlice({
BoxDecoration decoration,
double deltaTheta = kTwoPi,
- double padding = 0.0
+ double padding = 0.0,
}) : _padding = padding, _desiredDeltaTheta = deltaTheta, super(decoration);
double _desiredDeltaTheta;
@@ -377,7 +377,7 @@
while (child != null) {
final SectorConstraints innerConstraints = SectorConstraints(
maxDeltaRadius: remainingDeltaRadius,
- maxDeltaTheta: innerDeltaTheta
+ maxDeltaTheta: innerDeltaTheta,
);
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
childRadius += childDimensions.deltaRadius;
@@ -406,7 +406,7 @@
while (child != null) {
final SectorConstraints innerConstraints = SectorConstraints(
maxDeltaRadius: remainingDeltaRadius,
- maxDeltaTheta: innerDeltaTheta
+ maxDeltaTheta: innerDeltaTheta,
);
child.parentData.theta = innerTheta;
child.parentData.radius = childRadius;
@@ -488,7 +488,7 @@
Size getIntrinsicDimensions({
double width = double.infinity,
- double height = double.infinity
+ double height = double.infinity,
}) {
assert(child is RenderSector);
assert(child.parentData is SectorParentData);
@@ -556,7 +556,7 @@
class RenderSolidColor extends RenderDecoratedSector {
RenderSolidColor(this.backgroundColor, {
this.desiredDeltaRadius = double.infinity,
- this.desiredDeltaTheta = kTwoPi
+ this.desiredDeltaTheta = kTwoPi,
}) : super(BoxDecoration(color: backgroundColor));
double desiredDeltaRadius;
diff --git a/examples/layers/services/isolate.dart b/examples/layers/services/isolate.dart
index 5c689d6..a48958c 100644
--- a/examples/layers/services/isolate.dart
+++ b/examples/layers/services/isolate.dart
@@ -183,7 +183,7 @@
sender.send(<double>[ completed, total ]);
},
onResultListener: sender.send,
- data: message.data
+ data: message.data,
);
calculator.run();
}
@@ -221,7 +221,7 @@
)..repeat();
_calculationManager = CalculationManager(
onProgressListener: _handleProgressUpdate,
- onResultListener: _handleResult
+ onResultListener: _handleResult,
);
}
@@ -243,24 +243,24 @@
width: 120.0,
height: 120.0,
color: const Color(0xFF882222),
- )
+ ),
),
Opacity(
opacity: _calculationManager.isRunning ? 1.0 : 0.0,
child: CircularProgressIndicator(
value: _progress
- )
+ ),
),
Text(_status),
Center(
child: RaisedButton(
child: Text(_label),
- onPressed: _handleButtonPressed
- )
+ onPressed: _handleButtonPressed,
+ ),
),
- Text(_result)
- ]
- )
+ Text(_result),
+ ],
+ ),
);
}
diff --git a/examples/layers/widgets/gestures.dart b/examples/layers/widgets/gestures.dart
index 1e884a9..6dc63ef 100644
--- a/examples/layers/widgets/gestures.dart
+++ b/examples/layers/widgets/gestures.dart
@@ -13,7 +13,7 @@
this.scaleEnabled,
this.tapEnabled,
this.doubleTapEnabled,
- this.longPressEnabled
+ this.longPressEnabled,
});
final double zoom;
@@ -159,9 +159,9 @@
scaleEnabled: _scaleEnabled,
tapEnabled: _tapEnabled,
doubleTapEnabled: _doubleTapEnabled,
- longPressEnabled: _longPressEnabled
- )
- )
+ longPressEnabled: _longPressEnabled,
+ ),
+ ),
),
Positioned(
bottom: 0.0,
@@ -175,45 +175,45 @@
children: <Widget>[
Checkbox(
value: _scaleEnabled,
- onChanged: (bool value) { setState(() { _scaleEnabled = value; }); }
+ onChanged: (bool value) { setState(() { _scaleEnabled = value; }); },
),
const Text('Scale'),
- ]
+ ],
),
Row(
children: <Widget>[
Checkbox(
value: _tapEnabled,
- onChanged: (bool value) { setState(() { _tapEnabled = value; }); }
+ onChanged: (bool value) { setState(() { _tapEnabled = value; }); },
),
const Text('Tap'),
- ]
+ ],
),
Row(
children: <Widget>[
Checkbox(
value: _doubleTapEnabled,
- onChanged: (bool value) { setState(() { _doubleTapEnabled = value; }); }
+ onChanged: (bool value) { setState(() { _doubleTapEnabled = value; }); },
),
const Text('Double Tap'),
- ]
+ ],
),
Row(
children: <Widget>[
Checkbox(
value: _longPressEnabled,
- onChanged: (bool value) { setState(() { _longPressEnabled = value; }); }
+ onChanged: (bool value) { setState(() { _longPressEnabled = value; }); },
),
const Text('Long Press'),
- ]
+ ],
),
],
- crossAxisAlignment: CrossAxisAlignment.start
- )
- )
- )
+ crossAxisAlignment: CrossAxisAlignment.start,
+ ),
+ ),
+ ),
),
- ]
+ ],
);
}
}
@@ -223,7 +223,7 @@
theme: ThemeData.dark(),
home: Scaffold(
appBar: AppBar(title: const Text('Gestures Demo')),
- body: GestureDemo()
- )
+ body: GestureDemo(),
+ ),
));
}
diff --git a/examples/layers/widgets/media_query.dart b/examples/layers/widgets/media_query.dart
index 091fadb..4ef2687 100644
--- a/examples/layers/widgets/media_query.dart
+++ b/examples/layers/widgets/media_query.dart
@@ -19,8 +19,8 @@
margin: const EdgeInsets.all(8.0),
color: Colors.lightBlueAccent.shade100,
),
- Text(name)
- ]
+ Text(name),
+ ],
);
}
}
@@ -38,24 +38,24 @@
Expanded(
child: Container(
color: Colors.lightBlueAccent.shade100,
- )
+ ),
),
Container(
margin: const EdgeInsets.only(left: 8.0),
child: Row(
children: <Widget>[
Expanded(
- child: Text(name)
+ child: Text(name),
),
const IconButton(
icon: Icon(Icons.more_vert),
- onPressed: null
- )
- ]
- )
- )
- ]
- )
+ onPressed: null,
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
);
}
}
@@ -99,9 +99,9 @@
title: 'Media Query Example',
home: Scaffold(
appBar: AppBar(
- title: const Text('Media Query Example')
+ title: const Text('Media Query Example'),
),
- body: Material(child: AdaptiveContainer(names: _kNames))
- )
+ body: Material(child: AdaptiveContainer(names: _kNames)),
+ ),
));
}
diff --git a/examples/layers/widgets/sectors.dart b/examples/layers/widgets/sectors.dart
index 553e8af..2b64e99 100644
--- a/examples/layers/widgets/sectors.dart
+++ b/examples/layers/widgets/sectors.dart
@@ -12,7 +12,7 @@
RenderBox initCircle() {
return RenderBoxToRenderSectorAdapter(
innerRadius: 25.0,
- child: RenderSectorRing(padding: 0.0)
+ child: RenderSectorRing(padding: 0.0),
);
}
@@ -74,7 +74,7 @@
ring.add(RenderSolidColor(color, desiredDeltaTheta: kTwoPi * 0.2));
return RenderBoxToRenderSectorAdapter(
innerRadius: 5.0,
- child: ring
+ child: ring,
);
}
RenderBoxToRenderSectorAdapter sectorAddIcon = initSector(const Color(0xFF00DD00));
@@ -104,12 +104,12 @@
Container(
padding: const EdgeInsets.all(4.0),
margin: const EdgeInsets.only(right: 10.0),
- child: WidgetToRenderBoxAdapter(renderBox: sectorAddIcon)
+ child: WidgetToRenderBoxAdapter(renderBox: sectorAddIcon),
),
const Text('ADD SECTOR'),
- ]
- )
- )
+ ],
+ ),
+ ),
),
RaisedButton(
onPressed: _enabledRemove ? removeSector : null,
@@ -119,16 +119,16 @@
Container(
padding: const EdgeInsets.all(4.0),
margin: const EdgeInsets.only(right: 10.0),
- child: WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon)
+ child: WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon),
),
const Text('REMOVE SECTOR'),
- ]
- )
- )
+ ],
+ ),
+ ),
),
],
- mainAxisAlignment: MainAxisAlignment.spaceAround
- )
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
+ ),
),
Expanded(
child: Container(
@@ -139,12 +139,12 @@
padding: const EdgeInsets.all(8.0),
child: WidgetToRenderBoxAdapter(
renderBox: sectors,
- onBuild: doUpdates
- )
- )
+ onBuild: doUpdates,
+ ),
+ ),
),
],
- mainAxisAlignment: MainAxisAlignment.spaceBetween
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
);
}
@@ -155,10 +155,10 @@
title: 'Sector Layout',
home: Scaffold(
appBar: AppBar(
- title: const Text('Sector Layout in a Widget Tree')
+ title: const Text('Sector Layout in a Widget Tree'),
),
- body: buildBody()
- )
+ body: buildBody(),
+ ),
);
}
}
diff --git a/examples/layers/widgets/spinning_mixed.dart b/examples/layers/widgets/spinning_mixed.dart
index 4801ac7..b9f4d1c 100644
--- a/examples/layers/widgets/spinning_mixed.dart
+++ b/examples/layers/widgets/spinning_mixed.dart
@@ -26,7 +26,7 @@
return Expanded(
child: Container(
color: color,
- )
+ ),
);
}
}
diff --git a/examples/layers/widgets/spinning_square.dart b/examples/layers/widgets/spinning_square.dart
index 6539ffc..efaae8c 100644
--- a/examples/layers/widgets/spinning_square.dart
+++ b/examples/layers/widgets/spinning_square.dart
@@ -38,7 +38,7 @@
width: 200.0,
height: 200.0,
color: const Color(0xFF00FF00),
- )
+ ),
);
}
}
diff --git a/examples/layers/widgets/styled_text.dart b/examples/layers/widgets/styled_text.dart
index 633d55e..ffabd25 100644
--- a/examples/layers/widgets/styled_text.dart
+++ b/examples/layers/widgets/styled_text.dart
@@ -29,7 +29,7 @@
const TextStyle _kUnderline = TextStyle(
decoration: TextDecoration.underline,
decorationColor: Color(0xFF000000),
- decorationStyle: TextDecorationStyle.wavy
+ decorationStyle: TextDecorationStyle.wavy,
);
Widget toStyledText(String name, String text) {
@@ -44,14 +44,14 @@
children: <TextSpan>[
TextSpan(
style: _kUnderline,
- text: name
+ text: name,
),
- const TextSpan(text: ':')
- ]
+ const TextSpan(text: ':'),
+ ],
),
- TextSpan(text: text)
- ]
- )
+ TextSpan(text: text),
+ ],
+ ),
);
}
@@ -67,7 +67,7 @@
border: Border(
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0))
)
- )
+ ),
);
}
}
@@ -112,9 +112,9 @@
child: Column(
children: children,
mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.start
- )
- )
+ crossAxisAlignment: CrossAxisAlignment.start,
+ ),
+ ),
);
}
}
@@ -124,12 +124,12 @@
theme: ThemeData.light(),
home: Scaffold(
appBar: AppBar(
- title: const Text('Hal and Dave')
+ title: const Text('Hal and Dave'),
),
body: Material(
color: Colors.grey.shade50,
- child: StyledTextDemo()
- )
- )
+ child: StyledTextDemo(),
+ ),
+ ),
));
}