0

enter image description here

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?

Anjali
  • 47
  • 8

2 Answers2

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