> For the complete documentation index, see [llms.txt](https://docs.wortise.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wortise.com/en/flutter-sdk/sdk-integration/rewarded.md).

# Rewarded

## Integration

&#x20;Below we show a simple example to understand how rewarded ads work:

```dart
import 'package:wortise/rewarded_ad.dart';

RewardedAd _rewardedAd;

// Create an interstitial
_rewardedAd = RewardedAd('Wortise Ad Unit ID', listener: (event, args) {
  // This listener will be invoked when an event happens
});

// Request an ad
await _rewardedAd.loadAd();

/* ... */

// Show the ad if available
if (await _rewardedAd.isAvailable) {
  await _rewardedAd.showAd();
}
```

The `RewardedAd` class constructor admits a third parameter, called `reloadOnDismissed`, that when it is set to `true` (the default value is `false`) allows the rewarded to automatically load a new ad when the current one is dismissed.

## **Listener events**

The assigned listener to an `RewardedAd` can receive the following events:

```dart
// The ad has been clicked
RewardedAdEvent.CLICKED
// The ad has been completed
// (the 'amount', 'label' y 'success' arguments are passed)
RewardedAdEvent.COMPLETED
// The ad has been dismissed
RewardedAdEvent.DISMISSED
// The ad could not be loaded
RewardedAdEvent.FAILED_TO_LOAD
// The ad could not be shown
RewardedAdEvent.FAILED_TO_SHOW
// The ad has generated an impression
RewardedAdEvent.IMPRESSION
// The ad has been loaded
RewardedAdEvent.LOADED
// The ad has generated revenue
RewardedAdEvent.REVENUE_PAID
// The ad has been shown
RewardedAdEvent.SHOWN
```

Below, we show a small example about how to obtain the reward once the ad has completed successfully:

```dart
(event, args) {
  if (event == RewardedAdEvent.COMPLETED) {
    int    amount  = args['amount'];
    String label   = args['label'];
    bool   success = args['success'];
    
    ...
  }
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wortise.com/en/flutter-sdk/sdk-integration/rewarded.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
