open method
Future method open
takes the String path and String type
Call MethodChannel and invokeMethod
that has String return Value
Implementation
@override
Future<String> open({required String path, String type = ''}) async {
try {
if (path.isNotEmpty) {
final vPath = await methodChannel
.invokeMethod<String>(_OPEN_FILE, {_PATH: path, _TYPE: type});
if (vPath != null) {
return vPath;
} else {
return "Check Permissions";
}
} else {
return "Path Couldn't beEmpty";
}
} catch (e) {
return e.toString();
}
}