您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
33 行
1.1 KiB
33 行
1.1 KiB
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.rendering;
|
|
|
|
namespace Unity.UIWidgets.widgets {
|
|
public class AnnotatedRegion<T> : SingleChildRenderObjectWidget
|
|
where T : class {
|
|
public AnnotatedRegion(
|
|
Key key = null,
|
|
Widget child = null,
|
|
T value = null,
|
|
bool sized = true
|
|
) : base(key: key, child: child) {
|
|
D.assert(value != null);
|
|
D.assert(child != null);
|
|
this.value = value;
|
|
this.sized = sized;
|
|
}
|
|
|
|
public readonly T value;
|
|
|
|
public readonly bool sized;
|
|
|
|
public override RenderObject createRenderObject(BuildContext context) {
|
|
return new RenderAnnotatedRegion<T>(value: this.value, sized: this.sized);
|
|
}
|
|
|
|
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
|
|
RenderAnnotatedRegion<T> _renderObject = (RenderAnnotatedRegion<T>) renderObject;
|
|
_renderObject.value = this.value;
|
|
_renderObject.sized = this.sized;
|
|
}
|
|
}
|
|
}
|