testing library
Test doubles for apps that use flutter_device_ai.
FlutterDeviceAiPlatform.instance = FakeOnDeviceAiPlatform(
responder: (prompt, history) => 'Echo: $prompt',
);
Classes
- FakeOnDeviceAiEmbedder
- Deterministic embedder for tests: hashes words into a fixed-size bag-of-words vector, so texts sharing words score as similar. It is a test double, not a language model; never ship it.
- FakeOnDeviceAiPlatform
- In-memory platform implementation for unit and widget tests.
- FakeSession
- State of one fake conversation.