messages method
Implementation
Future<Iterable<HeaderModel>> messages(
{String? folderId,
String? contains,
QueryType? queryType,
int? skip,
int take = 20}) async {
final Map<String, dynamic> queryParameters = {
'folderId': folderId,
'contains': contains,
'take': take,
'skip': skip
};
if (queryType != null) {
queryParameters['type'] = queryType.toString().split('.').last;
}
final response = await dio.get('/mail', queryParameters: queryParameters);
final data = List<HeaderModel>.from(
response.data.map((e) => HeaderModel.fromJson(e)));
return data;
}