ローカル通知の大きなアイコンに File を設定するの?|largeIcon|FilePathAndroidBitmap|FlutterLocalNotifications|Android|Flutter


FlutterLocalNotifications 13.0.0 を使ったローカル通知に、ユーザのアバター画像を表示したい。

largeIcon」に設定すればいいのだけど、例えば、以下みたいに取得した、

File に保存済みの画像を出せるのかな?


出し方

FilePathAndroidBitmap」を使えば File に保存済みの画像をローカル通知に表示できるよ~。

---
final androidNotificationDetails =
    AndroidNotificationDetails(
        'channel id', 'channel name',
        channelDescription: 'channel description',
        largeIcon: FilePathAndroidBitmap(file.path));
await flutterLocalNotificationsPlugin.show(
    id, 'title', 'body'
    NotificationDetails(android: androidNotificationDetails));
---


関連する記事


参照した記事


直近に遊んでいたゲーム(おすすめ)

コメント

このブログの人気の投稿

ImagePicker を操作すると「Lost connection to device.」とだけ言い残して強制終了するの?|iOS|Flutter

Android SDK バージョン(コンパイルに使用する Android API レベル)を変更するの?|compileSdkVersion|SDK|Android|Flutter