'visual studio code keeps display an error after updating flutter to v 2.10.3
after upgrading my old flutter with latest version of flutter 2.10.3 vs code keeps display the errors down below : /C:/flutter2/packages/flutter/lib/src/material/animated_icons.dart:9:8:
Error: Not found: 'dart:ui' import 'dart:ui' as ui show Paint, Path, Canvas; ^ /C:/flutter2/packages/flutter/lib/src/material/animated_icons.dart:10:8: Error: Not found: 'dart:ui' import 'dart:ui' show lerpDouble; ^ /C:/flutter2/packages/flutter/lib/src/material/app.dart:5:8: Error: Not found: 'dart:ui' import 'dart:ui' as ui; ^ /C:/flutter2/packages/flutter/lib/src/material/app_bar_theme.dart:5:8: Error: Not found: 'dart:ui' import 'dart:ui' show lerpDouble; ^ /C:/flutter2/packages/flutter/lib/src/material/arc.dart:6:8: Error: Not found: 'dart:ui' import 'dart:ui' show lerpDouble; ^ /C:/flutter2/packages/flutter/lib/src/material/banner_theme.dart:5:8: Error: Not found: 'dart:ui' import 'dart:ui' show lerpDouble; ^ /C:/flutter2/packages/flutter/lib/src/material/bottom_app_bar_theme.dart:5:8: Error: Not found: 'dart:ui' import 'dart:ui' show lerpDouble; ^ /C:/flutter2/packages/flutter/lib/src/material/bottom_navigation_bar_theme.dart:5:8: Error: Not found: 'dart:ui' import 'dart:ui' show lerpDouble; ^ /C:/flutter2/packages/flutter/lib/src/material/bottom_sheet.dart:5:8: Error: Not found: 'dart:ui' import 'dart:ui' show lerpDouble; ^ /C:/flutter2/packages/flutter/lib/src/material/bottom_sheet_theme.dart:5:8: Error: Not found: 'dart:ui' import 'dart:ui' show lerpDouble;
[Done] exited with code=254 in 102.936 seconds
here is result of flutter doctor command
Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 2.10.3, on Microsoft Windows [Version 10.0.19042.1526], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [√] Chrome - develop for the web [!] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.10) X The current Visual Studio installation is incomplete. Please reinstall Visual Studio. [√] Android Studio (version 2021.1) [√] IntelliJ IDEA Community Edition (version 2021.2) [√] VS Code (version 1.65.2) [√] Connected device (4 available) [√] HTTP Host Availability
! Doctor found issues in 1 category.
NOTE : even Android studio displays such error , both of Android studio and VS code don't connect to the emulator properly (Pixel XL API 30)
Solution 1:[1]
I was getting the same error when I try to run it from the run button at the top right corner
But I notice there are three options above the main method there are three options I selected Debug and it successfully worked!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dan Harms |