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

Generic configuration management system for Flutter apps (feature flags + remote config + local storage)

tool_config #

Feature flag system with remote configuration support.

Overview #

Provides runtime feature toggles for:

  • Module-specific features
  • App-level features
  • Remote configuration (Firebase)
  • Local overrides

Core Concepts #

FeatureName #

Interface for defining feature enums:

enum ChatFeatureName implements FeatureName {
  stickers,
  quickActions,
}

FeaturesStateContract #

Contract for BLoC states with feature flags:

abstract class ChatState implements FeaturesStateContract {
  static List<ChatFeatureName> get supportedFeatureNames => [
    ChatFeatureName.stickers,
  ];

  const ChatState({
    required List<Feature> features,
  });

  factory ChatState.initial() => ChatState(
    features: supportedFeatureNames
        .map((e) => Feature.enabled(e))
        .toList(),
  );
}

Feature Checking #

// In UI
if (state.isFeatureEnabled(ChatFeatureName.stickers)) {
  return StickerButton();
}

// In BlocBuilder
BlocBuilder<ChatBloc, ChatState>(
  buildWhen: (prev, curr) => isFeatureChangesCondition(
    ChatFeatureName.stickers,
    prev,
    curr,
  ),
  builder: (context, state) => ...,
)

Feature Flags Repository #

// Fetch features from remote config
final features = await featureFlagsRepository.getFeatures([
  ChatFeatureName.stickers,
  ChatFeatureName.quickActions,
]);

// Update state
emit(state.copyWith(features: features));

Remote Configuration #

Features can be toggled remotely via Firebase Remote Config without app updates.

See Pattern 2: Module-Specific Feature Flags for complete integration guide.

0
likes
50
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

Generic configuration management system for Flutter apps (feature flags + remote config + local storage)

Homepage

License

MIT (license)

Dependencies

firebase_remote_config, flutter, flutter_localizations, freezed_annotation, get_it, intl, rxdart, tool_arch, tool_errors, tool_locale, tool_logger, tool_modularity, tool_network, tool_storage, tool_utils

More

Packages that depend on tool_config