ctrlapp 0.1.0
ctrlapp: ^0.1.0 copied to clipboard
Remote kill-switch, feature flags, forced update, forms and inbox for Flutter, plus diagnostics, device-integrity checks, push permission and hosted login.
ctrlapp — Flutter SDK #
The remote control layer for your Flutter app. Turn off a broken feature in production in 5 seconds — no release, no review.
Install #
dependencies:
ctrlapp: ^0.1.0
flutter pub get
30-second quickstart #
import 'package:ctrlapp/ctrlapp.dart';
await CtrlApp.init(
apiKey: 'ck_pub_...',
baseUrl: 'https://ctrlapp.dev', // override for self-hosted
);
final c = CtrlApp.instance;
// 1. The kill-switch — works offline from local cache.
if (c.blocked()) return MaintenanceScreen(reason: c.blockReason());
// 2. Feature flag
if (c.flag('checkout_v2').isOn) return NewCheckout();
// 3. Remote copy / images / deep links
final label = c.text('cta_primary', 'Buy now');
final hero = c.image('hero_banner');
final url = c.link('promo_target');
// 4. Live updates + kill-switch changes
c.subscribe((map) => setState(() {}));
c.blockChanges.listen((b) => rerender());
Typed keys #
npx @ctrlapp/cli codegen --lang dart --out lib/ctrlapp_keys.dart
Requirements #
- Flutter ≥ 3.0, Dart ≥ 3.0
- iOS 12+, Android SDK 21+
More in this package #
Everything is one package, ctrlapp. Next to the main CtrlApp object there
are independent building blocks you can use on their own:
| Need | Use |
|---|---|
| Crash and error reporting (opt-in, redacted) | CtrlAppDiagnostics, CtrlAppHandlers, CtrlAppDebugOverlay |
| Jailbreak / root / emulator / debugger signals | CtrlAppIntegrity.detect() |
| Device model and OS details | CtrlAppDeviceInfo.detect() |
| Notification permission and push tokens | CtrlAppPush.requestPermission() |
| Re-check the kill-switch while the app is open | CtrlAppBlockWatch |
| Low-level client, transport and mock transport for tests | CtrlAppClient, HttpCtrlAppTransport, MockCtrlAppTransport |
| Hosted social login and app session | package:ctrlapp/auth.dart |
import 'package:ctrlapp/ctrlapp.dart';
final diagnostics = CtrlAppDiagnostics();
CtrlAppHandlers(diagnostics).install(); // chains FlutterError / platform handlers
final signals = await CtrlAppIntegrity.detect();
final status = await CtrlAppPush.requestPermission();
The login surface uses generic names (Loading, Offline, Expired, ...), so
it lives in its own library: import 'package:ctrlapp/auth.dart';
Docs & links #
- Full docs: https://ctrlapp.dev/docs
- Same API shape ships on JS, Kotlin, Swift and .NET.
- Report an issue: https://github.com/ctrlapp/ctrlapp/issues
Screen Capture Protection #
The per-app Screen Capture Protection dashboard switch is enforced on
Android in this release via
WindowManager.LayoutParams.FLAG_SECURE
on the attached Activity. The policy value is cached per-apiKey and
applied on cold start (before any network) so a killed feature stays
protected offline. iOS enforcement (masking on capture) is planned for a
following release; today the iOS side returns a safe no-op.
Ownership rule (Android): the plugin never clears a FLAG_SECURE
that the host app or another library already set — it only releases the
flag it added itself. Idempotent across attach / reattach / configuration
changes.
Caveats (Android): FLAG_SECURE also blocks Assistant screenshots,
some casting flows, and some accessibility / remote-support tools that
work via screen capture. Leave the setting off unless you need it.
MIT © CtrlApp