listFiles method

  1. @override
Future<List<String>> listFiles(
  1. String directoryPath
)
override

Lists files under the specified directory.

Implementation

@override
Future<List<String>> listFiles(String directoryPath) async {
  final dir = _directory(directoryPath);
  if (!await dir.exists()) return [];
  return dir
      .list()
      .where((e) => e is File)
      .map(
        (e) =>
            p.relative(e.path, from: _resolvedBasePath).replaceAll('\\', '/'),
      )
      .toList();
}