openDocument method

  1. @override
Future<bool> openDocument({
  1. required String filePath,
  2. required DocType docType,
  3. DocumentFeatures features = const DocumentFeatures(),
})
override

Opens the document at filePath using the native viewer.

docType identifies the format so the native layer can pick the correct renderer. Use DocType.fromPath to infer the type automatically.

Returns true on success.

Implementation

@override
Future<bool> openDocument({
  required String filePath,
  required DocType docType,
  DocumentFeatures features = const DocumentFeatures(),
}) async {
  final result = await methodChannel.invokeMethod<bool>(
    'openDocument',
    <String, dynamic>{
      'filePath': filePath,
      'docType': docType.identifier,
      'features': features.toMap(),
    },
  );
  return result ?? false;
}