diff --git a/lib/src/editor/block_component/table_block_component/table_block_component.dart b/lib/src/editor/block_component/table_block_component/table_block_component.dart index edcdb4dd2..58c6c2bc6 100644 --- a/lib/src/editor/block_component/table_block_component/table_block_component.dart +++ b/lib/src/editor/block_component/table_block_component/table_block_component.dart @@ -222,7 +222,8 @@ class _TableBlockComponentWidgetState extends State @override Offset localToGlobal(Offset offset) => _renderBox.localToGlobal(offset); - + @override + Offset globalToLocal(Offset offset) => _renderBox.globalToLocal(offset); @override Rect getBlockRect() { return getRectsInSelection(Selection.invalid()).first; diff --git a/lib/src/service/selection_gesture_detector/mobile_selection_gesture_detector.dart b/lib/src/service/selection_gesture_detector/mobile_selection_gesture_detector.dart index 11ed9f43d..e8f7d87b4 100644 --- a/lib/src/service/selection_gesture_detector/mobile_selection_gesture_detector.dart +++ b/lib/src/service/selection_gesture_detector/mobile_selection_gesture_detector.dart @@ -1,4 +1,3 @@ -import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; diff --git a/test/render/selection/mobile_selection_widget_test.dart b/test/render/selection/mobile_selection_widget_test.dart index 754f0602e..07e06363e 100644 --- a/test/render/selection/mobile_selection_widget_test.dart +++ b/test/render/selection/mobile_selection_widget_test.dart @@ -14,11 +14,11 @@ void main() { Stack( children: [ MobileSelectionWidget( - showLeftHandler: true, - showRightHandler: true, + handleType: HandleType.up, layerLink: node.layerLink, - rect: const Rect.fromLTWH(0, 0, 100, 100), - color: Colors.red, + selectionRect: const Rect.fromLTWH(0, 0, 100, 100), + selectionColor: Colors.blue, + selectionHandleColor: Colors.red, ), ], ), diff --git a/test/service/mobile_selection_gesture_test.dart b/test/service/mobile_selection_gesture_test.dart index 62caca0f2..bd40db327 100644 --- a/test/service/mobile_selection_gesture_test.dart +++ b/test/service/mobile_selection_gesture_test.dart @@ -1,4 +1,4 @@ -import 'package:appflowy_editor/src/service/selection/mobile_selection_gesture.dart'; +import 'package:appflowy_editor/src/service/selection_gesture_detector/mobile_selection_gesture_detector.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -15,11 +15,11 @@ void main() { }); testWidgets('on tap gesture', (tester) async { - bool onTapDown = false; + bool onTap = false; await tester.buildAndPump( MobileSelectionGestureDetector( - onTapDown: (_) => onTapDown = true, + onTap: () => onTap = true, child: const SizedBox.square(dimension: 50), ), ); @@ -28,7 +28,7 @@ void main() { await tester.tap(find.byType(SizedBox), warnIfMissed: false); await tester.pumpAndSettle(); - expect(onTapDown, true); + expect(onTap, true); }); testWidgets('on double tap gesture', (tester) async { @@ -52,12 +52,12 @@ void main() { expect(onDoubleTapDown, true); }); - testWidgets('on triple tap gesture', (tester) async { - bool onTripleTapDown = false; + testWidgets('on double tap gesture', (tester) async { + bool onDoubleTap = false; await tester.buildAndPump( MobileSelectionGestureDetector( - onTripleTapDown: (_) => onTripleTapDown = true, + onDoubleTap: () => onDoubleTap = true, child: const SizedBox.square(dimension: 50), ), ); @@ -73,7 +73,7 @@ void main() { await tester.pumpAndSettle(); - expect(onTripleTapDown, true); + expect(onDoubleTap, true); }); }); }