confirmRestore static method

void confirmRestore(
  1. BuildContext context,
  2. VoidCallback onConfirm, {
  3. String? name,
})

Implementation

static void confirmRestore(BuildContext context, VoidCallback onConfirm, {String? name}) {
  final msg = name != null
      ? Text.rich(TextSpan(
          style: TextStyle(fontSize: 14),
          text: 'Do you really want to restore ',
          children: [TextSpan(text: name, style: const TextStyle(fontWeight: FontWeight.bold)), const TextSpan(text: '?')],
        ))
      : 'Do you really want to restore this item?';

  show(context,
      title: 'Are you sure?',
      text: msg,
      icon: Icons.unarchive_rounded,
      color: context.theme.info,
      confirmButton: AlertButton(text: 'Restore', onClick: onConfirm));
}