From 4feb18ca3dd392ed55459cae77688625b0d4f8c5 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Tue, 19 Jan 2021 16:44:03 -0600 Subject: [PATCH] Remove deprecated CupertinoDialog (#73604) --- packages/flutter/lib/fix_data.yaml | 27 ++++++++++++ .../flutter/lib/src/cupertino/dialog.dart | 41 ------------------- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/packages/flutter/lib/fix_data.yaml b/packages/flutter/lib/fix_data.yaml index 9420e05415..be8d1795d7 100644 --- a/packages/flutter/lib/fix_data.yaml +++ b/packages/flutter/lib/fix_data.yaml @@ -11,6 +11,33 @@ version: 1 transforms: + # Change made in https://github.com/flutter/flutter/pull/20649 + # TODO(Piinks): Add tests when `bulkApply:false` testing is supported, https://github.com/dart-lang/sdk/issues/44639 + - title: 'Replace with CupertinoPopupSurface' + date: 2021-01-07 + bulkApply: false + element: + uris: [ 'cupertino.dart' ] + class: 'CupertinoDialog' + changes: + - kind: 'rename' + newName: 'CupertinoPopupSurface' + + # Change made in https://github.com/flutter/flutter/pull/20649 + # TODO(Piinks): Add tests when `bulkApply:false` testing is supported, https://github.com/dart-lang/sdk/issues/44639 + - title: 'Replace with CupertinoAlertDialog' + date: 2021-01-07 + bulkApply: false + element: + uris: [ 'cupertino.dart' ] + class: 'CupertinoDialog' + changes: + - kind: 'rename' + newName: 'CupertinoAlertDialog' + - kind: 'renameParameter' + oldName: 'child' + newName: 'content' + # Changes made in https://github.com/flutter/flutter/pull/61648 - title: 'Migrate to autovalidateMode' date: 2020-09-02 diff --git a/packages/flutter/lib/src/cupertino/dialog.dart b/packages/flutter/lib/src/cupertino/dialog.dart index 42732807c0..da3973a711 100644 --- a/packages/flutter/lib/src/cupertino/dialog.dart +++ b/packages/flutter/lib/src/cupertino/dialog.dart @@ -279,47 +279,6 @@ class CupertinoAlertDialog extends StatelessWidget { } } -/// An iOS-style dialog. -/// -/// This dialog widget does not have any opinion about the contents of the -/// dialog. Rather than using this widget directly, consider using -/// [CupertinoAlertDialog], which implement a specific kind of dialog. -/// -/// Push with `Navigator.of(..., rootNavigator: true)` when using with -/// [CupertinoTabScaffold] to ensure that the dialog appears above the tabs. -/// -/// See also: -/// -/// * [CupertinoAlertDialog], which is a dialog with title, contents, and -/// actions. -/// * -@Deprecated( - 'Use CupertinoAlertDialog for alert dialogs. Use CupertinoPopupSurface for custom popups. ' - 'This feature was deprecated after v0.2.3.' -) -class CupertinoDialog extends StatelessWidget { - /// Creates an iOS-style dialog. - const CupertinoDialog({ - Key? key, - this.child, - }) : super(key: key); - - /// The widget below this widget in the tree. - final Widget? child; - - @override - Widget build(BuildContext context) { - return Center( - child: SizedBox( - width: _kCupertinoDialogWidth, - child: CupertinoPopupSurface( - child: child, - ), - ), - ); - } -} - /// Rounded rectangle surface that looks like an iOS popup surface, e.g., alert dialog /// and action sheet. ///