wrap_all_children_with_expanded
Wrap all children with Expanded
widget.
This assist is only available when the selected widget is a direct child of a
Flex
widget. This assist will skip children that are
Expanded
, Flexible
or Spacer
. Before
Widget build(BuildContext context) {
return const Column(
// ^^^^^^^^^^^^
children: [
Text('Hello'),
Spacer(),
Text('World'),
],
);
}
After
Widget build(BuildContext context) {
return const Column(
children: [
Expanded(child: Text('Hello')),
Spacer(),
Expanded(child: Text('World')),
],
);
}