varioqub_configs 0.7.1 copy "varioqub_configs: ^0.7.1" to clipboard
varioqub_configs: ^0.7.1 copied to clipboard

Flutter plugin providing work with remote configs, experiments and A/B testing via Varioqub

example/lib/main.dart

// ignore_for_file: public_member_api_docs

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:varioqub_configs/varioqub_configs.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final varioqub = VarioqubConfigs();
  await varioqub.build(
    BuildSettings(
      client: VarioqubClient.appmetrica(
        'XXXXXXX',
      ),
    ), //  your AppMetrica application ID
  );
  await varioqub.activateConfig();
  await varioqub.fetchConfig();

  runApp(
    MaterialApp(
      home: TestScreenWidget(
        varioqub: varioqub,
      ),
    ),
  );
}

class TestScreenWidget extends StatefulWidget {
  final VarioqubConfigs varioqub;

  const TestScreenWidget({
    required this.varioqub,
    super.key,
  });

  @override
  State<TestScreenWidget> createState() => TestScreenWidgetState();
}

class TestScreenWidgetState extends State<TestScreenWidget> {
  @override
  Widget build(final BuildContext context) => Scaffold(
        appBar: AppBar(
          title: const Text('Press button to print config'),
        ),
        body: Center(
          child: CupertinoButton.filled(
            onPressed: () async {
              debugPrint(
                await widget.varioqub.getString(
                  key: 'FLAG',
                  defaultValue: 'DEFAULT',
                ),
              );
            },
            child: const Text('Get config'),
          ),
        ),
      );
}
5
likes
160
pub points
64%
popularity

Publisher

verified publishermolchanovia.dev

Flutter plugin providing work with remote configs, experiments and A/B testing via Varioqub

Repository (GitHub)
View/report issues

Topics

#varioqub #configs #experiments

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on varioqub_configs