diff --git a/examples/widgets/drag_and_drop.dart b/examples/widgets/drag_and_drop.dart index 14e60391f1..03747ff801 100644 --- a/examples/widgets/drag_and_drop.dart +++ b/examples/widgets/drag_and_drop.dart @@ -77,11 +77,8 @@ class ExampleDragSource extends StatelessComponent { Widget build(BuildContext context) { double size = kDotSize; - DraggableConstructor constructor = new Draggable#; - if (heavy) { + if (heavy) size *= kHeavyMultiplier; - constructor = new LongPressDraggable#; - } Widget contents = new DefaultTextStyle( style: Theme.of(context).text.body1.copyWith(textAlign: TextAlign.center), @@ -112,13 +109,23 @@ class ExampleDragSource extends StatelessComponent { anchor = DragAnchor.child; } - return constructor( - data: color, - child: contents, - feedback: feedback, - feedbackOffset: feedbackOffset, - dragAnchor: anchor - ); + if (heavy) { + return new Draggable( + data: color, + child: contents, + feedback: feedback, + feedbackOffset: feedbackOffset, + dragAnchor: anchor + ); + } else { + return new LongPressDraggable( + data: color, + child: contents, + feedback: feedback, + feedbackOffset: feedbackOffset, + dragAnchor: anchor + ); + } } } diff --git a/packages/flutter/lib/src/widgets/drag_target.dart b/packages/flutter/lib/src/widgets/drag_target.dart index 92a6be0fb2..2231ae6ce4 100644 --- a/packages/flutter/lib/src/widgets/drag_target.dart +++ b/packages/flutter/lib/src/widgets/drag_target.dart @@ -19,15 +19,6 @@ typedef void DragTargetAccept(T data); typedef Widget DragTargetBuilder(BuildContext context, List candidateData, List rejectedData); typedef void DragStartCallback(Point position, int pointer); -typedef DraggableBase DraggableConstructor({ - Key key, - T data, - Widget child, - Widget feedback, - Offset feedbackOffset, - DragAnchor dragAnchor -}); - enum DragAnchor { /// Display the feedback anchored at the position of the original child. If /// feedback is identical to the child, then this means the feedback will diff --git a/packages/playfair/test/playfair_test.dart b/packages/playfair/test/playfair_test.dart deleted file mode 100644 index 271d43bcde..0000000000 --- a/packages/playfair/test/playfair_test.dart +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:test/test.dart'; - -import 'package:playfair/playfair.dart'; -import 'test_painting_canvas.dart'; - -void main() { - test('test_chart', () { - ChartData data = new ChartData( - startX: 0.0, - startY: 0.0, - endX: 10.0, - endY: 1.0, - dataSet: [ - const Point(0.0, 0.0), - const Point(2.0, 0.5), - const Point(5.0, 0.2), - const Point(10.0, 0.9), - ] - ); - - StringBuffer buffer = new StringBuffer(); - PaintingCanvas canvas = new TestPaintingCanvas( - new PictureRecorder(), - const Size(100.0, 100.0), - buffer.write - ); - - new ChartPainter(data).paint(canvas, new Rect.fromLTRB(0.0, 0.0, 100.0, 100.0)); - - // TODO(jackson): Update this to the correct value once Sky packages can test - // See https://github.com/domokit/sky_engine/issues/580 - expect(buffer.toString(), equals("")); - }); -}