unleash
Unleash용 서버 사이드 Dart SDK입니다. Unleash는 오픈소스 기능 플래그 서비스입니다.
Unleash용 Dart 클라이언트
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Unleash
pub.dev GitHub Workflow Status Code Coverage Sponsoring
This is an unofficial Unleash Client SDK for Dart. It is compatible with the Unleash-hosted.com SaaS offering and Unleash Open-Source. It also works with GitLab Feature Flags.
First, you will need to add unleash to your pubspec.yaml:
dependencies:
unleash: x.y.z
# use the latest version found on pub.dev
Then, run flutter packages get in your terminal.
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/unleash.dart';
Future<void> main() async {
final unleash = await Unleash.init(
UnleashSettings(
appName: '<appname>',
instanceId: '<instanceid>',
unleashApi: Uri.parse('<api_url>'),
),
);
print(unleash.isEnabled('Awesome Feature'));
}
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", defaultValue: 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", defaultValue: true);
This client SDK supports version 4 of the API. This SDK currently does not support metrics reporting.
I'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me. By doing so, I will prioritize your issues or your pull-requests before the others.