unleash 0.3.0
unleash: ^0.3.0 copied to clipboard

A dart client for Unleash. Unleash is a simple and easy to use feature toggle (feature flag) service.

example/example.dart

import 'dart:async';

import 'package:unleash/unleash.dart';

Future<void> main() async {
  final unleash = await Unleash.init(
    UnleashSettings(
      appName: 'debug',
      instanceId: 'Q8XiLix59zo2NytFGd1b',
      unleashApi:
          Uri.parse('https://gitlab.com/api/v4/feature_flags/unleash/18585314'),
    ),
    onUpdate: () {
      print('refreshed feature toggles');
    },
  );
  print(unleash.isEnabled('awesome_feature'));
  // wait some time so that toggles can be polled a few times
  // and dispose unleash at the end of it
  Timer(
    const Duration(seconds: 60),
    unleash.dispose,
  );
  print('finished');
}
2
likes
130
pub points
59%
popularity

Publisher

uekoetter.dev

A dart client for Unleash. Unleash is a simple and easy to use feature toggle (feature flag) service.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

http, meta, path

More

Packages that depend on unleash