fromJSON method

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

Implementation

@override
Duration? fromJSON(dynamic jsonValue, DeserializationContext context) {
  return jsonValue is num
      ? Duration(microseconds: jsonValue as int)
      : jsonValue;
}