flutter icon indicating copy to clipboard operation
flutter copied to clipboard

[Bug] explicitly wrap non-list object as list for children property.

Open softmarshmallow opened this issue 4 years ago • 0 comments

When anonymous widget assigns to children property, and it's non list but a single object. It still build as-is.

So,

Stack(
   children: Widget()
);

code something like above gets generated.

prevent this by wrapping incomming widget as array - [] for preventing this.

so expected code will be.

Stack(
   children: [Widget()]
);

softmarshmallow avatar Nov 08 '20 08:11 softmarshmallow