dummy_api_overlay library

A Flutter package that provides a developer overlay to mock REST API responses during development — without touching your real networking code.

Quick start

  1. Wrap your app:
void main() {
  runApp(DummyApiOverlay(child: MyApp()));
}
  1. Use DummyHttpClient instead of http.Client:
final client = DummyHttpClient();
final res = await client.get(Uri.parse('https://api.example.com/users'));
  1. Or add DummyDioInterceptor to your Dio instance:
dio.interceptors.add(DummyDioInterceptor());
  1. Tap the floating API button in your app to manage mock rules.

Classes

DummyApiOverlay
Wraps your app's widget tree and injects a draggable overlay button that opens the mock rules manager screen.
DummyDioInterceptor
A Interceptor for Dio that intercepts requests matching any enabled MockRule and resolves with the configured dummy response.
DummyHttpClient
A drop-in replacement for http.Client that intercepts requests matching any enabled MockRule and returns the configured dummy response.
MockRule
MockRuleStore

Enums

HttpMethod

Extensions

HttpMethodX on HttpMethod