Getting StartedQuickstart

Quickstart

Send your first remote notification to a live Flutter app in under 5 minutes.

1. Install the package

Add another_flushbar to your pubspec.yaml:

yaml
dependencies:
  flutter:
    sdk: flutter
  another_flushbar: ^2.0.0

Then run:

bash
flutter pub get

2. Get an API key

Sign up at app.flushkit.dev, create a project, and copy your API key from the dashboard. It looks like fk_live_••••••••••••••••.

3. Initialise the SDK

Call FlushbarRemote.init in the initState of your root widget and FlushbarRemote.dispose in dispose:

dart
import 'package:another_flushbar/flushbar_remote.dart';

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    FlushbarRemote.init(
      apiKey: 'fk_live_••••••••••••••••',
      context: context,
    );
  }

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(/* ... */);
  }
}

4. Send your first notification

With a device running your app, send a notification from your terminal:

bash
curl -X POST https://api.flushkit.dev/v1/notify \
  -H "Authorization: Bearer fk_live_••••••••••••••••" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Hello from the server!",
    "title": "FlushKit works 🎉",
    "position": "top",
    "backgroundColor": "#7C3AED",
    "durationSeconds": 4
  }'

You should see the Flushbar appear on the device immediately.

You can also send notifications directly from the dashboard at app.flushkit.dev without writing any code.

What's next?