How to prevent Visual Studio Code Flutter/Dart Editor from formatting new line/wrapping code? - flutter

I recently started working on Flutter/Dart, I like the flutter autoformatting on-save, but one thing might or might not be related is the code wrapping for long code even if code is still fitting my 4k editor window.
Is there a way to prevent new line but keep the comma auto format?
Thanks

Follow the instructions below:
Open Settings.
Expand Extensions and click Dart & Flutter on the left.
Find Dart: Line Length.
Change it to the value you want.

Related

Is there Partial Formatting for Flutter&Dart in Visual Studio Code?

I tend to CTRL+S my code quite often so Dart SDK formatter automatically formats the .dart file completely, from top to bottom. I know it is easy to turn this off by simply going to settings.json file of VSCode and adding "editor.formatOnSave": false,
When using Android Studio, I tend to turn this feature off and do partial formatting where I choose which part of the code I want formatted and hit the keys, telling IDE to format it which isCTRL+ALT+L by default.
Now I wonder if I can do partial formatting in Visual Studio Code. I don't want to auto-format my dart code and I don't want to format the whole dart file in VS Code, what do I do, can I do it?
No, there is no partial formatting as of right now.

Build a code editor with syntax highlighter using TextField in Flutter

I am trying to build Code Editor in Flutter app using TextField, I tried using flutter_syntax_view but the problem is, it only accept code as a predefined string text and it does not have any option to write a code.
This is what I have tried:
Used TextField with maxLines 10
If we can show number of lines on left like code editor
Open for suggestions, appreciate the help
See my work on github:
http://github.com/icedman/flutter_editor
It uses flutter_highlight, multicursor edits, minimap, line number gutter. Under development - you may want to contribute to that project.
I also wrote an article on creating an editor under 1000 lines of code in Flutter - wherein i explained why i ditched the textfield and made my own widget:
https://levelup.gitconnected.com/build-a-text-editor-with-flutter-ui-under-1000-lines-of-code-5a9dd2a053da

VS Code - Line in the middle of the screen

I'm a big fan of VS Code and i'm just learning to code. But when using dart language, there is a line in the middle of my screen the-line!!!. I don't have this trouble in html, css or any other language. I updated my graphics cards. What do you think could be the problem?
thanks
This isn't an issue with your graphics card. This is a Dart setting when you install the plugin via VS Code. You should be able to modify/remove this 'line' within the settings. It appears there is a fix here. The line is simply a formatting suggestion to where you are recommended to 'break' your code or start a new line.
Steps on getting rid of the line:
Go to your vs code and press on dart in the bottom of your screen
https://i.stack.imgur.com/hEH82.png
Then click on "Configure 'dart' language based settings..." https://i.stack.imgur.com/gWMua.png
Find the line that says "editor.rulers": [80] and change the value to what ever you want or delete the "editor.rulers" line to get rid of that huge line on your vs code screen
https://i.stack.imgur.com/Haass.png

Why is my Dart code auto-moved to a different line, when I Ctrl+S?

What happened is that when I move my codes to different lines, and when I CTRL+S, the code automatically get moved to a different line.
What setting in VS Code is this?
That's because you have format on save.
You need to go to VS Code settings and search formatOnSave and turn it off
check if the "auto format on save" option is on: VSCode: How do you autoformat on save?
you can also go into the dart plugin's preferences in vscode and change the line length at which formatting the code will auto-wrap it. You can make it however long you want. Just go into settings and search "Dart: Line Length"
For me, I went to the dart extension setting, there is an option of Dart: Enable SDK Formatter. It should be the problem I guess because when I disabled it, everything started working fine.
We can directly search for Dart: Enable SDK Formatter in VS Code settings.

sublime text-like code scrollbar on visual studio code

I have recently switched from Sublime Text to Visual studio code, but there is something that i truly miss, and it is the scroll bar at the top right corner of the which shows a smaller version of the file being edited (I don't know the exact name).
I find it pretty useful to navigate through my files, especially when i want to start deleting blocks of code i have commented out, before i submit my code.
Is there any plugin to get this on visual studio code, or is there any ongoing plans in order to implement it? Thanks!
Tracked in this feature request: https://github.com/Microsoft/vscode/issues/4865