Unverified Commit d486aa70 authored by chunhtai's avatar chunhtai Committed by GitHub

Refactor TextSelectionOverlay (#98153)

* Refactor TextSelectionOverlay

* fix test

* remove print

* fix more tests

* update

* added tests

* fix comments

* fmt

* fix test

* addressing comment

* remove dispose

* remove new line
parent e8bc5c5a
......@@ -1089,7 +1089,7 @@ class EditableText extends StatefulWidget {
/// {@endtemplate}
final SelectionChangedCallback? onSelectionChanged;
/// {@macro flutter.widgets.TextSelectionOverlay.onSelectionHandleTapped}
/// {@macro flutter.widgets.SelectionOverlay.onSelectionHandleTapped}
final VoidCallback? onSelectionHandleTapped;
/// {@template flutter.widgets.editableText.inputFormatters}
......
......@@ -1326,7 +1326,7 @@ void main() {
// Move the gesture very slightly
await gesture.moveBy(const Offset(1.0, 1.0));
await tester.pump(TextSelectionOverlay.fadeDuration * 0.5);
await tester.pump(SelectionOverlay.fadeDuration * 0.5);
handle = tester.widget(fadeFinder.at(0));
// The handle should still be fully opaque.
......
......@@ -4759,14 +4759,14 @@ void main() {
if (expectedRightVisibleBefore)
expect(right.opacity.value, equals(1.0));
await tester.pump(TextSelectionOverlay.fadeDuration ~/ 2);
await tester.pump(SelectionOverlay.fadeDuration ~/ 2);
if (expectedLeftVisible != expectedLeftVisibleBefore)
expect(left.opacity.value, equals(0.5));
if (expectedRightVisible != expectedRightVisibleBefore)
expect(right.opacity.value, equals(0.5));
await tester.pump(TextSelectionOverlay.fadeDuration ~/ 2);
await tester.pump(SelectionOverlay.fadeDuration ~/ 2);
if (expectedLeftVisible)
expect(left.opacity.value, equals(1.0));
......@@ -7462,14 +7462,14 @@ void main() {
if (expectedRightVisibleBefore)
expect(right.opacity.value, equals(1.0));
await tester.pump(TextSelectionOverlay.fadeDuration ~/ 2);
await tester.pump(SelectionOverlay.fadeDuration ~/ 2);
if (expectedLeftVisible != expectedLeftVisibleBefore)
expect(left.opacity.value, equals(0.5));
if (expectedRightVisible != expectedRightVisibleBefore)
expect(right.opacity.value, equals(0.5));
await tester.pump(TextSelectionOverlay.fadeDuration ~/ 2);
await tester.pump(SelectionOverlay.fadeDuration ~/ 2);
if (expectedLeftVisible)
expect(left.opacity.value, equals(1.0));
......
......@@ -568,7 +568,7 @@ void main() {
// Move the gesture very slightly
await gesture.moveBy(const Offset(1.0, 1.0));
await tester.pump(TextSelectionOverlay.fadeDuration * 0.5);
await tester.pump(SelectionOverlay.fadeDuration * 0.5);
handle = tester.widget(fadeFinder.at(0));
// The handle should still be fully opaque.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment