flutter-tester

Standardizes Flutter unit, widget, and integration tests with Given-When-Then templates and layer isolation rules.

Updated Jul 22, 2025
One-click install
npx skills add https://github.com/MichaelSolati/mkai --skill flutter-tester-michaelsolati
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flutter-tester
Source: https://github.com/MichaelSolati/mkai/tree/main/profiles/flutter/skills/flutter-tester
Command: npx skills add https://github.com/MichaelSolati/mkai --skill flutter-tester-michaelsolati

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Flutter developers frequently struggle with inconsistent test coverage, flaky tests, and incorrect mocking patterns when testing across different architectural layers, leading to missed bugs, wasted debugging time, and unreliable test suites.

Core Features & Use Cases

  • Layer-specific testing templates: Pre-built, isolated patterns for testing repositories, DAOs, services, Riverpod providers, and widgets with correct dependency mocking and setup.
  • Built-in best practice guardrails: Clear guidance to avoid common pitfalls like mocking providers directly, missing GetIt resets between tests, or using unstable widget finders that break on text changes.
  • Use Case: A developer working on a Flutter app with Riverpod state management and local SQLite storage can use this skill to write reliable provider tests that correctly override dependencies, widget tests for UI interactions, and DAO tests for database CRUD operations, all following consistent Given-When-Then structure.

Quick Start

Use the flutter-tester skill to write a complete set of isolated unit tests for your app's user repository, covering both successful data fetch and error handling scenarios.

Frequently Asked Questions about flutter-tester

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

FAQPage Schema
How do I write Flutter unit tests that don't become flaky when using GetIt and Riverpod?

Reliable Flutter unit tests require strict layer isolation and proper dependency resets. Using Given-When-Then templates and guardrails for resetting GetIt between tests prevents flaky suites and inconsistent coverage across architectural layers.

What is the correct way to test Riverpod providers without mocking them directly?

Correct Riverpod provider testing requires overriding dependencies rather than mocking providers directly. Applying layer isolation rules and mock setup patterns ensures provider tests follow best practices and avoid common architectural testing mistakes.

How do I set up in-memory databases for Flutter DAO testing with Mockito?

Flutter DAO testing with Mockito uses setup patterns for in-memory databases to isolate data layer logic. Pre-built templates for CRUD operations ensure consistent Given-When-Then structure across data access object tests without hitting real storage.

Can I use flutter_test widget testing patterns for apps using GetIt for dependency injection?

Yes, flutter_test widget testing works with GetIt but requires proper resets between tests to avoid state bleed. Guardrails for missing GetIt resets and layer-specific templates ensure widgets are tested with correct dependency mocking and stable finders.

Why does my Flutter widget test break when using unstable finders and how do I fix it?

Flutter widget tests break with unstable finders because they rely on text or attributes that change. Built-in best practice guardrails help avoid unstable widget finders, ensuring UI interaction tests remain robust against text changes.