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

Flutter widgets and extensions for the flutter_gate policy and feature flag system.

flutter_gate #

Flutter widgets and extensions for the flutter_gate policy and feature flag system.

Part of the flutter_gate monorepo. Re-exports flutter_gate_core.

Installation #

dependencies:
  flutter_gate: ^0.1.0

Usage #

import 'package:flutter_gate/flutter_gate.dart';

void main() {
  gate.policy<Post>(() => PostPolicy());
  gate.define(const DarkModeFeature());
  runApp(const MyApp());
}
Can(
  ability: 'update',
  user: userId,
  model: post,
  child: EditButton(),
)

FeatureGuard<DarkModeFeature>(
  child: DarkPanel(),
)

Widgets #

  • Can / Cannot — authorization guards
  • FeatureGuard / FeatureGuardAsync — feature toggles
  • FeatureValue / FeatureValueAsync — read feature values in UI
  • BuildContext extensions — context.can(), context.featureEnabled()

Documentation #

0
likes
140
points
24
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Flutter widgets and extensions for the flutter_gate policy and feature flag system.

Repository (GitHub)
View/report issues

Topics

#authorization #feature-flags #widget #policy

License

MIT (license)

Dependencies

flutter, flutter_gate_core

More

Packages that depend on flutter_gate