Importing path variants
In the previous examples, we imported a local file library that lives in the same directory as the library customer, so we just specified the filename.
However, that's not the case for when you are using third-party Dart packages. In this case, the files will not exist in the same directory, so let's take a look at how we can import an outer package Dart library.
There are several ways to specify library paths in the import statement, and we have already used two of them: relative file import and importing from a package. Now, let's take a look at all of them in more detail.
Let's assume that we have a package directory of a small foo package containing two files: a.dart and b.dart. To import them, we can use multiple ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access