Home > Blockchain >  How to remove dart/flutter (hint) squiggles in vscode?
How to remove dart/flutter (hint) squiggles in vscode?

Time:02-22

Is it possible? related to flutter plugin? or is it related to the Problem pane? I can remove hints from problem pane but not from the editor (shows squiggles). Since flutter is already quite verbose, these don't help, especially in the middle of writing the software.(import, consts etc)

CodePudding user response:

From Dart 2.15, you can add the lint rules that you would like to ignore to your analysis_options.yaml file. If you do not have it in your project. Add it to your root project system. After that you can add the lint rules that you would like to ignore to it.

include: package:flutter_lints/flutter.yaml

linter:
  rules:
    prefer_const_constructors_in_immutables:
      enabled: false

p.s. My honest and professional opinion is for you to follow the analyzer. It works for your own good.

CodePudding user response:

All the issues that are displayed can be controlled by adding/removing rules in your source code. It's also a good idea to actually address those issues than just silencing them.

For instance, you would normally get a warning if you have unused imports like so:

enter image description here

However, you can either use a directive to disable them in the current file as shown in top of this code:

enter image description here

CodePudding user response:

Here is a shortcut method to deal with.

  1. Goto that line where squiggly line is
  2. Click on that small icon.
  3. Choose what you want

enter image description here

You can add const as well

CodePudding user response:

In another way, you can use fix_import solution. While you're writing code, use the fix import command with cmd p or control p then it'll be automatically fixed to the relative path to all your import. enter image description here

https://marketplace.visualstudio.com/items?itemName=luanpotter.dart-import

  • Related