dart format
This commit is contained in:
@@ -7,16 +7,15 @@ class NotificationService {
|
||||
|
||||
NotificationService._internal();
|
||||
|
||||
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
||||
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
|
||||
Future<void> initializeNotifications() async {
|
||||
const androidSettings = AndroidInitializationSettings(
|
||||
'@mipmap/ic_launcher'
|
||||
);
|
||||
|
||||
final iosSettings = DarwinInitializationSettings(
|
||||
'@mipmap/ic_launcher',
|
||||
);
|
||||
|
||||
final iosSettings = DarwinInitializationSettings();
|
||||
|
||||
final initializationSettings = InitializationSettings(
|
||||
android: androidSettings,
|
||||
@@ -24,13 +23,16 @@ class NotificationService {
|
||||
);
|
||||
|
||||
await flutterLocalNotificationsPlugin.initialize(
|
||||
settings: initializationSettings
|
||||
settings: initializationSettings,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> showNotification({required String title, required String body, required int badgeCount}) async {
|
||||
const androidPlatformChannelSpecifics =
|
||||
AndroidNotificationDetails(
|
||||
Future<void> showNotification({
|
||||
required String title,
|
||||
required String body,
|
||||
required int badgeCount,
|
||||
}) async {
|
||||
const androidPlatformChannelSpecifics = AndroidNotificationDetails(
|
||||
'marmobile',
|
||||
'Marianum Fulda',
|
||||
importance: Importance.defaultImportance,
|
||||
@@ -42,14 +44,14 @@ class NotificationService {
|
||||
|
||||
const platformChannelSpecifics = NotificationDetails(
|
||||
android: androidPlatformChannelSpecifics,
|
||||
iOS: iosPlatformChannelSpecifics
|
||||
iOS: iosPlatformChannelSpecifics,
|
||||
);
|
||||
|
||||
await flutterLocalNotificationsPlugin.show(
|
||||
id: 0,
|
||||
title: title,
|
||||
body: body,
|
||||
notificationDetails: platformChannelSpecifics
|
||||
notificationDetails: platformChannelSpecifics,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user