@@ -26,24 +26,16 @@ class JsonSerializableConverter extends JsonConverter {
2626 T _decodeMap <T >(Map <String , dynamic > values) {
2727 final jsonFactory = factories[T ];
2828 if (jsonFactory == null ) {
29- throw JsonUnsupportedObjectError (
30- T ,
31- cause:
32- 'No fromJson was registered for JsonSerializableConverter for $T ' ,
33- );
29+ throw JsonUnsupportedObjectError (T , cause: 'No fromJson was registered for JsonSerializableConverter for $T ' );
3430 }
3531 if (jsonFactory is ! JsonFactory <T >) {
36- throw JsonUnsupportedObjectError (
37- T ,
38- cause: 'fromJson type does not match $T ' ,
39- );
32+ throw JsonUnsupportedObjectError (T , cause: 'fromJson type does not match $T ' );
4033 }
4134
4235 return jsonFactory (values);
4336 }
4437
45- List <T > _decodeList <T >(Iterable <dynamic > values) =>
46- values.nonNulls.map <T >((v) => _decode <T >(v) as T ).toList ();
38+ List <T > _decodeList <T >(Iterable <dynamic > values) => values.nonNulls.map <T >((v) => _decode <T >(v) as T ).toList ();
4739
4840 dynamic _decode <T >(dynamic entity) {
4941 if (entity is Iterable ) return _decodeList <T >(entity as List );
@@ -54,13 +46,9 @@ class JsonSerializableConverter extends JsonConverter {
5446 }
5547
5648 @override
57- FutureOr <Response <BodyType >> convertResponse <BodyType , InnerType >(
58- Response <dynamic > response,
59- ) async {
49+ FutureOr <Response <BodyType >> convertResponse <BodyType , InnerType >(Response <dynamic > response) async {
6050 final jsonRes = await super .convertResponse <dynamic , dynamic >(response);
6151
62- return jsonRes.copyWith <BodyType >(
63- body: _decode <InnerType >(jsonRes.body) as BodyType ,
64- );
52+ return jsonRes.copyWith <BodyType >(body: _decode <InnerType >(jsonRes.body) as BodyType );
6553 }
6654}
0 commit comments