For the complete documentation index, see llms.txt. This page is also available as Markdown.

Premium Offers

The PremiumOffersWidget is a standalone, high performance UI component that becomes available immediately after SDK initialisation. It is designed to be highly flexible, allowing you to embed it anywhere in your application's widget tree.

Key Features:

  • More Offers: Seamlessly opens the full Offerwall.

  • Active Offers: Quick access to a user's currently active campaigns.

  • Campaign Details: Direct navigation to specific campaign records.

  • Play: Intelligent routing to activate the offer and redirect to appropriate app store.


1. Usage

Unlike the previous version, the widget is now a standalone class. You no longer need to call a method on the Tyrads instance or provide a BuildContext.

import 'package:tyrads_sdk/tyrads_sdk.dart';

class MyOffersPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Top Rewards')),
      body: SingleChildScrollView(
        child: Column(
          children: [
            // Standard integration, no parameters required
            const PremiumOffersWidget(), 
            
            // ... your other widgets
          ],
        ),
      ),
    );
  }
}

2. Customization Options

You can control the visual presentation of the offers using the widgetStyle parameter.

Parameter
Type
Default
Description

widgetStyle

PremiumWidgetStyles

.list

Determines the layout of the offers.

Available Styles:

  • PremiumWidgetStyles.list: Displays offers in a vertical list.

  • PremiumWidgetStyles.sliderCards: Displays offers in a horizontal, swipeable card carousel.

Option 1
Option 2

Example with Custom Style:


3. Technical Requirements

  • SDK Initialization: Ensure Tyrads.instance.init() and loginUser() have been called before the widget is rendered.

  • Global Navigation: The widget automatically leverages the navigatorKey provided during SDK initialization. No manual context passing is required.

Last updated