simplify adding a single-child parent Widget
See original GitHub issueFrom @HansMuller on February 19, 2016 0:13
This comes up all the time as one realizes that a widget needs padding, or a border, or a background, etc.
Say I start with this:
return new Foo(
child: new Column(
justifyContent: FlexJustifyContent.start,
children: <Widget>[
...
]
)
);
and I want to end up with this:
return new Foo(
child: new Padding(
padding: const EdgeDims.all(16.0),
child: new Column(
justifyContent: FlexJustifyContent.start,
children: <Widget>[
...
]
)
)
);
I’d like to be able to put the cursor inside the Column(), press a magic key to get:
return new Foo(
child: new TBD(
child: new Column(
justifyContent: FlexJustifyContent.start,
children: <Widget>[
...
]
)
)
);
which is easily finished by changing TBD to Padding and add the padding: parameter.
Copied from original issue: flutter/flutter#2016
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (16 by maintainers)
Top Results From Across the Web
Reset child widget from parent widget in flutter - Stack Overflow
I have a child widget that is full of variables. When I do a setState() on my parent widget, I want it to...
Read more >Flutter Single Child Layout Widgets | by Chamith Chathuka
As the name suggests, it can have only one child widget inside the parent ... This Widget help to build the layout by...
Read more >9 Manager Widgets - O'Reilly
The Scale creates and manages its own widgets; the only children that you can add to a Scale are Label widgets that represent...
Read more >StatefulWidget lifecycle | Flutter by Example
Initialize properties that rely on this widgets 'parent' in the tree. 3. ... initState(); // Add listeners to this class cartItemStream.listen((data) ...
Read more >Flutter - Flexible Widget - GeeksforGeeks
In the body of the app, the parent widget is Center followed by Container and Padding. After that, we have a Column widget...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, please!
It was and went over great! 👍