9/6/1
This commit is contained in:
@@ -26,7 +26,7 @@ class CRUD {
|
||||
if (response.statusCode == 200) {
|
||||
var jsonData = jsonDecode(response.body);
|
||||
if (jsonData['status'] == 'success') {
|
||||
print(jsonData);
|
||||
// print(jsonData);
|
||||
return response.body;
|
||||
}
|
||||
return jsonData['status'];
|
||||
@@ -65,6 +65,39 @@ class CRUD {
|
||||
return (jsonData['status']);
|
||||
}
|
||||
|
||||
Future<dynamic> postFromDialogue({
|
||||
required String link,
|
||||
Map<String, dynamic>? payload,
|
||||
}) async {
|
||||
var url = Uri.parse(
|
||||
link,
|
||||
);
|
||||
var response = await http.post(
|
||||
url,
|
||||
body: payload,
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
'Authorization':
|
||||
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||
},
|
||||
);
|
||||
print(response.request);
|
||||
|
||||
var jsonData = jsonDecode(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
if (jsonData['status'] == 'success') {
|
||||
Get.back();
|
||||
Get.snackbar(
|
||||
jsonData['status'],
|
||||
jsonData['message'],
|
||||
);
|
||||
|
||||
return response.body;
|
||||
}
|
||||
}
|
||||
return (jsonData['status']);
|
||||
}
|
||||
|
||||
Future<dynamic> getGoogleApi({
|
||||
required String link,
|
||||
Map<String, dynamic>? payload,
|
||||
|
||||
Reference in New Issue
Block a user