added uptime monitoring
This commit is contained in:
@@ -135,7 +135,9 @@ class ReceiptController extends ChangeNotifier {
|
||||
model.transaction = transaction;
|
||||
setLoading(false);
|
||||
return ApiResponse.success(transaction);
|
||||
} catch (e) {
|
||||
} catch (e, s) {
|
||||
print(e);
|
||||
print(s);
|
||||
setLoading(false);
|
||||
return ApiResponse.failure(
|
||||
"Problem fetching transaction data, are you connected to the internet?",
|
||||
|
||||
@@ -119,18 +119,23 @@ class _ReceiptScreenState extends State<ReceiptScreen>
|
||||
}
|
||||
|
||||
Future<void> _fetchTransaction() async {
|
||||
final id =
|
||||
widget.transactionId ??
|
||||
transactionController.model.receiptData?["id"] ??
|
||||
receiptController.model.transaction?.id;
|
||||
try {
|
||||
final id =
|
||||
widget.transactionId ??
|
||||
transactionController.model.receiptData?["id"] ??
|
||||
receiptController.model.transaction?.id;
|
||||
|
||||
if (id == null) return;
|
||||
if (id == null) return;
|
||||
|
||||
final response = await receiptController.getReceiptData(id);
|
||||
if (response.isSuccess && response.data != null) {
|
||||
setState(() {
|
||||
_transaction = response.data;
|
||||
});
|
||||
final response = await receiptController.getReceiptData(id);
|
||||
if (response.isSuccess && response.data != null) {
|
||||
setState(() {
|
||||
_transaction = response.data;
|
||||
});
|
||||
}
|
||||
} catch (e, s) {
|
||||
print(e);
|
||||
print(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user