Installation
Add the dependency to your pubspec.yaml:
pubspec.yamlyaml
# pubspec.yaml
dependencies:
flutter:
sdk: flutter
perkox_flutter_sdk: ^1.1.0Implementation Example
main.dartdart
import 'package:flutter/material.dart';
import 'package:perkox_flutter_sdk/perkox_flutter_sdk.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
// 1. Initialize Perkox
PerkoxFlutterSdk.instance.init(
appId: "YOUR_APP_ID",
playerId: "USER_12345",
);
// 2. Set event listeners
PerkoxFlutterSdk.instance.onReward((reward) {
debugPrint("Reward received: ${reward['amount']} ${reward['status']}");
});
PerkoxFlutterSdk.instance.onClose(() {
debugPrint("Offerwall closed");
});
}
void _openOfferwall() {
// 3. Launch offerwall
PerkoxFlutterSdk.instance.show();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Perkox Flutter Demo')),
body: Center(
child: ElevatedButton(
onPressed: _openOfferwall,
child: const Text('Open Offerwall'),
),
),
),
);
}
}Android & iOS Permissions
The plugin automatically manages Android internet permissions and iOS modal view controller presentations.

