fileExists method

  1. @override
Future<bool> fileExists({
  1. required String fileName,
  2. String? folderPath,
  3. bool fromRoot = false,
})
override

Implementation

@override
Future<bool> fileExists({
  required String fileName,
  String? folderPath,
  bool fromRoot = false,
}) async {
  final String folder = fromRoot
      ? (folderPath ?? '')
      : (folderPath != null ? 'DCIM/$folderPath' : 'DCIM');

  final bool? result = await methodChannel.invokeMethod('fileExists', {
    'fileName': fileName,
    'folderPath': folder,
    'fromRoot': fromRoot,
  });

  return result ?? false;
}