easy_mock_system_channel 0.1.0
easy_mock_system_channel: ^0.1.0 copied to clipboard
Default test mocks for Flutter's SystemChannels, built on easy_mock_channel. Answers HapticFeedback / SystemChrome / SystemSound / Clipboard and the other framework method channels with sensible defau [...]
0.1.0 #
- Initial release.
mockSystemChannel.init()installs a default mock for every SystemChannels method channel (correct codec per channel; each method returns null and is recorded), auto-removed on teardown.- Seeded defaults:
Clipboard.hasStrings→{'value': false},getKeyboardState→{}. flutter/textinputis left to the framework'sTestTextInput, which owns it;init()relaxes the unmocked-channel guard on that channel so it can't fail while the handler is unregistered.- Per-channel access via
mockSystemChannel.platform/.navigation/.mouseCursor/ … orchannel(name)— override with.when(...), assert with.verify(...).