androidnotify 0.0.5
androidnotify: ^0.0.5 copied to clipboard

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: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.stream.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'),
        ),
      ),
    );
  }
}
0
likes
80
pub points
0%
popularity

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

Homepage

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on androidnotify