Skip to main content

brudcast_in_app 0.2.2 copy "brudcast_in_app: ^0.2.2" to clipboard
brudcast_in_app: ^0.2.2 copied to clipboard

In-app messages and the inbox for the Brudcast Flutter SDK, drawn by the native Android and iOS renderers.

example/example.md

Example #

Run the module, hold messages back during checkout, and build an inbox screen in Flutter:

import 'package:brudcast_flutter/brudcast_flutter.dart';
import 'package:brudcast_in_app/brudcast_in_app.dart';
import 'package:flutter/material.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Brudcast.initialize('bpk_...', const BrudcastOptions(modules: [BrudcastInApp.module]));
  runApp(const MaterialApp(home: InboxScreen()));
}

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

  @override
  State<InboxScreen> createState() => _InboxScreenState();
}

class _InboxScreenState extends State<InboxScreen> {
  final controller = InboxController();

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(title: const Text('Inbox')),
        body: ListenableBuilder(
          listenable: controller,
          builder: (context, _) => RefreshIndicator(
            onRefresh: controller.refresh,
            child: ListView(
              children: [
                for (final message in controller.messages)
                  ListTile(
                    title: Text(message.title),
                    subtitle: Text(message.preview),
                    onTap: () {
                      controller.markRead(message);
                      Navigator.of(context).push(MaterialPageRoute(
                        builder: (_) => Scaffold(body: BrudcastInboxMessage(message: message, expand: true)),
                      ));
                    },
                  ),
              ],
            ),
          ),
        ),
      );
}

Future<void> checkout() async {
  await Brudcast.inApp.pauseDisplay();
  await Brudcast.track('checkout_started');
}

A complete app is in the repository's example.

0
likes
160
points
148
downloads

Documentation

Documentation
API reference

Publisher

verified publisherbrudcast.com

Weekly Downloads

In-app messages and the inbox for the Brudcast Flutter SDK, drawn by the native Android and iOS renderers.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#in-app-messaging #inbox #engagement

License

Apache-2.0 (license)

Dependencies

brudcast_flutter, flutter, meta

More

Packages that depend on brudcast_in_app

Packages that implement brudcast_in_app