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:
committed by
GitHub
parent
046f960ae2
commit
387f885481
@@ -56,14 +56,14 @@ class CardCollectionState extends State<CardCollection> {
|
||||
(int i) {
|
||||
_cardModels[i].height = _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i];
|
||||
return _cardModels[i];
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _initVariableSizedCardModels() {
|
||||
_cardModels = List<CardModel>.generate(
|
||||
_cardHeights.length,
|
||||
(int i) => CardModel(i, _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i])
|
||||
(int i) => CardModel(i, _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
Widget _buildAppBar(BuildContext context) {
|
||||
return AppBar(
|
||||
actions: <Widget>[
|
||||
Text(_dismissDirectionText(_dismissDirection))
|
||||
Text(_dismissDirectionText(_dismissDirection)),
|
||||
],
|
||||
flexibleSpace: Container(
|
||||
padding: const EdgeInsets.only(left: 72.0),
|
||||
|
||||
@@ -32,11 +32,11 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
|
||||
color: data.isEmpty ? _color : Colors.grey.shade200,
|
||||
border: Border.all(
|
||||
width: 3.0,
|
||||
color: data.isEmpty ? Colors.white : Colors.blue
|
||||
color: data.isEmpty ? Colors.white : Colors.blue,
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -65,10 +65,10 @@ class DotState extends State<Dot> {
|
||||
decoration: BoxDecoration(
|
||||
color: widget.color,
|
||||
border: Border.all(width: taps.toDouble()),
|
||||
shape: BoxShape.circle
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: widget.child
|
||||
)
|
||||
child: widget.child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ class ExampleDragSource extends StatelessWidget {
|
||||
this.color,
|
||||
this.heavy = false,
|
||||
this.under = true,
|
||||
this.child
|
||||
this.child,
|
||||
}) : super(key: key);
|
||||
|
||||
final Color color;
|
||||
@@ -103,13 +103,13 @@ class ExampleDragSource extends StatelessWidget {
|
||||
child: Dot(
|
||||
color: color,
|
||||
size: size,
|
||||
child: Center(child: child)
|
||||
)
|
||||
child: Center(child: child),
|
||||
),
|
||||
);
|
||||
|
||||
Widget feedback = Opacity(
|
||||
opacity: 0.75,
|
||||
child: contents
|
||||
child: contents,
|
||||
);
|
||||
|
||||
Offset feedbackOffset;
|
||||
@@ -118,7 +118,7 @@ class ExampleDragSource extends StatelessWidget {
|
||||
feedback = Transform(
|
||||
transform: Matrix4.identity()
|
||||
..translate(-size / 2.0, -(size / 2.0 + kFingerSize)),
|
||||
child: feedback
|
||||
child: feedback,
|
||||
);
|
||||
feedbackOffset = const Offset(0.0, -kFingerSize);
|
||||
anchor = DragAnchor.pointer;
|
||||
@@ -133,7 +133,7 @@ class ExampleDragSource extends StatelessWidget {
|
||||
child: contents,
|
||||
feedback: feedback,
|
||||
feedbackOffset: feedbackOffset,
|
||||
dragAnchor: anchor
|
||||
dragAnchor: anchor,
|
||||
);
|
||||
} else {
|
||||
return Draggable<Color>(
|
||||
@@ -141,7 +141,7 @@ class ExampleDragSource extends StatelessWidget {
|
||||
child: contents,
|
||||
feedback: feedback,
|
||||
feedbackOffset: feedbackOffset,
|
||||
dragAnchor: anchor
|
||||
dragAnchor: anchor,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -193,15 +193,15 @@ class MovableBall extends StatelessWidget {
|
||||
color: Colors.blue.shade700,
|
||||
size: kBallSize,
|
||||
tappable: true,
|
||||
child: const Center(child: Text('BALL'))
|
||||
)
|
||||
child: const Center(child: Text('BALL')),
|
||||
),
|
||||
);
|
||||
final Widget dashedBall = Container(
|
||||
width: kBallSize,
|
||||
height: kBallSize,
|
||||
child: const CustomPaint(
|
||||
painter: DashOutlineCirclePainter()
|
||||
)
|
||||
),
|
||||
);
|
||||
if (position == ballPosition) {
|
||||
return Draggable<bool>(
|
||||
@@ -209,14 +209,14 @@ class MovableBall extends StatelessWidget {
|
||||
child: ball,
|
||||
childWhenDragging: dashedBall,
|
||||
feedback: ball,
|
||||
maxSimultaneousDrags: 1
|
||||
maxSimultaneousDrags: 1,
|
||||
);
|
||||
} else {
|
||||
return DragTarget<bool>(
|
||||
onAccept: (bool data) { callback(position); },
|
||||
builder: (BuildContext context, List<bool> accepted, List<dynamic> rejected) {
|
||||
return dashedBall;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Drag and Drop Flutter Demo')
|
||||
title: const Text('Drag and Drop Flutter Demo'),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
@@ -251,22 +251,22 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
||||
color: Colors.yellow.shade300,
|
||||
under: true,
|
||||
heavy: false,
|
||||
child: const Text('under')
|
||||
child: const Text('under'),
|
||||
),
|
||||
ExampleDragSource(
|
||||
color: Colors.green.shade300,
|
||||
under: false,
|
||||
heavy: true,
|
||||
child: const Text('long-press above')
|
||||
child: const Text('long-press above'),
|
||||
),
|
||||
ExampleDragSource(
|
||||
color: Colors.indigo.shade300,
|
||||
under: false,
|
||||
heavy: false,
|
||||
child: const Text('above')
|
||||
child: const Text('above'),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
@@ -275,8 +275,8 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
||||
Expanded(child: ExampleDragTarget()),
|
||||
Expanded(child: ExampleDragTarget()),
|
||||
Expanded(child: ExampleDragTarget()),
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
@@ -286,10 +286,10 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
||||
MovableBall(2, position, moveBall),
|
||||
MovableBall(3, position, moveBall),
|
||||
],
|
||||
)
|
||||
),
|
||||
),
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -297,6 +297,6 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
||||
void main() {
|
||||
runApp(MaterialApp(
|
||||
title: 'Drag and Drop Flutter Demo',
|
||||
home: DragAndDropApp()
|
||||
home: DragAndDropApp(),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class _IgnoreDrag extends Drag {
|
||||
class _PointDemoPainter extends CustomPainter {
|
||||
_PointDemoPainter({
|
||||
Animation<double> repaint,
|
||||
this.arc
|
||||
this.arc,
|
||||
}) : _repaint = repaint, super(repaint: repaint);
|
||||
|
||||
final MaterialPointArcTween arc;
|
||||
@@ -202,7 +202,7 @@ class _PointDemoState extends State<_PointDemo> {
|
||||
key: _painterKey,
|
||||
foregroundPainter: _PointDemoPainter(
|
||||
repaint: _animation,
|
||||
arc: arc
|
||||
arc: arc,
|
||||
),
|
||||
// Watch out: if this IgnorePointer is left out, then gestures that
|
||||
// fail _PointDemoPainter.hitTest() will still be recognized because
|
||||
@@ -213,12 +213,12 @@ class _PointDemoState extends State<_PointDemo> {
|
||||
child: Text(
|
||||
'Tap the refresh button to run the animation. Drag the green '
|
||||
"and red points to change the animation's path.",
|
||||
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ class _PointDemoState extends State<_PointDemo> {
|
||||
class _RectangleDemoPainter extends CustomPainter {
|
||||
_RectangleDemoPainter({
|
||||
Animation<double> repaint,
|
||||
this.arc
|
||||
this.arc,
|
||||
}) : _repaint = repaint, super(repaint: repaint);
|
||||
|
||||
final MaterialRectArcTween arc;
|
||||
@@ -350,11 +350,11 @@ class _RectangleDemoState extends State<_RectangleDemo> {
|
||||
_screenSize = screenSize;
|
||||
_begin = Rect.fromLTWH(
|
||||
screenSize.width * 0.5, screenSize.height * 0.2,
|
||||
screenSize.width * 0.4, screenSize.height * 0.2
|
||||
screenSize.width * 0.4, screenSize.height * 0.2,
|
||||
);
|
||||
_end = Rect.fromLTWH(
|
||||
screenSize.width * 0.1, screenSize.height * 0.4,
|
||||
screenSize.width * 0.3, screenSize.height * 0.3
|
||||
screenSize.width * 0.3, screenSize.height * 0.3,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
|
||||
key: _painterKey,
|
||||
foregroundPainter: _RectangleDemoPainter(
|
||||
repaint: _animation,
|
||||
arc: arc
|
||||
arc: arc,
|
||||
),
|
||||
// Watch out: if this IgnorePointer is left out, then gestures that
|
||||
// fail _RectDemoPainter.hitTest() will still be recognized because
|
||||
@@ -386,12 +386,12 @@ class _RectangleDemoState extends State<_RectangleDemo> {
|
||||
child: Text(
|
||||
'Tap the refresh button to run the animation. Drag the rectangles '
|
||||
"to change the animation's path.",
|
||||
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -426,13 +426,13 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
|
||||
_ArcDemo('POINT', (_ArcDemo demo) {
|
||||
return _PointDemo(
|
||||
key: demo.key,
|
||||
controller: demo.controller
|
||||
controller: demo.controller,
|
||||
);
|
||||
}, this),
|
||||
_ArcDemo('RECTANGLE', (_ArcDemo demo) {
|
||||
return _RectangleDemo(
|
||||
key: demo.key,
|
||||
controller: demo.controller
|
||||
controller: demo.controller,
|
||||
);
|
||||
}, this),
|
||||
];
|
||||
@@ -466,9 +466,9 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
|
||||
},
|
||||
),
|
||||
body: TabBarView(
|
||||
children: _allDemos.map<Widget>((_ArcDemo demo) => demo.builder(demo)).toList()
|
||||
)
|
||||
)
|
||||
children: _allDemos.map<Widget>((_ArcDemo demo) => demo.builder(demo)).toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,7 +515,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
|
||||
debugPrint(_textSpan.toStringDeep());
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -573,7 +573,7 @@ class _UnderlinesState extends State<Underlines> {
|
||||
),
|
||||
child: ListBody(
|
||||
children: lines,
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -668,7 +668,7 @@ class _FallbackState extends State<Fallback> {
|
||||
child: ListBody(
|
||||
children: lines,
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user