notifications 0.0.2 copy "notifications: ^0.0.2" to clipboard
notifications: ^0.0.2 copied to clipboard

outdated

A plugin for tracking notifications on the device. Works exclusively for Android.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:notifications/notifications.dart';

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

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

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    Notifications notifications = new Notifications();
    StreamSubscription<NotificationEvent> events;
    events = notifications.noiseStream.listen(onData);
  }

  void onData(NotificationEvent event) => print(event.toString());

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
      ),
    );
  }
}
78
likes
0
pub points
83%
popularity

Publisher

verified publishercachet.dk

A plugin for tracking notifications on the device. Works exclusively for Android.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on notifications