listClientNames method

Future<List<String>> listClientNames()

Returns the sorted names of every client directory, or an empty list when the clients directory does not exist.

Implementation

Future<List<String>> listClientNames() async {
  if (!clientsDir.existsSync()) return [];
  final names = <String>[];
  await for (final entity in clientsDir.list()) {
    if (entity is Directory) names.add(p.basename(entity.path));
  }
  return names..sort();
}