stream_notifications 1.0.0
stream_notifications: ^1.0.0

A new Flutter plugin.

stream_notifications #

A new Flutter plugin.

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Getting Started #

Setup #

Android: Register service in the manifest #

The plugin uses an Android system service to track notifications. To allow this service to run the following code should be put inside the Android manifest, between the <application></application> tags.

 <service android:name=""
            <action android:name="android.service.notification.NotificationListenerService" />

Use #

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:stream_notifications/stream_notifications.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  StreamNotifications _notifications;
  StreamSubscription<LiveNotificationEvent> _subscription;

  void initState() {

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {

  void onData(LiveNotificationEvent event) {

  void startListening() {
    _notifications = new StreamNotifications();
    try {
      _subscription = _notifications.notificationStream.listen(onData);
    } on NotificationException catch (exception) {

  void stopListening() {

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),