提交 b8953a4b 编写于 作者: A Adam Barth

Fix Dart analyzer warnings in scaffold.dart

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1154013006
上级 8cbfd0a9
...@@ -5,18 +5,19 @@ ...@@ -5,18 +5,19 @@
import '../fn2.dart'; import '../fn2.dart';
import '../theme/typography.dart' as typography; import '../theme/typography.dart' as typography;
import 'dart:sky' as sky; import 'dart:sky' as sky;
import '../rendering/render_box.dart';
import '../rendering/render_node.dart';
// RenderNode // RenderNode
class RenderScaffold extends RenderDecoratedBox { class RenderScaffold extends RenderBox {
RenderScaffold({ RenderScaffold({
BoxDecoration decoration,
RenderBox toolbar, RenderBox toolbar,
RenderBox body, RenderBox body,
RenderBox statusbar, RenderBox statusbar,
RenderBox drawer, RenderBox drawer,
RenderBox floatingActionButton RenderBox floatingActionButton
}) : super(decoration) { }) {
this.toolbar = toolbar; this.toolbar = toolbar;
this.body = body; this.body = body;
this.statusbar = statusbar; this.statusbar = statusbar;
...@@ -120,7 +121,7 @@ class RenderScaffold extends RenderDecoratedBox { ...@@ -120,7 +121,7 @@ class RenderScaffold extends RenderDecoratedBox {
if (floatingActionButton != null) { if (floatingActionButton != null) {
floatingActionButton.layout(new BoxConstraints(minWidth: 0.0, maxWidth: size.width, minHeight: size.height, maxHeight: size.height)); floatingActionButton.layout(new BoxConstraints(minWidth: 0.0, maxWidth: size.width, minHeight: size.height, maxHeight: size.height));
assert(floatingActionButton.parentData is BoxParentData); assert(floatingActionButton.parentData is BoxParentData);
floatingActionButton.parentData.position = new sky.Point(size.width - xButtonX, bodyPosition + bodyHeight - kButtonY); floatingActionButton.parentData.position = new sky.Point(size.width - kButtonX, bodyPosition + bodyHeight - kButtonY);
} }
} }
...@@ -140,7 +141,7 @@ class RenderScaffold extends RenderDecoratedBox { ...@@ -140,7 +141,7 @@ class RenderScaffold extends RenderDecoratedBox {
void hitTestChildren(HitTestResult result, { sky.Point position }) { void hitTestChildren(HitTestResult result, { sky.Point position }) {
assert(floatingActionButton == null || floatingActionButton.parentData is BoxParentData); assert(floatingActionButton == null || floatingActionButton.parentData is BoxParentData);
assert(statusbar == null || statusbar.parentData is BoxParentData); assert(statusbar == null || statusbar.parentData is BoxParentData);
if ((drawer != null) && (x < drawer.size.width)) { if ((drawer != null) && (position.x < drawer.size.width)) {
drawer.hitTest(result, position: position); drawer.hitTest(result, position: position);
} else if ((floatingActionButton != null) && (position.x >= floatingActionButton.parentData.position.x) && (position.x < floatingActionButton.parentData.position.x + floatingActionButton.size.width) } else if ((floatingActionButton != null) && (position.x >= floatingActionButton.parentData.position.x) && (position.x < floatingActionButton.parentData.position.x + floatingActionButton.size.width)
&& (position.y >= floatingActionButton.parentData.position.y) && (position.y < floatingActionButton.parentData.position.y + floatingActionButton.size.height)) { && (position.y >= floatingActionButton.parentData.position.y) && (position.y < floatingActionButton.parentData.position.y + floatingActionButton.size.height)) {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:sky' as sky; import 'dart:sky' as sky;
import 'render_node.dart';
import 'render_box.dart'; import 'render_box.dart';
import 'render_node.dart'; import 'render_node.dart';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册