Ban sync*/async* from user facing code (#95050)
This commit is contained in:
@@ -48,9 +48,9 @@ class CastListState extends State<CastList> {
|
||||
const Actor('James Madison', 'JM'),
|
||||
];
|
||||
|
||||
Iterable<Widget> get actorWidgets sync* {
|
||||
for (final Actor actor in _cast) {
|
||||
yield Padding(
|
||||
Iterable<Widget> get actorWidgets {
|
||||
return _cast.map((Actor actor) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Chip(
|
||||
avatar: CircleAvatar(child: Text(actor.initials)),
|
||||
@@ -64,7 +64,7 @@ class CastListState extends State<CastList> {
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -30,6 +30,7 @@ class MyStatefulWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
// ignore: no_sync_async_star
|
||||
final Stream<int> _bids = (() async* {
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
yield 1;
|
||||
|
||||
@@ -94,13 +94,13 @@ class RenderDiagonal extends RenderBox with SlottedContainerRenderObjectMixin<Di
|
||||
|
||||
// Returns children in hit test order.
|
||||
@override
|
||||
Iterable<RenderBox> get children sync* {
|
||||
if (_topLeft != null) {
|
||||
yield _topLeft!;
|
||||
}
|
||||
if (_bottomRight != null) {
|
||||
yield _bottomRight!;
|
||||
}
|
||||
Iterable<RenderBox> get children {
|
||||
return <RenderBox>[
|
||||
if (_topLeft != null)
|
||||
_topLeft!,
|
||||
if (_bottomRight != null)
|
||||
_bottomRight!,
|
||||
];
|
||||
}
|
||||
|
||||
// LAYOUT
|
||||
|
||||
Reference in New Issue
Block a user