diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index f158eb316db76..a91c94a45f066 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -279,16 +279,6 @@ abstract interface class DeletableChipAttributes { /// If null, the default [MaterialLocalizations.deleteButtonTooltip] will be /// used. String? get deleteButtonTooltipMessage; - - /// Whether to use a tooltip on the chip's delete button showing the - /// [deleteButtonTooltipMessage]. - /// - /// Defaults to true. - @Deprecated( - 'Migrate to deleteButtonTooltipMessage. ' - 'This feature was deprecated after v2.10.0-0.3.pre.' - ) - bool get useDeleteButtonTooltip; } /// An interface for Material Design chips that can have check marks. @@ -597,11 +587,6 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri this.shadowColor, this.surfaceTintColor, this.iconTheme, - @Deprecated( - 'Migrate to deleteButtonTooltipMessage. ' - 'This feature was deprecated after v2.10.0-0.3.pre.' - ) - this.useDeleteButtonTooltip = true, }) : assert(elevation == null || elevation >= 0.0); @override @@ -648,12 +633,6 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri final Color? surfaceTintColor; @override final IconThemeData? iconTheme; - @override - @Deprecated( - 'Migrate to deleteButtonTooltipMessage. ' - 'This feature was deprecated after v2.10.0-0.3.pre.' - ) - final bool useDeleteButtonTooltip; @override Widget build(BuildContext context) { @@ -666,7 +645,6 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri deleteIcon: deleteIcon, onDeleted: onDeleted, deleteIconColor: deleteIconColor, - useDeleteButtonTooltip: useDeleteButtonTooltip, deleteButtonTooltipMessage: deleteButtonTooltipMessage, tapEnabled: false, side: side, @@ -771,11 +749,6 @@ class RawChip extends StatefulWidget this.showCheckmark, this.checkmarkColor, this.avatarBorder = const CircleBorder(), - @Deprecated( - 'Migrate to deleteButtonTooltipMessage. ' - 'This feature was deprecated after v2.10.0-0.3.pre.' - ) - this.useDeleteButtonTooltip = true, }) : assert(pressElevation == null || pressElevation >= 0.0), assert(elevation == null || elevation >= 0.0), deleteIcon = deleteIcon ?? _kDefaultDeleteIcon; @@ -855,12 +828,6 @@ class RawChip extends StatefulWidget final Color? checkmarkColor; @override final ShapeBorder avatarBorder; - @override - @Deprecated( - 'Migrate to deleteButtonTooltipMessage. ' - 'This feature was deprecated after v2.10.0-0.3.pre.' - ) - final bool useDeleteButtonTooltip; /// If set, this indicates that the chip should be disabled if all of the /// tap callbacks ([onSelected], [onPressed]) are null. @@ -1159,9 +1126,8 @@ class _RawChipState extends State with MaterialStateMixin, TickerProvid container: true, button: true, child: _wrapWithTooltip( - tooltip: widget.useDeleteButtonTooltip - ? widget.deleteButtonTooltipMessage ?? MaterialLocalizations.of(context).deleteButtonTooltip - : null, + tooltip: widget.deleteButtonTooltipMessage + ?? MaterialLocalizations.of(context).deleteButtonTooltip, enabled: widget.onDeleted != null, child: InkWell( // Radius should be slightly less than the full size of the chip. diff --git a/packages/flutter/lib/src/material/input_chip.dart b/packages/flutter/lib/src/material/input_chip.dart index e2146d14d481c..33a4bfd841d53 100644 --- a/packages/flutter/lib/src/material/input_chip.dart +++ b/packages/flutter/lib/src/material/input_chip.dart @@ -123,11 +123,6 @@ class InputChip extends StatelessWidget this.showCheckmark, this.checkmarkColor, this.avatarBorder = const CircleBorder(), - @Deprecated( - 'Migrate to deleteButtonTooltipMessage. ' - 'This feature was deprecated after v2.10.0-0.3.pre.' - ) - this.useDeleteButtonTooltip = true, }) : assert(pressElevation == null || pressElevation >= 0.0), assert(elevation == null || elevation >= 0.0); @@ -199,12 +194,6 @@ class InputChip extends StatelessWidget final ShapeBorder avatarBorder; @override final IconThemeData? iconTheme; - @override - @Deprecated( - 'Migrate to deleteButtonTooltipMessage. ' - 'This feature was deprecated after v2.10.0-0.3.pre.' - ) - final bool useDeleteButtonTooltip; @override Widget build(BuildContext context) { @@ -223,7 +212,6 @@ class InputChip extends StatelessWidget deleteIcon: resolvedDeleteIcon, onDeleted: onDeleted, deleteIconColor: deleteIconColor, - useDeleteButtonTooltip: useDeleteButtonTooltip, deleteButtonTooltipMessage: deleteButtonTooltipMessage, onSelected: onSelected, onPressed: onPressed, diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index e7708dd28c505..992bd5947b05c 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -138,7 +138,6 @@ Widget chipWithOptionalDeleteButton({ Key? labelKey, required bool deletable, TextDirection textDirection = TextDirection.ltr, - bool useDeleteButtonTooltip = true, String? chipTooltip, String? deleteButtonTooltipMessage, VoidCallback? onPressed = doNothing, @@ -154,7 +153,6 @@ Widget chipWithOptionalDeleteButton({ onPressed: onPressed, onDeleted: deletable ? doNothing : null, deleteIcon: Icon(Icons.close, key: deleteButtonKey), - useDeleteButtonTooltip: useDeleteButtonTooltip, deleteButtonTooltipMessage: deleteButtonTooltipMessage, label: Text( deletable @@ -3204,31 +3202,6 @@ void main() { expect(box.size, equals(const Size(128, 24.0 + 16.0))); }); - testWidgetsWithLeakTracking('Chip delete button tooltip can be disabled using useDeleteButtonTooltip', (WidgetTester tester) async { - await tester.pumpWidget( - chipWithOptionalDeleteButton( - deletable: true, - useDeleteButtonTooltip: false, - ), - ); - - // Tap at the delete icon of the chip, which is at the right side of the - // chip - final Offset topRightOfInkwell = tester.getTopLeft(find.byType(InkWell).first); - final Offset tapLocationOfDeleteButton = topRightOfInkwell + const Offset(8, 8); - final TestGesture tapGesture = await tester.startGesture(tapLocationOfDeleteButton); - - await tester.pump(); - - // Wait for some more time while pressing and holding the delete button - await tester.pumpAndSettle(); - - // There should be no delete button tooltip - expect(findTooltipContainer('Delete'), findsNothing); - - await tapGesture.up(); - }); - testWidgetsWithLeakTracking('Chip delete button tooltip is disabled if deleteButtonTooltipMessage is empty', (WidgetTester tester) async { final UniqueKey deleteButtonKey = UniqueKey(); await tester.pumpWidget(