showBigTextNotification method
Future<int>
showBigTextNotification({
- required String title,
- required String message,
- required String bigText,
- String? channelId,
- NotificationImportance? importance,
- bool? autoCancel,
- String? targetScreen,
- Map<
String, dynamic> ? extraData,
override
Show a notification with big text style.
Implementation
@override
Future<int> showBigTextNotification({
required String title,
required String message,
required String bigText,
String? channelId,
NotificationImportance? importance,
bool? autoCancel,
String? targetScreen,
Map<String, dynamic>? extraData,
}) async {
try {
// Check if the browser supports notifications
if (!_isNotificationSupported()) {
return -1;
}
if (web.Notification.permission == 'granted') {
// For web, we'll combine message and bigText
final fullMessage = '$message\n\n$bigText';
final options = web.NotificationOptions(
body: fullMessage,
// Add more options as needed
);
final notification = web.Notification(title, options);
return 1; // Return a notification ID
}
return -1; // Failed to show notification
} catch (e) {
return -1; // Failed to show notification
}
}