render static method

bool render({
  1. required BuildContext context,
  2. required String campaignId,
  3. required String type,
  4. required Map<String, dynamic> config,
  5. required LifecycleListener listener,
})

Dispatch entrypoint — routes a campaign's type to the right renderer. Returns true when the type was recognised.

Implementation

static bool render({
  required BuildContext context,
  required String campaignId,
  required String type,
  required Map<String, dynamic> config,
  required LifecycleListener listener,
}) {
  switch (type) {
    case 'carousel_cards':
      return CarouselCardsRenderer.show(
          context: context, campaignId: campaignId, config: config, listener: listener);
    case 'sticky_bar':
      return StickyBarRenderer.show(
          context: context, campaignId: campaignId, config: config, listener: listener);
    case 'progress_bar':
      return ProgressBarRenderer.show(
          context: context, campaignId: campaignId, config: config, listener: listener);
    case 'coachmark_tour':
      return CoachmarkTourRenderer.show(
          context: context, campaignId: campaignId, config: config, listener: listener);
    case 'product_recommendation':
      return ProductRecommendationRenderer.show(
          context: context, campaignId: campaignId, config: config, listener: listener);
    default:
      return false;
  }
}