getNameFile method Null safety

  1. @override
Future<String> getNameFile(
  1. {required String url}
)
override

Get the url name

Implementation

@override
Future<String> getNameFile({required String url}) async {
  try {
    if (Platform.isWindows) return url.split("/").last;
    return await methodChannel.invokeMethod("getName", url);
  } on PlatformException catch (e) {
    throw OpenDocumentException('getNameFile: ${e.stacktrace.toString()}');
  }
}