浏览代码

temporary fix

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
2adc73cc
共有 3 个文件被更改,包括 66 次插入25 次删除
  1. 42
      com.unity.uiwidgets/Runtime/widgets/text_selection.cs
  2. 43
      com.unity.uiwidgets/Runtime/widgets/ticker_provider.cs
  3. 6
      com.unity.uiwidgets/Runtime/widgets/tween_animation_builder.cs

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


public abstract class TextSelectionControls {
public abstract Widget buildHandle(BuildContext context, TextSelectionHandleType type, float textLineHeight);
public abstract Widget buildToolbar(BuildContext context, Rect globalEditableRegion, Offset position,
TextSelectionDelegate selectionDelegate);
public abstract Offset getHandleAnchor(TextSelectionHandleType type, float textLineHeight);
public abstract Widget buildToolbar(
BuildContext context,
Rect globalEditableRegion,
float textLineHeight,
Offset position,
List<TextSelectionPoint> endpoints,
TextSelectionDelegate selectionDelegate
);
public abstract Size getHandleSize(float textLineHeight);
public virtual bool canCut(TextSelectionDelegate selectionDelegate) {
return !selectionDelegate.textEditingValue.selection.isCollapsed;
public virtual bool canCut(TextSelectionDelegate _delegate) {
return _delegate.cutEnabled && !_delegate.textEditingValue.selection.isCollapsed;
public virtual bool canCopy(TextSelectionDelegate selectionDelegate) {
return !selectionDelegate.textEditingValue.selection.isCollapsed;
bool canCopy(TextSelectionDelegate _delegate) {
return _delegate.copyEnabled && !_delegate.textEditingValue.selection.isCollapsed;
public virtual bool canPaste(TextSelectionDelegate selectionDelegate) {
// TODO in flutter: return false when clipboard is empty
return true;
bool canPaste(TextSelectionDelegate _delegate) {
// TODO(goderbauer): return false when clipboard is empty, https://github.com/flutter/flutter/issues/11254
return _delegate.pasteEnabled;
public virtual bool canSelectAll(TextSelectionDelegate selectionDelegate) {
return selectionDelegate.textEditingValue.text.isNotEmpty() &&
selectionDelegate.textEditingValue.selection.isCollapsed;
bool canSelectAll(TextSelectionDelegate _delegate) {
return _delegate.selectAllEnabled
&& _delegate.textEditingValue.text.isNotEmpty()
&& _delegate.textEditingValue.selection.isCollapsed;
public void handleCut(TextSelectionDelegate selectionDelegate) {
TextEditingValue value = selectionDelegate.textEditingValue;

}
public class TextSelectionOverlay {
public TextSelectionOverlay(TextEditingValue value = null,
BuildContext context = null, Widget debugRequiredFor = null,
public TextSelectionOverlay(
TextEditingValue value = null,
BuildContext context = null,
Widget debugRequiredFor = null,
LayerLink layerLink = null,
RenderEditable renderObject = null,
TextSelectionControls selectionControls = null,

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


using Unity.UIWidgets.scheduler2;
namespace Unity.UIWidgets.widgets {
public class TickerMode : InheritedWidget {
public class TickerMode : StatelessWidget {
: base(key, child) {
: base(key:key) {
D.assert(enabled != null);
this.child = child;
public readonly Widget child;
var widget = (TickerMode) context.inheritFromWidgetOfExactType(typeof(TickerMode));
return widget != null ? widget.enabled : true;
_EffectiveTickerMode widget = context.dependOnInheritedWidgetOfExactType<_EffectiveTickerMode>();
return widget?.enabled ?? true;
public override bool updateShouldNotify(InheritedWidget oldWidget) {
return enabled != ((TickerMode) oldWidget).enabled;
public override Widget build(BuildContext context) {
return new _EffectiveTickerMode(
enabled: enabled && TickerMode.of(context),
child: child
);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new FlagProperty("requested mode", value: enabled, ifTrue: "enabled", ifFalse: "disabled", showName: true));
}
}
public class _EffectiveTickerMode : InheritedWidget {
public _EffectiveTickerMode(
bool enabled,
Key key = null,
Widget child = null) :
base(key: key, child: child) {
D.assert(enabled != null);
this.enabled = enabled;
public readonly bool enabled;
properties.add(new FlagProperty("mode", value: enabled, ifTrue: "enabled", ifFalse: "disabled",
showName: true));
properties.add(new FlagProperty("effective mode", value: enabled, ifTrue: "enabled", ifFalse: "disabled", showName: true));
}
public override bool updateShouldNotify(InheritedWidget oldWidget) {
oldWidget = (_EffectiveTickerMode) oldWidget;
return enabled != ((_EffectiveTickerMode) oldWidget).enabled;
public abstract class SingleTickerProviderStateMixin<T> : State<T>, TickerProvider where T : StatefulWidget {
Ticker _ticker;

6
com.unity.uiwidgets/Runtime/widgets/tween_animation_builder.cs


public override void initState() {
_currentTween = widget.tween;
_currentTween.begin ??= _currentTween.end;
if (_currentTween.begin == null) {
_currentTween.begin = _currentTween.end;
}
base.initState();
if (_currentTween.begin.Equals( _currentTween.end)) {
controller.forward();

正在加载...
取消
保存