state/mp_state library

Classes

MiniProgramLiveStatePolicy
Host-owned memory limits for one active mini-program state namespace.
MiniProgramLiveStatePolicyProvider
Supplies per-mini-program live-state policy to the runtime host.
MpRouter
Lightweight router facade used by Mp JSON actions.
MpStateManager
Typed facade around MpStore owned by a mini-program host instance.
MpStore
In-memory state store for one active mini-program host instance.

Functions

validateStateKey(String key) String
Validates and normalizes an Mp state key.

Typedefs

MpRouterPopToScreenHandler = Future<HostActionResult> Function(String screenId, Map<String, dynamic> result, String? requestId)
MpRouterResultHandler = Future<HostActionResult> Function(Map<String, dynamic> result, String? requestId)
MpRouterScreenHandler = Future<HostActionResult> Function(String screenId, Map<String, dynamic> result, String? requestId)

Exceptions / Errors

MiniProgramStateLimitException
Raised when a live-state write would exceed host-owned limits.