targetPlatformOf static method

TargetPlatform targetPlatformOf(
  1. BuildContext context
)

The platform whose behaviour applies at context: the preview frame's platform inside one, else the device's own platform. A host reads this instead of pinning a platform.

Implementation

static TargetPlatform targetPlatformOf(BuildContext context) =>
    maybeOf(context)?.platform.targetPlatform ?? defaultTargetPlatform;