I want to import the about.dart file in my main.dart file. But it is showing error while I'm copying its path. I tried many ways to import it, but all fails. Can anyone please help me in this?
Asked
Active
Viewed 239 times
2 Answers
0
if both the files are in the same folder you can import them using this line
import './dialpad.dart';
if you want to import the file from a folder at the same level of the file in which you want to import you can use this line
import '../widgets/some_file.dart';

Munsif Ali
- 1,839
- 1
- 8
- 22
0
To use your local package you have to define package and give a package path
inside your pubspec.yaml
for the package.
To add local package in pubspec.yaml
:
sip_up-0.5.6:
path: ./sip_up-0.5.6

Sanket Patel
- 202
- 5
-
It's not working, It is giving error while I'm trying to do this. – Anjali Feb 09 '23 at 13:05