您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
21 行
550 B
21 行
550 B
using Unity.UIWidgets.foundation;
|
|
|
|
namespace Unity.UIWidgets.widgets {
|
|
public abstract class UniqueWidget<T> :StatefulWidget where T: State<StatefulWidget> {
|
|
|
|
public UniqueWidget(
|
|
GlobalKey<T> key
|
|
) : base(key: key) {
|
|
D.assert(key != null);
|
|
}
|
|
public abstract override State createState();
|
|
|
|
T currentState {
|
|
get {
|
|
GlobalKey<T> globalKey = key as GlobalKey<T>;
|
|
return globalKey.currentState;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|