smartlinks_ad 2.0.1 copy "smartlinks_ad: ^2.0.1" to clipboard
smartlinks_ad: ^2.0.1 copied to clipboard

In-app ads (banner, interstitial, native) for the SmartLinks Flutter SDK.

example/lib/main.dart

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:smartlinks_flutter/smartlinks_flutter.dart';

import 'firebase_options.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // Required only when enablePushAds: true
  await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);

  await SmartLinks.initialize(
    apiKey: 'YOUR_API_KEY',
    isDebug: true,
    initializeAds: true,
    enablePushAds: true,
  );

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('SmartLinks Ad Example')),
        body: const AdExample(),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        const Text('Banner Ad Below:'),
        const SizedBox(height: 10),
        SmartLinkBannerAd(adService: SmartLinks.ads, height: 100),
        const Spacer(),
        const Text('End of screen'),
      ],
    );
  }
}
1
likes
150
points
143
downloads

Documentation

API reference

Publisher

verified publisheralkashier.com

Weekly Downloads

In-app ads (banner, interstitial, native) for the SmartLinks Flutter SDK.

Homepage
Repository (GitLab)

License

MIT (license)

Dependencies

cached_network_image, dio, flutter, shared_preferences, smartlinks_core, url_launcher

More

Packages that depend on smartlinks_ad