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

@@ -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(),
),
),
));
}