response method Null safety

  1. @override
Future<List<BaseMessage>> response(
  1. Map<String, dynamic> res
)
override

Implementation

@override
Future<List<BaseMessage>> response(res) async {
  final lst = (res['messages'] as List)
      .map((e) => BaseMessage.msgFromJson(e, channelType: channelType))
      .toList();
  lst.removeWhere((element) => element == null);
  return List<BaseMessage>.from(lst);
}