WithFeature<TFeature> constructor

WithFeature<TFeature>({
  1. Key? key,
  2. required TFeature feature,
  3. bool? isLicensed,
  4. required Widget child,
  5. ValueSetter<FeatureDescriptor<TFeature>>? onFeatureTap,
  6. bool withBanner = false,
  7. DecorationBuilder<FeatureDescriptor<TFeature>>? bannerDecorationBuilder,
  8. 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);
}