feature_flutter

Last updated:

0 purchases

feature_flutter Image
feature_flutter Images
Add to Cart

Description:

feature flutter

feature_flutter #
Important note: We recommend that you read about the feature_core package before using it.
Usage #
With the feature_flutter package you can integrate features into the Flutter application.
The package provides three main widgets: FeaturesProvider, FeatureWidget, DebugFeaturesWidget.
FeaturesProvider
Passes the manager down the tree.
void main() {
final FeaturesManager featuresManager = FeaturesManager(...);

runApp(MaterialApp(
home: FeaturesProvider(
manager: featuresManager,
),
...
));
}
copied to clipboard
FeatureWidget
Allows you to show/hide widgets depending on the value of a feature.
You can use a simplified variant
FeatureWidget(
feature: featuresManager.getFeature('feature_key'),
child: Text(
'child when feature: has 'false' value,'
'OR is disabled OR not found in manager',
),
activatedChild: Text(
'child when feature found in manager AND is enabled.'
),
visible: true, // default, totally shows/hides widget
)
copied to clipboard
Or you can handle feature values more flexibly through the builder.
Important note: By default, if the bilder returns nothing, an empty SizedBox is used.
FeatureWidget.builder(
feature: featuresManager.getFeatureByType<SomeFeature>(),
builder: (BuildContext context, Feature? feature) {
if (feature == null) {
return // your widget here
}
if (feature.enabled) {
return // your widget here
}
},
)
copied to clipboard
DebugFeaturesWidget
Just a handy widget which depends on the manager and gives access to enable/disable features.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.