Merge pull request #332 from Hixie/flutter-analyze
flutter analyze command
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'velocity_tracker_data.dart';
|
||||
@@ -45,20 +43,4 @@ void main() {
|
||||
watch.stop();
|
||||
print("Dart tracker: " + watch.elapsed.toString());
|
||||
});
|
||||
|
||||
test('Native velocity tracker performance', () {
|
||||
ui.VelocityTracker tracker = new ui.VelocityTracker();
|
||||
Stopwatch watch = new Stopwatch();
|
||||
watch.start();
|
||||
for (int i = 0; i < kNumIters; i++) {
|
||||
for (PointerInputEvent event in events) {
|
||||
if (event.type == 'pointerdown' || event.type == 'pointermove')
|
||||
tracker.addPosition((event.timeStamp*1000.0).toInt(), event.x, event.y);
|
||||
if (event.type == 'pointerup')
|
||||
tracker.getVelocity();
|
||||
}
|
||||
}
|
||||
watch.stop();
|
||||
print("Native tracker: " + watch.elapsed.toString());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,16 +8,19 @@ import 'rendering_tester.dart';
|
||||
class SquareImage implements ui.Image {
|
||||
int get width => 10;
|
||||
int get height => 10;
|
||||
void dispose() { }
|
||||
}
|
||||
|
||||
class WideImage implements ui.Image {
|
||||
int get width => 20;
|
||||
int get height => 10;
|
||||
void dispose() { }
|
||||
}
|
||||
|
||||
class TallImage implements ui.Image {
|
||||
int get width => 10;
|
||||
int get height => 20;
|
||||
void dispose() { }
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
Reference in New Issue
Block a user