setAvatar method

Future<void> setAvatar(
  1. String avatar
)

Update the avatar of this

Example :

await webhook.setAvatar('assets/images/my_picture.png');

Implementation

Future<void> setAvatar (String avatar) async {
  String path = await Helper.getPicture(avatar);
  Response response = await ioc.use<HttpService>().patch(url: "/webhooks/$id", payload: { 'avatar': path });

  if (response.statusCode == 200) {
    avatar = path;
  }
}