normalizePlatform static method

String normalizePlatform(
  1. String raw
)

Canonical platform key used to match Flutter integration targets.

android* → android; ios / iphone / ipad → ios.

Implementation

static String normalizePlatform(String raw) {
  final key = raw.toLowerCase().replaceAll(RegExp(r'[^a-z0-9]'), '');
  if (key.startsWith('android')) return 'android';
  if (key.startsWith('ios') ||
      key.startsWith('iphone') ||
      key.startsWith('ipad')) {
    return 'ios';
  }
  return key;
}