Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 'wrap with (Flutter) Builder refactor' #33957

Closed
xster opened this issue Jul 24, 2018 · 2 comments
Closed

Add a 'wrap with (Flutter) Builder refactor' #33957

xster opened this issue Jul 24, 2018 · 2 comments
Labels
analyzer-refactoring area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P4 type-enhancement A request for a change that isn't a bug

Comments

@xster
Copy link
Contributor

xster commented Jul 24, 2018

The 2 patterns of taking a Widget instance or taking a WidgetBuilder instance are common in Flutter.

Currently if one makes a mistake and wrote one when the other is needed, it's inconvenient to make the switch since one has to make the manual act of balancing brackets etc.

Would be good to have a quick-refactor function to flip between the two.

@vsmenon vsmenon added analyzer-refactoring area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Jul 24, 2018
@bwilkerson bwilkerson added the type-enhancement A request for a change that isn't a bug label Aug 28, 2018
@srawlins srawlins added the P4 label Jan 11, 2021
dart-bot pushed a commit that referenced this issue Apr 12, 2021
Fixes issues such as

* flutter/flutter-intellij#814
* #33957 .

Essentially, in Flutter, it's often useful to create a new context in the UI/widget tree as a place to begin a search towards the trunk of the tree for various state structures attached to lower levels of the tree. The basic `Builder` widget is the official means for creating such a context/entry-point.

The patches in this PR are essentially a copy-paste-tweak from two types of existing, similar assists. The main origin was taken from `FlutterWrapStreamBuilder` which wraps client code with a constructor for the StreamBuilder sub-class. The new assist, provided here, is a little more basic/general than the StreamBuilder so it was able to also adopt assertion and test code from some of the other assists for basic widgets.

Closes #45656
#45656

GitOrigin-RevId: 00a5043
Change-Id: I5f93837af571b4974e35da131112f82cd9359697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
@MrBirb
Copy link

MrBirb commented Apr 14, 2021

@xster #45656 was recently merged. It claims to fix this issue.

@xster
Copy link
Contributor Author

xster commented Apr 14, 2021

Very cool

@xster xster closed this as completed Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-refactoring area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P4 type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants