Visual Studio Code no indented code flutter when press Enter - flutter

I am working with flutter in vscode and when I press enter the cursor is not indented correctly, I currently have the extensions installed from flutter, dart, awesome flutter snippets.
The weird thing is that it doesn't work on a macbook but on my windows computer it works correctly and I have the same extensions installed.
Any help would be greatly appreciated.

Go to your settings - editor - autoIndent and set it to full.

Related

Visual Studio Code's intellisense is not working

For some reason my VScode's intellisense is not working. I'm using the M1 Macbook pro and zsh for my terminal, not sure if that's relevant but I'm no longer getting any dropdown options. I tried expanding the box of suggestions but there's nothing other than a syntax suggestion:
Any suggestions? I assumed this was supposed to work out of the box, I deactivated Emmet as well but it's not budging.

Flutter and Dark extensions not showing in Visual Studio Code

I am trying to learn how to use Flutter and am using Visual Studio Code. When in Visual Studio Code and with a project selected, I try to: run > run without debugging. I am then supposed to see a list of my installed extensions to choose between - something like this:
but instead I see:
as if there are no extensions installed. However you can see:
that I do have Flutter and Dart extensions installed.
So I'm trying to figure out why my extensions are not showing. Any help gratefully received!
I am using Ubuntu 18.04.
You need to open main.dart or any other dart file. Then do run without debugging.

VSCode Taskbar Icon - Shows a blank white file icon

Whenever I open VSCode application on my Windows 10 Machine, the icon shows a blank white file in the taskbar instead of the VSCode icon. (Preview)
I've looked online for a solution, and couldn't find an answer to my issue except for "Uninstalling Google Drive" which I do not have installed.
Actions done:
Reinstalled VSCode.
Rebuilt the C: drive icons.
Your help is needed, and thank you!
After looking through the Icon issue I had, I landed on this website.
I downloaded the cleariconcache.vbs file, and ran it - It worked for all the missing Icons on my Windows 10.
Hope this helps anyone in the future.
This is what worked for me:
Right Click the Paper White icon that should be a Visual Studio Code icon.
Right click on Visual Studio Code, then click Properties.
Change the Shortcut Target and Start in values to the same folder from where Visual Studio Code is installed.
Click Ok.
Close and reopen Visual Studio Code.

Getting black screen in visual studio after Installation completed

I was getting black screen after opening Visual studio each time. I got a solution from Stack overflow i.e code --disable-gpu. It is working fine but my main issue is when I use to code in vs code. I am not getting suggestions as intellisense is not working and I am unable to install any extensions from Visual studio code.
to disable hardware acceleration permanently (without adding --disable-gpu argument) open folder "C:\Users\your_username_here\.vscode" than open file argv.json with any editor and look for
"//disable-hardware-acceleration": true, and just remove the tow slashes before disable. i think there is a similar workaround in linux
Hit Ctrl Shift P to open the command palette,
Type Developer and choose Developer: Toggle Developer Tools.
switch to the Network tab in Dev tools.
Search for extensions now
Go to properties of visual studio
change target . Add --disable-gpu
make sure to add a space before --
it will resolve your issue.

VS Code and Flutter/Dart, Widget Autocomplete not working

I'm working with some tutorials to learn Flutter and the one that I'm taking now uses VSCode. I actually prefer it to Android Studio because it doesn't overheat my Macbook. The only frustration I've had with it so far is that there are quite a few times where autocomplete just stops working. For instance, if I wrap a Column in a widget and then start typing Container, Android Studio will pop up an autocomplete showing Container VS Code used to do this for me, but has stopped for some reason. I can still get the autocomplete list if I press Ctrl+Spacebar.
I'm using the following:
VS Code - 1.36.1
Dart Extension - 3.2.0
Flutter Extension - 3.2.0
Material Icon Theme - 3.8.0
This is the latest version for all of these.
Is there some setting or something that I need to change? I've spent the last two hours trying to work out what's going on. In searching, I did see some references to earlier versions of VS Code and the extensions causing problems, but nothing about these versions.
Go to pubspec.yaml and hit save or run get packages. It worked for me, hope it helps
There are generally two reasons for VS Code to automatically open code completion - 1) when you press a key that the extension ahs told VS Code should invoke it and 2) when VS Code thinks it would be useful (for example when you start typing on a blank line). If you're typing in a line of existing code it won't always do this.
Pressing Ctrl+Space is the correct way to open completion in the cases where it doesn't appear automatically.
That said, if you can provide more information about a specific instance, I can take a look if it's something we could/should pop completion open for. It would be best raised at https://github.com/Dart-Code/Dart-Code/issues with a screenshot and details of exactly where your cursor is (and how you got there).
dont use too many flutter extension, I also face this problem , then I realize that 3 flutter extension are installed, use only one , it works for me, try it.
I did have a derivative of this problem when I was working with VS Code and flutter and this is what I did.
This is for windows though. This is what I did ;
Go to C:\Users<your username >\AppData\Roaming\Code and delete all the files and the directory called "Code". Usually the folder AppData is hidden so you'll have to unhide it. Then restart your computer and then reopen VS Code. This I think cleared some of the unwanted cache files which kind of made things right again.
Hope it helped.
Make sure
Preferences > Editor > Intentions > Quick assist powered by the Dart
Analysis Server
is enabled (Screenshot).
If so, most likely your Dart Analysis server is crashing. Navigate to your HOME folder:
cd ~
And then below should resolve your issue:
sudo chown -R $USER .dart .flutter
Clear your cache if the issue still exists:
File > Invalidate Caches > Clear file system cache and Local History > Invalidate and Restart.
Also, Power Save Mode should be disabled:
File > Power Save Mode
Doing a flutter clean and then flutter pub upgrade worked for me. Sometimes flutter clean using the command line does not work if you have android studio then in tools go to flutter and then do flutter clean.
just do flutter clean then flutter create. and then flutter pub upgrade, and also see if your flutter SDK is latest or not.
Check to make sure Android Studio is not on low power mode
Menu>File>Low Power Save Mode
I solved in in my Macbook Pro by
Going to System Preferences > Keyboard > Shortcuts > Input Sources
Disable: Select the previous input source (^ space)
Updating VS Code dart and flutter extensions
Restarting the computer.
And voila! Ctrl + space now shows options in VS Code.