浏览代码

[Cupertino] Fix warnings

/main
iizzaya 5 年前
当前提交
f2eeefa2
共有 7 个文件被更改,包括 31 次插入47 次删除
  1. 14
      Runtime/cupertino/button.cs
  2. 28
      Runtime/cupertino/nav_bar.cs
  3. 1
      Runtime/cupertino/page_scaffold.cs
  4. 13
      Runtime/cupertino/route.cs
  5. 6
      Runtime/cupertino/slider.cs
  6. 10
      Runtime/cupertino/switch.cs
  7. 6
      Runtime/cupertino/tab_scaffold.cs

14
Runtime/cupertino/button.cs


BorderRadius borderRadius = null,
bool filled = false
) : base(key: key) {
D.assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0));
D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
this._filled = filled;
this.child = child;
this.onPressed = onPressed;

float pressedOpacity = 0.1f,
BorderRadius borderRadius = null
) {
D.assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0));
D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
return new CupertinoButton(
key: key,
color: null,

}
},
child: new ConstrainedBox(
constraints: this.widget.minSize == null
? new BoxConstraints()
: new BoxConstraints(
minWidth: this.widget.minSize,
minHeight: this.widget.minSize
),
constraints: new BoxConstraints(
minWidth: this.widget.minSize,
minHeight: this.widget.minSize
),
child: new FadeTransition(
opacity: this._opacityAnimation,
child: new DecoratedBox(

28
Runtime/cupertino/nav_bar.cs


BuildContext toHeroContext
) => {
D.assert(animation != null);
D.assert(flightDirection != null);
D.assert(fromHeroContext != null);
D.assert(toHeroContext != null);
D.assert(fromHeroContext.widget is Hero);

bottomNavBar: fromNavBar,
topNavBar: toNavBar
);
break;
case HeroFlightDirection.pop:
return new _NavigationBarTransition(
animation: animation,

new Builder(
builder: (BuildContext _context) => {
return new Hero(
tag: this.widget.heroTag == NavBarUtils._defaultHeroTag
tag: this.widget.heroTag as _HeroTag == NavBarUtils._defaultHeroTag
? new _HeroTag(Navigator.of(_context))
: this.widget.heroTag,
createRectTween: NavBarUtils._linearTranslateWithLargestRectSizeTween,

bool transitionBetweenRoutes = true,
object heroTag = null
) : base(key: key) {
D.assert(automaticallyImplyLeading != null);
D.assert(automaticallyImplyTitle != null);
D.assert(
automaticallyImplyTitle == true || largeTitle != null,
() => "No largeTitle has been provided but automaticallyImplyTitle is also " +

float persistentHeight,
bool alwaysShowMiddle
) {
D.assert(this.persistentHeight != null);
D.assert(this.alwaysShowMiddle != null);
D.assert(this.transitionBetweenRoutes != null);
this.keys = keys;
this.components = components;
this.userMiddle = userMiddle;

}
return new Hero(
tag: this.heroTag == NavBarUtils._defaultHeroTag
tag: this.heroTag as _HeroTag == NavBarUtils._defaultHeroTag
? new _HeroTag(Navigator.of(context))
: this.heroTag,
createRectTween: NavBarUtils._linearTranslateWithLargestRectSizeTween,

style: CupertinoTheme.of(context).textTheme.navTitleTextStyle,
child: middle
);
middle = this.middleVisible == null
? middle
: new AnimatedOpacity(
opacity: this.middleVisible ? 1.0f : 0.0f,
duration: NavBarUtils._kNavBarTitleFadeDuration,
child: middle
);
middle = new AnimatedOpacity(
opacity: this.middleVisible ? 1.0f : 0.0f,
duration: NavBarUtils._kNavBarTitleFadeDuration,
child: middle
);
}
Widget leading = this.components.leading;

_TransitionableNavigationBar topNavBar,
_TransitionableNavigationBar bottomNavBar
) {
this.animation = animation;
this.topNavBar = topNavBar;
this.bottomNavBar = bottomNavBar;
this.heightTween = new FloatTween(
begin: this.bottomNavBar.renderBox.size.height,
end: this.topNavBar.renderBox.size.height

_TransitionableNavigationBar topNavBar,
TextDirection directionality
) {
this.animation = animation;
this.bottomComponents = bottomNavBar.componentsKeys;
this.topComponents = topNavBar.componentsKeys;
this.bottomNavBarBox = bottomNavBar.renderBox;

1
Runtime/cupertino/page_scaffold.cs


bool resizeToAvoidBottomInset = true
) : base(key: key) {
D.assert(child != null);
D.assert(resizeToAvoidBottomInset != null);
this.child = child;
this.navigationBar = navigationBar;

13
Runtime/cupertino/route.cs


_CupertinoEdgeShadowDecoration b,
float t
) {
D.assert(t != null);
if (a == null && b == null) {
return null;
}

public override BoxPainter createBoxPainter(VoidCallback onChanged = null) {
return new _CupertinoEdgeShadowPainter(this, onChanged);
}
public override int GetHashCode() {
return this.edgeGradient.GetHashCode();
}
public bool Equals(_CupertinoEdgeShadowDecoration other) {

) :
base(settings: settings, fullscreenDialog: fullscreenDialog) {
D.assert(builder != null);
D.assert(maintainState != null);
D.assert(fullscreenDialog != null);
D.assert(this.opaque);
this.builder = builder;
this.title = title;

return buildPageTransitions(this, context, animation, secondaryAnimation, child);
}
public string debugLabel {
public new string debugLabel {
get { return $"{base.debugLabel}(${this.settings.name})"; }
}
}

bool linearTransition,
Key key = null
) : base(key: key) {
D.assert(linearTransition != null);
this._primaryPositionAnimation =
(linearTransition
? primaryRouteAnimation

get { return CupertinoRouteUtils._kModalPopupTransitionDuration; }
}
Animation<float> _animation;
new Animation<float> _animation;
public override Animation<float> createAnimation() {
D.assert(this._animation == null);

6
Runtime/cupertino/slider.cs


) : base(key: key) {
D.assert(value != null);
D.assert(onChanged != null);
D.assert(min != null);
D.assert(max != null);
D.assert(value >= min && value <= max);
D.assert(divisions == null || divisions > 0);
this.value = value.Value;

TickerProvider vsync = null
) : base(additionalConstraints: BoxConstraints.tightFor(width: SliderUtils._kSliderWidth,
height: SliderUtils._kSliderHeight)) {
D.assert(value != null && value >= 0.0f && value <= 1.0f);
D.assert(value >= 0.0f && value <= 1.0f);
this._value = value;
this._divisions = divisions;
this._activeColor = activeColor;

public float value {
get { return this._value; }
set {
D.assert(value != null && value >= 0.0f && value <= 1.0f);
D.assert(value >= 0.0f && value <= 1.0f);
if (value == this._value) {
return;
}

10
Runtime/cupertino/switch.cs


Key key = null,
Color activeColor = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.start
) :
base(key: key) {
D.assert(value != null);
D.assert(dragStartBehavior != null);
) : base(key: key) {
this.value = value;
this.onChanged = onChanged;
this.activeColor = activeColor;

width: CupertinoSwitchUtils._kSwitchWidth,
height: CupertinoSwitchUtils._kSwitchHeight)
) {
D.assert(value != null);
D.assert(activeColor != null);
D.assert(vsync != null);
this._value = value;

public bool value {
get { return this._value; }
set {
D.assert(value != null);
if (value == this._value) {
return;
}

public TextDirection textDirection {
get { return this._textDirection; }
set {
D.assert(value != null);
if (this._textDirection == value) {
return;
}

public DragStartBehavior dragStartBehavior {
get { return this._drag.dragStartBehavior; }
set {
D.assert(value != null);
if (this._drag.dragStartBehavior == value) {
return;
}

6
Runtime/cupertino/tab_scaffold.cs


int tabNumber,
IndexedWidgetBuilder tabBuilder
) {
D.assert(currentTabIndex != null);
D.assert(tabNumber != null && tabNumber > 0);
D.assert(tabNumber > 0);
this.currentTabIndex = currentTabIndex;
this.tabNumber = tabNumber;
this.tabBuilder = tabBuilder;
}
public readonly int currentTabIndex;

正在加载...
取消
保存