QuickStrt
Improving variable names
Improve the variable names in this function
Avoiding sequential conditional checks
Simplify this code. Avoid using if/else chains but retain all function return values.
Reducing nested logic
Rewrite this code to avoid the nested if/else statements
Splitting up large methods
How could the XXX method be refactored to be more useful and easier to maintain
Fix lint error
- Fix the lint errors
- Use dart_fix to fix the lint errors
- Use the attached style guide to fix the lint errors
- Make sure all functions use snake_case naming style
Refactoring for performance optimization
Optimize this code for performance
Refactoring to implement a design pattern
- What design patterns could improve this code? Don't show me code examples.
- Refactor this code using the module pattern
Decoupling business logic from UI components
Use ViewModel to separate the bussiness code from the Widget/State in this code.
Handling cross-cutting concerns
@workspace Refactor this project by using AOP to avoid logging that has cross-cutting concerns
Translating code to a different programming language
- Tell me how I can convert this languageA code to languageB. The functionality and output of the new code should be exactly the same as the existing one. Also tell me how to run the new file.
Generating unit tests
- /tests Generate unit tests for this code. Validate both success and failure, and include edge cases.
- /tests Create a unit test to ensure the service is called correctly. Mock the service object.
- Using flutter_test, generate an e2e test to ensure the app displays correctly.
Updating unit tests to match code changes
Given the update to this code, update the unit tests that may fail or become outdated as a result.