add missing trailing commas (#81406)

This commit is contained in:
Alexandre Ardhuin
2021-04-28 22:54:49 +02:00
committed by GitHub
parent 7c27db3dfe
commit 7f31861914
26 changed files with 131 additions and 93 deletions

View File

@@ -68,7 +68,8 @@ class _MyHomePageState extends State<MyHomePage> {
child: Center(
child: Text(
'Platform button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
style: const TextStyle(fontSize: 17.0)),
style: const TextStyle(fontSize: 17.0),
),
),
),
Container(

View File

@@ -10,7 +10,7 @@ void main() =>
child:
Text('Hello, world!',
key: Key('title'),
textDirection: TextDirection.ltr
)
)
textDirection: TextDirection.ltr,
),
),
);

View File

@@ -83,7 +83,7 @@ class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(
(context ?? SecurityContext())..setTrustedCertificatesBytes(certificate.codeUnits)
(context ?? SecurityContext())..setTrustedCertificatesBytes(certificate.codeUnits),
);
}
}
@@ -189,11 +189,13 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
Completer<bool>(),
];
final List<Future<bool>> futures = completers.map(
(Completer<bool> completer) => completer.future).toList();
(Completer<bool> completer) => completer.future,
).toList();
final DateTime started = DateTime.now();
Future.wait(futures).then((_) {
print(
'===image_list=== all loaded in ${DateTime.now().difference(started).inMilliseconds}ms.');
'===image_list=== all loaded in ${DateTime.now().difference(started).inMilliseconds}ms.',
);
});
return Scaffold(
appBar: AppBar(
@@ -222,16 +224,21 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
);
}
List<Widget> createImageList(int count, List<Completer<bool>> completers,
List<AnimationController> controllers) {
List<Widget> createImageList(
int count,
List<Completer<bool>> completers,
List<AnimationController> controllers,
) {
final List<Widget> list = <Widget>[];
for (int i = 0; i < count; i++) {
list.add(Flexible(
fit: FlexFit.tight,
flex: i + 1,
child: RotationTransition(
turns: controllers[i],
child: createImage(i + 1, completers[i]))));
fit: FlexFit.tight,
flex: i + 1,
child: RotationTransition(
turns: controllers[i],
child: createImage(i + 1, completers[i]),
),
));
}
return list;
}

View File

@@ -16,8 +16,9 @@ Future<void> beginFrame(Duration timeStamp) async {
final ui.Paint backgroundPaint = ui.Paint()..color = Colors.white;
canvas.drawRect(paintBounds, backgroundPaint);
await const DefaultShaderWarmUp(
drawCallSpacing: 80.0, canvasSize: ui.Size(1024, 1024))
.warmUpOnCanvas(canvas);
drawCallSpacing: 80.0,
canvasSize: ui.Size(1024, 1024),
).warmUpOnCanvas(canvas);
final ui.Picture picture = recorder.endRecording();
// COMPOSITE

View File

@@ -29,8 +29,10 @@ void beginFrame(Duration timeStamp) {
final double t = timeStamp.inMicroseconds / Duration.microsecondsPerMillisecond / 1800.0;
canvas.rotate(math.pi * (t % 1.0));
canvas.drawRect(const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0));
canvas.drawRect(
const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0),
);
final ui.Picture picture = recorder.endRecording();
// COMPOSITE

View File

@@ -19,8 +19,10 @@ ui.Picture paint(ui.Rect paintBounds) {
final ui.Size logicalSize = ui.window.physicalSize / devicePixelRatio;
canvas.translate(logicalSize.width / 2.0, logicalSize.height / 2.0);
canvas.drawRect(const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0));
canvas.drawRect(
const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0),
);
// The paint method of Paragraph draws the contents of the paragraph onto the
// given canvas.

View File

@@ -20,7 +20,7 @@ class NonStopVSync implements TickerProvider {
void main() {
// We first create a render object that represents a green box.
final RenderBox green = RenderDecoratedBox(
decoration: const BoxDecoration(color: Color(0xFF00FF00))
decoration: const BoxDecoration(color: Color(0xFF00FF00)),
);
// Second, we wrap that green box in a render object that forces the green box
// to have a specific size.

View File

@@ -40,7 +40,7 @@ class Calculator {
if (key is int && i++ % _NOTIFY_INTERVAL == 0)
onProgressListener(i.toDouble(), _NUM_ITEMS.toDouble());
return value;
}
},
);
try {
final List<dynamic> result = decoder.convert(_data) as List<dynamic>;
@@ -249,7 +249,7 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
Opacity(
opacity: _calculationManager.isRunning ? 1.0 : 0.0,
child: CircularProgressIndicator(
value: _progress
value: _progress,
),
),
Text(_status),

View File

@@ -30,8 +30,9 @@ class _GesturePainter extends CustomPainter {
final Offset center = size.center(Offset.zero) * zoom + offset;
final double radius = size.width / 2.0 * zoom;
final Gradient gradient = RadialGradient(
colors: forward ? <Color>[swatch.shade50, swatch.shade900]
: <Color>[swatch.shade900, swatch.shade50]
colors: forward
? <Color>[swatch.shade50, swatch.shade900]
: <Color>[swatch.shade900, swatch.shade50],
);
final Paint paint = Paint()
..shader = gradient.createShader(Rect.fromCircle(

View File

@@ -135,7 +135,7 @@ class SectorAppState extends State<SectorApp> {
child: Container(
margin: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
border: Border.all()
border: Border.all(),
),
padding: const EdgeInsets.all(8.0),
child: WidgetToRenderBoxAdapter(

View File

@@ -67,8 +67,8 @@ class SpeakerSeparator extends StatelessWidget {
margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 64.0),
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0))
)
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0)),
),
),
);
}

View File

@@ -75,10 +75,11 @@ class _MyHomePageState extends State<MyHomePage> {
Padding(
padding: const EdgeInsets.all(18.0),
child: ElevatedButton(
child: Platform.isIOS
? const Text('Continue in iOS view')
: const Text('Continue in Android view'),
onPressed: _launchPlatformCount),
child: Platform.isIOS
? const Text('Continue in iOS view')
: const Text('Continue in Android view'),
onPressed: _launchPlatformCount,
),
),
],
),
@@ -88,8 +89,7 @@ class _MyHomePageState extends State<MyHomePage> {
padding: const EdgeInsets.only(bottom: 15.0, left: 5.0),
child: Row(
children: <Widget>[
Image.asset('assets/flutter-mark-square-64.png',
scale: 1.5),
Image.asset('assets/flutter-mark-square-64.png', scale: 1.5),
const Text(
'Flutter',
style: TextStyle(fontSize: 30.0),