platformType top-level property

PxPlatformType get platformType

Returns the current PxPlatformType based on kIsWeb and defaultTargetPlatform.

Implementation

PxPlatformType get platformType {
  if (kIsWeb) return PxPlatformType.web;
  switch (defaultTargetPlatform) {
    case TargetPlatform.android:
      return PxPlatformType.android;
    case TargetPlatform.iOS:
      return PxPlatformType.ios;
    case TargetPlatform.macOS:
      return PxPlatformType.macos;
    case TargetPlatform.windows:
      return PxPlatformType.windows;
    case TargetPlatform.linux:
      return PxPlatformType.linux;
    case TargetPlatform.fuchsia:
      return PxPlatformType.fuchsia;
  }
}