Skip to content
pubscout

firebase_notifications_handler

3.0.3, released 3 months ago by rithikbhandari.dev

Handle Firebase Cloud Messaging notifications with built-in local notifications support.

$ flutter pub add firebase_notifications_handler
Source repository

What it does

Provides a widget-based approach to handle Firebase Cloud Messaging and display local notifications when the app is in the foreground, background, or terminated. It exposes callbacks and streams to manage notification events, taps, tokens, and custom sounds.

AI-written summary of version 3.0.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to display Firebase push notifications while the app is in the foreground without extra setup.
  • You prefer a widget-based approach to manage notification callbacks and data.
  • You need built-in stream subscriptions for notification taps and incoming messages.

Skip it when

  • You are not using Firebase Cloud Messaging for push notifications.
  • You want to avoid native configuration steps like enabling core library desugaring on Android.

Strengths

  • Foreground notification display without extra boilerplate.
  • Widget-based approach that integrates with Flutter's UI architecture.
  • Built-in streams for notification arrivals and taps.

Weaknesses

  • Requires platform-specific setup including Android core library desugaring and minimum SDK version 24.
  • Re-exports major versions of underlying packages, making breaking changes cascade.

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
6

Requires Android minSdk 24, enabling core library desugaring in build.gradle, Java 17 compatibility, and Firebase project configuration.

FirebaseNotifications(
  child: MyApp(),
  onTap: (notificationInfo) {
    // Handle notification tap
  },
)

Alternatives

Packages that do the same job and could replace firebase_notifications_handler.

Works with

Packages commonly used together with firebase_notifications_handler: ones it builds on, ones built on it, and its own family.