VsCode Dart code highlighting wrong colors - flutter

I have a very strange issue. After upgrading Flutter yesterday to the newest version, my syntax highlighting is awfully off. When I open a file, everything seems fine, but as soon as the file is analyzed and the result is used for highlighting, everything breaks.
Correct (for 1-2 seconds after opening the file):
Wrong (after around 2 seconds):
I am using the Monokai Theme for VsCode. I would love to get my old coloring back, as I think the new scheme is outrageously difficult to look at.
My Flutter Doctor outpu (All versions etc.):
[flutter] flutter doctor -v
[√] Flutter (Channel stable, 2.0.3, on Microsoft Windows [Version 10.0.19042.867], locale en-NZ)
• Flutter version 2.0.3 at R:\Programme\Flutter
• Framework revision 4d7946a68d (3 days ago), 2021-03-18 17:24:33 -0700
• Engine revision 3459eb2436
• Dart version 2.12.2
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at R:\Programme\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: R:\Programme\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.0)
• Android Studio at R:\Programme\Android\Android Studio
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] IntelliJ IDEA Ultimate Edition (version 2020.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.2
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
[√] VS Code, 64-bit edition (version 1.54.3)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.20.0
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90
• Edge (web) • edge • web-javascript • Microsoft Edge 89.0.774.57
• No issues found!
exit code 0
Any help would be greatly appreciated :)

Add "editor.semanticHighlighting.enabled": false in your vscode settings.json

Related

I got Flutter Build time and runtime error - Execution failed for task ':background_locator:compileDebugKotlin'

I got Flutter Build time and runtime error - Execution failed for task ':background_locator:compileDebugKotlin'.
when i try to run the app i got error as below, please help me.
Please can anyone help me to how i solve this problem.
below is my flutter doctor -v output.
PS D:__> flutter doctor -v
[√] Flutter (Channel stable, 3.0.1, on Microsoft Windows [Version 10.0.19044.1706], locale en-IN)
• Flutter version 3.0.1 at D:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fb57da5f94 (8 days ago), 2022-05-19 15:50:29 -0700
• Engine revision caaafc5604
• Dart version 2.17.1
• DevTools version 2.12.2
Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\Dev_Flutter\AppData\Local\Android\sdk
• Platform android-32, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.0)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.1.32210.238
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.67.2)
• VS Code at C:\Users\Dev_Flutter\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.40.0
[√] Connected device (4 available)
• CPH2127 (mobile) • 1cb8d2b1 • android-arm64 • Android 11 (API 30)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1706]
• Chrome (web) • chrome • web-javascript • Google Chrome 101.0.4951.67
• Edge (web) • edge • web-javascript • Microsoft Edge 101.0.1210.39
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Try This command in your project directory:
Flutter Pub Upgrade
There may be an inconsistency between your imported package and the flutter version you're using. this command will upgrade your packages to the latest feasible version.
Also, Please Provide your Flutter doctor output which is helpful to find a solution.

Why I can't find Chrome as a debug target?

As you can see, there is only Windows debug.
I removed android and ios folders so it is not strange not to see them, but it's strange that I can't see Chrome.
Why there is only Windows (desktop)? Any way to debug with Chrome (or Edge)?
flutter doctor -v
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.22000.675], locale ja-JP)
• Flutter version 2.10.5 at C:\Flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5464c5bac7 (4 weeks ago), 2022-04-18 09:55:37 -0700
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at C:\Users\yukik.000\AppData\Local\Android\sdk
• Platform android-32, build-tools 32.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.11)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.32228.343
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.67.1)
• VS Code at C:\Users\yukik.000\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.40.0
[√] Connected device (1 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.675]
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Wasn't [√] Chrome installed here before?
Try to run below command if your project is not web enabled or not Web folder inside your project
flutter config --enable-web
Then restart VsCode and run your project with available device Chrome or Edge.

How do I get hot Reload to work with flutter?

I have tried just about everything. Uninstalled the flutter plug in, made sure my path was right. Ran flutter doctor and everything is fine. Ran flutter clean up.
Even tried switching to windows beta.
Can't do a hot Reload when I run in windows app but I can do it when I run it for chrome.
Using Android Studio bumblebee which I have also reinstalled.
Any other advice?
Added my flutter doctor -v
[√] Flutter (Channel beta, 2.11.0-0.1.pre, on Microsoft Windows [Version 10.0.19042.1526], locale en-US)
• Flutter version 2.11.0-0.1.pre at C:\Users\pluca\Documents\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b101bfe32f (7 days ago), 2022-02-16 07:36:54 -0800
• Engine revision e355993572
• Dart version 2.17.0 (build 2.17.0-69.2.beta)
• DevTools version 2.10.0-dev.1
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at C:\Users\pluca\AppData\Local\Android\sdk
• Platform android-32, build-tools 32.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.0)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.1.32210.238
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.1526]
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.102
• Edge (web) • edge • web-javascript • Microsoft Edge 98.0.1108.56
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
I figured it out! I was running Visual Studio 2022. I uninstalled it an installed Visual Studio 2019.
Now it works!!!

Flutter Material icons: some icons dont exist in the flutter's Icons class

I realize that this is a duplicate of this question, but that question does not seem to have any activity so I'm trying to get more attention to this issue.
I am trying to use the percent icon from Material icons, although in the fonts.google.com site,it shows flutter implementation (screenshot attached below), when I try to call it from flutter code I get the error The getter 'percent' isn't defined for the type 'Icons'. (screenshot attached below).
what is the reason for this, and why is google trying to show some icon is supported for flutter when it clearly is not?
here is my flutter doctor -v output:
[√] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Version 10.0.19041.1348], locale en-US)
• Flutter version 2.8.0 at C:\Users\adnan\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cf44000065 (23 hours ago), 2021-12-08 14:06:50 -0800
• Engine revision 40a99c5951
• Dart version 2.15.0
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\adnan\AppData\Local\Android\sdk
• Platform android-31, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[!] Android Studio (version 4.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
X Unable to determine bundled Java version.
• Try updating or re-installing Android Studio.
[√] VS Code (version 1.62.3)
• VS Code at C:\Users\adnan\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.29.0
[√] VS Code (version 1.61.0-insider)
• VS Code at C:\Users\adnan\AppData\Local\Programs\Microsoft VS Code Insiders
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (3 available)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.45
• Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.43
! Doctor found issues in 1 category.
Apparently, now with Flutter 2.10, they've added some icons.
Last but not least, we’ve added 1,028 new Material icons.
which kinda answers this question, so the clear answer is whenever we encounter such an issue, we have to just sit and wait for flutter to integrate those icons, or use another Icons package.

Hot Reloads 0 libraries out of x libraries even though there are changes to reload

When I hot reload my flutter application, it always reloads 0 out of n number of libraries (Even if I make changes).
I am using Flutter on Intellij. Everything was working fine and now it doesn't work anymore.
Flutter Doctor
[√] Flutter (Channel beta, v1.17.0, on Microsoft Windows [Version
10.0.18362.720], locale en-US)
• Flutter version 1.17.0 at C:\Users\msoha\Desktop\Flutter\flutter
• Framework revision d3ed9ec945 (7 days ago), 2020-04-06 14:07:34 -0700
• Engine revision c9506cb8e9
• Dart version 2.8.0 (build 2.8.0-dev.18.0 eea9717938)
[√] Android toolchain - develop for Android devices (Android SDK
version 29.0.0)
• Android SDK at C:\Users\msoha\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 3.4)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 36.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[√] IntelliJ IDEA Community Edition (version 2019.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1.3
• Flutter plugin version 44.0.3
• Dart plugin version 193.6911.31
[√] VS Code (version 1.38.1)
• VS Code at C:\Users\msoha\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.4.1
[√] Connected device (3 available)
• SM S367VL • 5200e8cccc8f76a3 • android-arm • Android 9 (API 28)
• Chrome • chrome • web-javascript • Google Chrome 80.0.3987.163
• Web Server • web-server • web-javascript • Flutter Tools
• No issues found! Process finished with exit code 0
For reference, I am building on an android phone.