I´m new to DART/FLUTTER. I read the documentation and lot´s of posts, but am still confused about the concept of dart imports. The documentation on dart.dev is much about building and using packages, but not very clear on general aspects of 'import'. Some explanations are spread somewhere in the text. But I´m still missing a clear language definition. There is a DartLangSpec-v2.10.pdf, which is not helpful to understand the basic concepts.
On dart.dev we find two types of import:
- import 'dart:xxx' -> Multi-platform libraries, Native platform libraries, Web platform libraries. So this are the core libraries !?
- import 'package:xxx' -> libraries from packages. All kinds of third party libraries we can install from pub.dev.
So, that´s pretty much all we find about imports. There is some explanation in the language tour, a post on stackoverflow and tutorialspoint.
Is there a more detailed explanation or reference of the concepts and syntax of dart imports somewhere?
What I found:
- You can use libraries similar to code modules in JS, beside some differences in the use of namespaces. The library file has to start with 'library + name', definitions are imported directly, as long as you do not use 'import .. as'.
- definitions beginning with an underscore are not exported
Questions:
- can I use an absolute path for a library? Just found relative path definitions
- can we use URL´s in a path definition to read a library from the web?
- what happens, if a library is imported multiple times in different modules?
- can we have different libraries with the same name, but different path?
- are there any limitations in the data types we can use in a library file?
Maybe I simply missed a source, but from other posts it seems, I´m not the only one looking for this information.