fromJSON method

  1. @override
Int32 fromJSON(
  1. dynamic jsonValue,
  2. DeserializationContext context
)

Implementation

@override
Int32 fromJSON(dynamic jsonValue, DeserializationContext context) {
  return jsonValue is Int32
      ? jsonValue
      : jsonValue is String
          ? Int32.parseInt(jsonValue)
          : Int32(jsonValue);
}