setIcon method

Future<void> setIcon(
  1. String filename
)

Update the icon of this

Example :

await guild.setIcon('assets/images/my_guild_icon.png');

Implementation

Future<void> setIcon (String filename) async {
  String file = await Helper.getPicture(filename);

  Response response = await ioc.use<HttpService>().patch(url: "/guilds/$id", payload: { 'icon': file });

  if (response.statusCode == 200) {
    _icon = ImageFormater(file, '');
  }
}