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('$basePath/$directoryPath');
  if (!await dir.exists()) return [];
  return dir
      .list()
      .where((e) => e is File)
      .map((e) => e.path.replaceFirst('$basePath/', ''))
      .toList();
}