Untitled

mail@pastecode.io avatar
unknown
plain_text
20 days ago
913 B
3
Indexable
Never
import 'package:awesome_notifications/awesome_notifications.dart';
import 'package:flutter/material.dart';

class NotificationUtil {
  const NotificationUtil._();

  static Future<void> init() async {
    final awesomeNotif = AwesomeNotifications();
    awesomeNotif.initialize(
        // set the icon to null if you want to use the default app icon
        'resource://drawable/ic_stat_onesignal_default',
        [
          NotificationChannel(
              channelGroupKey: 'basic_channel_group',
              channelKey: 'basic_channel',
              importance: NotificationImportance.High,
              soundSource: "resource://raw/notification_sound",
              channelName: 'Basic notifications',
              channelDescription: 'Notification channel for basic tests',
              defaultColor: Color(0xFF9D50DD),
              ledColor: Colors.white)
        ],
        debug: true);
  }
}
Leave a Comment