getById method

Future<Message> getById(
  1. String id
)

Implementation

Future<Message> getById(String id) async {
  final url = Uri.parse('${baseUrl}api/messages/$id');
  final response = await client.get(url);

  if (response.statusCode != 200) {
    throw MailosaurError(response);
  }

  return Message.fromJson(jsonDecode(response.body));
}