prosapp_web_app has chat, dashboard, calendar, support, 13 providers and Fluro URL routing. Keep Dockerfile + nginx.conf from previous prosappweb. Upgrade google_fonts 6.2.1 → 8.1.0 (Dart 3.12 compat fix). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
712 B
Dart
28 lines
712 B
Dart
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<void> sendPushNotification(
|
|
String token, String title, String body) async {
|
|
try {
|
|
http.Response response = await http.post(
|
|
Uri.parse('$API_BASE_URL/notifications/send'),
|
|
headers: <String, String>{
|
|
'Content-Type': 'application/json; charset=UTF-8',
|
|
},
|
|
body: jsonEncode(
|
|
<String, dynamic>{
|
|
'title': title,
|
|
'body': body,
|
|
'to': token,
|
|
},
|
|
),
|
|
);
|
|
response;
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
}
|