definePlatform method
dynamic
definePlatform(
- dynamic p1,
- dynamic p2
Determines the platform and returns the appropriate value based on the provided parameters.
This method takes two parameters, p1
and p2
, and returns one of them
based on the current platform. If the platform is iOS, Android, or Fuchsia,
it returns p1
. Otherwise, it returns p2
.
-
Parameters:
- p1: The value to return if the platform is iOS, Android, or Fuchsia.
- p2: The value to return if the platform is not iOS, Android, or Fuchsia.
-
Returns: The appropriate value based on the current platform.
Implementation
dynamic definePlatform(var p1, var p2) =>
(Platform.isIOS || Platform.isAndroid || Platform.isFuchsia) ? p1 : p2;