ctrlapp library
Classes
- CtrlApp
- CtrlAppBlock
-
Decision returned by
/sdk/v1/session. Cached locally so a killed or force-updated app stays blocked even when the user launches offline. - CtrlAppBlockWatch
- Re-checks the portal's kill-switch on an interval so a block applies to an app that is already open.
- CtrlAppClient
- The main client. Compose once per app; call dispose on teardown.
- CtrlAppConfig
- CtrlAppDebugOverlay
- CtrlAppDevice
- CtrlAppDeviceInfo
- Immutable hardware/OS descriptor returned by the native platform channel. available is true only when the native call actually ran and returned a payload; on failure all fields are null and available is false.
- CtrlAppDeviceReport
- CtrlAppDiagnostics
- CtrlAppDiagnosticsConfig
- CtrlAppHandlers
- CtrlAppInboxMessage
- CtrlAppInlineAd
- Put this inside a list or feed to show your inline ads ("Sponsored"). It is empty when there is no ad, so it is safe to leave in place.
- CtrlAppIntegrity
- CtrlAppIntegrityDecision
- CtrlAppIntegritySignals
- CtrlAppMessage
- CtrlAppMessageController
- What a design needs to react to a message. Your own builders receive one.
- CtrlAppMessageKinds
-
Message kinds the package draws.
pushandinboxare never drawn here. - CtrlAppMessageLabels
- Text used by the default designs. Pass your own (for example translated).
- CtrlAppMessageUi
- How messages look and behave. All fields are optional.
- CtrlAppPush
- CtrlAppReward
- What a rewarded ad gives for watching it to the end.
- CtrlAppState
- The portal's verdict for this device, as of checkedAt.
- CtrlAppTransport
- Abstract transport contract. Two implementations ship:
- CtrlAppTrigger
- "Show this only after the app reports event this many times."
- FlagEvaluation
- A feature flag evaluation result — value + reason for the exposure.
- FlutterSecureSessionStore
- SecureSessionStore backed by platform secure storage.
- HttpCtrlAppTransport
-
Real HTTP transport with a built-in package:http adapter.
Supply
httpSendonly when a custom adapter is needed. - InMemorySecureSessionStore
- Default in-memory store. NOT persistent. Suitable for tests and for the illustrative showcase; production apps MUST provide a real Keychain/Keystore-backed implementation.
- MobileSessionManager
- Coordinates access to the mobile app-session bearer.
- MockCtrlAppTransport
-
Deterministic in-process transport. Every response is watermarked
(
mock: truein the body) so a caller cannot mistake this for production. - PlatformSecureKeyValueStore
-
Contract for the underlying platform-secure keystore. Kept as a small
interface so this file has NO import on
package:flutter_secure_storage— the showcase wires the concrete plugin inFlutterSecureSessionStore.wire. - RefreshOutcome
- Result of a refresh attempt.
- SecureSessionStore
-
Abstract secure storage contract. Customers back this with
flutter_secure_storage(Keychain / Keystore) in production. - TransportResult
- Result of a single transport call. Never throws for non-2xx: callers pattern-match on ok and reasonClass.
Enums
- PushPermissionStatus
- SecureStorageFailure
- Reason class for a failed secure-storage call. Callers map this to a SDK ReasonClass without ever surfacing raw plugin messages.
Constants
-
kCtrlAppLifecycleEvents
→ const List<
String>
Functions
-
ctrlAppBucket01(
String input) → double -
ctrlAppParseColor(
String? hex) → Color? - "#RRGGBB", "RRGGBB" or "#AARRGGBB" -> a color, or null.
-
defaultHttpSend(
{required String method, required Uri url, Map< String, String> ? headers, String? body, Duration? timeout}) → Future<Map< String, dynamic> > - Built-in HTTP adapter. Redirects are disabled so SDK keys and session bearers cannot be forwarded to a different host. The timeout covers both sending the request and reading its entire response body.
-
redactShallow(
Map< String, dynamic> input) → Map<String, dynamic> - Redacts obviously-sensitive fields in a shallow map before egress. Keeps the SDK honest to the security invariants.
Typedefs
- CtrlAppInlineAdBuilder = Widget Function(BuildContext context, CtrlAppMessage message, VoidCallback onTap)
- Builds one inline ad card. Return the widget for the slot.
- CtrlAppMessageBuilder = Widget Function(BuildContext context, CtrlAppMessage message, CtrlAppMessageController controller)
-
DiagnosticBeforeSend
= Map<
String, Object?> ? Function(Map<String, Object?> event) - DiagnosticRedactor = Object? Function(Object? payload)