detectPlatforms static method

List<String> detectPlatforms()

Dynamically detects platforms based on directory existence in the project root.

Implementation

static List<String> detectPlatforms() {
  final detected = <String>[];
  if (Directory(p.join(root, 'android')).existsSync()) {
    detected.add('android');
  }
  if (Directory(p.join(root, 'ios')).existsSync()) {
    detected.add('ios');
  }
  if (Directory(p.join(root, 'macos')).existsSync()) {
    detected.add('macos');
  }
  if (Directory(p.join(root, 'web')).existsSync()) {
    detected.add('web');
  }
  if (detected.isEmpty) {
    return const ['android', 'ios', 'macos', 'web'];
  }
  return detected;
}