unleash_proxy 0.0.1+1 copy "unleash_proxy: ^0.0.1+1" to clipboard
unleash_proxy: ^0.0.1+1 copied to clipboard

outdated

Unleash Flutter Proxy SDK

Unleash Flutter Proxy SDK #

style: very good analysis Powered by Mason License: MIT

This library is meant to be used with the unleash-proxy. The proxy application layer will sit between your unleash instance and your client applications, and provides performance and security benefits. DO NOT TRY to connect this library directly to the unleash instance, as the datasets follow different formats because the proxy only returns evaluated toggle information.

Installation πŸ’» #

❗ In order to start using Unleash you must have the Flutter SDK installed on your machine.

Add unleash_proxy to your pubspec.yaml:

dependencies:
  unleash_proxy:

Install it:

flutter packages get

Usage #

To use the unleash_proxy to your Flutter application read the code example below:


import 'package:example/unleash_environment.dart';
import 'package:flutter/material.dart';

/// Import package here
import 'package:unleash_proxy/unleash_proxy.dart';

Future<void> main() async {
  /// Initialize unleash client here
  await Unleash.initializeApp(
    config: UnleashEnvironment.config,
    context: UnleashEnvironment.context,
  );

  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Unleash Demo',
      theme: ThemeData(
        primarySwatch: Colors.purple,
      ),
      home: const UnleashPage(),
    );
  }
}

class UnleashPage extends StatefulWidget {
  const UnleashPage({super.key});

  @override
  State<UnleashPage> createState() => _UnleashPageState();
}

class _UnleashPageState extends State<UnleashPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Unleash Page'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'Toggle Status',
              style: TextStyle(height: 2.5, fontWeight: FontWeight.w500),
            ),
            toggleStatus(),
          ],
        ),
      ),
    );
  }

  Widget toggleStatus() {
    /// Call [isEnabled] to get the toggle value
    final status = Unleash.isEnabled(ToggleKeys.experiment);

    return Text(status == true ? 'Enabled' : 'Disabled');
  }
}


Can check the example here

Continuous Integration πŸ€– #

Unleash Flutter Proxy SDK comes with a built-in GitHub Actions workflow powered by Very Good Workflows but you can also add your preferred CI/CD solution.

Out of the box, on each pull request and push, the CI formats, lints, and tests the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses Very Good Analysis for a strict set of analysis options used by our team. Code coverage is enforced using the Very Good Workflows.


Running Tests πŸ§ͺ #

For first time users, install the very_good_cli:

dart pub global activate very_good_cli

To run all unit tests:

very_good test --coverage

To view the generated coverage report you can use lcov.

# Generate Coverage Report
genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
open coverage/index.html

Issues #

Please file any issues, bugs or feature requests as an issue on the GitHub page. Commercial support is available, you can contact me at rizentium@gmail.com.

Author #

This unleash_proxy plugin for Flutter is developed by Arif Hidayat.

1
likes
0
points
3
downloads

Publisher

unverified uploader

Weekly Downloads

Unleash Flutter Proxy SDK

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, flutter, http, uuid

More

Packages that depend on unleash_proxy