audienzz_sdk_flutter 0.0.2 copy "audienzz_sdk_flutter: ^0.0.2" to clipboard
audienzz_sdk_flutter: ^0.0.2 copied to clipboard

A Flutter plugin that provides seamless integration with the Audienzz Mobile Advertising SDK, enabling developers to easily implement advanced advertising solutions in their Flutter applications.

example/lib/main.dart

import 'dart:async';
import 'dart:developer';

import 'package:audienzz_sdk_flutter/audienzz_sdk_flutter.dart';
import 'package:audienzz_sdk_flutter_example/pages/banner_ad_example.dart';
import 'package:audienzz_sdk_flutter_example/pages/interstitial_ad_example.dart';
import 'package:audienzz_sdk_flutter_example/pages/rewarded_ad_example.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  late final Future<void> init;

  @override
  void initState() {
    super.initState();
    init = initializeSdk();
  }

  Future<void> initializeSdk() async {
    final status = await AudienzzSdkFlutter.instance.initialize(
      companyId: 'Company Id',
    );

    log(status.toString());
  }

  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: init,
      builder: (_, snapshot) {
        if (snapshot.connectionState == ConnectionState.done) {
          return const MaterialApp(
            home: AdsPages(),
          );
        } else {
          return const MaterialApp(
            home: Center(
              child: CircularProgressIndicator(),
            ),
          );
        }
      },
    );
  }
}

final class AdsPages extends StatelessWidget {
  const AdsPages({super.key});

  @override
  Widget build(BuildContext context) {
    final viewPadding = MediaQuery.of(context).viewPadding;

    return Padding(
      padding: viewPadding,
      child: Scaffold(
        body: SingleChildScrollView(
          child: Column(
            children: [
              Divider(),
              Padding(
                padding: EdgeInsets.all(8.0),
                child: Text('Banner ads'),
              ),
              BannerAdExample(),
              Divider(),
              Padding(
                padding: EdgeInsets.all(8.0),
                child: Text('Rewarded ad'),
              ),
              RewardedAdExample(),
              Divider(),
              Padding(
                padding: EdgeInsets.all(8.0),
                child: Text('Interstitial ads'),
              ),
              InterstitialAdExample(),
              Divider(),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
0
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that provides seamless integration with the Audienzz Mobile Advertising SDK, enabling developers to easily implement advanced advertising solutions in their Flutter applications.

Homepage

License

unknown (license)

Dependencies

collection, equatable, flutter, plugin_platform_interface

More

Packages that depend on audienzz_sdk_flutter

Packages that implement audienzz_sdk_flutter