easy_mock_system_channel 0.1.0 copy "easy_mock_system_channel: ^0.1.0" to clipboard
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/textinput is left to the framework's TestTextInput, 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 / … or channel(name) — override with .when(...), assert with .verify(...).
0
likes
140
points
120
downloads

Documentation

API reference

Publisher

verified publisherahmedomar.com.ly

Weekly Downloads

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 defaults (each method returns null and is recorded) so they never reach the real platform — override and verify per channel. Uses the correct codec per channel; no extra dependencies.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

easy_mock_channel, flutter, flutter_test

More

Packages that depend on easy_mock_system_channel