PdfThumbnail.fromFile constructor

PdfThumbnail.fromFile(
  1. String path, {
  2. Key? key,
  3. Color? backgroundColor,
  4. BoxDecoration? currentPageDecoration,
  5. CurrentPageWidget? currentPageWidget,
  6. double? height,
  7. ThumbnailPageCallback? onPageClicked,
  8. required int currentPage,
  9. Widget? loadingIndicator,
  10. ImageThumbnailCacher? cacher,
  11. bool? scrollToCurrentPage,
  12. 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,
  );
}