diff --git a/analysis_options.yaml b/analysis_options.yaml index 5115d4d..b72ece3 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -19,9 +19,6 @@ # Android Studio, and the `flutter analyze` command. analyzer: - strong-mode: - implicit-casts: true - implicit-dynamic: true errors: # treat missing required parameters as a warning (not a hint) missing_required_param: error @@ -41,12 +38,14 @@ analyzer: - lib/src/http/** - lib/proto_build/** - lib/common_widgets/platform_widgets/** + language: + strict-casts: true + strict-raw-types: true linter: rules: - always_declare_return_types - - always_require_non_null_named_parameters - annotate_overrides - avoid_empty_else - avoid_init_to_null diff --git a/example/pubspec.lock b/example/pubspec.lock index aecadfe..d62533c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,58 +5,58 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.6.1" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: caac504f942f41dfadcf45229ce8c47065b93919a12739f20d6173a883c5ec73 + url: "https://pub.dev" source: hosted version: "1.0.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -67,27 +67,46 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.10" + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -97,64 +116,64 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.5.1" touchable: dependency: "direct main" description: path: ".." relative: true source: path - version: "1.0.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "1.0.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" diff --git a/lib/src/canvas_touch_detector.dart b/lib/src/canvas_touch_detector.dart index 03bd936..3bf20aa 100644 --- a/lib/src/canvas_touch_detector.dart +++ b/lib/src/canvas_touch_detector.dart @@ -25,7 +25,7 @@ class CanvasTouchDetector extends StatefulWidget { class _CanvasTouchDetectorState extends State { final StreamController touchController = StreamController.broadcast(); - StreamSubscription? streamSubscription; + StreamSubscription? streamSubscription; Future addStreamListener(Function(Gesture) callBack) async { await streamSubscription?.cancel(); @@ -168,31 +168,35 @@ class _CanvasTouchDetectorState extends State { onPanUpdate: !widget.gesturesToOverride.contains(GestureType.onPanUpdate) ? null - : (tapDetail) { - touchController - .add(Gesture(GestureType.onPanUpdate, tapDetail)); - }, + : (tapDetail) { + touchController.add(Gesture(GestureType.onPanUpdate, tapDetail)); + }, onPanDown: !widget.gesturesToOverride.contains(GestureType.onPanDown) ? null : (tapDetail) { - touchController - .add(Gesture(GestureType.onPanDown, tapDetail)); + touchController.add(Gesture(GestureType.onPanDown, tapDetail)); }, - onSecondaryTapDown: !widget.gesturesToOverride - .contains(GestureType.onSecondaryTapDown) + onPanEnd: !widget.gesturesToOverride.contains(GestureType.onPanEnd) ? null : (tapDetail) { - touchController - .add(Gesture(GestureType.onSecondaryTapDown, tapDetail)); + touchController.add(Gesture(GestureType.onPanEnd, tapDetail)); }, - onSecondaryTapUp: !widget.gesturesToOverride - .contains(GestureType.onSecondaryTapUp) + onPanCancel: !widget.gesturesToOverride.contains(GestureType.onPanCancel) + ? null + : () { + touchController.add(Gesture(GestureType.onPanCancel, null)); + }, + onSecondaryTapDown: !widget.gesturesToOverride.contains(GestureType.onSecondaryTapDown) + ? null + : (tapDetail) { + touchController.add(Gesture(GestureType.onSecondaryTapDown, tapDetail)); + }, + onSecondaryTapUp: !widget.gesturesToOverride.contains(GestureType.onSecondaryTapUp) ? null : (tapDetail) { touchController .add(Gesture(GestureType.onSecondaryTapUp, tapDetail)); - }, - )); + })); } @override diff --git a/lib/src/shape_handler.dart b/lib/src/shape_handler.dart index ac6a8fd..10c7b09 100644 --- a/lib/src/shape_handler.dart +++ b/lib/src/shape_handler.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/cupertino.dart'; import 'package:touchable/src/shapes/clip.dart'; import 'package:touchable/src/shapes/shape.dart'; @@ -10,6 +8,9 @@ class ShapeHandler { final List _shapeStack = []; final List clipItems = []; final Set _registeredGestures = {}; + Object? panningShapeId; + + ShapeHandler(this.panningShapeId); Set get registeredGestures => _registeredGestures; @@ -42,8 +43,7 @@ class ShapeHandler { return true; } - Offset _getActualOffsetFromScrollController( - Offset touchPoint, ScrollController? controller, AxisDirection direction) { + Offset _getActualOffsetFromScrollController(Offset touchPoint, ScrollController? controller, AxisDirection direction) { if (controller == null) { return touchPoint; } @@ -60,8 +60,11 @@ class ShapeHandler { } } + Shape? _getShapeById(Object? shapeId) => + shapeId == null ? null : _shapeStack.firstWhereOrNull((shape) => shape.id == shapeId); + List _getTouchedShapes(Offset point) { - var selectedShapes = []; + final selectedShapes = []; for (int i = _shapeStack.length - 1; i >= 0; i--) { var shape = _shapeStack[i]; if (shape.hitTestBehavior == HitTestBehavior.deferToChild) { @@ -84,20 +87,33 @@ class ShapeHandler { } Future handleGestureEvent( - Gesture gesture, { - ScrollController? scrollController, - AxisDirection direction = AxisDirection.down, - }) async { - var touchPoint = _getActualOffsetFromScrollController( - TouchCanvasUtil.getPointFromGestureDetail(gesture.gestureDetail), scrollController, direction); + Gesture gesture, { + ScrollController? scrollController, + AxisDirection direction = AxisDirection.down, + }) async { if (!_registeredGestures.contains(gesture.gestureType)) return; + final panningShapeIdLocal = panningShapeId; + if (gesture.gestureType == GestureType.onPanUpdate) { + if (panningShapeIdLocal != null) { + final panningShape = _getShapeById(panningShapeIdLocal); + if (panningShape != null && panningShape.registeredGestures.contains(gesture.gestureType)) { + panningShape.getCallbackFromGesture(gesture)(); + } + } + } else { + final pointFromGestureDetail = TouchCanvasUtil.getPointFromGestureDetail(gesture.gestureDetail); + final touchPoint = _getActualOffsetFromScrollController( + pointFromGestureDetail, scrollController, direction); - var touchedShapes = _getTouchedShapes(touchPoint); - if (touchedShapes.isEmpty) return; - for (var touchedShape in touchedShapes) { - if (touchedShape.registeredGestures.contains(gesture.gestureType)) { - var callback = touchedShape.getCallbackFromGesture(gesture); - callback(); + final touchedShapes = _getTouchedShapes(touchPoint); + if (touchedShapes.isEmpty) return; + for (var touchedShape in touchedShapes) { + if (touchedShape.registeredGestures.contains(gesture.gestureType)) { + if (gesture.gestureType == GestureType.onPanStart || gesture.gestureType == GestureType.onPanDown) { + panningShapeId = touchedShape.id; + } + touchedShape.getCallbackFromGesture(gesture)(); + } } } } diff --git a/lib/src/shapes/arc.dart b/lib/src/shapes/arc.dart index 87592a8..4a00883 100644 --- a/lib/src/shapes/arc.dart +++ b/lib/src/shapes/arc.dart @@ -1,5 +1,4 @@ import 'dart:math'; -import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:touchable/src/shapes/constant.dart'; diff --git a/lib/src/shapes/clip.dart b/lib/src/shapes/clip.dart index 37ebdf7..69a3119 100644 --- a/lib/src/shapes/clip.dart +++ b/lib/src/shapes/clip.dart @@ -1,6 +1,5 @@ import 'dart:ui'; -import 'package:flutter/cupertino.dart'; import 'package:touchable/src/shapes/shape.dart'; abstract class ClipShape extends Shape { diff --git a/lib/src/shapes/oval.dart b/lib/src/shapes/oval.dart index ec063a6..e29423b 100644 --- a/lib/src/shapes/oval.dart +++ b/lib/src/shapes/oval.dart @@ -1,5 +1,4 @@ import 'dart:math'; -import 'dart:ui'; import 'package:flutter/cupertino.dart'; import 'package:touchable/src/shapes/constant.dart'; diff --git a/lib/src/shapes/path.dart b/lib/src/shapes/path.dart index 50fb6a8..5301c83 100644 --- a/lib/src/shapes/path.dart +++ b/lib/src/shapes/path.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/cupertino.dart'; import 'package:touchable/src/shapes/shape.dart'; import 'package:touchable/src/types/types.dart'; diff --git a/lib/src/shapes/point.dart b/lib/src/shapes/point.dart index d5c680e..f2d9bbf 100644 --- a/lib/src/shapes/point.dart +++ b/lib/src/shapes/point.dart @@ -76,14 +76,22 @@ class PolygonUtil { int dir4 = _direction(l2.p1, l2.p2, l1.p2); if (dir1 != dir2 && dir3 != dir4) return true; //they are intersecting - if (dir1 == 0 && l1.isInside(l2.p1)) //when p2 of line2 are on the line1 + if (dir1 == 0 && l1.isInside(l2.p1)) { + //when p2 of line2 are on the line1 return true; - if (dir2 == 0 && l1.isInside(l2.p2)) //when p1 of line2 are on the line1 + } + if (dir2 == 0 && l1.isInside(l2.p2)) { + //when p1 of line2 are on the line1 return true; - if (dir3 == 0 && l2.isInside(l1.p1)) //when p2 of line1 are on the line2 + } + if (dir3 == 0 && l2.isInside(l1.p1)) { + //when p2 of line1 are on the line2 return true; - if (dir4 == 0 && l2.isInside(l1.p2)) //when p1 of line1 are on the line2 + } + if (dir4 == 0 && l2.isInside(l1.p2)) { + //when p1 of line1 are on the line2 return true; + } return false; } diff --git a/lib/src/shapes/rectangle.dart b/lib/src/shapes/rectangle.dart index e271f13..3cc84ee 100644 --- a/lib/src/shapes/rectangle.dart +++ b/lib/src/shapes/rectangle.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/cupertino.dart'; import 'package:touchable/src/shapes/shape.dart'; import 'package:touchable/src/types/types.dart'; diff --git a/lib/src/shapes/rounded_rectangle.dart b/lib/src/shapes/rounded_rectangle.dart index fe658e3..23e5e73 100644 --- a/lib/src/shapes/rounded_rectangle.dart +++ b/lib/src/shapes/rounded_rectangle.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/cupertino.dart'; import 'package:touchable/src/shapes/shape.dart'; import 'package:touchable/src/types/types.dart'; @@ -8,11 +6,16 @@ class RoundedRectangle extends Shape { final RRect rRect; RoundedRectangle(this.rRect, - {Paint? paint, + {Object? id, + Paint? paint, Map? gestureMap, HitTestBehavior? hitTestBehavior, PaintingStyle? paintStyleForTouch}) - : super(hitTestBehavior: hitTestBehavior, paint: paint ?? Paint(), gestureCallbackMap: gestureMap ?? {}); + : super( + id: id, + hitTestBehavior: hitTestBehavior, + paint: paint ?? Paint(), + gestureCallbackMap: gestureMap ?? {}); @override bool isInside(Offset p) { diff --git a/lib/src/shapes/shape.dart b/lib/src/shapes/shape.dart index 0861cc9..46fdf0e 100644 --- a/lib/src/shapes/shape.dart +++ b/lib/src/shapes/shape.dart @@ -1,11 +1,9 @@ -import 'dart:ui'; - -import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:touchable/src/shapes/constant.dart'; import 'package:touchable/touchable.dart'; abstract class Shape { + final Object? id; final Paint paint; final Map gestureCallbackMap; final HitTestBehavior hitTestBehavior; @@ -13,6 +11,7 @@ abstract class Shape { Set get registeredGestures => gestureCallbackMap.keys.toSet(); Shape({ + this.id, Paint? paint, Map? gestureCallbackMap, HitTestBehavior? hitTestBehavior, diff --git a/lib/src/shapes/util.dart b/lib/src/shapes/util.dart index bcd96dc..f1c8b79 100644 --- a/lib/src/shapes/util.dart +++ b/lib/src/shapes/util.dart @@ -1,6 +1,4 @@ import 'dart:math'; -import 'dart:ui'; - import 'package:flutter/material.dart'; import 'package:touchable/src/types/types.dart'; @@ -38,7 +36,7 @@ class TouchCanvasUtil { case ForcePressDetails: return (gestureDetail as ForcePressDetails).localPosition; default: - throw Exception("gestureDetail.runTimeType = ${gestureDetail.runtimeType} is not recognized ! "); + throw Exception('gestureDetail.runTimeType = ${gestureDetail.runtimeType} is not recognized !'); } } @@ -96,7 +94,6 @@ class TouchCanvasUtil { if (onPanDown != null) { map.putIfAbsent(GestureType.onPanDown, () => onPanDown); } - if (onSecondaryTapDown != null) { map.putIfAbsent(GestureType.onSecondaryTapDown, () => onSecondaryTapDown); } @@ -107,3 +104,13 @@ class TouchCanvasUtil { return map; } } + +extension IterableExtension on Iterable { + /// The first element satisfying [test], or `null` if there are none. + T? firstWhereOrNull(bool Function(T element) test) { + for (var element in this) { + if (test(element)) return element; + } + return null; + } +} \ No newline at end of file diff --git a/lib/src/touchy_canvas.dart b/lib/src/touchy_canvas.dart index b674e06..efa422f 100644 --- a/lib/src/touchy_canvas.dart +++ b/lib/src/touchy_canvas.dart @@ -1,10 +1,7 @@ -import 'dart:math'; import 'dart:typed_data'; import 'dart:ui'; -import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart' hide Image; -import 'package:touchable/src/canvas_touch_detector.dart'; import 'package:touchable/src/shape_handler.dart'; import 'package:touchable/src/shapes/arc.dart'; import 'package:touchable/src/shapes/circle.dart'; @@ -16,11 +13,13 @@ import 'package:touchable/src/shapes/point.dart'; import 'package:touchable/src/shapes/rectangle.dart'; import 'package:touchable/src/shapes/rounded_rectangle.dart'; import 'package:touchable/src/shapes/util.dart'; +import 'package:touchable/touchable.dart'; class TouchyCanvas { final Canvas _canvas; + final Object? panningShapeId; - final ShapeHandler _shapeHandler = ShapeHandler(); + late final ShapeHandler _shapeHandler ; ///[TouchyCanvas] helps you add gesture callbacks to the shapes you draw. /// @@ -28,17 +27,25 @@ class TouchyCanvas { /// The parameter [canvas] is the [Canvas] object that you get in your [paint] method inside [CustomPainter] TouchyCanvas( BuildContext context, - this._canvas, { - ScrollController? scrollController, - AxisDirection scrollDirection = AxisDirection.down, - }) { + this._canvas, {ScrollController? scrollController, + AxisDirection scrollDirection = AxisDirection.down, + GestureDragEndCallback? onPanEnd, + GestureDragCancelCallback? onPanCancel, + this.panningShapeId}) { + _shapeHandler = ShapeHandler(panningShapeId); var touchController = TouchDetectionController.of(context); - touchController?.addListener((event) { - _shapeHandler.handleGestureEvent( - event, - scrollController: scrollController, - direction: scrollDirection, - ); + touchController?.addListener((Gesture gesture) { + if (gesture.gestureType == GestureType.onPanEnd) { + onPanEnd?.call(gesture.gestureDetail as DragEndDetails); + } else if (gesture.gestureType == GestureType.onPanCancel) { + onPanCancel?.call(); + } else { + _shapeHandler.handleGestureEvent( + gesture, + scrollController: scrollController, + direction: scrollDirection, + ); + } }); } @@ -280,6 +287,7 @@ class TouchyCanvas { void drawRRect( RRect rrect, Paint paint, { + Object? shapeId, HitTestBehavior? hitTestBehavior, GestureTapDownCallback? onTapDown, PaintingStyle? paintStyleForTouch, @@ -299,6 +307,7 @@ class TouchyCanvas { }) { _canvas.drawRRect(rrect, paint); _shapeHandler.addShape(RoundedRectangle(rrect, + id: shapeId, paint: paint, hitTestBehavior: hitTestBehavior, gestureMap: TouchCanvasUtil.getGestureCallbackMap( diff --git a/lib/src/types/types.dart b/lib/src/types/types.dart index ff2476a..bca9105 100644 --- a/lib/src/types/types.dart +++ b/lib/src/types/types.dart @@ -39,6 +39,8 @@ enum GestureType { onPanStart, onPanUpdate, onPanDown, + onPanEnd, + onPanCancel, onSecondaryTapDown, onSecondaryTapUp, } diff --git a/pubspec.lock b/pubspec.lock index ad6d1df..f15e892 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,51 +5,50 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.6.1" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.1" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -60,27 +59,46 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.10" + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -90,57 +108,57 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.3.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.5.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" diff --git a/test/shapes/arc.dart b/test/shapes/arc.dart index ff052f0..429fdf9 100644 --- a/test/shapes/arc.dart +++ b/test/shapes/arc.dart @@ -1,6 +1,5 @@ import 'dart:math'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:touchable/src/shapes/arc.dart'; @@ -45,7 +44,7 @@ void testArc() { expect(arc2.isInside(Offset(227.0, 113.1)), true); }); - test("Arc with sweep greather than 360 degree test", () { + test('Arc with sweep greather than 360 degree test', () { var arc3 = Arc(Rect.fromLTWH(100, 100, 200, 200), 3 * pi / 2, -10 * pi / 3, false, paint: Paint() diff --git a/test/shapes/line.dart b/test/shapes/line.dart index 96382c2..c5c266f 100644 --- a/test/shapes/line.dart +++ b/test/shapes/line.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:touchable/src/shapes/line.dart'; diff --git a/test/shapes/point.dart b/test/shapes/point.dart index 2f43421..7d14aad 100644 --- a/test/shapes/point.dart +++ b/test/shapes/point.dart @@ -1,6 +1,5 @@ import 'dart:ui'; -import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:touchable/src/shapes/point.dart'; diff --git a/test/shapes/rectangle.dart b/test/shapes/rectangle.dart index 37db25e..f07489d 100644 --- a/test/shapes/rectangle.dart +++ b/test/shapes/rectangle.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:touchable/src/shapes/rectangle.dart';