promotion_overlay 1.0.5 copy "promotion_overlay: ^1.0.5" to clipboard
promotion_overlay: ^1.0.5 copied to clipboard

PlatformiOSmacOS

Flutter plugin for displaying the native promotion overlay. Wraps a platform-specific promotional overlay banner (SKOverlay on iOS and macOS).

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter promotion_overlay example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
            seedColor: const Color.fromRGBO(255, 27, 61, 1)),
        useMaterial3: true,
      ),
      debugShowCheckedModeBanner: false,
      home: const MyHomePage(title: 'Flutter promotion_overlay example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({
    super.key,
    required this.title,
  });

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  PromotionOverlay? promotionOverlay;

  @override
  void initState() {
    super.initState();

    promotionOverlay = PromotionOverlay('1498057243');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.primary,
        title: Text(widget.title, style: const TextStyle(color: Colors.white)),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              onPressed: () => promotionOverlay!.show(),
              child: const Text('Open overlay'),
            ),
            const SizedBox(height: 24),
            ElevatedButton(
              onPressed: () => promotionOverlay!.dismiss(),
              child: const Text('Dismiss overlay'),
            ),
          ],
        ),
      ),
    );
  }
}
6
likes
160
points
33
downloads

Publisher

verified publisherpsycatgames.com

Weekly Downloads

Flutter plugin for displaying the native promotion overlay. Wraps a platform-specific promotional overlay banner (SKOverlay on iOS and macOS).

Repository (GitHub)

Topics

#app-store

Documentation

API reference

License

MIT (license)

Dependencies

flutter, promotion_overlay_foundation, promotion_overlay_platform_interface

More

Packages that depend on promotion_overlay