when<HostPlatformTypeResult extends Object?> method

HostPlatformTypeResult when<HostPlatformTypeResult extends Object?>({
  1. required HostPlatformTypeResult io(),
  2. required HostPlatformTypeResult web(),
})

Run callback on specific host platform

Implementation

HostPlatformTypeResult when<HostPlatformTypeResult extends Object?>({
  required HostPlatformTypeResult Function() io,
  required HostPlatformTypeResult Function() web,
}) =>
    this == HostPlatformType.web ? web() : io();