flipt_client 0.1.0-pre.3 copy "flipt_client: ^0.1.0-pre.3" to clipboard
flipt_client: ^0.1.0-pre.3 copied to clipboard

Flipt Client Evaluation SDK for Dart

Flipt Client Dart #

pub package

The flipt-client-dart library contains the Dart source code for the Flipt client-side evaluation client.

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  flipt_client: ^0.1.0
copied to clipboard

Then run dart pub get to install the package.

Supported Architectures #

This SDK currently supports the following OSes/architectures:

  • Linux x86_64
  • Linux arm64
  • MacOS x86_64
  • MacOS arm64

Important

This SDK currently only supports desktop platforms (MacOS and Linux). We are working on adding support for mobile platforms such as iOS and Android.

Usage #

import 'package:flipt_client/flipt_client.dart';

void main() {
  // Initialize the client
  final client = FliptEvaluationClient(
    'default',
    Options.withClientToken(
      'your-token',
      url: 'http://localhost:8080',
    ),
  );

  // Evaluate a variant flag
  final result = client.evaluateVariant(
    flagKey: 'flag1',
    entityId: 'someentity',
    context: {'fizz': 'buzz'},
  );

  print('Variant: ${result.variantKey}');

  // Evaluate a boolean flag
  final result = client.evaluateBoolean(
    flagKey: 'flag2',
    entityId: 'user123',
    context: {'key': 'value'},
  );

  print('Enabled: ${result.enabled}');

  // Don't forget to close the client when you're done
  client.close();
}
copied to clipboard

Authentication #

The FliptEvaluationClient supports the following authentication strategies:

Development #

To generate the JSON serialization code, run:

dart run build_runner build --delete-conflicting-outputs
copied to clipboard

Contributing #

Contributions are welcome! Please feel free to open an issue or submit a Pull Request.

License #

This project is licensed under the MIT License.

0
likes
0
points
79
downloads

Publisher

verified publisherflipt.io

Weekly Downloads

2024.10.08 - 2025.04.22

Flipt Client Evaluation SDK for Dart

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, json_annotation, path

More

Packages that depend on flipt_client