导入库
导入内置库
import 'dart:html';
拆分成多个库
a.dart
part of "./sum.dart";
class A {
static int a = 10;
}
b.dart
part of "./sum.dart";
class B {
static int b = 100;
}
sum.dart
//定义一个库
library sum;
//声明两个文件属于sum库
part './a.dart';
part './b.dart';
int s() {
return A.a + B.b;
}
main.dart
import './lib/sum.dart';
main(List<String> args) {
print(s());
}