flutter-add-widget-test
Installation
SKILL.md
Writing Flutter Widget Tests
Contents
- Setup & Configuration
- Core Components
- Workflow: Implementing a Widget Test
- Interaction & State Management
- Examples
Setup & Configuration
Ensure the testing environment is properly configured before authoring widget tests.
- Add the
flutter_testdependency to thedev_dependenciessection ofpubspec.yaml. - Place all test files in the
test/directory at the root of the project. - Suffix all test file names with
_test.dart(e.g.,widget_test.dart).
Core Components
Utilize the following flutter_test components to interact with and validate the widget tree: