fromJson method

  1. @override
TargetPlatform? fromJson(
  1. String? json
)

Implementation

@override
TargetPlatform? fromJson(String? json) {
  if (json == null) return null;

  switch (json) {
    case 'android':
      return TargetPlatform.android;

    case 'fuchsia':
      return TargetPlatform.fuchsia;

    case 'iOS':
      return TargetPlatform.iOS;

    case 'linux':
      return TargetPlatform.linux;

    case 'macOS':
      return TargetPlatform.macOS;

    case 'windows':
      return TargetPlatform.windows;
  }

  throw 'Unsuported_Json_Value';
}