PdfThumbnail.fromFile constructor
PdfThumbnail.fromFile(
- String path, {
- Key? key,
- Color? backgroundColor,
- BoxDecoration? currentPageDecoration,
- CurrentPageWidget? currentPageWidget,
- double? height,
- ThumbnailPageCallback? onPageClicked,
- required int currentPage,
- Widget? loadingIndicator,
- ImageThumbnailCacher? cacher,
- bool? scrollToCurrentPage,
- Widget? closeButton,
Creates a PdfThumbnail from a file.
Implementation
factory PdfThumbnail.fromFile(
String path, {
Key? key,
Color? backgroundColor,
BoxDecoration? currentPageDecoration,
CurrentPageWidget? currentPageWidget,
double? height,
ThumbnailPageCallback? onPageClicked,
required int currentPage,
Widget? loadingIndicator,
ImageThumbnailCacher? cacher,
bool? scrollToCurrentPage,
Widget? closeButton,
}) {
return PdfThumbnail._(
key: key,
path: path,
backgroundColor: backgroundColor ?? Colors.black,
height: height ?? 200,
onPageClicked: onPageClicked,
currentPage: currentPage,
currentPageWidget:
currentPageWidget ?? (page, isCurrent) => const SizedBox(),
currentPageDecoration: currentPageDecoration ??
BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.blue,
width: 4,
),
),
loadingIndicator: loadingIndicator ??
const Center(
child: CircularProgressIndicator(),
),
cacher: cacher,
scrollToCurrentPage: scrollToCurrentPage ?? false,
closeButton: closeButton,
);
}