flutter_pdfview_ohos 1.0.0 copy "flutter_pdfview_ohos: ^1.0.0" to clipboard
flutter_pdfview_ohos: ^1.0.0 copied to clipboard

A Flutter plugin that provides a PDFView widget on ohos.

flutter_pdfview_ohos #

一个Flutter插件,为OpenHarmony平台提供PDFView组件的实现。

Usage #

dependencies:
  flutter_pdfview: any
  flutter_pdfview_ohos: any

Example: #

import 'package:flutter_pdfview_ohos/flutter_pdfview_ohos.dart';

PDFView(
  filePath: widget.path,
  enableSwipe: true,
  swipeHorizontal: true,
  autoSpacing: false,
  pageFling: true,
  pageSnap: true,
  defaultPage: currentPage!,
  fitPolicy: FitPolicy.BOTH,
  preventLinkNavigation:
      false, // if set to true, link navigation will be handled within Flutter
  onRender: (_pages) {
    setState(() {
      pages = _pages;
      isReady = true;
    });
  },
  onError: (error) {
    setState(() {
      errorMessage = error.toString();
    });
    print(error.toString());
  },
  onPageError: (page, error) {
    setState(() {
      errorMessage = '$page: ${error.toString()}';
    });
    print('$page: ${error.toString()}');
  },
  onViewCreated: (PDFViewController pdfViewController) {
    _controller.complete(pdfViewController);
  },
  onLinkHandler: (String? uri) {
    print('goto uri: $uri');
  },
  onPageChanged: (int? page, int? total) {
    print('page change: $page/$total');
    setState(() {
      currentPage = page;
    });
  },
)
0
likes
60
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that provides a PDFView widget on ohos.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_pdfview_ohos