adn_flutter_offerwall 1.0.2 copy "adn_flutter_offerwall: ^1.0.2" to clipboard
adn_flutter_offerwall: ^1.0.2 copied to clipboard

ADN Flutter Offerwall plugin project.

example/lib/main.dart

import 'dart:io' show Platform;
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:adn_flutter_offerwall/adn_flutter_offerwall_plugin.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initOfferWall();
  }

  Future<void> initOfferWall() async {
    final appKey = Platform.isAndroid
        ? "android Unit ID"
        : Platform.isIOS
            ? "iOS Unit ID"
            : throw Exception("Unsupported Platform");
    OfferWall.init(appKey: appKey);
    OfferWall.setUserId(userId: 'userId');
    OfferWall.setGender(gender: 'F');
    OfferWall.setBirthYear(birthYear: 1992);
  }

  Future<void> showOfferWall() async {
    OfferWall.showOfferWall(title: "Get point");
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              ElevatedButton(
                child: Text("Show OfferWalls"),
                onPressed: () {
                  showOfferWall();
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

ADN Flutter Offerwall plugin project.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on adn_flutter_offerwall