Implement User Failure Handling in InfinitePay Dashboard Flutter

Enhance infinitepay-dashboard with robust failure handling and multilingual support for user onboarding.

Workflow Stage:
Media Type & Category:
Use Case
Save Prompt
Prompt Saved

Overview

This prompt guides developers in enhancing the infinitepay-dashboard-flutter repository by implementing a new failure handling system. Programmers working on this project will benefit from clear instructions and structured output requirements.

Prompt Overview

Purpose: This implementation aims to enhance user onboarding by handling specific failure scenarios effectively.
Audience: Developers working on the infinitepay-dashboard-flutter repository will benefit from improved error management.
Distinctive Feature: The new `PepPersonFailure` class introduces localized error messages for politically exposed persons.
Outcome: Users will receive clear feedback during onboarding, improving overall user experience and compliance.

Quick Specs

Variables to Fill

No inputs required — just copy and use the prompt.

Example Variables Block

No example values needed for this prompt.

The Prompt


In the infinitepay-dashboard-flutter repository, expand functionality by implementing a new failure and its handling across multiple files and languages.
## Steps
1. Create User Failure
– Open the file:
`create_user_failure.dart`
in the `shared_onboarding` package.
– Create a new failure class named:
`PepPersonFailure`.
2. Map the Failure
– Add a case for:
`PepPersonFailure`
in the file:
`create_user_exception_mapper.dart`.
– Ensure it matches a 422 status code with response code:
`12`.
3. UI Error Handling
– Modify:
`OnboardingErrorsFactory`
in:
`app/lib/featuresonboarding/presentation/ui_errors`.
– Add error messages for the new failure:
– EN:
– Title: “Hey, politically exposed person”
– Message: “This CPF belongs to a politically exposed person and we don’t allow creating accounts for people like that.”
– PT:
– Title: “Ei, pessoa politicamente exposta”
– Message: “Esse CPF pertence a uma pessoa politicamente exposta e não permitimos a criação da conta de pessoas assim.”
4. Localize Messages
– Add these messages to the `.arb` files within the app folder.
– Execute:
`flutter pub run intl_utils:generate`
to generate localized files.
5. Unit Testing
– Create or update unit tests for all modified or newly created classes.
## Output Format
Describe the changes made, including any relevant file paths and code snippets. Detail the test case setup and results in a structured format.
## Notes
– Adhere to existing coding standards and project guidelines.
– Ensure multilingual support is implemented correctly as per `.arb` file settings.

Screenshot Examples

How to Use This Prompt

  1. Copy the prompt provided above.
  2. Open your preferred code editor for the project.
  3. Follow the steps outlined in the prompt sequentially.
  4. Implement changes in the specified files and locations.
  5. Test your changes thoroughly for functionality.
  6. Document your changes and results as instructed.

Tips for Best Results

  • Create User Failure: Implement the `PepPersonFailure` class in `create_user_failure.dart` within the `shared_onboarding` package.
  • Map the Failure: Update `create_user_exception_mapper.dart` to handle `PepPersonFailure` with a 422 status code and response code 12.
  • UI Error Handling: Modify `OnboardingErrorsFactory` to include English and Portuguese error messages for `PepPersonFailure`.
  • Unit Testing: Create or update unit tests for the new failure class and error handling to ensure proper functionality.

FAQ

  • What is the new failure class created?
    The new failure class created is named `PepPersonFailure` in `create_user_failure.dart`.
  • Where is the failure mapped?
    The failure is mapped in `create_user_exception_mapper.dart` with a 422 status code.
  • What messages were added for UI error handling?
    Messages for politically exposed persons were added in English and Portuguese in `OnboardingErrorsFactory`.
  • How are messages localized in the app?
    Messages are added to `.arb` files and localized using `flutter pub run intl_utils:generate`.

Compliance and Best Practices

  • Best Practice: Review AI output for accuracy and relevance before use.
  • Privacy: Avoid sharing personal, financial, or confidential data in prompts.
  • Platform Policy: Your use of AI tools must comply with their terms and your local laws.

Revision History

  • Version 1.0 (February 2026): Initial release.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Used Prompts

Related articles

AI Powered Web Development Portfolio with React PHP Bootstrap and DBMS Integration

Learn to build a dynamic portfolio that showcases full-stack development skills.

AI Wallet Finder Program with Authentication and Security

Ensure secure and user-friendly wallet tracking with reliable authentication features.

Determine Movie Ticket Cost by Age Conditional Logic Guide

Discover the perfect movie ticket price based on age with our easy-to-use

Create a 3D Robot Slum Simulation with Three.js for Developers

Embark on a neon-lit journey through Sector Zero's dystopian robot slum in