import 'package:http/http.dart' as http; import 'dart:convert'; import 'package:prosapp_web_app/utils/constants.dart' show API_BASE_URL; class LocalNotifications { static Future sendPushNotification( String token, String title, String body) async { try { http.Response response = await http.post( Uri.parse('$API_BASE_URL/notifications/send'), headers: { 'Content-Type': 'application/json; charset=UTF-8', }, body: jsonEncode( { 'title': title, 'body': body, 'to': token, }, ), ); response; } catch (e) { rethrow; } } }