engage_flutter 2.2.0 copy "engage_flutter: ^2.2.0" to clipboard
engage_flutter: ^2.2.0 copied to clipboard

The official Flutter SDK for Engage push notifications, in-app experiences, feature flags, and message center.

example/lib/main.dart

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

const engageAppKey = String.fromEnvironment('ENGAGE_APP_KEY');

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  if (engageAppKey.isNotEmpty) {
    await Engage.start(config: const EngageConfig(appKey: engageAppKey));
  }
  runApp(const ExampleApp());
}

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

  @override
  Widget build(BuildContext context) => MaterialApp(
    title: 'Engage Flutter',
    theme: ThemeData(colorSchemeSeed: Colors.indigo),
    home: const ExampleHome(),
  );
}

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

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(title: const Text('Engage Flutter')),
    body: StreamBuilder<String?>(
      stream: Engage.installation.id,
      initialData: Engage.installation.id.value,
      builder: (context, snapshot) => Padding(
        padding: const EdgeInsets.all(24),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text('Installation: ${snapshot.data ?? 'pending'}'),
            const SizedBox(height: 24),
            FilledButton(
              onPressed: engageAppKey.isEmpty
                  ? null
                  : () => Engage.messageCenter.display(),
              child: const Text('Open Message Center'),
            ),
          ],
        ),
      ),
    ),
  );
}
0
likes
140
points
278
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

The official Flutter SDK for Engage push notifications, in-app experiences, feature flags, and message center.

Repository (GitHub)
View/report issues

Topics

#notifications #push-notifications #engagement #feature-flags #in-app-messaging

License

unknown (license)

Dependencies

flutter, meta

More

Packages that depend on engage_flutter

Packages that implement engage_flutter