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
This commit is contained in:
Alexandre Ardhuin
2019-03-01 08:17:55 +01:00
committed by GitHub
parent 046f960ae2
commit 387f885481
626 changed files with 5183 additions and 5183 deletions

View File

@@ -24,7 +24,7 @@ void beginFrame(Duration timeStamp) {
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();

View File

@@ -28,7 +28,7 @@ ui.Picture paint(ui.Rect paintBounds) {
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

View File

@@ -24,6 +24,6 @@ void main() {
// particular text direction.
textDirection: TextDirection.ltr,
),
)
),
);
}

View File

@@ -26,7 +26,7 @@ void main() {
// 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 @@ void main() {
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);

View File

@@ -14,7 +14,7 @@ class SectorConstraints extends Constraints {
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 @@ class SectorConstraints extends Constraints {
@override
bool debugAssertIsValid({
bool isAppliedConstraint = false,
InformationCollector informationCollector
InformationCollector informationCollector,
}) {
assert(isNormalized);
return isNormalized;
@@ -58,11 +58,11 @@ class SectorDimensions {
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 @@ class RenderSectorRing extends RenderSectorWithChildren {
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 @@ class RenderSectorRing extends RenderSectorWithChildren {
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 @@ class RenderSectorRing extends RenderSectorWithChildren {
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 @@ class RenderSectorSlice extends RenderSectorWithChildren {
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 @@ class RenderSectorSlice extends RenderSectorWithChildren {
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 @@ class RenderSectorSlice extends RenderSectorWithChildren {
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 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
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 RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
class RenderSolidColor extends RenderDecoratedSector {
RenderSolidColor(this.backgroundColor, {
this.desiredDeltaRadius = double.infinity,
this.desiredDeltaTheta = kTwoPi
this.desiredDeltaTheta = kTwoPi,
}) : super(BoxDecoration(color: backgroundColor));
double desiredDeltaRadius;

View File

@@ -183,7 +183,7 @@ class CalculationManager {
sender.send(<double>[ completed, total ]);
},
onResultListener: sender.send,
data: message.data
data: message.data,
);
calculator.run();
}
@@ -221,7 +221,7 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
)..repeat();
_calculationManager = CalculationManager(
onProgressListener: _handleProgressUpdate,
onResultListener: _handleResult
onResultListener: _handleResult,
);
}
@@ -243,24 +243,24 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
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),
],
),
);
}

View File

@@ -13,7 +13,7 @@ class _GesturePainter extends CustomPainter {
this.scaleEnabled,
this.tapEnabled,
this.doubleTapEnabled,
this.longPressEnabled
this.longPressEnabled,
});
final double zoom;
@@ -159,9 +159,9 @@ class GestureDemoState extends State<GestureDemo> {
scaleEnabled: _scaleEnabled,
tapEnabled: _tapEnabled,
doubleTapEnabled: _doubleTapEnabled,
longPressEnabled: _longPressEnabled
)
)
longPressEnabled: _longPressEnabled,
),
),
),
Positioned(
bottom: 0.0,
@@ -175,45 +175,45 @@ class GestureDemoState extends State<GestureDemo> {
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 @@ void main() {
theme: ThemeData.dark(),
home: Scaffold(
appBar: AppBar(title: const Text('Gestures Demo')),
body: GestureDemo()
)
body: GestureDemo(),
),
));
}

View File

@@ -19,8 +19,8 @@ class AdaptedListItem extends StatelessWidget {
margin: const EdgeInsets.all(8.0),
color: Colors.lightBlueAccent.shade100,
),
Text(name)
]
Text(name),
],
);
}
}
@@ -38,24 +38,24 @@ class AdaptedGridItem extends StatelessWidget {
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 @@ void main() {
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)),
),
));
}

View File

@@ -12,7 +12,7 @@ import '../rendering/src/sector_layout.dart';
RenderBox initCircle() {
return RenderBoxToRenderSectorAdapter(
innerRadius: 25.0,
child: RenderSectorRing(padding: 0.0)
child: RenderSectorRing(padding: 0.0),
);
}
@@ -74,7 +74,7 @@ class SectorAppState extends State<SectorApp> {
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 @@ class SectorAppState extends State<SectorApp> {
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 @@ class SectorAppState extends State<SectorApp> {
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 @@ class SectorAppState extends State<SectorApp> {
padding: const EdgeInsets.all(8.0),
child: WidgetToRenderBoxAdapter(
renderBox: sectors,
onBuild: doUpdates
)
)
onBuild: doUpdates,
),
),
),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween
mainAxisAlignment: MainAxisAlignment.spaceBetween,
);
}
@@ -155,10 +155,10 @@ class SectorAppState extends State<SectorApp> {
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(),
),
);
}
}

View File

@@ -26,7 +26,7 @@ class Rectangle extends StatelessWidget {
return Expanded(
child: Container(
color: color,
)
),
);
}
}

View File

@@ -38,7 +38,7 @@ class _SpinningSquareState extends State<SpinningSquare> with SingleTickerProvid
width: 200.0,
height: 200.0,
color: const Color(0xFF00FF00),
)
),
);
}
}

View File

@@ -29,7 +29,7 @@ const TextStyle _kBold = TextStyle(fontWeight: FontWeight.bold);
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 @@ Widget toStyledText(String name, String text) {
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 @@ class SpeakerSeparator extends StatelessWidget {
border: Border(
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0))
)
)
),
);
}
}
@@ -112,9 +112,9 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
child: Column(
children: children,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start
)
)
crossAxisAlignment: CrossAxisAlignment.start,
),
),
);
}
}
@@ -124,12 +124,12 @@ void main() {
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(),
),
),
));
}