extractMessages function
Implementation
Future<String> extractMessages(Map<String, dynamic> payload) async {
const String api = "/process_messages";
String result = "";
try {
final response = await dio.post(api, data: payload);
if (response.statusCode == 200) {
result = response.data.toString();
addMobileMoney({"messages": result});
await showMsgSuccess("Mobile Money", "Mobile Money synced successfully");
}
} catch (e) {
print(e.toString());
showMsgFailed("Mobile Money", "Failed to sync and mobile money");
}
return result;
}