Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97313

Flutter in VSCode Interpreting package as URI

$
0
0

I'm trying to get started using flutter from VSCode. I think I've done all the proper setup:

1) Downloaded extensions for flutter and dart and codeRunner on VS code

2) Downloaded the flutter SDK and added it the path

3) Run flutter doctor with no doctor with no errors enter image description here

After all the setup I tried clicking "Run Code", and received the error: 'dart' is not recognized as an internal or external command. After reading other online posts, I figured it was because I only added flutter SDK to my path and not dart SDK, so I added dart SDK to my path as well.

From there, I tried running the code again and got the following error:

lib/main.dart: Warning: Interpreting this as package URI, 'package:tranfer_app/main.dart'.
../../flutter/packages/flutter/lib/src/material/animated_icons.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui show Paint, Path, Canvas;
       ^
../../flutter/packages/flutter/lib/src/material/animated_icons.dart:10:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
       ^
../../flutter/packages/flutter/lib/src/material/app.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
       ^
../../flutter/packages/flutter/lib/src/material/app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
       ^
../../flutter/packages/flutter/lib/src/material/arc.dart:6:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
       ^
../../flutter/packages/flutter/lib/src/material/bottom_app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
       ^
../../flutter/packages/flutter/lib/src/material/bottom_sheet_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
       ^
../../flutter/packages/flutter/lib/src/material/button_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
       ^
../../flutter/packages/flutter/lib/src/material/card_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
       ^
../../flutter/packages/flutter/lib/src/material/chip_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
       ^

From my readings online, it sounds like VS Code might be trying to run as a dart app rather than a flutter app, and although I've found how to change this in Android Studio, I'm not sure how to change it in VSCode (which is where I'd like to do my development). Notably, if instead of running code with Ctrl+Alt+N, I use F5, the app will run just fine on an emulator, but I'd rather figure out these warnings before continuing as they seem important.

I expect my code to be runnable using the usual Ctrl+Alt+N Code Runner.

Thanks so much for the help!


Viewing all articles
Browse latest Browse all 97313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>