showBigPictureNotificationHiddenLargeIcon method

Future<void> showBigPictureNotificationHiddenLargeIcon({
  1. String? title,
  2. String? body,
  3. String? payload,
  4. required String imagePath,
  5. required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
})

Implementation

Future<void> showBigPictureNotificationHiddenLargeIcon({String? title, String? body, String? payload, required String imagePath, required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin}) async {
  final String largeIconPath = await downloadAndSaveFile(url: imagePath, fileName: 'largeIcon');
  final String bigPicturePath = await downloadAndSaveFile(url: imagePath, fileName: 'bigPicture');
  final BigPictureStyleInformation bigPictureStyleInformation = BigPictureStyleInformation(
    FilePathAndroidBitmap(bigPicturePath), hideExpandedLargeIcon: true,
    contentTitle: title, htmlFormatContentTitle: true,
    summaryText: body, htmlFormatSummaryText: true,
  );
  final AndroidNotificationDetails androidPlatformChannelSpecifics = AndroidNotificationDetails(
    'CCG_delivery', 'CCG_delivery name',
    largeIcon: FilePathAndroidBitmap(largeIconPath), priority: Priority.max, playSound: true,
    styleInformation: bigPictureStyleInformation, importance: Importance.max,
    sound: const RawResourceAndroidNotificationSound('notification'),
  );
  final NotificationDetails platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics);
  await flutterLocalNotificationsPlugin.show(0, title, body, platformChannelSpecifics, payload: payload);
}