added wallet functionality

This commit is contained in:
Prince
2026-06-11 23:48:26 +02:00
parent ad79bf2af8
commit 2bcee59fd7
17 changed files with 1309 additions and 292 deletions

View File

@@ -403,7 +403,7 @@ class BatchController extends ChangeNotifier {
}
}
Future<ApiResponse<GroupBatch>> pollBatch(
Future<ApiResponse<TransactionModel>> pollBatch(
String batchId,
String userId,
) async {
@@ -418,11 +418,18 @@ class BatchController extends ChangeNotifier {
body.toJson(),
);
final response = _unwrap(raw);
final batch = GroupBatch.fromJson(response as Map<String, dynamic>);
model.currentBatch = batch;
final batchTransaction = TransactionModel.fromJson(
response as Map<String, dynamic>,
);
model.isActing = false;
if (!_disposed) notifyListeners();
return ApiResponse.success(batch);
if (response['status'] != 'FAILED') {
return ApiResponse.success(batchTransaction);
} else {
return ApiResponse.failure(
response['errorMessage'] ?? "Transaction failed",
);
}
} catch (e, s) {
logger.e(e);
logger.e(s);