flutter-testing-apps

Implements unit, widget, and integration tests for Flutter applications.

1|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/Wishtohear/bucket-water-oms --skill flutter-testing-apps-wishtohear
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: flutter-testing-apps
Source: https://github.com/Wishtohear/bucket-water-oms/tree/main/bucket-water-oms-admin-mobile/skills/flutter-testing-apps
Command: npx skills add https://github.com/Wishtohear/bucket-water-oms --skill flutter-testing-apps-wishtohear

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Flutter apps without a structured test suite suffer from regressions, untested ViewModels, and unverified platform channel behavior, making releases risky and debugging expensive. ## Core Features & Use Cases - Three-Layer Test Strategy: Guides implementation of unit tests for ViewModels and repositories, widget tests for views using WidgetTester and Finders, and integration tests via the integration_test package. - Architectural Testability: Enforces fakes-over-mocks patterns so repositories and services can be tested in isolation from HTTP clients and databases. - Plugin Testing Coverage: Combines Dart tests with native JUnit, XCTest, and GoogleTest suites to validate method channel communication across Android, iOS, Linux, and Windows. - Use Case: When adding a new booking feature to a Flutter app, follow the checklist to create fake repositories, unit-test the ViewModel, widget-test the screen, and run an end-to-end integration test on a device or Firebase Test Lab. ## Quick Start Write a complete test suite with unit, widget, and integration tests for my Flutter app's checkout feature.

Frequently Asked Questions about flutter-testing-apps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests for a Flutter ViewModel?▼

Write unit tests for ViewModels by injecting fake repository implementations instead of mocks, then assert on the exposed state. This tests UI logic without depending on Flutter libraries, HTTP clients, or databases.

How to run Flutter integration tests on a device?▼

Add the integration_test package, connect an Android or iOS device or emulator, then run flutter test integration_test/app_test.dart. For web targets, launch ChromeDriver and use flutter drive with the chrome device flag.

Should I use mocks or fakes when testing Flutter repositories?▼

Prefer Fake implementations of repositories over mocking libraries when testing ViewModels and views. Fakes provide well-defined inputs and outputs, making tests more maintainable and less coupled to implementation details.

How do I test Flutter plugin platform channels?▼

Combine Dart unit tests that mock the platform channel with native tests: JUnit in android/src/test, XCTest in example/ios/RunnerTests, and GoogleTest for Linux and Windows. Add at least one integration test per channel call.

Why do Flutter integration tests fail on Linux CI?▼

Linux CI environments lack a display server, so tests fail without a windowing context. Invoke an X server using xvfb-run before executing flutter test with the linux device flag to provide the required display environment.