koolbase_flutter 1.0.0 copy "koolbase_flutter: ^1.0.0" to clipboard
koolbase_flutter: ^1.0.0 copied to clipboard

Flutter SDK for Koolbase — feature flags, remote config, and version enforcement for mobile apps.

koolbase_flutter #

Flutter SDK for Koolbase — feature flags, remote config, and version enforcement for mobile apps.

Installation #

dependencies:
  koolbase_flutter: ^1.0.0

Setup #

Initialize the SDK before runApp():

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Koolbase.initialize(KoolbaseConfig(
    publicKey: 'pk_live_xxxx',  // From your Koolbase dashboard
    baseUrl: 'https://api.koolbase.com',
  ));

  runApp(MyApp());
}

Feature Flags #

if (Koolbase.isEnabled('new_checkout')) {
  // show new checkout
}

Remote Config #

final timeout = Koolbase.configInt('swap_timeout_seconds', fallback: 30);
final url = Koolbase.configString('api_base_url', fallback: 'https://api.example.com');
final debugMode = Koolbase.configBool('debug_mode', fallback: false);

Version Enforcement #

final result = Koolbase.checkVersion();

switch (result.status) {
  case VersionStatus.forceUpdate:
    // Block the app — show update screen
    break;
  case VersionStatus.softUpdate:
    // Show a banner
    break;
  case VersionStatus.upToDate:
    // All good
    break;
}

How It Works #

  1. On first launch, the SDK generates a stable anonymous device UUID stored in secure storage
  2. On init, the cached payload loads instantly — no network wait
  3. A fresh bootstrap payload is fetched in the background
  4. Flag evaluation happens locally using stableHash(deviceId + ":" + flagKey) % 100
  5. The payload refreshes on a configurable interval (default 60s)
  6. If the network is unavailable, the last cached payload is used

Rollout Bucketing #

Rollout decisions are made locally by the SDK, not the server. This means:

  • The bootstrap response is identical for all devices (CDN cacheable)
  • The same device always gets the same flag result (stable)
  • Evaluation works offline
// This is what happens internally
final bucket = stableHash('$deviceId:$flagKey') % 100;
final enabled = bucket < flag.rolloutPercentage;
8
likes
0
points
536
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter SDK for Koolbase — feature flags, remote config, and version enforcement for mobile apps.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, flutter, flutter_secure_storage, http, package_info_plus, shared_preferences, uuid

More

Packages that depend on koolbase_flutter