unleash 0.0.1 copy "unleash: ^0.0.1" to clipboard
unleash: ^0.0.1 copied to clipboard

outdated

A dart client for unleash

Pub GitHub Workflow Status Code Coverage

Unleash Client SDK for Dart and Flutter #

This is the Unleash Client SDK for Dart. It is compatible with the Unlesah-hosted.com SaaS offering and Unleash Open-Source. It also works with GitLab Feature Flags.

Getting started #

First, you will need to add unleash to your pubspec.yaml:

dependencies:
  unleash: 0.0.1 # use the latest version found on pub.dev

Then, run flutter packages get in your terminal.

Create a new Unleash instance #

It is easy to get a new instance of Unleash. In your app you typically just want one instance of Unleash, and inject that where you need it.

To create a new instance of Unleash you need to pass in a config object:

import 'package:unleash/unleashdart.dart';

Future<void> main() async {
  await Unleash.init(
    UnleashSettings(
      appName: '<your_app_name_here>',
      instanceId: '<your_instanceId_here>',
      unleashApi:
          Uri.parse('https://example.org/api'),
    ),
  );
  print(Unleash.isEnabled('AwesomeFeature'));
}

Awesome feature toggle API #

It is really simple to use unleash.

if(Unleash.isEnabled("AwesomeFeature")) {
  //do some magic
} else {
  //do old boring stuff
}

Calling Unleash.isEnabled("AwesomeFeature") is the equivalent of calling Unleash.isEnabled("AwesomeFeature", false). Which means that it will return false if it cannot find the named toggle.

If you want it to default to true instead, you can pass true as the second argument:

Unleash.isEnabled("AwesomeFeature", true);

Current state of development #

This SDK currently does not support any strategies, metrics reporting or anything else. It just gets the feature toggels yet.

20
likes
0
pub points
81%
popularity

Publisher

verified publishergetunleash.io

A dart client for unleash

Homepage

License

unknown (LICENSE)

Dependencies

http, meta

More

Packages that depend on unleash