CPDFReaderWidgetController constructor
CPDFReaderWidgetController(
- int id, {
- CPDFPageChangedCallback? onPageChanged,
- CPDFDocumentSaveCallback? saveCallback,
Implementation
CPDFReaderWidgetController(int id, {
CPDFPageChangedCallback? onPageChanged,
CPDFDocumentSaveCallback? saveCallback}) {
_channel = MethodChannel('com.compdfkit.flutter.ui.pdfviewer.$id');
_channel.setMethodCallHandler((call) async {
switch (call.method) {
case 'onPageChanged':
var pageIndex = call.arguments['pageIndex'];
onPageChanged?.call(pageIndex);
break;
case 'saveDocument':
saveCallback?.call();
break;
}
});
_document = CPDFDocument.withController(id);
}