提交 bbeb05af 编写于 作者: E Eric Seidel

Make stocksapp.dart almost pass the dart analyzer.

To test:
sky/tools/shelldb analyze sky/examples/stocks-fn/stocksapp.dart

It prints 600+ warnings about the "native" keyword, and after
this change only a couple warnings about missing library names
which I don't fully understand.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/987613002
上级 ebc0dd2c
......@@ -106,22 +106,22 @@ abstract class FixedHeightScrollable extends Component {
_scheduleFlingUpdate();
}
void _handleScrollUpdate(sky.Event event) {
void _handleScrollUpdate(sky.GestureEvent event) {
_scrollBy(-event.dy);
}
void _handleFlingStart(sky.Event event) {
void _handleFlingStart(sky.GestureEvent event) {
setState(() {
_flingCurve = new FlingCurve(-event.velocityY, event.timeStamp);
_scheduleFlingUpdate();
});
}
void _handleFlingCancel(sky.Event event) {
void _handleFlingCancel(sky.GestureEvent event) {
_stopFling();
}
void _handleWheel(sky.Event event) {
void _handleWheel(sky.WheelEvent event) {
_scrollBy(-event.offsetY);
}
}
......@@ -33,9 +33,9 @@ abstract class MaterialComponent extends Component {
..events.listen('pointerdown', _startSplash);
}
sky.ClientRect _getBoundingRect() => getRoot().getBoundingClientRect();
sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingClientRect();
void _startSplash(sky.Event event) {
void _startSplash(sky.PointerEvent event) {
setState(() {
if (_splashes == null) {
_splashes = new LinkedHashSet<SplashAnimation>();
......
......@@ -3,9 +3,7 @@ library stocksapp;
import '../../framework/fn.dart';
import '../data/stocks.dart';
import '../fn/widgets/widgets.dart';
import 'dart:collection';
import 'dart:math';
import 'dart:sky' as sky;
part 'stockarrow.dart';
part 'stocklist.dart';
......
......@@ -10,7 +10,7 @@ import 'dart:sky' as sky;
import 'reflect.dart' as reflect;
bool _initIsInCheckedMode() {
void testFn(double i) {}
String testFn(i) { double d = i; return d.toString(); }
try {
testFn('not a double');
} catch (ex) {
......@@ -405,7 +405,6 @@ class Container extends Element {
String get _tagName => 'div';
static final Container _emptyContainer = new Container();
Element get _emptyElement => _emptyContainer;
Container({
......@@ -470,8 +469,11 @@ class Anchor extends Element {
String get _tagName => 'a';
static final Anchor _emptyAnchor = new Anchor();
Element get _emptyElement => _emptyAnchor;
String href;
int width;
int height;
Anchor({
Object key,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册