Files
umbrix/lib/services/notification/notification_service.dart
problematicconsumer b617c95f62 initial
2023-07-06 17:18:41 +03:30

31 lines
828 B
Dart

import 'dart:io';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:hiddify/services/notification/local_notification_service.dart';
import 'package:hiddify/services/notification/stub_notification_service.dart';
abstract class NotificationService {
factory NotificationService() {
if (Platform.isWindows) return StubNotificationService();
return LocalNotificationService(FlutterLocalNotificationsPlugin());
}
Future<void> init();
void onDidReceiveNotificationResponse(
NotificationResponse notificationResponse,
);
Future<bool> grantPermission();
Future<void> showNotification({
required int id,
required String title,
String? body,
NotificationDetails? details,
String? payload,
});
Future<void> removeNotification(int id);
}