浏览代码

Clear warnings

/main
Yuncong Zhang 6 年前
当前提交
19d64981
共有 16 个文件被更改,包括 226 次插入109 次删除
  1. 7
      Runtime/material/app_bar.cs
  2. 3
      Runtime/material/bottom_app_bar.cs
  3. 1
      Runtime/material/bottom_navigation_bar.cs
  4. 1
      Runtime/material/bottom_sheet.cs
  5. 23
      Runtime/material/dropdown.cs
  6. 55
      Runtime/material/input_border.cs
  7. 170
      Runtime/material/input_decorator.cs
  8. 25
      Runtime/material/outline_button.cs
  9. 2
      Runtime/rendering/object.mixin.gen.cs
  10. 2
      Runtime/rendering/proxy_box.cs
  11. 8
      Runtime/rendering/sliver_persistent_header.cs
  12. 1
      Runtime/rendering/stack.cs
  13. 1
      Runtime/widgets/basic.cs
  14. 4
      Runtime/widgets/sliver_persistent_header.cs
  15. 2
      Samples/UIWidgetsGallery/demo/colors_demo.cs
  16. 30
      Samples/UIWidgetsGallery/gallery/demo.cs

7
Runtime/material/app_bar.cs


bool pinned = false,
bool snap = false
) : base(key: key) {
D.assert(automaticallyImplyLeading != null);
D.assert(forceElevated != null);
D.assert(primary != null);
D.assert(titleSpacing != null);
D.assert(floating != null);
D.assert(pinned != null);
D.assert(snap != null);
D.assert(floating || !snap, "The 'snap' argument only makes sense for floating app bars.");
this.leading = leading;
this.automaticallyImplyLeading = true;

3
Runtime/material/bottom_app_bar.cs


float notchMargin = 4.0f,
Widget child = null
) : base(key: key) {
D.assert(elevation != null);
D.assert(clipBehavior != null);
this.child = child;
this.color = color;
this.elevation = elevation;

) : base(reclip: geometry) {
D.assert(geometry != null);
D.assert(shape != null);
D.assert(notchMargin != null);
this.geometry = geometry;
this.shape = shape;
this.notchMargin = notchMargin;

1
Runtime/material/bottom_navigation_bar.cs


bool selected = false,
string indexLabel = null
) {
D.assert(selected != null);
this.type = type;
this.item = item;
this.animation = animation;

1
Runtime/material/bottom_sheet.cs


public override Widget build(BuildContext context) {
MediaQueryData mediaQuery = MediaQuery.of(context);
MaterialLocalizations localizations = MaterialLocalizations.of(context);
string routeLabel = "";
return new GestureDetector(
onTap: () => Navigator.pop(context),

23
Runtime/material/dropdown.cs


public readonly T result;
public static bool operator ==(_DropdownRouteResult<T> left, _DropdownRouteResult<T> right) {
return left.result == right.result;
return left.Equals(right);
return left.result != right.result;
return !left.Equals(right);
}
public bool Equals(_DropdownRouteResult<T> other) {
return this.result == other.result;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((_DropdownRouteResult<T>) obj);
}
public override int GetHashCode() {

}
class _DropdownButtonFormFieldState<T> : FormFieldState<T> where T : class {
public DropdownButtonFormField<T> widget {
public new DropdownButtonFormField<T> widget {
get { return base.widget as DropdownButtonFormField<T>; }
}

55
Runtime/material/input_border.cs


using System.Runtime.CompilerServices;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

canvas.drawLine(rect.bottomLeft, rect.bottomRight, this.borderSide.toPaint());
}
public static bool operator ==(UnderlineInputBorder left, UnderlineInputBorder other) {
return left.borderSide == other.borderSide;
public static bool operator ==(UnderlineInputBorder left, UnderlineInputBorder right) {
return left.Equals(right);
}
public static bool operator !=(UnderlineInputBorder left, UnderlineInputBorder right) {
return !left.Equals(right);
public static bool operator !=(UnderlineInputBorder left, UnderlineInputBorder other) {
return left.borderSide != other.borderSide;
public bool Equals(UnderlineInputBorder other) {
return this.borderSide == other.borderSide;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((UnderlineInputBorder) obj);
}
public override int GetHashCode() {

}
}
public static bool operator ==(OutlineInputBorder left, OutlineInputBorder other) {
return other.borderSide == left.borderSide
&& other.borderRadius == left.borderRadius
&& other.gapPadding == left.gapPadding;
public static bool operator ==(OutlineInputBorder left, OutlineInputBorder right) {
return left.Equals(right);
}
public static bool operator !=(OutlineInputBorder left, OutlineInputBorder right) {
return !left.Equals(right);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((OutlineInputBorder) obj);
public static bool operator !=(OutlineInputBorder left, OutlineInputBorder other) {
return !(left == other);
public bool Equals(OutlineInputBorder other) {
return other.borderSide == this.borderSide
&& other.borderRadius == this.borderRadius
&& other.gapPadding == this.gapPadding;
}
public override int GetHashCode() {

170
Runtime/material/input_decorator.cs


using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using RSG.Promises;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;

}
}
public static bool operator ==(_InputBorderGap left, _InputBorderGap other) {
return left.start == other.start && left.extent == other.extent;
public static bool operator ==(_InputBorderGap left, _InputBorderGap right) {
return left.Equals(right);
}
public bool Equals(_InputBorderGap other) {
return this.start == other.start && this.extent == other.extent;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((_InputBorderGap) obj);
}
public override int GetHashCode() {

public readonly Widget counter;
public readonly Widget container;
public static bool operator ==(_Decoration left, _Decoration other) {
return left.contentPadding == other.contentPadding
&& left.floatingLabelHeight == other.floatingLabelHeight
&& left.floatingLabelProgress == other.floatingLabelProgress
&& left.border == other.border
&& left.borderGap == other.borderGap
&& left.icon == other.icon
&& left.input == other.input
&& left.label == other.label
&& left.hint == other.hint
&& left.prefix == other.prefix
&& left.suffix == other.suffix
&& left.prefixIcon == other.prefixIcon
&& left.suffixIcon == other.suffixIcon
&& left.helperError == other.helperError
&& left.counter == other.counter
&& left.container == other.container;
public static bool operator ==(_Decoration left, _Decoration right) {
return left.Equals(right);
}
public static bool operator !=(_Decoration left, _Decoration right) {
return !left.Equals(right);
public static bool operator !=(_Decoration left, _Decoration other) {
return !(left == other);
public bool Equals(_Decoration other) {
return this.contentPadding == other.contentPadding
&& this.floatingLabelHeight == other.floatingLabelHeight
&& this.floatingLabelProgress == other.floatingLabelProgress
&& this.border == other.border
&& this.borderGap == other.borderGap
&& this.icon == other.icon
&& this.input == other.input
&& this.label == other.label
&& this.hint == other.hint
&& this.prefix == other.prefix
&& this.suffix == other.suffix
&& this.prefixIcon == other.prefixIcon
&& this.suffixIcon == other.suffixIcon
&& this.helperError == other.helperError
&& this.counter == other.counter
&& this.container == other.container;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((_Decoration) obj);
}
public override int GetHashCode() {

Dictionary<_DecorationSlot, Element> slotToChild = new Dictionary<_DecorationSlot, Element>();
Dictionary<Element, _DecorationSlot> childToSlot = new Dictionary<Element, _DecorationSlot>();
public _Decorator widget {
public new _Decorator widget {
public _RenderDecoration renderObject {
public new _RenderDecoration renderObject {
get { return (_RenderDecoration) base.renderObject; }
}

);
}
public static bool operator ==(InputDecoration left, InputDecoration other) {
return other.icon == left.icon
&& other.labelText == left.labelText
&& other.labelStyle == left.labelStyle
&& other.helperText == left.helperText
&& other.helperStyle == left.helperStyle
&& other.hintText == left.hintText
&& other.hintStyle == left.hintStyle
&& other.errorText == left.errorText
&& other.errorStyle == left.errorStyle
&& other.errorMaxLines == left.errorMaxLines
&& other.hasFloatingPlaceholder == left.hasFloatingPlaceholder
&& other.isDense == left.isDense
&& other.contentPadding == left.contentPadding
&& other.isCollapsed == left.isCollapsed
&& other.prefixIcon == left.prefixIcon
&& other.prefix == left.prefix
&& other.prefixText == left.prefixText
&& other.prefixStyle == left.prefixStyle
&& other.suffixIcon == left.suffixIcon
&& other.suffix == left.suffix
&& other.suffixText == left.suffixText
&& other.suffixStyle == left.suffixStyle
&& other.counterText == left.counterText
&& other.counterStyle == left.counterStyle
&& other.filled == left.filled
&& other.fillColor == left.fillColor
&& other.errorBorder == left.errorBorder
&& other.focusedBorder == left.focusedBorder
&& other.focusedErrorBorder == left.focusedErrorBorder
&& other.disabledBorder == left.disabledBorder
&& other.enabledBorder == left.enabledBorder
&& other.border == left.border
&& other.enabled == left.enabled;
public static bool operator ==(InputDecoration left, InputDecoration right) {
return left.Equals(right);
}
public static bool operator !=(InputDecoration left, InputDecoration right) {
return !left.Equals(right);
public static bool operator !=(InputDecoration left, InputDecoration other) {
return !(left == other);
public bool Equals(InputDecoration other) {
return other.icon == this.icon
&& other.labelText == this.labelText
&& other.labelStyle == this.labelStyle
&& other.helperText == this.helperText
&& other.helperStyle == this.helperStyle
&& other.hintText == this.hintText
&& other.hintStyle == this.hintStyle
&& other.errorText == this.errorText
&& other.errorStyle == this.errorStyle
&& other.errorMaxLines == this.errorMaxLines
&& other.hasFloatingPlaceholder == this.hasFloatingPlaceholder
&& other.isDense == this.isDense
&& other.contentPadding == this.contentPadding
&& other.isCollapsed == this.isCollapsed
&& other.prefixIcon == this.prefixIcon
&& other.prefix == this.prefix
&& other.prefixText == this.prefixText
&& other.prefixStyle == this.prefixStyle
&& other.suffixIcon == this.suffixIcon
&& other.suffix == this.suffix
&& other.suffixText == this.suffixText
&& other.suffixStyle == this.suffixStyle
&& other.counterText == this.counterText
&& other.counterStyle == this.counterStyle
&& other.filled == this.filled
&& other.fillColor == this.fillColor
&& other.errorBorder == this.errorBorder
&& other.focusedBorder == this.focusedBorder
&& other.focusedErrorBorder == this.focusedErrorBorder
&& other.disabledBorder == this.disabledBorder
&& other.enabledBorder == this.enabledBorder
&& other.border == this.border
&& other.enabled == this.enabled;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((InputDecoration) obj);
}
public override int GetHashCode() {

25
Runtime/material/outline_button.cs


}
}
public static bool operator ==(_OutlineBorder left, _OutlineBorder other) {
return left.side == other.side && left.shape == other.shape;
public static bool operator ==(_OutlineBorder left, _OutlineBorder right) {
return left.Equals(right);
}
public static bool operator !=(_OutlineBorder left, _OutlineBorder right) {
return !left.Equals(right);
public static bool operator !=(_OutlineBorder left, _OutlineBorder other) {
return left.side != other.side || left.shape != other.shape;
public bool Equals(_OutlineBorder other) {
return this.side == other.side && this.shape == other.shape;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((_OutlineBorder) obj);
}
public override int GetHashCode() {

2
Runtime/rendering/object.mixin.gen.cs


get { return this._childCount; }
}
public bool debugValidateChild(RenderObject child) {
public new bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(

2
Runtime/rendering/proxy_box.cs


Alignment alignment = null,
RenderBox child = null
) : base(child) {
D.assert(fit != null);
this._fit = fit;
this._alignment = alignment ?? Alignment.center;
}

public BoxFit fit {
get { return this._fit; }
set {
D.assert(value != null);
if (this._fit == value) {
return;
}

8
Runtime/rendering/sliver_persistent_header.cs


}
D.assert(this.child.hasSize);
D.assert(this.constraints.axis != null);
switch (this.constraints.axis) {
case Axis.vertical:
return this.child.size.height;

}
protected void layoutChild(float scrollOffset, float maxExtent, bool overlapsContent = false) {
D.assert(maxExtent != null);
D.assert(this.constraints == this.constraints);
D.assert(constraints == this.constraints);
this.updateChild(shrinkOffset, overlapsContent);
});
this._lastShrinkOffset = shrinkOffset;

public override void paint(PaintingContext context, Offset offset) {
if (this.child != null && this.geometry.visible) {
D.assert(this.constraints.axisDirection != null);
switch (GrowthDirectionUtils.applyGrowthDirectionToAxisDirection(this.constraints.axisDirection,
this.constraints.growthDirection)) {
case AxisDirection.up:

protected override void performLayout() {
float? maxExtent = this.maxExtent;
if (this._lastActualScrollOffset != null &&
((this.constraints.scrollOffset < this._lastActualScrollOffset) ||
if (((this.constraints.scrollOffset < this._lastActualScrollOffset) ||
(this._effectiveScrollOffset < maxExtent))) {
float delta = this._lastActualScrollOffset - this.constraints.scrollOffset;
bool allowFloatingExpansion = this.constraints.userScrollDirection == ScrollDirection.forward;

1
Runtime/rendering/stack.cs


}
public static RelativeRect lerp(RelativeRect a, RelativeRect b, float t) {
D.assert(t != null);
if (a == null && b == null) {
return null;
}

1
Runtime/widgets/basic.cs


Alignment alignment = null,
Widget child = null
) : base(key: key, child: child) {
D.assert(fit != null);
this.fit = fit;
this.alignment = alignment ?? Alignment.center;
}

4
Runtime/widgets/sliver_persistent_header.cs


bool floating = false
) : base(key: key) {
D.assert(del != null);
D.assert(pinned != null);
D.assert(floating != null);
this.del = del;
this.pinned = pinned;
this.floating = floating;

public _SliverPersistentHeaderElement(_SliverPersistentHeaderRenderObjectWidget widget) : base(widget) {
}
public _SliverPersistentHeaderRenderObjectWidget widget {
public new _SliverPersistentHeaderRenderObjectWidget widget {
get { return (_SliverPersistentHeaderRenderObjectWidget) base.widget; }
}

2
Samples/UIWidgetsGallery/demo/colors_demo.cs


public readonly int threshold;
public bool isValid {
get { return this.name != null && this.primary != null && this.threshold != null; }
get { return this.name != null && this.primary != null; }
}
}

30
Samples/UIWidgetsGallery/gallery/demo.cs


public readonly string documentationUrl;
public static bool operator ==(ComponentDemoTabData left, ComponentDemoTabData right) {
return right.tabName == left.tabName
&& right.description == left.description
&& right.documentationUrl == left.documentationUrl;
return left.Equals(right);
return right.tabName != left.tabName
|| right.description != left.description
|| right.documentationUrl != left.documentationUrl;
return !left.Equals(right);
}
public bool Equals(ComponentDemoTabData other) {
return other.tabName == this.tabName
&& other.description == this.description
&& other.documentationUrl == this.documentationUrl;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((ComponentDemoTabData) obj);
}
public override int GetHashCode() {

正在加载...
取消
保存