Skip to main content

fluttertest_ai 0.2.1 copy "fluttertest_ai: ^0.2.1" to clipboard
fluttertest_ai: ^0.2.1 copied to clipboard

A local-first CLI that analyzes Flutter apps and generates conservative, runnable tests without an API key.

example/README.md

FlutterTest AI Example #

This example demonstrates how to use FlutterTest AI to analyze a Flutter project and generate tests.

Getting Started #

  1. Install FlutterTest AI (if not already installed):
dart pub global activate fluttertest_ai
  1. Navigate to a Flutter project:
cd path/to/your/flutter_project
  1. Run the commands:
# Verify your environment
fluttertest-ai doctor

# Analyze the project
fluttertest-ai analyze

# Generate tests
fluttertest-ai generate

# Run the generated tests
fluttertest-ai run

# Fix any failing tests
fluttertest-ai fix

# Generate reports
fluttertest-ai report

What Gets Generated #

Generated test paths mirror the source path under lib/, moved under test/. Unit tests are suffixed _test.dart; widget tests are suffixed _widget_test.dart. For example:

  • lib/counter.dart -> test/counter_widget_test.dart (widget test)
  • lib/core/validators.dart -> test/core/validators_test.dart (unit test)

After running fluttertest-ai generate, you'll find new test files in the test/ directory:

test/
├── counter_widget_test.dart      # Widget test for the widget(s) in lib/counter.dart
└── core/
    └── validators_test.dart      # Unit tests for lib/core/validators.dart

Each generated file includes:

  • A header identifying it as generated by FlutterTest AI
  • A confidence score for the generated tests
  • An ownership marker for safe refresh and repair

Example Output #

Analyzing Flutter project...
State management: setState (85% confidence)
  behavior: setState() called in 1 file(s)
  class inheritance: _MyHomePageState extends State

Generating tests...
✓ test/counter_widget_test.dart

Running generated tests...
✓ 1 passed

Next Steps #

  • Review the generated tests before using them in production
  • Run fluttertest-ai fix to automatically repair common failures
  • Run fluttertest-ai report to generate Markdown and JSON reports
  • Use --dry-run to preview what would be generated without writing files
  • Use --force to refresh previously generated tests

Learn More #

1
likes
0
points
599
downloads

Documentation

Documentation

Publisher

unverified uploader

Weekly Downloads

A local-first CLI that analyzes Flutter apps and generates conservative, runnable tests without an API key.

Repository (GitHub)
View/report issues

Topics

#flutter #testing #cli #code-generation #automation

License

unknown (license)

Dependencies

analyzer, args, mason_logger, path, yaml

More

Packages that depend on fluttertest_ai