quick_notify_2 0.3.0-dev.0 copy "quick_notify_2: ^0.3.0-dev.0" to clipboard
quick_notify_2: ^0.3.0-dev.0 copied to clipboard

A cross-platform (Android/iOS/Web/Windows/macOS/Linux) notification plugin for Flutter.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:quick_notify_2/quick_notify.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                ElevatedButton(
                  child: const Text('hasPermission'),
                  onPressed: () async {
                    var hasPermission = await QuickNotify.hasPermission();
                    print('hasPermission $hasPermission');
                  },
                ),
                ElevatedButton(
                  child: const Text('requestPermission'),
                  onPressed: () async {
                    var requestPermission =
                        await QuickNotify.requestPermission();
                    print('requestPermission $requestPermission');
                  },
                ),
              ],
            ),
            ElevatedButton(
              child: const Text('notify'),
              onPressed: () {
                QuickNotify.notify(
                  title: 'My title',
                  content: 'My content',
                );
              },
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
140
pub points
48%
popularity

Publisher

unverified uploader

A cross-platform (Android/iOS/Web/Windows/macOS/Linux) notification plugin for Flutter.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

desktop_notifications, flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on quick_notify_2