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

  1. Fix the lint errors
  2. Use dart_fix to fix the lint errors
  3. Use the attached style guide to fix the lint errors
  4. Make sure all functions use snake_case naming style

Refactoring for performance optimization

Optimize this code for performance

Refactoring to implement a design pattern

  1. What design patterns could improve this code? Don't show me code examples.
  2. 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

  1. 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

  1. /tests Generate unit tests for this code. Validate both success and failure, and include edge cases.
  2. /tests Create a unit test to ensure the service is called correctly. Mock the service object.
  3. 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.