SoftUiDialog.viewer constructor

SoftUiDialog.viewer({
  1. SoftUiViewerDialogTypes type = SoftUiViewerDialogTypes.document,
  2. List<Widget> actions = const [],
  3. String? path,
  4. Uint8List? data,
  5. String? title,
  6. void onOpenPressed()?,
  7. void onDeletePressed()?,
  8. void onDownloadPressed()?,
})

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,
    ),
  );
}