1

I have Dart library error (the error in the title), when trying to run a Flutter file on VSCode, i tried everything in the old posts about the same problem, yet it still persists.

I can run flutter manually, using flutter run, but then hot reload and hot restart don't work. I need to retry debugging (and always get the same error), then again run flutter manually to see the changes i've made.

I tried flutter clean and then flutter pub get, yet it doesn't work. Still Error: Dart library 'dart:ui' is not available on this platform error persists.

I sent my code to my friend and she can debug and run it without flutter run.

Sorry if my formatting is bad, new here.

kivancksr
  • 11
  • 2
  • I thing this post maybe help you https://stackoverflow.com/questions/54072544/how-to-solved-dartui-error-when-going-to-run-flutter-app – shroot91 Feb 01 '23 at 15:17

1 Answers1

0

You'll get an error stating that dart:ui isn't available when trying to run a project with a Flutter dependency with the standalone Dart runtime (i.e., dart run vs flutter run) as only Flutter provides the dart:ui library.

It sounds like there might be something misconfigured in your VSCode launch options.

Ben Konyi
  • 2,849
  • 12
  • 20
  • Thank you, but i couldn't understand what i might have misconfigured while installing VSCode/Flutter, have you got any ideas? – kivancksr Feb 01 '23 at 16:14
  • Unfortunately, without being able to dig through your configuration, I don't think I can give much more advice :-( – Ben Konyi Feb 01 '23 at 16:24