SDK
v2.0
v2.0
  • Getting Started
    • Welcome
    • Start Here
    • Postback Payout (S2S)
    • Advanced options
      • Sending Media Source Data
      • Sending User Segments / User Info
  • Unity
    • Installation
    • Initialization
    • Obtaining Adverstising ID's
  • Android
    • Prerequisite
    • Installation
    • Initialization
      • Deeplinking Routes
      • Premium Offers
    • Obtaining Adverstising ID's
  • Flutter
    • Prerequisite
    • Installation
    • Initialization
      • Deeplinking Routes
      • Premium Offers
      • changeLanguage
    • Obtaining Advertising ID's
  • REACT NATIVE
    • Prerequisites
    • Installation
    • Initialization
      • Deeplinking Routes
      • Premium Offers
    • Obtaining Advertising ID's
  • Web / Iframe
    • Initialization
    • Premium Widgets
  • Questions and troubleshooting
    • Reporting bugs
    • Known issues
    • Changelog
Powered by GitBook
On this page
  1. Flutter
  2. Initialization

Premium Offers

PreviousDeeplinking RoutesNextchangeLanguage

Last updated 2 months ago

This method returns a pre-built Flutter widget that displays a list of top offers. It provides several customization options to control the widget's appearance and behavior.

Tyrads.instance.topOffersWidget({
  bool showMore = true,
  bool showMyOffers = true,
  bool showMyOffersEmptyView = false,
  int widgetStyle = 1
})

Parameters:

  • showMore (bool, optional): Determines whether a "Show More" button is displayed at the bottom of the widget. This button typically navigates the user to a full screen of available offers. Defaults to true.

  • showMyOffers (bool, optional): Determines whether a section displaying the user's current/claimed offers is shown within the widget. Defaults to true.

  • showMyOffersEmptyView (bool, optional): If showMyOffers is true, this determines whether a special view is displayed when the user has no current offers. This view might include a prompt to explore available offers. Defaults to false.

  • widgetStyle (int, optional): An integer value that selects a pre-defined style for the widget. Different style values might change the widget's layout, color scheme, or other visual aspects. Defaults to 1.

Available Widget Style options

Return Value:

  • Widget: A Flutter Widget (specifically, a TopOffersWidget) that can be embedded in your application's UI.

Usage Example:

import 'package:tyrads_sdk/tyrads_sdk.dart';

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Offers')),
      body: Column(
        children: [
          Tyrads.instance.topOffersWidget(
            showMore: true,
            showMyOffers: true,
            widgetStyle: 2,
          ),
          // ... other widgets
        ],
      ),
    );
  }
}
Option 1
Option 2
Option 3
Option 4