在DART中使用库时,我不完全理解part
/part of
和import
/export
之间的区别.例如:
one.dart:
library one;
part "two.dart";
Class One {
};
和
two.dart:
part of one;
import 'somefile.dart';
Class Two {
}
与
library one;
import 'two.dart';
Class One {
}
和
library two;
import 'somefile.dart';
export 'somefile.dart';
Class Two {
}
Both scenarios seem to do the same thing. When is it advantageous to use part
和 part of
rather than import
? And are there scenarios where import
will not work, but part
和 part of
will?