NyMockChannels class

Auto-mocking for common Flutter platform channels used in Nylo.

This class sets up mock handlers for:

  • flutter_timezone
  • flutter_local_notifications
  • path_provider
  • flutter_secure_storage
  • sqflite

Example:

NyMockChannels.setup();
// Now all platform channels are mocked

// Override specific behavior:
NyMockChannels.overridePathProvider('/custom/path');

Constructors

NyMockChannels()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

documentsPath → String
Get current mocked documents path.
no setter
isSetup → bool
Check if channels are set up.
no setter
temporaryPath → String
Get current mocked temporary path.
no setter
timezone → String
Get current mocked timezone.
no setter

Static Methods

clearSecureStorage() → void
Clear secure storage.
getSecureStorage() → Map<String, String>
Get secure storage contents (for assertions).
overridePathProvider({String? documentsPath, String? temporaryPath, String? applicationSupportPath, String? libraryPath, String? cachePath}) → void
Override path provider paths.
overrideTimezone(String timezone) → void
Override timezone.
reset() → void
Reset all mocks to default values.
setSecureStorageValue(String key, String value) → void
Pre-populate secure storage.
setup() → void
Setup all mock channels.
tearDown() → void
Teardown all mock channels.