Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: sky/sdk/example/mine_digger/lib/main.dart

Issue 1215163003: Random cleanup of various Dart things in our tree. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/sdk/example/game/main.dart ('k') | sky/sdk/example/raw/hello_world.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:sky' as sky; 5 import 'dart:sky' as sky;
6 import 'dart:math'; 6 import 'dart:math';
7 7
8 import 'package:sky/rendering/flex.dart'; 8 import 'package:sky/rendering/flex.dart';
9 import 'package:sky/widgets/basic.dart'; 9 import 'package:sky/widgets/basic.dart';
10 import 'package:sky/widgets/scaffold.dart'; 10 import 'package:sky/widgets/scaffold.dart';
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } else { 299 } else {
300 // Touch event. 300 // Touch event.
301 stopwatch = new Stopwatch()..start(); 301 stopwatch = new Stopwatch()..start();
302 } 302 }
303 } 303 }
304 304
305 void _handlePointerUp(sky.PointerEvent event) { 305 void _handlePointerUp(sky.PointerEvent event) {
306 if (stopwatch == null) 306 if (stopwatch == null)
307 return; 307 return;
308 // Pointer down was a touch event. 308 // Pointer down was a touch event.
309 var ms = stopwatch.elapsedMilliseconds;
310 if (stopwatch.elapsedMilliseconds < 250) { 309 if (stopwatch.elapsedMilliseconds < 250) {
311 game.probe(posX, posY); 310 game.probe(posX, posY);
312 } else { 311 } else {
313 // Long press flags. 312 // Long press flags.
314 game.flag(posX, posY); 313 game.flag(posX, posY);
315 } 314 }
316 stopwatch = null; 315 stopwatch = null;
317 } 316 }
318 317
319 Widget build() { 318 Widget build() {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } 363 }
365 364
366 Widget build() { 365 Widget build() {
367 return game.buildUI(); 366 return game.buildUI();
368 } 367 }
369 } 368 }
370 369
371 void main() { 370 void main() {
372 runApp(new MineDiggerApp()); 371 runApp(new MineDiggerApp());
373 } 372 }
OLDNEW
« no previous file with comments | « sky/sdk/example/game/main.dart ('k') | sky/sdk/example/raw/hello_world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698