浏览代码

fix error

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
f1a7f82c
共有 7 个文件被更改,包括 96 次插入58 次删除
  1. 54
      com.unity.uiwidgets/Runtime/cupertino/colors.cs
  2. 20
      com.unity.uiwidgets/Runtime/cupertino/theme.cs
  3. 1
      com.unity.uiwidgets/Runtime/rendering/layer.cs
  4. 2
      com.unity.uiwidgets/Runtime/widgets/framework.cs
  5. 42
      com.unity.uiwidgets/Runtime/widgets/layout_builder.cs
  6. 21
      com.unity.uiwidgets/Runtime/widgets/routes.cs
  7. 14
      com.unity.uiwidgets/Runtime/widgets/sliver.cs

54
com.unity.uiwidgets/Runtime/cupertino/colors.cs


public static readonly CupertinoDynamicColor label = new CupertinoDynamicColor(
debugLabel: "label",
//effectiveColor:Color.fromARGB(255, 0, 0, 0),
effectiveColor:Color.fromARGB(255, 0, 0, 0),
color: Color.fromARGB(255, 0, 0, 0),
darkColor: Color.fromARGB(255, 255, 255, 255),
highContrastColor: Color.fromARGB(255, 0, 0, 0),

public static readonly CupertinoDynamicColor secondaryLabel = new CupertinoDynamicColor(
debugLabel: "secondaryLabel",
//effectiveColor:Color.fromARGB(153, 60, 60, 67),
effectiveColor:Color.fromARGB(153, 60, 60, 67),
color: Color.fromARGB(153, 60, 60, 67),
darkColor: Color.fromARGB(153, 235, 235, 245),
highContrastColor: Color.fromARGB(173, 60, 60, 67),

/// [UIColor.tertiaryLabel](https://developer.apple.com/documentation/uikit/uicolor/3173153-tertiarylabel).
public static readonly CupertinoDynamicColor tertiaryLabel = new CupertinoDynamicColor(
debugLabel: "tertiaryLabel",
//effectiveColor: Color.fromARGB(76, 60, 60, 67),
effectiveColor: Color.fromARGB(76, 60, 60, 67),
color: Color.fromARGB(76, 60, 60, 67),
darkColor: Color.fromARGB(76, 235, 235, 245),
highContrastColor: Color.fromARGB(96, 60, 60, 67),

public static readonly CupertinoDynamicColor quaternaryLabel = new CupertinoDynamicColor(
debugLabel: "quaternaryLabel",
//effectiveColor:Color.fromARGB(45, 60, 60, 67),
effectiveColor:Color.fromARGB(45, 60, 60, 67),
color: Color.fromARGB(45, 60, 60, 67),
darkColor: Color.fromARGB(40, 235, 235, 245),
highContrastColor: Color.fromARGB(66, 60, 60, 67),

public static readonly CupertinoDynamicColor systemFill = new CupertinoDynamicColor(
debugLabel: "systemFill",
//effectiveColor:Color.fromARGB(51, 120, 120, 128),
effectiveColor:Color.fromARGB(51, 120, 120, 128),
color: Color.fromARGB(51, 120, 120, 128),
darkColor: Color.fromARGB(91, 120, 120, 128),
highContrastColor: Color.fromARGB(71, 120, 120, 128),

public static readonly CupertinoDynamicColor secondarySystemFill = new CupertinoDynamicColor(
debugLabel: "secondarySystemFill",
//effectiveColor: Color.fromARGB(40, 120, 120, 128),
effectiveColor: Color.fromARGB(40, 120, 120, 128),
color: Color.fromARGB(40, 120, 120, 128),
darkColor: Color.fromARGB(81, 120, 120, 128),
highContrastColor: Color.fromARGB(61, 120, 120, 128),

public static readonly CupertinoDynamicColor tertiarySystemFill = new CupertinoDynamicColor(
debugLabel: "tertiarySystemFill",
//effectiveColor:Color.fromARGB(30, 118, 118, 128),
effectiveColor:Color.fromARGB(30, 118, 118, 128),
color: Color.fromARGB(30, 118, 118, 128),
darkColor: Color.fromARGB(61, 118, 118, 128),
highContrastColor: Color.fromARGB(51, 118, 118, 128),

public static readonly CupertinoDynamicColor quaternarySystemFill = new CupertinoDynamicColor(
debugLabel: "quaternarySystemFill",
//effectiveColor:Color.fromARGB(20, 116, 116, 128),
effectiveColor:Color.fromARGB(20, 116, 116, 128),
color: Color.fromARGB(20, 116, 116, 128),
darkColor: Color.fromARGB(45, 118, 118, 128),
highContrastColor: Color.fromARGB(40, 116, 116, 128),

/// [UIColor.placeholderText](https://developer.apple.com/documentation/uikit/uicolor/3173134-placeholdertext).
public static readonly CupertinoDynamicColor placeholderText = new CupertinoDynamicColor(
debugLabel: "placeholderText",
//effectiveColor:Color.fromARGB(76, 60, 60, 67),
effectiveColor:Color.fromARGB(76, 60, 60, 67),
color: Color.fromARGB(76, 60, 60, 67),
darkColor: Color.fromARGB(76, 235, 235, 245),
highContrastColor: Color.fromARGB(96, 60, 60, 67),

public static readonly CupertinoDynamicColor systemBackground = new CupertinoDynamicColor(
debugLabel: "systemBackground",
//effectiveColor:Color.fromARGB(255, 255, 255, 255),
effectiveColor:Color.fromARGB(255, 255, 255, 255),
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 0, 0, 0),
highContrastColor: Color.fromARGB(255, 255, 255, 255),

public static readonly CupertinoDynamicColor secondarySystemBackground = new CupertinoDynamicColor(
debugLabel: "secondarySystemBackground",
//effectiveColor:Color.fromARGB(255, 242, 242, 247),
effectiveColor:Color.fromARGB(255, 242, 242, 247),
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 28, 28, 30),
highContrastColor: Color.fromARGB(255, 235, 235, 240),

public static readonly CupertinoDynamicColor tertiarySystemBackground = new CupertinoDynamicColor(
debugLabel: "tertiarySystemBackground",
//effectiveColor:Color.fromARGB(255, 255, 255, 255),
effectiveColor:Color.fromARGB(255, 255, 255, 255),
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 44, 44, 46),
highContrastColor: Color.fromARGB(255, 255, 255, 255),

public static readonly CupertinoDynamicColor systemGroupedBackground = new CupertinoDynamicColor(
debugLabel: "systemGroupedBackground",
//effectiveColor:Color.fromARGB(255, 242, 242, 247),
effectiveColor:Color.fromARGB(255, 242, 242, 247),
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 0, 0, 0),
highContrastColor: Color.fromARGB(255, 235, 235, 240),

public static readonly CupertinoDynamicColor secondarySystemGroupedBackground = new CupertinoDynamicColor(
debugLabel: "secondarySystemGroupedBackground",
//effectiveColor:Color.fromARGB(255, 255, 255, 255),
effectiveColor:Color.fromARGB(255, 255, 255, 255),
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 28, 28, 30),
highContrastColor: Color.fromARGB(255, 255, 255, 255),

public static readonly CupertinoDynamicColor tertiarySystemGroupedBackground = new CupertinoDynamicColor(
debugLabel: "tertiarySystemGroupedBackground",
//effectiveColor:Color.fromARGB(255, 242, 242, 247),
effectiveColor:Color.fromARGB(255, 242, 242, 247),
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 44, 44, 46),
highContrastColor: Color.fromARGB(255, 235, 235, 240),

public static readonly CupertinoDynamicColor separator = new CupertinoDynamicColor(
debugLabel: "separator",
//effectiveColor:Color.fromARGB(73, 60, 60, 67),
effectiveColor:Color.fromARGB(73, 60, 60, 67),
color: Color.fromARGB(73, 60, 60, 67),
darkColor: Color.fromARGB(153, 84, 84, 88),
highContrastColor: Color.fromARGB(94, 60, 60, 67),

/// equivalent to [UIColor.opaqueSeparator](https://developer.apple.com/documentation/uikit/uicolor/3173133-opaqueseparator).
public static readonly CupertinoDynamicColor opaqueSeparator = new CupertinoDynamicColor(
debugLabel: "opaqueSeparator",
//effectiveColor:Color.fromARGB(255, 198, 198, 200),
effectiveColor:Color.fromARGB(255, 198, 198, 200),
color: Color.fromARGB(255, 198, 198, 200),
darkColor: Color.fromARGB(255, 56, 56, 58),
highContrastColor: Color.fromARGB(255, 198, 198, 200),

public static readonly CupertinoDynamicColor link =
new CupertinoDynamicColor(
debugLabel: "link",
//effectiveColor:Color.fromARGB(255, 0, 122, 255),
effectiveColor:Color.fromARGB(255, 0, 122, 255),
color: Color.fromARGB(255, 0, 122, 255),
darkColor: Color.fromARGB(255, 9, 132, 255),
highContrastColor: Color.fromARGB(255, 0, 122, 255),

if (resolvable == null)
return null;
D.assert(context != null);
var resolveColor = (resolvable is CupertinoDynamicColor)
? ((CupertinoDynamicColor)resolvable).resolveFrom(context, nullOk: nullOk)
: resolvable;
//var resolveColor = (resolvable is CupertinoDynamicColor) ? ((CupertinoDynamicColor)resolvable).resolveFrom(context, nullOk: nullOk) : resolvable;
Color resolveColor = null;
if (resolvable is CupertinoDynamicColor) {
int i = 0;
resolveColor = ((CupertinoDynamicColor) resolvable).resolveFrom(context, nullOk: nullOk)._effectiveColor;
}
else {
int j = 0;
resolveColor = resolvable;
}
return resolveColor;
}

}
public CupertinoDynamicColor resolveFrom(BuildContext context, bool nullOk = true) {
Brightness brightness = _isPlatformBrightnessDependent
? CupertinoTheme.brightnessOf(context, nullOk: nullOk) ?? Brightness.light
: Brightness.light;

20
com.unity.uiwidgets/Runtime/cupertino/theme.cs


public static readonly _CupertinoThemeDefaults _kDefaultTheme =
new _CupertinoThemeDefaults(
brightness:null,
null,
color: new Color(0xF0F9F9F9),
darkColor: new Color(0xF01D1D1D)
),
color: new Color(0xF0F9F9F9),
darkColor: new Color(0xF01D1D1D)
// Values extracted from navigation bar. For toolbar or tabbar the dark color is 0xF0161616.
),
textThemeDefaults :
}

public readonly Widget child;
public static CupertinoThemeData of(BuildContext context) {
_InheritedCupertinoTheme inheritedTheme = context.dependOnInheritedWidgetOfExactType<_InheritedCupertinoTheme>();
return ((inheritedTheme?.theme?.data) ?? new CupertinoThemeData()).resolveFrom(context, nullOk: true);
_InheritedCupertinoTheme inheritedTheme = context.dependOnInheritedWidgetOfExactType<_InheritedCupertinoTheme>();
var result = (inheritedTheme?.theme?.data ?? new CupertinoThemeData()).resolveFrom(context, nullOk: true);
return result;
}
public static Brightness? brightnessOf(BuildContext context, bool nullOk = false) {

public CupertinoThemeData resolveFrom(BuildContext context, bool nullOk = false ) {
Color convertColor(Color color) => CupertinoDynamicColor.resolve(color, context, nullOk: nullOk);
return _rawWithDefaults(
return new CupertinoThemeData(
brightness:brightness,
primaryColor:convertColor(_primaryColor),
primaryContrastingColor:convertColor(_primaryContrastingColor),

1
com.unity.uiwidgets/Runtime/rendering/layer.cs


RRect clipRRect = null,
Clip clipBehavior = Clip.antiAlias
) {
D.assert(clipRRect != null);
D.assert(clipBehavior != Clip.none);
_clipRRect = clipRRect;
_clipBehavior = clipBehavior;

2
com.unity.uiwidgets/Runtime/widgets/framework.cs


get { return _renderObject; }
}
bool _debugDoingBuild = false;
public bool _debugDoingBuild = false;
public override bool debugDoingBuild {
get { return _debugDoingBuild; }

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.rendering;

}
public class _LayoutBuilderElement<ConstraintType> : RenderObjectElement
where ConstraintType : Constraints {
public class _LayoutBuilderElement<ConstraintType> : RenderObjectElement where ConstraintType : Constraints {
public _LayoutBuilderElement(ConstrainedLayoutBuilder<ConstraintType> widget)
: base(widget) {
}

return base.widget as ConstrainedLayoutBuilder<ConstraintType>;
return (ConstrainedLayoutBuilder<ConstraintType>)base.widget ;
get { return base.renderObject as RenderConstrainedLayoutBuilderMixinRenderObject<ConstraintType, RenderObject>;}
get {
return base.renderObject as RenderConstrainedLayoutBuilderMixinRenderObject<ConstraintType, RenderObject> ;
}
}
Element _child;

}
public override void mount(Element parent, object newSlot) {
base.mount(parent, newSlot); // Creates the renderObject.
renderObject.updateCallback(_layout);
((RenderConstrainedLayoutBuilderMixinRenderObject<ConstraintType, RenderObject>)renderObject).updateCallback(_layout);
}
public override void update(Widget newWidget) {

public void _layout(ConstraintType constraints) {
owner.buildScope(this, ()=> {
built = widget.builder(this, constraints);
WidgetsD.debugWidgetBuilderValue(widget, built);
try {
built = widget.builder(this, constraints);
WidgetsD.debugWidgetBuilderValue(widget, built);
} catch (Exception e) {
_debugDoingBuild = false;
IEnumerable<DiagnosticsNode> informationCollector() {
yield return new DiagnosticsDebugCreator(new DebugCreator(this));
}
built = ErrorWidget.builder(WidgetsD._debugReportException("building " + this, e, informationCollector));
}
_child = updateChild(_child, built, null);
D.assert(_child != null);
try {
_child = updateChild(_child, built, null);
D.assert(_child != null);
} catch (Exception e) {
_debugDoingBuild = false;
IEnumerable<DiagnosticsNode> informationCollector() {
yield return new DiagnosticsDebugCreator(new DebugCreator(this));
}
built = ErrorWidget.builder(WidgetsD._debugReportException("building " + this, e, informationCollector));
}
});
}

21
com.unity.uiwidgets/Runtime/widgets/routes.cs


public static Future<T> showGeneralDialog<T>(
BuildContext context = null,
RoutePageBuilder pageBuilder = null,
bool barrierDismissible = false,
bool? barrierDismissible = null,
string barrierLabel = null,
Color barrierColor = null,
TimeSpan? transitionDuration = null,

) {
//D.assert(!barrierDismissible || barrierLabel != null);
return Navigator.of(context, rootNavigator: true).push<T>(
return Navigator.of(context, rootNavigator: true).push(
pageBuilder: pageBuilder,
barrierDismissible: barrierDismissible,
barrierLabel: barrierLabel,
barrierColor: barrierColor,
transitionDuration: transitionDuration,
transitionBuilder: transitionBuilder,
settings: routeSettings) as Route<T>
); //.to<object>();
pageBuilder: pageBuilder,
barrierDismissible: barrierDismissible ?? false,
barrierLabel: barrierLabel,
barrierColor: barrierColor,
transitionDuration: transitionDuration,
transitionBuilder: transitionBuilder,
settings: routeSettings) as Route
).to<T>();
}
}

14
com.unity.uiwidgets/Runtime/widgets/sliver.cs


RenderBox _currentBeforeChild;
protected override void performRebuild() {
//_didUnderflow = false;
_childWidgets.Clear();
base.performRebuild();
_currentBeforeChild = null;

SplayTree<int, Element> newChildren = new SplayTree<int, Element>();
void processElement(int index) {
_currentlyUpdatingChildIndex = index;
if (_childElements[index] != null && _childElements[index] != newChildren[index]) {

_childElements.Remove(index);
}
}
foreach ( int index in _childElements.Keys.ToList()) {
Key key = _childElements[index].widget.key;
int? newIndex = key == null ? null : widget.del.findIndexByKey(key);

if (childParentData != null)
childParentData.layoutOffset = null;
newChildren[newIndex ?? 0] = _childElements[index];
newChildren[(int)newIndex] = _childElements[index];
} else {
}
else {
newChildren.putIfAbsent(index, () => _childElements[index]);
}
}

if (_didUnderflow) {
int lastKey = _childElements.Count == 0 ? -1 : _childElements.Keys.Last();
int rightBoundary = lastKey + 1;
newChildren[rightBoundary] = _childElements[rightBoundary];
if(newChildren.ContainsKey(rightBoundary))
newChildren[rightBoundary] = _childElements.getOrDefault(rightBoundary);
processElement(rightBoundary);
}
} finally {

childParentData.index = _currentlyUpdatingChildIndex.Value;
}
bool _didUnderflow = false;
public bool _didUnderflow = false;
public void setDidUnderflow(bool value) {
_didUnderflow = value;

正在加载...
取消
保存