How to reference another file in Dart?

Posted by Jessica Taylor | Updated on

If you want to reference another file in Dart? You will be importing the filename.dart and not the name of your library. So if the name of your library is: myLib and it is saved in the file: someDartFile.dart.

Here is a quick example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers