浏览代码

fix basic

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
0e8f9c81
共有 5 个文件被更改,包括 383 次插入265 次删除
  1. 2
      com.unity.uiwidgets/Runtime/painting/edge_insets.cs
  2. 64
      com.unity.uiwidgets/Runtime/rendering/image.cs
  3. 46
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  4. 107
      com.unity.uiwidgets/Runtime/rendering/shifted_box.cs
  5. 429
      com.unity.uiwidgets/Runtime/widgets/basic.cs

2
com.unity.uiwidgets/Runtime/painting/edge_insets.cs


get { return _left + _right + _start + _end; }
}
float vertical {
public float vertical {
get { return _top + _bottom; }
}

64
com.unity.uiwidgets/Runtime/rendering/image.cs


Color color = null,
BlendMode colorBlendMode = BlendMode.srcIn,
BoxFit? fit = null,
Alignment alignment = null,
AlignmentGeometry alignment = null,
bool matchTextDirection = false,
TextDirection? textDirection = null,
bool invertColors = false,
FilterQuality filterQuality = FilterQuality.low
) {

_alignment = alignment ?? Alignment.center;
_invertColors = invertColors;
_filterQuality = filterQuality;
_textDirection = textDirection;
_matchTextDirection = matchTextDirection;
}
Alignment _resolvedAlignment;
bool _flipHorizontally;
void _resolve() {
if (_resolvedAlignment != null)
return;
_resolvedAlignment = alignment.resolve(textDirection);
_flipHorizontally = matchTextDirection && textDirection == TextDirection.rtl;
}
void _markNeedResolution() {
_resolvedAlignment = null;
_flipHorizontally = false;
markNeedsPaint();
}
Image _image;

}
}
Alignment _alignment;
AlignmentGeometry _alignment;
public Alignment alignment {
public AlignmentGeometry alignment {
get { return _alignment; }
set {
if (value == _alignment) {

}
}
public bool matchTextDirection {
get { return _matchTextDirection; }
set {
D.assert(value != null);
if (value == _matchTextDirection)
return;
_matchTextDirection = value;
_markNeedResolution();
}
}
bool _matchTextDirection;
public TextDirection? textDirection {
get { return _textDirection; }
set {
if (_textDirection == value)
return;
_textDirection = value;
_markNeedResolution();
}
}
TextDirection? _textDirection;
Size _sizeForConstraints(BoxConstraints constraints) {
constraints = BoxConstraints.tightFor(
_width,

if (_image == null) {
return;
}
_resolve();
D.assert(_resolvedAlignment != null);
D.assert(_flipHorizontally != null);
painting_.paintImage(
canvas: context.canvas,
rect: offset & size,

fit: _fit,
alignment: _alignment,
alignment: _resolvedAlignment,
invertColors: _invertColors,
flipHorizontally: _flipHorizontally,
invertColors: invertColors,
filterQuality: _filterQuality
);
}

properties.add(new EnumProperty<BlendMode>("colorBlendMode", colorBlendMode,
defaultValue: foundation_.kNullDefaultValue));
properties.add(new EnumProperty<BoxFit?>("fit", fit, defaultValue: foundation_.kNullDefaultValue));
properties.add(new DiagnosticsProperty<Alignment>("alignment", alignment,
properties.add(new DiagnosticsProperty<AlignmentGeometry>("alignment", alignment,
defaultValue: foundation_.kNullDefaultValue));
properties.add(new EnumProperty<ImageRepeat>("repeat", repeat, defaultValue: ImageRepeat.noRepeat));
properties.add(new DiagnosticsProperty<Rect>("centerSlice", centerSlice,

properties.add(new FlagProperty("matchTextDirection", value: matchTextDirection, ifTrue: "match text direction"));
properties.add(new EnumProperty<TextDirection>("textDirection", (TextDirection)textDirection, defaultValue: null));
}
}
}

46
com.unity.uiwidgets/Runtime/rendering/proxy_box.cs


public class ShapeBorderClipper : CustomClipper<Path> {
public ShapeBorderClipper(
ShapeBorder shape = null) {
ShapeBorder shape = null,
TextDirection? textDirection = null
) {
this.textDirection = textDirection;
public readonly TextDirection? textDirection;
return shape.getOuterPath(Offset.zero & size);
return shape.getOuterPath(Offset.zero & size, textDirection: textDirection);
if (oldClipper.GetType() != GetType()) {
if (oldClipper.GetType() != typeof(ShapeBorderClipper))
}
ShapeBorderClipper typedOldClipper = (ShapeBorderClipper) oldClipper;
return typedOldClipper.shape != shape;
ShapeBorderClipper typedOldClipper = oldClipper as ShapeBorderClipper;
return typedOldClipper.shape != shape
|| typedOldClipper.textDirection != textDirection;
}
}

public class RenderFittedBox : RenderProxyBox {
public RenderFittedBox(
BoxFit fit = BoxFit.contain,
Alignment alignment = null,
AlignmentGeometry alignment = null,
TextDirection? textDirection = null,
_textDirection = textDirection;
}
Alignment _resolvedAlignment;

return;
}
_resolvedAlignment = alignment;
_resolvedAlignment = alignment.resolve(textDirection);
}
void _markNeedResolution() {

BoxFit _fit;
public Alignment alignment {
public AlignmentGeometry alignment {
get { return _alignment; }
set {
D.assert(value != null);

_markNeedResolution();
}
}
AlignmentGeometry _alignment;
Alignment _alignment;
public TextDirection? textDirection {
get {
return _textDirection;
}
set {
if (_textDirection == value)
return;
_textDirection = value;
_clearPaintData();
_markNeedResolution();
}
}
TextDirection? _textDirection;
protected override void performLayout() {
if (child != null) {

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<BoxFit>("fit", fit));
properties.add(new DiagnosticsProperty<Alignment>("alignment", alignment));
properties.add(new DiagnosticsProperty<AlignmentGeometry>("alignment", alignment));
properties.add(new EnumProperty<TextDirection>("textDirection", (TextDirection)textDirection, defaultValue: null));
}
}

107
com.unity.uiwidgets/Runtime/rendering/shifted_box.cs


public class RenderPadding : RenderShiftedBox {
public RenderPadding(
EdgeInsets padding = null,
EdgeInsetsGeometry padding = null,
TextDirection? textDirection = null,
_textDirection = textDirection;
EdgeInsets _resolvedPadding;
void _resolve() {
if (_resolvedPadding != null)
return;
_resolvedPadding = padding.resolve(textDirection);
D.assert(_resolvedPadding.isNonNegative);
}
public EdgeInsets padding {
void _markNeedResolution() {
_resolvedPadding = null;
markNeedsLayout();
}
public EdgeInsetsGeometry padding {
get { return _padding; }
set {
D.assert(value != null);

markNeedsLayout();
}
}
EdgeInsetsGeometry _padding;
EdgeInsets _padding;
public TextDirection? textDirection {
get { return _textDirection; }
set {if (_textDirection == value)
return;
_textDirection = value;
_markNeedResolution(); }
}
TextDirection? _textDirection;
if (child != null) {
return child.getMinIntrinsicWidth(Mathf.Max(0.0f, height - _padding.vertical)) +
_padding.horizontal;
}
return _padding.horizontal;
_resolve();
float totalHorizontalPadding = _resolvedPadding.left + _resolvedPadding.right;
float totalVerticalPadding = _resolvedPadding.top + _resolvedPadding.bottom;
if (child != null) // next line relies on double.infinity absorption
return child.getMinIntrinsicWidth(Mathf.Max(0.0f, height - totalVerticalPadding)) + totalHorizontalPadding;
return totalHorizontalPadding;
if (child != null) {
return child.getMaxIntrinsicWidth(Mathf.Max(0.0f, height - _padding.vertical)) +
_padding.horizontal;
}
return _padding.horizontal;
_resolve();
float totalHorizontalPadding = _resolvedPadding.left + _resolvedPadding.right;
float totalVerticalPadding = _resolvedPadding.top + _resolvedPadding.bottom;
if (child != null) // next line relies on double.infinity absorption
return child.getMaxIntrinsicWidth(Mathf.Max(0.0f, height - totalVerticalPadding)) + totalHorizontalPadding;
return totalHorizontalPadding;
if (child != null) {
return child.getMinIntrinsicHeight(Mathf.Max(0.0f, width - _padding.horizontal)) +
_padding.vertical;
}
return _padding.vertical;
_resolve();
float totalHorizontalPadding = _resolvedPadding.left + _resolvedPadding.right;
float totalVerticalPadding = _resolvedPadding.top + _resolvedPadding.bottom;
if (child != null) // next line relies on double.infinity absorption
return child.getMinIntrinsicHeight(Mathf.Max(0.0f, width - totalHorizontalPadding)) + totalVerticalPadding;
return totalVerticalPadding;
if (child != null) {
return child.getMaxIntrinsicHeight(Mathf.Max(0.0f, width - _padding.horizontal)) +
_padding.vertical;
}
return _padding.vertical;
_resolve();
float totalHorizontalPadding = _resolvedPadding.left + _resolvedPadding.right;
float totalVerticalPadding = _resolvedPadding.top + _resolvedPadding.bottom;
if (child != null) // next line relies on double.infinity absorption
return child.getMaxIntrinsicHeight(Mathf.Max(0.0f, width - totalHorizontalPadding)) + totalVerticalPadding;
return totalVerticalPadding;
BoxConstraints constraints = this.constraints;
_resolve();
D.assert(_resolvedPadding != null);
size = constraints.constrain(_padding.inflateSize(Size.zero));
size = constraints.constrain(new Size(
_resolvedPadding.left + _resolvedPadding.right,
_resolvedPadding.top + _resolvedPadding.bottom
));
var innerConstraints = constraints.deflate(_padding);
BoxConstraints innerConstraints = constraints.deflate(_resolvedPadding);
var childParentData = (BoxParentData) child.parentData;
childParentData.offset = _padding.topLeft;
size = constraints.constrain(_padding.inflateSize(child.size));
BoxParentData childParentData = child.parentData as BoxParentData;
childParentData.offset = new Offset(_resolvedPadding.left, _resolvedPadding.top);
size = constraints.constrain(new Size(
_resolvedPadding.left + child.size.width + _resolvedPadding.right,
_resolvedPadding.top + child.size.height + _resolvedPadding.bottom
));
D.assert(() => {
D.assert(()=> {
D.debugPaintPadding(context.canvas, outerRect,
child != null ? _padding.deflateRect(outerRect) : null);
D.debugPaintPadding(context.canvas, outerRect, child != null ? _resolvedPadding.deflateRect(outerRect) : null);
return true;
});
}

properties.add(new DiagnosticsProperty<EdgeInsets>("padding", padding));
properties.add(new DiagnosticsProperty<EdgeInsetsGeometry>("padding", padding));
properties.add(new EnumProperty<TextDirection>("textDirection", (TextDirection)textDirection, defaultValue: null));
}
}

429
com.unity.uiwidgets/Runtime/widgets/basic.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Alignment>("alignment", alignment));
properties.add(new DiagnosticsProperty<AlignmentGeometry>("alignment", alignment));
properties.add(new FloatProperty("widthFactor",
widthFactor, defaultValue: foundation_.kNullDefaultValue));
properties.add(new FloatProperty("heightFactor",

}
}
public class IntrinsicWidth : SingleChildRenderObjectWidget {
public class IntrinsicWidth : SingleChildRenderObjectWidget {
public IntrinsicWidth(
Key key = null,
float? stepWidth = null,

properties.add(new FloatProperty("aspectRatio", aspectRatio));
}
}
public class Flex : MultiChildRenderObjectWidget {
public Flex(
Axis direction = Axis.vertical,
TextDirection? textDirection = null,
TextBaseline? textBaseline = null,
Key key = null,
MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
MainAxisSize mainAxisSize = MainAxisSize.max,
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
VerticalDirection verticalDirection = VerticalDirection.down,
List<Widget> children = null
) : base(key, children) {
this.direction = direction;
this.mainAxisAlignment = mainAxisAlignment;
this.mainAxisSize = mainAxisSize;
this.crossAxisAlignment = crossAxisAlignment;
this.textDirection = textDirection;
this.verticalDirection = verticalDirection;
this.textBaseline = textBaseline;
}
public readonly Axis direction;
public readonly MainAxisAlignment mainAxisAlignment;
public readonly MainAxisSize mainAxisSize;
public readonly CrossAxisAlignment crossAxisAlignment;
public readonly TextDirection? textDirection;
public readonly VerticalDirection verticalDirection;
public readonly TextBaseline? textBaseline;
bool _needTextDirection {
get {
switch (direction) {
case Axis.horizontal:
return true;
case Axis.vertical:
return (crossAxisAlignment == CrossAxisAlignment.start ||
crossAxisAlignment == CrossAxisAlignment.end);
}
return false;
}
}
public TextDirection getEffectiveTextDirection(BuildContext context) {
return textDirection ?? (_needTextDirection ? Directionality.of(context) : TextDirection.ltr);
}
public override RenderObject createRenderObject(BuildContext context) {
return new RenderFlex(
direction: direction,
mainAxisAlignment: mainAxisAlignment,
mainAxisSize: mainAxisSize,
crossAxisAlignment: crossAxisAlignment,
textDirection: getEffectiveTextDirection(context),
verticalDirection: verticalDirection,
textBaseline: textBaseline ?? TextBaseline.alphabetic
);
}
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
((RenderFlex) renderObject).direction = direction;
((RenderFlex) renderObject).mainAxisAlignment = mainAxisAlignment;
((RenderFlex) renderObject).mainAxisSize = mainAxisSize;
((RenderFlex) renderObject).crossAxisAlignment = crossAxisAlignment;
((RenderFlex) renderObject).textDirection = textDirection ?? TextDirection.ltr;
((RenderFlex) renderObject).verticalDirection = verticalDirection;
((RenderFlex) renderObject).textBaseline = textBaseline ?? TextBaseline.alphabetic;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<Axis>("direction", direction));
properties.add(new EnumProperty<MainAxisAlignment>("mainAxisAlignment", mainAxisAlignment));
properties.add(new EnumProperty<MainAxisSize>("mainAxisSize", mainAxisSize,
defaultValue: MainAxisSize.max));
properties.add(new EnumProperty<CrossAxisAlignment>("crossAxisAlignment", crossAxisAlignment));
properties.add(new EnumProperty<TextDirection?>("textDirection", textDirection, defaultValue: null));
properties.add(new EnumProperty<VerticalDirection>("verticalDirection", verticalDirection,
defaultValue: VerticalDirection.down));
properties.add(new EnumProperty<TextBaseline?>("textBaseline", textBaseline, defaultValue: null));
}
}
public class MouseRegion : StatefulWidget {
public MouseRegion(

PointerHoverEventListener onHover= null,
bool opaque = true,
Widget child = null) : base(key: key) {
Widget child = null
) : base(key: key) {
D.assert(opaque != null);
this.onEnter = onEnter;
this.onExit = onExit;

properties.add(new FloatProperty("height", height, defaultValue: null));
}
}
public class PositionedDirectional : StatelessWidget {
public class PositionedDirectional : StatelessWidget {
Key key = null,
float? start = null,
float? top = null,
float? end = null,
float? bottom = null,
float? width = null,
float? height = null,
Widget child = null
) : base(key: key) {
this.child = child;
Key key = null,
float? start = null,
float? top = null,
float? end = null,
float? bottom = null,
float? width = null,
float? height = null,
Widget child = null
) : base(key: key) {
this.child = child;
}
public readonly float? start;
public readonly float? top;
public readonly float? end;
public readonly float? bottom;
public readonly float? width;
public readonly float? height;
public readonly Widget child;
public override Widget build(BuildContext context) {
return Positioned.directional(
textDirection: Directionality.of(context),
start: start,
top: top,
end: end,
bottom: bottom,
width: width,
height: height,
child: child
);
}
public class Flex : MultiChildRenderObjectWidget {
public Flex(
Key key = null,
Axis direction = Axis.vertical,
MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
MainAxisSize mainAxisSize = MainAxisSize.max,
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
TextDirection? textDirection = null,
VerticalDirection verticalDirection = VerticalDirection.down,
TextBaseline? textBaseline = null,
List<Widget> children = null
) : base(key, children) {
this.direction = direction;
this.mainAxisAlignment = mainAxisAlignment;
this.mainAxisSize = mainAxisSize;
this.crossAxisAlignment = crossAxisAlignment;
this.textDirection = textDirection;
this.verticalDirection = verticalDirection;
this.textBaseline = textBaseline;
}
public readonly float start;
public readonly Axis direction;
public readonly MainAxisAlignment mainAxisAlignment;
public readonly MainAxisSize mainAxisSize;
public readonly CrossAxisAlignment crossAxisAlignment;
public readonly TextDirection? textDirection;
public readonly VerticalDirection verticalDirection;
public readonly TextBaseline? textBaseline;
public readonly float top;
bool _needTextDirection {
get {
switch (direction) {
case Axis.horizontal:
return true;
case Axis.vertical:
return (crossAxisAlignment == CrossAxisAlignment.start ||
crossAxisAlignment == CrossAxisAlignment.end);
}
public readonly float end;
return false;
}
}
public readonly float bottom;
public TextDirection getEffectiveTextDirection(BuildContext context) {
return textDirection ?? (_needTextDirection ? Directionality.of(context) : TextDirection.ltr);
}
public readonly float width;
public override RenderObject createRenderObject(BuildContext context) {
return new RenderFlex(
direction: direction,
mainAxisAlignment: mainAxisAlignment,
mainAxisSize: mainAxisSize,
crossAxisAlignment: crossAxisAlignment,
textDirection: getEffectiveTextDirection(context),
verticalDirection: verticalDirection,
textBaseline: textBaseline ?? TextBaseline.alphabetic
);
}
public readonly float height;
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
((RenderFlex) renderObject).direction = direction;
((RenderFlex) renderObject).mainAxisAlignment = mainAxisAlignment;
((RenderFlex) renderObject).mainAxisSize = mainAxisSize;
((RenderFlex) renderObject).crossAxisAlignment = crossAxisAlignment;
((RenderFlex) renderObject).textDirection = textDirection ?? TextDirection.ltr;
((RenderFlex) renderObject).verticalDirection = verticalDirection;
((RenderFlex) renderObject).textBaseline = textBaseline ?? TextBaseline.alphabetic;
}
public readonly Widget child;
public override Widget build(BuildContext context) {
return Positioned.directional(
textDirection: Directionality.of(context),
start: start,
top: top,
end: end,
bottom: bottom,
width: width,
height: height,
child: child
);
}
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<Axis>("direction", direction));
properties.add(new EnumProperty<MainAxisAlignment>("mainAxisAlignment", mainAxisAlignment));
properties.add(new EnumProperty<MainAxisSize>("mainAxisSize", mainAxisSize,
defaultValue: MainAxisSize.max));
properties.add(new EnumProperty<CrossAxisAlignment>("crossAxisAlignment", crossAxisAlignment));
properties.add(new EnumProperty<TextDirection?>("textDirection", textDirection, defaultValue: null));
properties.add(new EnumProperty<VerticalDirection>("verticalDirection", verticalDirection,
defaultValue: VerticalDirection.down));
properties.add(new EnumProperty<TextBaseline?>("textBaseline", textBaseline, defaultValue: null));
}
}
TextDirection? textDirection = null,
TextBaseline? textBaseline = null,
TextDirection? textDirection = null,
TextBaseline? textBaseline = null,
children: children,
children: children ?? new List<Widget>(),
key: key,
direction: Axis.horizontal,
textDirection: textDirection,

public class Column : Flex {
public Column(
TextDirection? textDirection = null,
TextBaseline? textBaseline = null,
TextDirection? textDirection = null,
TextBaseline? textBaseline = null,
children: children,
children: children ?? new List<Widget>(),
key: key,
direction: Axis.vertical,
textDirection: textDirection,

//[!!!] class Flow?
/// Creates a flow layout.
///
/// Wraps each of the given children in a [RepaintBoundary] to avoid
/// repainting the children when the flow repaints.
///
/// The [delegate] argument must not be null.
Key key,
FlowDelegate _delegate,
Key key = null,
FlowDelegate _delegate = null,
: base(key: key, children: RepaintBoundary.wrapAll(children)) {
: base(key: key, children: RepaintBoundary.wrapAll(children ?? new List<Widget>())) {
// https://github.com/dart-lang/sdk/issues/29277
/// Creates a flow layout.
///
/// Does not wrap the given children in repaint boundaries, unlike the default
/// constructor. Useful when the child is trivial to paint or already contains
/// a repaint boundary.
///
/// The [delegate] argument must not be null.
Flow.unwrapped(
Key key,
FlowDelegate _delegate,
public static Flow unwrapped(
Key key = null,
FlowDelegate _delegate = null,
) :
base(key: key, children: children) {
) : base(key: key, children: children) {
D.assert(_delegate != null);
}

TextHeightBehavior textHeightBehavior = null
) : base(key: key, children: _extractChildren(text)) {
D.assert(text != null);
D.assert(textAlign != null);
D.assert(softWrap != null);
D.assert(overflow != null);
D.assert(textScaleFactor != null);
D.assert(textWidthBasis != null);
this.text = text;
this.textAlign = textAlign;
this.textDirection = textDirection;

properties.add( new EnumProperty<TextDirection>("textDirection", textDirection.Value, defaultValue: null));
properties.add( new FlagProperty("softWrap", value: softWrap, ifTrue: "wrapping at box width", ifFalse: "no wrapping except at line break characters", showName: true));
properties.add( new EnumProperty<TextOverflow>("overflow", overflow, defaultValue: TextOverflow.clip));
//properties.add( new DoubleProperty("textScaleFactor", textScaleFactor, defaultValue: 1.0));
properties.add( new FloatProperty("textScaleFactor", textScaleFactor, defaultValue: 1.0));
properties.add( new IntProperty("maxLines", maxLines, ifNull: "unlimited"));
properties.add( new EnumProperty<TextWidthBasis>("textWidthBasis", textWidthBasis, defaultValue: TextWidthBasis.parent));
properties.add( new StringProperty("text", text.toPlainText()));

Color color = null,
BlendMode colorBlendMode = BlendMode.srcIn,
BoxFit? fit = null,
Alignment alignment = null,
AlignmentGeometry alignment = null,
bool matchTextDirection = false,
bool invertColors = false,
FilterQuality filterQuality = FilterQuality.low
) : base(key) {

this.repeat = repeat;
this.centerSlice = centerSlice;
this.invertColors = invertColors;
this.matchTextDirection = matchTextDirection;
this.filterQuality = filterQuality;
}

public readonly Color color;
public readonly BlendMode colorBlendMode;
public readonly BoxFit? fit;
public readonly Alignment alignment;
public readonly AlignmentGeometry alignment;
public readonly bool matchTextDirection;
TextDirection? textDirection = null;
if ((matchTextDirection || !(alignment is Alignment)))
textDirection = Directionality.of(context);
return new RenderImage(
image: image,
width: width,

alignment: alignment,
repeat: repeat,
centerSlice: centerSlice,
matchTextDirection: matchTextDirection,
textDirection: textDirection,
filterQuality: filterQuality
filterQuality: filterQuality
TextDirection? textDirection = null;
if ((matchTextDirection || !(alignment is Alignment)))
textDirection = Directionality.of(context);
renderImage.image = image;
renderImage.width = width;
renderImage.height = height;

renderImage.fit = fit;
renderImage.repeat = repeat;
renderImage.centerSlice = centerSlice;
renderImage.matchTextDirection = matchTextDirection;
renderImage.textDirection = textDirection;
renderImage.invertColors = invertColors;
renderImage.filterQuality = filterQuality;
}

properties.add(new EnumProperty<BlendMode>("colorBlendMode", colorBlendMode,
defaultValue: foundation_.kNullDefaultValue));
properties.add(new EnumProperty<BoxFit?>("fit", fit, defaultValue: foundation_.kNullDefaultValue));
properties.add(new DiagnosticsProperty<Alignment>("alignment", alignment,
properties.add(new DiagnosticsProperty<AlignmentGeometry>("alignment", alignment,
properties.add(new FlagProperty("matchTextDirection", value: matchTextDirection, ifTrue: "match text direction"));
properties.add(new DiagnosticsProperty<bool>("invertColors", invertColors));
properties.add(new EnumProperty<FilterQuality>("filterMode", filterQuality));
}

DefaultAssetBundle result =
(DefaultAssetBundle) context.dependOnInheritedWidgetOfExactType<DefaultAssetBundle>();
return result?.bundle;
}
public override bool updateShouldNotify(InheritedWidget oldWidget) {

public class WidgetToRenderBoxAdapter : LeafRenderObjectWidget {
public WidgetToRenderBoxAdapter(
RenderBox renderBox = null,
VoidCallback onBuild = null
) :base(key: new GlobalObjectKey<State>(renderBox)) {
D.assert(renderBox != null);
}
public readonly RenderBox renderBox;
public readonly VoidCallback onBuild;
public override RenderObject createRenderObject(BuildContext context) {
return renderBox;
}
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
if (onBuild != null)
onBuild();
}
}
public class Listener : StatelessWidget {
public Listener(

PointerEnterEventListener onPointerEnter = null,
PointerExitEventListener onPointerExit = null,
PointerEnterEventListener onPointerEnter = null,//
PointerExitEventListener onPointerExit = null,//
PointerScrollEventListener onPointerScroll = null,
PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter = null,
PointerDragFromEditorHoverEventListener onPointerDragFromEditorHover = null,
PointerDragFromEditorExitEventListener onPointerDragFromEditorExit = null,
PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease = null,
// PointerScrollEventListener onPointerScroll = null,
// PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter = null,
// PointerDragFromEditorHoverEventListener onPointerDragFromEditorHover = null,
// PointerDragFromEditorExitEventListener onPointerDragFromEditorExit = null,
// PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease = null,
HitTestBehavior behavior = HitTestBehavior.deferToChild,
Widget child = null
) : base(key: key) {

this.onPointerCancel = onPointerCancel;
this.onPointerSignal = onPointerSignal;
this.onPointerHover = onPointerHover;
this.onPointerExit = onPointerExit;
this.onPointerEnter = onPointerEnter;
this.onPointerScroll = onPointerScroll;
//this.onPointerExit = onPointerExit;
//this.onPointerEnter = onPointerEnter;
// this.onPointerScroll = onPointerScroll;
this.onPointerDragFromEditorEnter = onPointerDragFromEditorEnter;
this.onPointerDragFromEditorHover = onPointerDragFromEditorHover;
this.onPointerDragFromEditorExit = onPointerDragFromEditorExit;
this.onPointerDragFromEditorRelease = onPointerDragFromEditorRelease;
}

public readonly PointerExitEventListener onPointerExit;
public readonly PointerScrollEventListener onPointerScroll;
//public readonly PointerScrollEventListener onPointerScroll;
public readonly PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter;
//public readonly PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter;
public readonly PointerDragFromEditorHoverEventListener onPointerDragFromEditorHover;
//public readonly PointerDragFromEditorHoverEventListener onPointerDragFromEditorHover;
public readonly PointerDragFromEditorExitEventListener onPointerDragFromEditorExit;
//public readonly PointerDragFromEditorExitEventListener onPointerDragFromEditorExit;
public readonly PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease;
//public readonly PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease;
public readonly Widget _child;

child: result
);
}
result = new _PointerListener(
onPointerDown: onPointerDown,
onPointerUp: onPointerUp,

}
public class RepaintBoundary : SingleChildRenderObjectWidget {
public RepaintBoundary(Key key = null, Widget child = null) : base(key: key, child: child) {
public RepaintBoundary(
Key key = null,
Widget child = null) :
base(key: key, child: child) {
}
public static RepaintBoundary wrap(Widget child, int childIndex) {

public class MetaData : SingleChildRenderObjectWidget {
public MetaData(
object metaData,
object metaData = null,
HitTestBehavior behavior = HitTestBehavior.deferToChild,
Widget child = null) : base(key: key, child: child) {
this.metaData = metaData;

public class KeyedSubtree : StatelessWidget {
public KeyedSubtree(
Key key,
Key key = null,
Widget child = null
) : base(key: key) {
D.assert(child != null);

}
}
public delegate Widget StatefulWidgetBuilder(BuildContext context, StateSetter setState);
public class StatefulBuilder : StatefulWidget {
public StatefulBuilder(
Key key = null,
StatefulWidgetBuilder builder = null
) : base(key: key) {
D.assert(builder != null);
this.builder = builder;
}
public readonly StatefulWidgetBuilder builder;
public override State createState() {
return new _StatefulBuilderState();
}
}
public class _StatefulBuilderState : State<StatefulBuilder> {
public override Widget build(BuildContext context) {
return widget.builder(context, setState);
}
}
/// Creates a widget that paints its area with the specified [Color].
///
/// The [color] parameter must not be null.
public ColoredBox(Color color = null, Widget child = null, Key key = null) : base(key: key, child: child) {
public ColoredBox(
Color color = null,
Widget child = null,
Key key = null) : base(key: key, child: child) {
/// The color to paint the background area with.
public readonly Color color;
public override RenderObject createRenderObject(BuildContext context) {

public void updateRenderObject(BuildContext context, _RenderColoredBox renderObject) {
renderObject.color = color;
public override void updateRenderObject(BuildContext context,RenderObject renderObject) {
renderObject = (_RenderColoredBox) renderObject;
((_RenderColoredBox) renderObject).color = color;
}

正在加载...
取消
保存