winr_flutter_sdk library
WINR Flutter SDK
A sweepstakes and engagement SDK for Flutter applications.
This SDK provides:
- Daily streak engagement system (V2 auto-open bottom-drawer experience)
- Email capture and age verification
- Push notification support
- Analytics integration
- GDPR / RTD compliance features
Example usage:
import 'package:winr_flutter_sdk/winr_flutter_sdk.dart';
// Configure the SDK with user (call once at app launch)
await WINR.configure(WINRConfiguration(
apiKey: 'winr_live_xxxxxxxxxx',
environment: WINREnvironment.production,
bundleId: 'com.example.myapp',
user: WINRUser(
id: 'user123',
firstName: 'Jane',
lastName: 'Doe',
),
));
// Attach the SDK navigator key so the experience can auto-open on the
// first app-open of the day (the experience presents itself; there is
// no manual launch API):
MaterialApp(navigatorKey: WINR.navigatorKey, ...);
Classes
- AnalyticsAdapter
- Abstract interface for analytics tracking.
- DailyEntryGrant
- Represents the entries granted to a user for a daily claim.
- Giveaway
- Represents a giveaway configuration from the backend.
- GiveawayWinner
-
The most recent drawn winner for a giveaway chain (mirrors iOS
GiveawayWinner). Drives the "WE HAVE A WINNER!" banner + modal. - MilestoneConfig
-
Milestone accelerator configuration from the giveaway (mirrors iOS
MilestoneConfigAPI): after day, every subsequent day earns an extra bonusEntries per day. -
Result<
T, E> - Simple Result type for error handling.
- StreakConfig
- Configuration for the three-tier streak system.
- StreakEngine
- Implementation of the three-tier streak system.
- StreakEngineProtocol
- Protocol for streak calculation logic.
- StreakState
- Represents the current state of a user's engagement streaks.
- WINR
- Main entry point for the WINR Flutter SDK.
- WINRAnalyticsEvents
- Built-in analytics events tracked by the WINR SDK.
- WINRBranding
- Defines the visual branding and theme for the WINR SDK.
- WINRConfiguration
- Required configuration for the WINR SDK.
- WinrEmailCaptureCopy
- Email-capture screen copy. V2 hardcodes the design and only honors the consent line, but the field is namespaced with the rest of the screen's copy so the backend contract matches the other WINR SDKs.
- WinrExperienceConfig
-
Server-driven experience behavior flags (mirrors iOS
ExperienceConfig). - WINROptions
- Optional behavior toggles for the WINR SDK.
- WINRPushNotificationManager
- Manages push notification token registration with the WINR backend.
- WinrSdkBranding
- Publisher branding config — only the V2 publisher-configurable bits.
- WinrSdkConfig
-
Typed view over the server-driven
sdkConfigpayload (mirrors the iOS SDK'sSDKConfigResponse/ExperienceConfigin WINRAPI.swift). - WinrSdkCopy
-
Server-driven copy overrides (mirrors the iOS SDK's
SDKCopyConfig). - WINRUser
- Represents a user within the WINR system.
Enums
- GiveawayPeriod
- Available giveaway duration types.
- LoggingLevel
- Logging levels for SDK debug output.
- WINREnvironment
- Defines the target environment for the WINR SDK.
- WINRError
- Represents errors that can occur within the WINR SDK.
Exceptions / Errors
- WINRException
- Exception wrapper for WINRError that can be thrown and caught.