WithFeature<TFeature> constructor
WithFeature<TFeature> ({
- Key? key,
- required TFeature feature,
- bool? isLicensed,
- required Widget child,
- ValueSetter<
FeatureDescriptor< ? onFeatureTap,TFeature> > - bool withBanner = false,
- DecorationBuilder<
FeatureDescriptor< ? bannerDecorationBuilder,TFeature> > - Decoration? notLicensedDecoration,
Implementation
WithFeature({
Key? key,
required TFeature feature,
bool? isLicensed,
required this.child,
ValueSetter<FeatureDescriptor<TFeature>>? onFeatureTap,
this.withBanner = false,
this.bannerDecorationBuilder,
this.notLicensedDecoration,
}) : super(key: key) {
final featureDescriptor = LicenseController.instance.getFeature(feature);
this.feature = featureDescriptor as FeatureDescriptor<TFeature>;
final controller = LicenseController.instance as LicenseController<dynamic, TFeature>;
_onFeatureTap = onFeatureTap ?? controller.onFeatureTap;
this.isLicensed = isLicensed ?? controller.isLicensed(this.feature.license);
}