From 2a9c2c40bf84415efbfc64c3708f278d4a8bcab4 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 5 Mar 2015 16:52:14 -0800 Subject: [PATCH] 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 --- examples/fn/widgets/fixedheightscrollable.dart | 8 ++++---- examples/fn/widgets/material.dart | 4 ++-- examples/stocks-fn/stocksapp.dart | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/fn/widgets/fixedheightscrollable.dart b/examples/fn/widgets/fixedheightscrollable.dart index 3c134aa924..ecb558962a 100644 --- a/examples/fn/widgets/fixedheightscrollable.dart +++ b/examples/fn/widgets/fixedheightscrollable.dart @@ -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); } } diff --git a/examples/fn/widgets/material.dart b/examples/fn/widgets/material.dart index 2d38a511dc..89cbdf2353 100644 --- a/examples/fn/widgets/material.dart +++ b/examples/fn/widgets/material.dart @@ -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(); diff --git a/examples/stocks-fn/stocksapp.dart b/examples/stocks-fn/stocksapp.dart index 873fead7dc..154c17c4e4 100644 --- a/examples/stocks-fn/stocksapp.dart +++ b/examples/stocks-fn/stocksapp.dart @@ -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';