showBigTextNotification static method

Future<void> showBigTextNotification({
  1. required String title,
  2. required String message,
  3. required String bigText,
})

Show big text notification (mobile only)

Note: Desktop platforms don't support big text notifications. On desktop, this will show a simple notification with the bigText as the message.

Parameters:

  • title: Notification title (required)
  • message: Short notification message (required)
  • bigText: Expanded text content (required)

Example:

await UnifiedNotificationService.showBigTextNotification(
  title: 'Article Update',
  message: 'New article published',
  bigText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...',
);

Implementation

static Future<void> showBigTextNotification({
  required String title,
  required String message,
  required String bigText,
}) async {
  if (!_isInitialized) {
    if (kDebugMode) {
      print(
        'UnifiedNotificationService: Not initialized. Call initialize() first.',
      );
    }
    return;
  }

  try {
    if (_isDesktopPlatform()) {
      // Desktop doesn't support big text, show simple notification with bigText
      if (kDebugMode) {
        print(
          'UnifiedNotificationService: Big text notifications not supported on desktop, showing simple notification',
        );
      }
      await showNotification(
        title: title,
        message: bigText, // Use bigText as message on desktop
      );
    } else {
      // Use notification_master for mobile
      await _notificationMaster.showBigTextNotification(
        title: title,
        message: message,
        bigText: bigText,
      );
    }
  } catch (e) {
    if (kDebugMode) {
      print(
        'UnifiedNotificationService: Failed to show big text notification: $e',
      );
    }
  }
}