In a Flutter app I have a dart file located at FlutterTest\sandbox\lib\my_widget\my_widget.dart
.
And I have an image located at FlutterTest\sandbox\lib\my_widget\imgs\myImage.png
.
From my_widget.dart
how can I point a file to this image, something along the lines of new File("???\my_widget\myImage.png")
?
Just to clarify, in Java I could do something like MyClass.class.getResource("myImage.png").toString()
.
By the way if I print(Directory.current.path)
it gives me simply /
. And if I try to list the contents of this directory it tells me: "Directory listing failed, path = '/' (OS Error: Permission denied, errno = 13)". So I don't actually know where the current directory is.