- 
                Notifications
    You must be signed in to change notification settings 
- Fork 348
Description
We have a function for a confirmation / suggested-action dialog:
void showSuggestedActionDialog({
  required BuildContext context,
  required String title,
  required String message,
  required String? actionButtonText,
  required VoidCallback onActionButtonPress,
}) {
  final zulipLocalizations = ZulipLocalizations.of(context);
  showDialog<void>(
    context: context,
    builder: (BuildContext context) => AlertDialog(
      title: Text(title),
      content: SingleChildScrollView(child: Text(message)),
      actions: [
        TextButton(
          onPressed: () => Navigator.pop(context),
          child: _dialogActionText(zulipLocalizations.dialogCancel)),
        TextButton(
          onPressed: onActionButtonPress,
          child: _dialogActionText(actionButtonText ?? zulipLocalizations.dialogContinue)),
      ]));
}It should grow a param bool destructive = false, and, when that's true, show the action button in a style that's appropriate for a destructive action.
On iOS (post-#996) this should be straightforward: just pass isDestructiveAction: true to CupertinoDialogAction.
In Material 3 style for Android, it looks like there isn't actually a special "destructive"/"danger" style for destructive actions. See the "Dialogs" M3 doc, which even includes a confirmation dialog for a "Delete" action, and the "Delete" button is styled just the same as the "Cancel" button. So, until/unless we get a design from Vlad that says otherwise, we'll just keep the styling we get by default, and give showSuggestedActionDialog a dartdoc that says the new param only has an effect on iOS.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status