premium_ads 0.2.6 copy "premium_ads: ^0.2.6" to clipboard
premium_ads: ^0.2.6 copied to clipboard

Flutter plugin for Premium Ads (AdMob/AdManager adapter)

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:premium_ads/premium_ads.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Enable debug mode for development
  await PremiumAds.setDebug(true);
  
  runApp(const MyApp());
}

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

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

class _MyAppState extends State<MyApp> {
  bool _debugEnabled = true;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Premium Ads Example')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Text('Premium Ads Plugin Demo'),
              const SizedBox(height: 20),
              Text('Debug Mode: ${_debugEnabled ? "ON" : "OFF"}'),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () async {
                  setState(() {
                    _debugEnabled = !_debugEnabled;
                  });
                  await PremiumAds.setDebug(_debugEnabled);
                  if (mounted) {
                    ScaffoldMessenger.of(context).showSnackBar(
                      SnackBar(
                        content: Text('Debug mode ${_debugEnabled ? "enabled" : "disabled"}'),
                        duration: const Duration(seconds: 2),
                      ),
                    );
                  }
                },
                child: Text(_debugEnabled ? 'Disable Debug' : 'Enable Debug'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
155
points
4
downloads

Publisher

verified publisherpremiumads.net

Weekly Downloads

Flutter plugin for Premium Ads (AdMob/AdManager adapter)

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on premium_ads

Packages that implement premium_ads