showPdfDialog static method
Future<void>
showPdfDialog({
- required BuildContext context,
- String? filePath,
- String? url,
- String? assetPath,
- PDFViewSource source = PDFViewSource.file,
- String? title,
- bool barrierDismissible = true,
- bool enableTextSelection = true,
- IconData? fabIcon,
- VoidCallback? onFabPressed,
Implementation
static Future<void> showPdfDialog({
required BuildContext context,
String? filePath,
String? url,
String? assetPath,
PDFViewSource source = PDFViewSource.file,
String? title,
bool barrierDismissible = true,
bool enableNavigation = true,
bool enableTextSelection = true,
IconData? fabIcon,
VoidCallback? onFabPressed,
}) async {
return showDialog(
context: context,
barrierDismissible: barrierDismissible,
builder: (context) => Dialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.r),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(16.r),
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height * 0.8,
child: BoltPDFViewer(
filePath: filePath,
url: url,
assetPath: assetPath,
source: source,
title: title,
enableNavigation: enableNavigation,
enableTextSelection: enableTextSelection,
isModal: true,
fabIcon: fabIcon,
onFabPressed: onFabPressed,
),
),
),
),
);
}