Yes, I read dart import and part of directives in same file
I have this structure:
- lib/
- src/
- one/
- SomeClass.dart
- one.dart
- one/
- mylib.dart
- src/
- main.dart
I'm trying to achieve this behavior:
- All public and hidden variables are fully accessible inside library.
- All public variables from library are accessible to main.dart.
There is a problem. For some weird reason I can't use any directive with 'part of'. So I can't use this in the one.dart
:
part of mylib;
import 'SomeClass.dart';
//somecode
So I either need to move class definition from SomeClass.dart
to one.dart
(and that will make code less readable and mixed up) or I need to move 'import' in the mylib.dart
.
library mylib;
import 'SomeClass.dart';
part ..
I don't like either of the options. In the second case I will need to parse all modules then and move import/exports. Which will definitely break something.
It may sound weird but the project will build from various modules automatically. And one/
is one of them.
This app design is bad, I know. But either I need to find a better way or just make all variables public and don't bother.