fromJson static method

PageMeta fromJson(
  1. dynamic value
)

Returns a new PageMeta instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static PageMeta fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return PageMeta(
      branch: mapValueOfType<String>(json, r'branch') as String,
      product: mapValueOfType<String>(json, r'product') as String,
      version: mapValueOfType<String>(json, r'version') as String,
      preview: mapValueOfType<bool>(json, r'preview') ?? false,
    );
  }
  throw ArgumentError('Value is not a map');
}