second commit

This commit is contained in:
Anbarasu
2026-05-27 10:35:09 +05:30
parent c53794c04c
commit 1435ac47b0
501 changed files with 52818 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
import 'dart:convert';
import 'package:http/http.dart';
import '../../../Helper/Logger.dart';
import '../../../Model/Request/Notification/Notification_request_rider.dart';
import '../../../Model/Request/Notification/Notificationrequest.dart';
import '../../../Model/Response/Authentication/Sms/Smsresponse.dart';
import '../../../Model/Response/Notification/Notificationresponse.dart';
class NotificationProvider{
Future<NotificationResponse?> createNotification(NotificationRequest data,String urldata,) async {
NotificationResponse? notificationResponse;
try {
final url = Uri.parse(urldata);
final response = await post(url,
body: json.encode(data),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
// 'Authorization': '$token',
});
logger.i(json.encode(data.toJson()));
print('notificationResponsebody ${response.body}');
print('notificationdatatoJson ${data.toJson()}');
print('CreateNotificationurlsssssssssss ${urldata.toString()}');
Map<String, dynamic> parsedJson = json.decode(response.body.toString());
notificationResponse = NotificationResponse.fromJson(parsedJson);
print('createOrderinprovider ${notificationResponse.toJson()}');
} catch (e) {
print(e.toString());
print("error");
}
return notificationResponse;
}
Future<NotificationResponse?> NotifyRider(RiderNotificationRequest data,String urldata,) async {
NotificationResponse? notificationResponse;
try {
final url = Uri.parse(urldata);
final response = await post(url,
body: json.encode(data),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
// 'Authorization': '$token',
});
logger.i(json.encode(data.toJson()));
print('notificationResponsebody ${response.body}');
print('notificationdatatoJson ${data.toJson()}');
print('CreateNotificationurlsssssssssss ${urldata.toString()}');
Map<String, dynamic> parsedJson = json.decode(response.body.toString());
notificationResponse = NotificationResponse.fromJson(parsedJson);
print('createOrderinprovider ${notificationResponse.toJson()}');
} catch (e) {
print(e.toString());
print("error");
}
return notificationResponse;
}
}