admin管理员组文章数量:1401298
I run the following code:
import 'pages/home_page.dart';
import 'pages/pages.dart';
import 'package:app/setup.dart';
import 'setup.dart';
The last 3 have red error lines, and the error:
Target of URI doesn't exist: 'pages/pages.dart'. // or 'setup.dart' etc.
Try creating the file referenced by the URI, or try using a URI for a file that does exist.
But the import 'pages/home_page.dart';
doesn't have an error line weirdly.
See below a screenshot of my lib folder. screenshot of lib folder
So why is importing pages/pages.dart
and setup.dart
not working? I tried using package:app
on line 3 of the above code (in the pubspec.yaml
it says name: app
) as well just to test if this would work but it doesn't.
I have looked online but can only find answers for importing packages, not importing dart files. There are a few questions about dart files but none of them solve my problem. I tried restarting VSCode,and I tried
flutter clean
flutter pub get
but neither worked. The project was working perfectly fine until I decided do split it from main.dart into smaller dart files and folders.
Also interestingly, in my main.dart
file, I do
import '../setup.dart';
import '../main.dart';
but only the import '../setup.dart'
has the error line. Anyone have any ideas? Thanks so much.
本文标签: flutterTarget of URI doesn39t exist (importing dart files) in VSCode WindowsStack Overflow
版权声明:本文标题:flutter - Target of URI doesn't exist (importing dart files) in VSCode Windows - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744208224a2595292.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论