1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] How to convert Bitmap to AndroidBitmap for push notifications in Flutter?

Discussão em 'Mobile' iniciado por Stack, Outubro 1, 2024 às 06:03.

  1. Stack

    Stack Membro Participativo

    I am trying to set up a large icon for push notification using flutter_local_notifications plugin and for the icon I want to use a network image. The code is as follows:

    Bitmap bitmap = await Bitmap.fromProvider(NetworkImage("http://pudim.com.br/pudim.jpg"));
    var androidSpecifics = new AndroidNotificationDetails(
    notificationData['id'].toString(),
    'Crop2x Notifications',
    'Crop2x Channel Description',
    importance: Importance.max,
    priority: Priority.high,
    largeIcon: bitmap,
    ticker: 'ticker');


    This code is giving an error because bitmap is of the type Bitmap and not of AndroidBitmap type, which the named argument largeIcon requires.

    Continue reading...

Compartilhe esta Página