updated the look and feel of the home page
This commit is contained in:
@@ -47,8 +47,10 @@ class IntegrationController extends ChangeNotifier {
|
||||
|
||||
dynamic response = workflowResponse['body'];
|
||||
|
||||
String? transactionId;
|
||||
if (response['status'] == 'SUCCESS') {
|
||||
model.status = response['status'];
|
||||
transactionId = response['id'];
|
||||
transactionController.updateReceiptData(response);
|
||||
|
||||
await gatewayController.poll(
|
||||
@@ -61,7 +63,13 @@ class IntegrationController extends ChangeNotifier {
|
||||
if (!_disposed) notifyListeners();
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!_disposed && context.mounted) context.go('/receipt');
|
||||
if (!_disposed && context.mounted) {
|
||||
if (transactionId != null) {
|
||||
context.go('/receipt/$transactionId');
|
||||
} else {
|
||||
context.go('/receipt');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return ApiResponse.success(Map<String, dynamic>.from(response));
|
||||
|
||||
@@ -49,8 +49,13 @@ class _IntegrationScreenState extends State<IntegrationScreen> {
|
||||
listenable: controller,
|
||||
builder: (context, child) {
|
||||
if (controller.model.status == 'SUCCESS') {
|
||||
final transactionId = controller.model.transaction?['id'];
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go('/receipt');
|
||||
if (transactionId != null) {
|
||||
context.go('/receipt/$transactionId');
|
||||
} else {
|
||||
context.go('/receipt');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user