Json to Dart Model extension can convert JSON objects into Dart data classes. It supports pure Dart class conversion, Flutter-recommended JSON serialization using annotations, Freezed support, Effective Dart:Style, and many more features. Currently, it has more than 135,000 installs.
response: (json['response'] as List<dynamic>)
?.map((e) => e == null
? null
: Response.fromJson(json['response'] as Map<String, dynamic>)) // Sorry for that :(
?.toList(),
to:
response: (json['response'] as List<dynamic>)
?.map((e) => e == null
? null
: Response.fromJson(e as Map<String, dynamic>))
?.toList(),
List<T>
from:
to: