openDocument method
Future<bool>
openDocument({
- required String filePath,
- required DocType docType,
- 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;
}