general_feature_flags 0.1.0 copy "general_feature_flags: ^0.1.0" to clipboard
general_feature_flags: ^0.1.0 copied to clipboard

A robust, multi-provider feature flag system for Flutter. Professional, extensible, and corporate-ready.

example/main.dart

import 'package:flutter/material.dart';
import 'package:general_feature_flags/general_feature_flags.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final flags = FeatureFlagsClient();

  // Initialize with a simple local provider
  await flags.initialize(
    providers: [
      LocalMapProvider({
        'new_feature': true,
        'header_color': '#FF5733',
        'items_count': 5,
      }),
    ],
    userId: 'user_123',
  );

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    final flags = FeatureFlagsClient();

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Feature Flags Example'),
          backgroundColor: Color(int.parse(
            flags.getString('header_color', defaultValue: '#2196F3').replaceAll('#', '0xFF'),
          )),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              if (flags.isEnabled('new_feature'))
                const Text('New Feature is Enabled! ✅')
              else
                const Text('New Feature is Disabled. ❌'),
              const SizedBox(height: 20),
              Text('Items to show: ${flags.getInt('items_count', defaultValue: 0)}'),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
47
downloads

Documentation

API reference

Publisher

verified publisherrivendev.app

Weekly Downloads

A robust, multi-provider feature flag system for Flutter. Professional, extensible, and corporate-ready.

Homepage
Repository (GitHub)
View/report issues

Topics

#feature-flags #remote-config #flutter #ab-testing

License

MIT (license)

Dependencies

collection, crypto, flutter, meta

More

Packages that depend on general_feature_flags