I'm using the most current version of Android Studio to develop Flutter Apps/Flutter 2.5.3.
In some projects, I can see the widget tree graphic lines in the editor, but sometimes when creating a new Flutter project it does not appear. And I'm unable to find the option to turn it on. Does anybody know the secret switch?
Thanks
Good editor settings: (see the yellow marked widget tree lines)
Bad editor settings: (no tree view... :-( )
Go to "File/Settings," then search for "Flutter" and enable "Show UI Guides for build methods":
Related
Is there a quick solution to Navigate through all the Stateful/Stateless widgets in your Flutter project through some sort of menu listing all of them?
It can get quite tedious to make or find a button in your code and write/remove/comment navigation code to quickly debug scenarios.
Is there such a quick navigation feature? I'm using VS Code.
Yes, you should be using Flutter Outline for this kind of stuff it is already available for projects in Android Studio. For VS Code there's a similar plugin which I am linking here. It is called Outline Map.
You can basically see all your widgets in a heirarchial tree formation and even navigate and extract by clicking on them.
This is my project and his indentation by default :
enter image description here
and this is a clone project on github:
enter image description here
How to get the indentation with this line between parent and children.
PS : I didn't touch the settings, I just clone and I'm on Android Studio.
When I disable the Show UI Guides for build methods in Settings -> Language & Frameworks -> Flutter, it remove this indentation that I wanted to have.
I am using Android studio chipmunk 2021.2.1 patch 2 for Apple M1 chip ... created a flutter project with patch 1 ... code is working fine but some android studio features not working ...
Flutter Outline shows the source code tree but I am unable to Export any widget nither directly from the editor nor from Eflutter Outline Tab ...
doubleclick on widget tree -> refector -> Extract Flutter Widget ...
Following popup appears but nothing happens on clicking Refactor...
The same thing works fine for the Extract Method...
Flutter Outline shows the code tree but it's also not extracting any Widget...
Only the Export Method button works fine here... it also does not show Wrapping any widget all buttons are disabled ...
The following suggestion bulb is also not showing anything for this project... (This screenshot is from another project)
Unable to rename anything... it shows an error...
This error does not make any sense.
And all things are working fine for the other flutter project I downloaded from Github...
I don't know why this thing happening only for this project and working fine for other projects.
So I am following this tutorial, which is quite recent, my Android Studio build is from May 16 so not too far off from this vid's upload date: https://youtu.be/CD1Y2DmL5JM?t=531
Notice how the welcome screen looks right at the time the vid starts on the point I linked. But for me, the welcome screen looks like this, why?:
Also, when I click "new flutter project" in the top right, this screen shows up which is different for the vid, why?:
Spent an hour but can't find anything. Now I can create a new flutter project and selected the right location for my flutter and dark SDK, and have both flutter and dart plugins installed. But the option of the standard "Application" template is not a standard option. Looks at the above options, I've tried them all and none are the counter app. In vscode I typed "flutter new project" in global search, and it gave the "Application" template, and running in with the emulator open showed the counter app. But where is the option in Android Studio?
On the left side pane, you actually have to select Flutter, input your SDK location, then click next from the same panel. Don't click next while Dart is selected otherwise you will get the options you see above:
After this it will take you to making a new Flutter project, not a Dart project. Then next to "Project Type:", choose "Application".
can someone help me to find the extension that make vscode do the tree like indentation like in the picture
enabling these two options like on the pic
I found it mentioned and shown here: dart and flutter extensions:
in the settings and enable the Dart:Preview Flutter Ui Guides option
Unless you are using the Dart language you are not going to be able to get that same indent guide effect as it requires that specific syntax to parse and enable the feature to work.
on Vscode Click Code -> Preferences -> Settings
and search for Preview Bazel Workspace Custom Scripts and check it
and search for Preview Flutter Ui Guides
and Check Dart: Preview Flutter Ui Guides
and Check Dart: Preview Flutter Ui Guides Custom Tracking
Open your VS code workspace and check:
Dart: Preview Bazel Workspace Custom Scripts
Dart: Preview Flutter Ui Guides
Dart: Preview Flutter Ui Guides Custom Tracking
This tree like indentation in vscode is UI Guide for Flutter.
Method 1
First of all please check in your VS code workspace Dart Plugin is enable.
Press Ctrl + ,
In search box Type Dart:Preview Flutter Ui Guides
Turn on both options for work.
I suggest you go in the settings and enable the Dart:Preview Flutter Ui Guides option. That will make it really easy to spot the parent-child relationships in your code, which is particularly useful when you have many nested widgets in your UI files.
run the Dart: Use Recommended Settings command from the VS Code command palette (ctrl + shift + P)and dart recommended setting will be written on your setting.json file.
and open the setting.json add this on top or below the dart settings and restart VsCode
"dart.previewFlutterUiGuides": true,
"dart.previewFlutterUiGuidesCustomTracking": true,
Search and check this (for new versions)