showNotification method
通知を表示する
Implementation
Future<void> showNotification({
int? id,
String? title,
String? body,
String? payload,
}) async {
try {
final notificationDetails = _notificationDetails();
await _flutterLocalNotificationsPlugin.show(
id ?? DateTime.now().millisecondsSinceEpoch,
title,
body,
notificationDetails,
payload: payload,
);
} catch (_) {
throw ServiceException(
ServiceErrorType.notificationShowError,
ServiceErrorType.notificationShowError.message,
);
}
}