kThemedPlatform top-level property

ThemedPlatform kThemedPlatform

kThemedPlatform is the platform of the app.

Uses Platform from dart:io to get the platform in native and uses kIsWeb to get the platform in web.

Implementation

ThemedPlatform get kThemedPlatform {
  if (kIsWeb) return ThemedPlatform.web;
  if (Platform.isAndroid) return ThemedPlatform.android;
  if (Platform.isIOS) return ThemedPlatform.iOS;
  if (Platform.isMacOS) return ThemedPlatform.macOS;
  if (Platform.isWindows) return ThemedPlatform.windows;
  if (Platform.isLinux) return ThemedPlatform.linux;
  if (Platform.isFuchsia) return ThemedPlatform.fuchsia;
  return ThemedPlatform.unknown;
}