Skip to content

Enter amount and contact us#7

Open
filo8856 wants to merge 7 commits into
Devsoc-BPGC:mainfrom
filo8856:main
Open

Enter amount and contact us#7
filo8856 wants to merge 7 commits into
Devsoc-BPGC:mainfrom
filo8856:main

Conversation

@filo8856

@filo8856 filo8856 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 8 additional findings in Devin Review.

Open in Devin Review

}

bool _validateFields() {
if (_pinController.text.isEmpty) return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Empty amount input silently fails validation with no user feedback

In _validateFields(), when _pinController.text.isEmpty (line 52), the method returns false without showing any SnackBar or user feedback. In contrast, the other two validation failure paths (invalid amount at line 54-66, consent not checked at line 67-79) both display a SnackBar explaining the issue. This was clearly modeled after SetPin._validateFields() in lib/Payments/set_pin.dart:51-90 where every failure path shows a SnackBar. The user taps PAY with an empty field and nothing visibly happens.

Suggested change
if (_pinController.text.isEmpty) return false;
if (_pinController.text.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Please enter an amount',
textAlign: TextAlign.center,
style: TextStyle(fontFamily: "Cinzel", fontSize: 20.r),
),
backgroundColor: Colors.redAccent,
duration: Duration(seconds: 2),
),
);
return false;
}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +325 to +327
if (_validateFields()) {
//navigate to next page
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 PAY button does nothing after successful validation

At lines 325-327, when _validateFields() returns true, the handler body is just a comment //navigate to next page with no actual implementation. The page was derived from SetPin (see lib/Payments/set_pin.dart) which has a full _handleSetPin method that calls the service and navigates. In EnterAmount, this was left empty — so a user who enters a valid amount and checks the consent box gets no response when tapping PAY. Additionally, _isLoading (line 18) is never set to true, so the loading state/disabled button logic at lines 322-355 can never activate.

Prompt for agents
In lib/Payments/enter_amount.dart, the PAY button's onTap handler at lines 324-328 needs a complete implementation. After _validateFields() returns true, the code should:
1. Set _isLoading to true via setState
2. Call the payment service (e.g., _services.makePayment with widget.qrdata, the parsed amount from _pinController.text, and any needed PIN)
3. Navigate to a success or failure page based on the result
4. Handle errors with appropriate SnackBar messages
5. Set _isLoading back to false in a finally block

Refer to lib/Payments/set_pin.dart's _handleSetPin method (around line 96) for the established pattern of handling async service calls with loading state in this codebase.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant