SoftUiDialog.viewer constructor
SoftUiDialog.viewer({})
Implementation
factory SoftUiDialog.viewer({
SoftUiViewerDialogTypes type = SoftUiViewerDialogTypes.document,
List<Widget> actions = const [],
String? path,
Uint8List? data,
String? title,
void Function()? onOpenPressed,
void Function()? onDeletePressed,
void Function()? onDownloadPressed,
}) {
return SoftUiDialog(
isFullscreen: true,
title: title,
actions: [
...actions,
if (onDownloadPressed != null)
SoftUiButton(
text: 'Baixar',
prefixIcon: Ionicons.download_outline,
type: onOpenPressed != null || onDeletePressed != null
? SoftUiButtonTypes.normal
: SoftUiButtonTypes.primary,
onPressed: onDownloadPressed,
),
if (onDeletePressed != null)
SoftUiButton(
text: 'Excluir',
prefixIcon: Ionicons.trash_outline,
type: SoftUiButtonTypes.danger,
onPressed: onDeletePressed,
),
if (onOpenPressed != null)
SoftUiButton(
text: 'Abrir',
prefixIcon: Ionicons.open_outline,
type: SoftUiButtonTypes.primary,
onPressed: onOpenPressed,
),
],
child: ViewerDialogWidget(
type: type,
path: path,
data: data,
),
);
}