imrpoving tran flow
This commit is contained in:
@@ -11,6 +11,7 @@ class ReceiptModel {
|
||||
Map<String, dynamic>? receiptData;
|
||||
bool isLoading = false;
|
||||
String? errorMessage;
|
||||
String status = '';
|
||||
}
|
||||
|
||||
class ReceiptController extends ChangeNotifier {
|
||||
@@ -45,6 +46,36 @@ class ReceiptController extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> doIntegration(String id) async {
|
||||
try {
|
||||
model.isLoading = true;
|
||||
model.status = '';
|
||||
notifyListeners();
|
||||
|
||||
dynamic workflowResponse = await http.get(
|
||||
'/public/transaction/integration/$id'
|
||||
);
|
||||
logger.i(workflowResponse.toString());
|
||||
|
||||
dynamic response = workflowResponse['body'];
|
||||
|
||||
if (response['status'] == 'SUCCESS') {
|
||||
model.status = response['status'];
|
||||
transactionController.updateReceiptData(response);
|
||||
} else {
|
||||
model.status = response['status'];
|
||||
model.errorMessage = response['errorMessage'];
|
||||
_showErrorSnackBar(response['errorMessage']);
|
||||
}
|
||||
notifyListeners();
|
||||
|
||||
} catch (e) {
|
||||
model.isLoading = false;
|
||||
model.errorMessage = e.toString();
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> repeatTransaction(BuildContext context) async {
|
||||
setLoading(true);
|
||||
// fetch provider & update tran controller
|
||||
|
||||
Reference in New Issue
Block a user