conversation method

Future<Iterable<Chat>> conversation(
  1. String contactId, {
  2. DateTime? before,
  3. int? take,
})

Implementation

Future<Iterable<Chat>> conversation(String contactId,
    {DateTime? before, int? take}) async {
  final Map<String, dynamic> queryParameters = {};
  if (before != null) queryParameters['before'] = before.toIso8601String();
  final response =
      await dio.get('/chat/$contactId', queryParameters: queryParameters);
  return (response.data as List).map((e) => Chat.fromJson(e));
}