浏览代码

refix widgets T

/siyaoH-1.17-PlatformMessage
guanghuispark 4 年前
当前提交
4372da2a
共有 9 个文件被更改,包括 267 次插入179 次删除
  1. 22
      com.unity.uiwidgets/Runtime/rendering/proxy_sliver.cs
  2. 2
      com.unity.uiwidgets/Runtime/scheduler2/ticker.cs
  3. 17
      com.unity.uiwidgets/Runtime/widgets/editable_text.cs
  4. 40
      com.unity.uiwidgets/Runtime/widgets/table.cs
  5. 22
      com.unity.uiwidgets/Runtime/widgets/text.cs
  6. 255
      com.unity.uiwidgets/Runtime/widgets/text_selection.cs
  7. 65
      com.unity.uiwidgets/Runtime/widgets/ticker_provider.cs
  8. 8
      com.unity.uiwidgets/Runtime/widgets/title.cs
  9. 15
      com.unity.uiwidgets/Runtime/widgets/transitions.cs

22
com.unity.uiwidgets/Runtime/rendering/proxy_sliver.cs


public class RenderSliverAnimatedOpacity :RenderAnimatedOpacityMixinRenderSliver<RenderSliver>{
public RenderSliverAnimatedOpacity(
Animation<float> opacity ,
RenderSliver sliver = null,
bool alwaysIncludeSemantics = false
RenderSliver sliver = null
this.alwaysIncludeSemantics = alwaysIncludeSemantics;
child = sliver;
}
}

float opacity = 1.0f,
bool alwaysIncludeSemantics = false
float opacity = 1.0f
D.assert(alwaysIncludeSemantics != null);
_alwaysIncludeSemantics = alwaysIncludeSemantics;
_alpha = ui.Color.getAlphaFromOpacity(opacity);
child = sliver;
}

}
}
float _opacity;
public bool alwaysIncludeSemantics {
get { return _alwaysIncludeSemantics;}
set {
if (value == _alwaysIncludeSemantics)
return;
_alwaysIncludeSemantics = value;
// markNeedsSemanticsUpdate();
}
}
bool _alwaysIncludeSemantics;
public override void paint(PaintingContext context, Offset offset) {
if (child != null && child.geometry.visible) {
if (_alpha == 0) {

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new FloatProperty("opacity", opacity));
properties.add(new FlagProperty("alwaysIncludeSemantics", value: alwaysIncludeSemantics, ifTrue: "alwaysIncludeSemantics"));
}
}

2
com.unity.uiwidgets/Runtime/scheduler2/ticker.cs


return _future;
}
DiagnosticsNode describeForError(string name) {
public DiagnosticsNode describeForError(string name) {
return new DiagnosticsProperty<Ticker>(name, this, description: toString(debugIncludeStack: true));
}

17
com.unity.uiwidgets/Runtime/widgets/editable_text.cs


Timer _cursorTimer;
bool _targetCursorVisibility = false;
ValueNotifier<bool> _cursorVisibilityNotifier = new ValueNotifier<bool>(false);
public readonly LayerLink _toolbarLayerLink = new LayerLink();
public readonly LayerLink _startHandleLayerLink = new LayerLink();
public readonly LayerLink _endHandleLayerLink = new LayerLink();
GlobalKey _editableKey = GlobalKey.key();
TextInputConnection _textInputConnection;

context: context,
value: _value,
debugRequiredFor: widget,
layerLink: _layerLink,
toolbarLayerLink: _toolbarLayerLink,
startHandleLayerLink: _startHandleLayerLink,
endHandleLayerLink: _endHandleLayerLink,
dragStartBehavior: widget.dragStartBehavior
dragStartBehavior: widget.dragStartBehavior,
onSelectionHandleTapped: widget.onSelectionHandleTapped
bool longPress = cause == SelectionChangedCause.longPress;
_selectionOverlay.handlesVisible = widget.showSelectionHandles;
_selectionOverlay.showHandles();
/*bool longPress = cause == SelectionChangedCause.longPress;
}
}*/
}
if (widget.onSelectionChanged != null) {

40
com.unity.uiwidgets/Runtime/widgets/table.cs


List<_TableElementRow> _children = new List<_TableElementRow>();
bool _debugWillReattachChildren = false;
D.assert(!_debugWillReattachChildren);
D.assert(() => {
_debugWillReattachChildren = true;
return true;
});
_children.Clear();
foreach (TableRow row in widget.children) {

);
}
D.assert(() => {
_debugWillReattachChildren = false;
return true;
});
D.assert(_debugWillReattachChildren);
D.assert(_debugWillReattachChildren);
D.assert(() => {
if (_debugWillReattachChildren) {
return true;
}
foreach (Element forgottenChild in _forgottenChildren) {
if (forgottenChild.renderObject == child) {
return true;
}
}
return false;
});
TableCellParentData childParentData = (TableCellParentData) child.parentData;
TableCellParentData childParentData = child.parentData as TableCellParentData;
renderObject.setChild(childParentData.x, childParentData.y, null);
}

D.assert(!_debugWillReattachChildren);
D.assert(() => {
_debugWillReattachChildren = true;
return true;
});
Table _newWidget = (Table) newWidget;
Dictionary<LocalKey, List<Element>> oldKeyedRows = new Dictionary<LocalKey, List<Element>>();

updateChildren(oldChildren, new List<Widget>(), forgottenChildren: _forgottenChildren);
}
D.assert(() => {
_debugWillReattachChildren = false;
return true;
});
_children = newChildren;
_updateRenderObjectChildren();
_forgottenChildren.Clear();

22
com.unity.uiwidgets/Runtime/widgets/text.cs


bool? softWrap = null,
TextOverflow? overflow = null,
float? textScaleFactor = null,
int? maxLines = null) : base(key) {
int? maxLines = null,
TextWidthBasis textWidthBasis = TextWidthBasis.parent,
ui.TextHeightBehavior textHeightBehavior = null) : base(key) {
D.assert(data != null, () => "A non-null string must be provided to a Text widget.");
textSpan = null;
this.data = data;

this.overflow = overflow;
this.textScaleFactor = textScaleFactor;
this.maxLines = maxLines;
this.textWidthBasis = textWidthBasis;
this.textHeightBehavior = textHeightBehavior;
}
Text(TextSpan textSpan,

bool? softWrap = null,
TextOverflow? overflow = null,
float? textScaleFactor = null,
int? maxLines = null) : base(key) {
int? maxLines = null,
TextWidthBasis textWidthBasis = default,
ui.TextHeightBehavior textHeightBehavior = null) : base(key) {
D.assert(textSpan != null, () => "A non-null TextSpan must be provided to a Text.rich widget.");
this.textSpan = textSpan;
data = null;

this.overflow = overflow;
this.textScaleFactor = textScaleFactor;
this.maxLines = maxLines;
this.textHeightBehavior = textHeightBehavior;
this.textWidthBasis = textWidthBasis;
}
public static Text rich(TextSpan textSpan,

public readonly string data;
public readonly TextSpan textSpan;
public readonly InlineSpan textSpan;
public readonly TextStyle style;

public readonly float? textScaleFactor;
public readonly int? maxLines;
public readonly TextWidthBasis? textWidthBasis;
public readonly ui.TextHeightBehavior textHeightBehavior;
public override Widget build(BuildContext context) {
DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context);

textScaleFactor: textScaleFactor ?? MediaQuery.textScaleFactorOf(context),
maxLines: maxLines ?? defaultTextStyle.maxLines,
strutStyle: strutStyle,
textWidthBasis: textWidthBasis ?? defaultTextStyle.textWidthBasis,
textHeightBehavior: textHeightBehavior ?? defaultTextStyle.textHeightBehavior,
text: new TextSpan(
style: effectiveTextStyle,
text: data,

properties.add(new FloatProperty("textScaleFactor", textScaleFactor,
defaultValue: foundation_.kNullDefaultValue));
properties.add(new IntProperty("maxLines", maxLines, defaultValue: foundation_.kNullDefaultValue));
properties.add(new EnumProperty<TextWidthBasis?>("textWidthBasis", textWidthBasis, defaultValue: null));
properties.add(new DiagnosticsProperty<ui.TextHeightBehavior>("textHeightBehavior", textHeightBehavior, defaultValue: null));
}
}
}

255
com.unity.uiwidgets/Runtime/widgets/text_selection.cs


using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Object = System.Object;
using Rect = Unity.UIWidgets.ui.Rect;
using TextRange = Unity.UIWidgets.ui.TextRange;

);
public abstract Size getHandleSize(float textLineHeight);
public abstract Size handleSize { get; }
public abstract Size handleSize { get; }// [!!!]useless?
public virtual bool canCut(TextSelectionDelegate _delegate) {
return _delegate.cutEnabled && !_delegate.textEditingValue.selection.isCollapsed;

TextEditingValue value = null,
BuildContext context = null,
Widget debugRequiredFor = null,
LayerLink layerLink = null,
LayerLink toolbarLayerLink = null,
LayerLink startHandleLayerLink = null,
LayerLink endHandleLayerLink = null,
bool handlesVisible = false,
DragStartBehavior dragStartBehavior = DragStartBehavior.start) {
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
VoidCallback onSelectionHandleTapped = null) {
D.assert(handlesVisible != null);
_handlesVisible = handlesVisible;
this.layerLink = layerLink;
this.toolbarLayerLink = toolbarLayerLink;
this.startHandleLayerLink = startHandleLayerLink;
this.endHandleLayerLink = endHandleLayerLink;
this.onSelectionHandleTapped = onSelectionHandleTapped;
OverlayState overlay = Overlay.of(context);
OverlayState overlay = Overlay.of(context, rootOverlay: true);
D.assert(overlay != null, () => $"No Overlay widget exists above {context}.\n" +
"Usually the Navigator created by WidgetsApp provides the overlay. Perhaps your " +
"app content was created above the Navigator with the WidgetsApp builder parameter.");

public readonly BuildContext context;
public readonly Widget debugRequiredFor;
public readonly LayerLink layerLink;
public readonly LayerLink toolbarLayerLink;
public readonly LayerLink startHandleLayerLink;
public readonly LayerLink endHandleLayerLink;
public readonly VoidCallback onSelectionHandleTapped;
public static readonly TimeSpan fadeDuration = TimeSpan.FromMilliseconds(150);
AnimationController _toolbarController;

}
TextEditingValue value {
get { return _value; }
}
TextEditingValue _value;

get { return _value.selection; }
}
bool _handlesVisible = false;
public bool handlesVisible {
get {
return _handlesVisible;
}
set {
D.assert(value != null);
if (_handlesVisible == value)
return;
_handlesVisible = value;
// If we are in build state, it will be too late to update visibility.
// We will need to schedule the build in next frame.
if (SchedulerBinding.instance.schedulerPhase == SchedulerPhase.persistentCallbacks) {
SchedulerBinding.instance.addPostFrameCallback((TimeSpan timespan) => {
_markNeedsBuild();
});
} else {
_markNeedsBuild();
}
}
}
public void showHandles() {
D.assert(_handles == null);
_handles = new List<OverlayEntry> {

_buildHandle(context, _TextSelectionHandlePosition.end)),
};
Overlay.of(this.context, debugRequiredFor: debugRequiredFor).insertAll(_handles);
Overlay.of(this.context, rootOverlay: true, debugRequiredFor: debugRequiredFor).insertAll(_handles);
public void hideHandles() {
if (_handles != null) {
_handles[0].remove();
_handles[1].remove();
_handles = null;
}
}
Overlay.of(context, debugRequiredFor: debugRequiredFor).insert(_toolbar);
Overlay.of(context, rootOverlay: true, debugRequiredFor: debugRequiredFor).insert(_toolbar);
_toolbarController.forward(from: 0.0f);
}

}
public bool handlesAreVisible {
get { return _handles != null; }
get { return _handles != null && handlesVisible; }
}

_handles[1].remove();
_handles = null;
}
if (_toolbar != null) {
hideToolbar();
}
}
_toolbar?.remove();
void hideToolbar() {
D.assert(_toolbar != null);
_toolbarController.stop();
_toolbar.remove();
_toolbarController.stop();
}
public void dispose() {

return new Container(); // hide the second handle when collapsed
}
return new _TextSelectionHandleOverlay(
onSelectionHandleChanged: (TextSelection newSelection) => {
_handleSelectionHandleChanged(newSelection, position);
},
onSelectionHandleTapped: _handleSelectionHandleTapped,
layerLink: layerLink,
renderObject: renderObject,
selection: _selection,
selectionControls: selectionControls,
position: position,
dragStartBehavior: dragStartBehavior
return new Visibility(
visible: handlesVisible,
child: new _TextSelectionHandleOverlay(
onSelectionHandleChanged: (TextSelection newSelection) => {
_handleSelectionHandleChanged(newSelection, position);
},
onSelectionHandleTapped: onSelectionHandleTapped,
startHandleLayerLink: startHandleLayerLink,
endHandleLayerLink: endHandleLayerLink,
renderObject: renderObject,
selection: _selection,
selectionControls: selectionControls,
position: position,
dragStartBehavior: dragStartBehavior
)
);
}

// Find the horizontal midpoint, just above the selected text.
List<TextSelectionPoint> endpoints = renderObject.getEndpointsForSelection(_selection);
Offset midpoint = new Offset(
(endpoints.Count == 1) ? endpoints[0].point.dx : (endpoints[0].point.dx + endpoints[1].point.dx) / 2.0f,
endpoints[0].point.dy - renderObject.preferredLineHeight
);
bool isMultiline = endpoints.last().point.dy - endpoints.first().point.dy >
renderObject.preferredLineHeight / 2;
float midX = isMultiline
? editingRegion.width / 2
: (endpoints.first().point.dx + endpoints.last().point.dx) / 2;
Offset midpoint = new Offset(
midX,
endpoints[0].point.dy - renderObject.preferredLineHeight
);
link: layerLink,
link: toolbarLayerLink,
child: selectionControls.buildToolbar(context,
child: selectionControls.buildToolbar(
context,
editingRegion,
renderObject.preferredLineHeight,
midpoint,

_value.copyWith(selection: newSelection, composing: TextRange.empty);
selectionDelegate.bringIntoView(textPosition);
}
void _handleSelectionHandleTapped() {
if (_value.selection.isCollapsed) {
if (_toolbar != null) {
_toolbar?.remove();
_toolbar = null;
}
else {
showToolbar();
}
}
}
}
class _TextSelectionHandleOverlay : StatefulWidget {

_TextSelectionHandlePosition position = _TextSelectionHandlePosition.start,
LayerLink layerLink = null,
LayerLink startHandleLayerLink = null,
LayerLink endHandleLayerLink = null,
RenderEditable renderObject = null,
ValueChanged<TextSelection> onSelectionHandleChanged = null,
VoidCallback onSelectionHandleTapped = null,

this.selection = selection;
this.position = position;
this.layerLink = layerLink;
this.startHandleLayerLink = startHandleLayerLink;
this.endHandleLayerLink = endHandleLayerLink;
this.renderObject = renderObject;
this.onSelectionHandleChanged = onSelectionHandleChanged;
this.onSelectionHandleTapped = onSelectionHandleTapped;

public readonly TextSelection selection;
public readonly _TextSelectionHandlePosition position;
public readonly LayerLink layerLink;
public readonly LayerLink startHandleLayerLink;
public readonly LayerLink endHandleLayerLink;
public readonly RenderEditable renderObject;
public readonly ValueChanged<TextSelection> onSelectionHandleChanged;
public readonly VoidCallback onSelectionHandleTapped;

AnimationController _controller;
const float kMinInteractiveDimension = 48.0f;
Animation<float> _opacity {
get { return _controller.view; }
}

}
void _handleDragStart(DragStartDetails details) {
_dragPosition = details.globalPosition +
new Offset(0.0f, -widget.selectionControls.handleSize.height);
Size handleSize = widget.selectionControls.getHandleSize(
widget.renderObject.preferredLineHeight
);
_dragPosition = details.globalPosition + new Offset(0.0f, -handleSize.height);
}
void _handleDragUpdate(DragUpdateDetails details) {

}
void _handleTap() {
widget.onSelectionHandleTapped();
if (widget.onSelectionHandleTapped != null)
widget.onSelectionHandleTapped();
}
public override Widget build(BuildContext context) {

LayerLink layerLink = null;
point = endpoints[0].point;
type = _chooseType(endpoints[0], TextSelectionHandleType.left, TextSelectionHandleType.right);
layerLink = widget.startHandleLayerLink;
type = _chooseType(
widget.renderObject.textDirection,
TextSelectionHandleType.left,
TextSelectionHandleType.right
);
D.assert(endpoints.Count == 2);
point = endpoints[1].point;
type = _chooseType(endpoints[1], TextSelectionHandleType.right, TextSelectionHandleType.left);
D.assert(!widget.selection.isCollapsed);
layerLink = widget.endHandleLayerLink;
type = _chooseType(
widget.renderObject.textDirection,
TextSelectionHandleType.right,
TextSelectionHandleType.left
);
Size viewport = widget.renderObject.size;
point = new Offset(
point.dx.clamp(0.0f, viewport.width),
point.dy.clamp(0.0f, viewport.height)
Offset handleAnchor = widget.selectionControls.getHandleAnchor(
type,
widget.renderObject.preferredLineHeight
);
Size handleSize = widget.selectionControls.getHandleSize(
widget.renderObject.preferredLineHeight
);
Rect handleRect = Rect.fromLTWH(
-handleAnchor.dx,
-handleAnchor.dy,
handleSize.width,
handleSize.height
);
Rect interactiveRect = handleRect.expandToInclude(
Rect.fromCircle(center: handleRect.center, radius: kMinInteractiveDimension/ 2)
);
RelativeRect padding = RelativeRect.fromLTRB(
Mathf.Max((interactiveRect.width - handleRect.width) / 2, 0),
Mathf.Max((interactiveRect.height - handleRect.height) / 2, 0),
Mathf.Max((interactiveRect.width - handleRect.width) / 2, 0),
Mathf.Max((interactiveRect.height - handleRect.height) / 2, 0)
link: widget.layerLink,
link: layerLink,
offset: interactiveRect.topLeft,
behavior: HitTestBehavior.translucent,
child: new Stack(
overflow: Overflow.visible,
children: new List<Widget>() {
new Positioned(
left: point.dx,
top: point.dy,
child: widget.selectionControls.buildHandle(context, type,
widget.renderObject.preferredLineHeight)
)
}
child: new Padding(
padding: EdgeInsets.only(
left: padding.left,
top: padding.top,
right: padding.right,
bottom: padding.bottom
),
child: widget.selectionControls.buildHandle(context, type,
widget.renderObject.preferredLineHeight)
)
)
)

TextSelectionHandleType _chooseType(
TextSelectionPoint endpoint,
TextDirection? textDirection,
TextSelectionHandleType ltrType,
TextSelectionHandleType rtlType
) {

D.assert(endpoint.direction != null);
switch (endpoint.direction) {
D.assert(textDirection != null);
switch (textDirection) {
case TextDirection.ltr:
return ltrType;
case TextDirection.rtl:

D.assert(() => throw new UIWidgetsError($"invalid endpoint.direction {endpoint.direction}"));
D.assert(() => throw new UIWidgetsError($"invalid endpoint.direction {textDirection}"));
return ltrType;
}
}

protected void onSingleLongTapEnd(LongPressEndDetails details) {
if (shouldShowSelectionToolbar)
editableText.showToolbar();
}
}
protected void onDoubleTapDown(TapDownDetails details) {
if (_delegate.selectionEnabled) {

public override Widget build(BuildContext context) {
Dictionary<Type, GestureRecognizerFactory> gestures = new Dictionary<Type, GestureRecognizerFactory>();
gestures.Add(typeof(TapGestureRecognizer), new GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
() => new TapGestureRecognizer(debugOwner: this),
instance => {
gestures.Add(typeof(_TransparentTapGestureRecognizer), new GestureRecognizerFactoryWithHandlers<_TransparentTapGestureRecognizer>(
() => new _TransparentTapGestureRecognizer(debugOwner: this),
(_TransparentTapGestureRecognizer instance) => {
instance.onTapDown = _handleTapDown;
instance.onTapUp = _handleTapUp;
instance.onTapCancel = _handleTapCancel;

behavior: widget.behavior,
child: widget.child
);
}
}
public class _TransparentTapGestureRecognizer : TapGestureRecognizer {
public _TransparentTapGestureRecognizer(Object debugOwner = default) : base(debugOwner: debugOwner) {}
public override void rejectGesture(int pointer) {
if (state == GestureRecognizerState.ready) {
acceptGesture(pointer);
} else {
base.rejectGesture(pointer);
}
}
}
}

65
com.unity.uiwidgets/Runtime/widgets/ticker_provider.cs


}
public class _EffectiveTickerMode : InheritedWidget {
public _EffectiveTickerMode(
bool enabled,
bool enabled = false,
D.assert(enabled != null);
this.enabled = enabled;
}
public readonly bool enabled;

return true;
}
throw new UIWidgetsError(
GetType() + " is a SingleTickerProviderStateMixin but multiple tickers were created.\n" +
"A SingleTickerProviderStateMixin can only be used as a TickerProvider once. If a " +
"State is used for multiple AnimationController objects, or if it is passed to other " +
"objects and those objects might use it more than one time in total, then instead of " +
"mixing in a SingleTickerProviderStateMixin, use a regular TickerProviderStateMixin."
);
throw new UIWidgetsError(new List<DiagnosticsNode>{
new ErrorSummary($"{GetType()} is a SingleTickerProviderStateMixin but multiple tickers were created."),
new ErrorDescription("A SingleTickerProviderStateMixin can only be used as a TickerProvider once."),
new ErrorHint(
"If a State is used for multiple AnimationController objects, or if it is passed to other " +
"objects and those objects might use it more than one time in total, then instead of " +
"mixing in a SingleTickerProviderStateMixin, use a regular TickerProviderStateMixin."
)
});
});
_ticker = new Ticker(onTick, debugLabel: foundation_.kDebugMode ? $"created by {this}" : null);

return true;
}
throw new UIWidgetsError(
this + " was disposed with an active Ticker.\n" +
GetType() + " created a Ticker via its SingleTickerProviderStateMixin, but at the time " +
"dispose() was called on the mixin, that Ticker was still active. The Ticker must " +
"be disposed before calling base.dispose(). Tickers used by AnimationControllers " +
"should be disposed by calling dispose() on the AnimationController itself. " +
"Otherwise, the ticker will leak.\n" +
"The offending ticker was: " + _ticker.toString(debugIncludeStack: true)
throw new UIWidgetsError(new List<DiagnosticsNode>{
new ErrorSummary($"{this} was disposed with an active Ticker."),
new ErrorDescription(
$"{GetType()} created a Ticker via its SingleTickerProviderStateMixin, but at the time " +
"dispose() was called on the mixin, that Ticker was still active. The Ticker must " +
"be disposed before calling super.dispose()."
),
new ErrorHint(
"Tickers used by AnimationControllers " +
"should be disposed by calling dispose() on the AnimationController itself. " +
"Otherwise, the ticker will leak."
),
_ticker.describeForError("The offending ticker was")
}
);
});
base.dispose();

if (_tickers != null) {
foreach (Ticker ticker in _tickers) {
if (ticker.isActive) {
throw new UIWidgetsError(
this + " was disposed with an active Ticker.\n" +
GetType() +
" created a Ticker via its TickerProviderStateMixin, but at the time " +
"dispose() was called on the mixin, that Ticker was still active. All Tickers must " +
"be disposed before calling base.dispose(). Tickers used by AnimationControllers " +
"should be disposed by calling dispose() on the AnimationController itself. " +
"Otherwise, the ticker will leak.\n" +
"The offending ticker was: " + ticker.toString(debugIncludeStack: true)
);
throw new UIWidgetsError(new List<DiagnosticsNode>{
new ErrorSummary($"{this} was disposed with an active Ticker."),
new ErrorDescription(
$"{GetType()} created a Ticker via its TickerProviderStateMixin, but at the time " +
"dispose() was called on the mixin, that Ticker was still active. All Tickers must " +
"be disposed before calling super.dispose()."
),
new ErrorHint(
"Tickers used by AnimationControllers " +
"should be disposed by calling dispose() on the AnimationController itself. " +
"Otherwise, the ticker will leak."
),
ticker.describeForError("The offending ticker was"),
});
}
}
}

8
com.unity.uiwidgets/Runtime/widgets/title.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.service;

Color color,
Color color = null,
Key key = null,
string title = "",
Widget child = null

this.color = color;
this.child = child;
this.title = title;
}
public readonly String title;

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new StringProperty("title", title, defaultValue: ""));
//properties.add(new ColorProperty("color", color, defaultValue: null));
properties.add(new ColorProperty("color", color, defaultValue: null));
}
}

15
com.unity.uiwidgets/Runtime/widgets/transitions.cs


public class SliverFadeTransition : SingleChildRenderObjectWidget {
public SliverFadeTransition(
Animation<float> opacity ,
Animation<float> opacity = default,
bool alwaysIncludeSemantics = false,
this.opacity = opacity;
public readonly bool alwaysIncludeSemantics;
opacity: opacity,
alwaysIncludeSemantics: alwaysIncludeSemantics
opacity: opacity
((RenderSliverAnimatedOpacity)renderObject).alwaysIncludeSemantics = alwaysIncludeSemantics;
}
}
properties.add(new FlagProperty("alwaysIncludeSemantics", value: alwaysIncludeSemantics, ifTrue: "alwaysIncludeSemantics"));
}
}
public class RelativeRectTween : Tween<RelativeRect> {

正在加载...
取消
保存