Add fadeDuration back to TextSelectionOverlay (#100381)
* Add fadeDuration back to TextSelectionOverlay * fix build and add dart fix * format * add test
This commit is contained in:
@@ -17,6 +17,20 @@
|
||||
|
||||
version: 1
|
||||
transforms:
|
||||
# Changes made in https://github.com/flutter/flutter/pull/100381
|
||||
- title: "Migrate 'TextSelectionOverlay.fadeDuration' to SelectionOverlay.fadeDuration"
|
||||
date: 2022-03-18
|
||||
element:
|
||||
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
|
||||
field: 'fadeDuration'
|
||||
inClass: 'TextSelectionOverlay'
|
||||
changes:
|
||||
- kind: 'replacedBy'
|
||||
newElement:
|
||||
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
|
||||
field: 'fadeDuration'
|
||||
inClass: 'SelectionOverlay'
|
||||
|
||||
# Changes made in https://github.com/flutter/flutter/pull/96174
|
||||
- title: "Migrate 'useDeleteButtonTooltip' to 'deleteButtonTooltipMessage'"
|
||||
date: 2022-01-05
|
||||
|
||||
@@ -303,6 +303,13 @@ class TextSelectionOverlay {
|
||||
);
|
||||
}
|
||||
|
||||
/// Controls the fade-in and fade-out animations for the toolbar and handles.
|
||||
@Deprecated(
|
||||
'Use `SelectionOverlay.fadeDuration` instead. '
|
||||
'This feature was deprecated after v2.12.0-4.1.pre.'
|
||||
)
|
||||
static const Duration fadeDuration = SelectionOverlay.fadeDuration;
|
||||
|
||||
// TODO(mpcomplete): what if the renderObject is removed or replaced, or
|
||||
// moves? Not sure what cases I need to handle, or how to handle them.
|
||||
/// The editable line in which the selected text is being displayed.
|
||||
|
||||
@@ -91,6 +91,10 @@ void main() {
|
||||
);
|
||||
}
|
||||
|
||||
test('TextSelectionOverlay.fadeDuration exist', () async {
|
||||
expect(TextSelectionOverlay.fadeDuration, SelectionOverlay.fadeDuration);
|
||||
});
|
||||
|
||||
testWidgets('a series of taps all call onTaps', (WidgetTester tester) async {
|
||||
await pumpGestureDetector(tester);
|
||||
await tester.tapAt(const Offset(200, 200));
|
||||
|
||||
@@ -226,4 +226,7 @@ void main() {
|
||||
bool nowShowing = scrollbar.isAlwaysShown;
|
||||
RawScrollbar rawScrollbar = RawScrollbar(isAlwaysShown: true);
|
||||
nowShowing = rawScrollbar.isAlwaysShown;
|
||||
|
||||
// Change made in https://github.com/flutter/flutter/pull/100381
|
||||
TextSelectionOverlay.fadeDuration;
|
||||
}
|
||||
|
||||
@@ -226,4 +226,7 @@ void main() {
|
||||
bool nowShowing = scrollbar.thumbVisibility;
|
||||
RawScrollbar rawScrollbar = RawScrollbar(thumbVisibility: true);
|
||||
nowShowing = rawScrollbar.thumbVisibility;
|
||||
|
||||
// Change made in https://github.com/flutter/flutter/pull/100381
|
||||
SelectionOverlay.fadeDuration;
|
||||
}
|
||||
|
||||
@@ -551,4 +551,7 @@ void main() {
|
||||
rawChip = RawChip(useDeleteButtonTooltip: true);
|
||||
rawChip = RawChip(useDeleteButtonTooltip: false, deleteButtonTooltipMessage: 'Delete Tooltip');
|
||||
rawChip.useDeleteButtonTooltip;
|
||||
|
||||
// Change made in https://github.com/flutter/flutter/pull/100381
|
||||
TextSelectionOverlay.fadeDuration;
|
||||
}
|
||||
|
||||
@@ -524,4 +524,7 @@ void main() {
|
||||
rawChip = RawChip();
|
||||
rawChip = RawChip(deleteButtonTooltipMessage: 'Delete Tooltip');
|
||||
rawChip.deleteButtonTooltipMessage;
|
||||
|
||||
// Change made in https://github.com/flutter/flutter/pull/100381
|
||||
SelectionOverlay.fadeDuration;
|
||||
}
|
||||
|
||||
@@ -181,4 +181,7 @@ void main() {
|
||||
// Changes made in https://github.com/flutter/flutter/pull/96957
|
||||
RawScrollbar rawScrollbar = RawScrollbar(isAlwaysShown: true);
|
||||
nowShowing = rawScrollbar.isAlwaysShown;
|
||||
|
||||
// Change made in https://github.com/flutter/flutter/pull/100381
|
||||
TextSelectionOverlay.fadeDuration;
|
||||
}
|
||||
|
||||
@@ -181,4 +181,7 @@ void main() {
|
||||
// Changes made in https://github.com/flutter/flutter/pull/96957
|
||||
RawScrollbar rawScrollbar = RawScrollbar(thumbVisibility: true);
|
||||
nowShowing = rawScrollbar.thumbVisibility;
|
||||
|
||||
// Change made in https://github.com/flutter/flutter/pull/100381
|
||||
SelectionOverlay.fadeDuration;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user