The documentation has been moved to the WinWinKit
website.
Installation
Add the dependency from the GitHub repository and pin it to the latest release tag:flutter pub get (or dart pub get for pure Dart projects).
Initialize the client
WinWinKit builds on dio and exposes the underlying client as sdk.dio. You can provide your own Dio instance, override the API base URL (for staging environments), or add interceptors such as request logging.
Using the APIs
All methods return aFuture<Response<T>>. The deserialized model lives under response.data.
Each snippet instantiates a new client for clarity—reuse a single WinWinKit instance in your app to share Dio configuration.
Create or update a user
For automatic updates of the
is_premium flag, enable integration with
RevenueCat. To do this, go to your project in
WinWinKit and navigate to Settings -> Integrations page.Retrieve a user
Claim a referral, promo, or affiliate code
claimResponse.data?.data?.rewardsGranted contains the rewards granted to the user, grouped by reward type.
Withdraw credits for a user
Fetch an App Store Offer Code
Error handling
dio throws a DioException when the request fails or the response cannot be deserialized. Inspect error.response?.statusCode and error.response?.data for details returned by WinWinKit.
User Interface
The SDKs provide interface for interacting with WinWinKit APIs, but not the UI. Thus you need to build the user interface for the referral feature in your app. We plan to provide UI with the SDK in the future. Please let us know if that is your requirement to get started.Requirements
- Dart 2.18.0+
- Flutter 3.3 or newer
dio5.7.x (pulled in automatically)
Check out the SDK on GitHub