submit method
Implementation
submit(BuildContext context, Function() callback, String? id,
Function post) async {
callback();
_pressed = true;
notifyListeners();
var response = await post(
url: 'result/report/?uuid=$id',
body: {
'uuid': id,
},
);
if (response != null && response.statusCode == 200) {
callback();
showSuccess("CDC submission successful!");
} else {
try {
var data = jsonDecode(response.body);
showError("${data["error"]}.");
} catch (_) {
showError("Something went wrong.");
}
}
try {
_pressed = false;
notifyListeners();
} catch (_) {}
}