easy_notifications 1.2.5 copy "easy_notifications: ^1.2.5" to clipboard
easy_notifications: ^1.2.5 copied to clipboard

A Flutter plugin for handling local notifications with enhanced security and privacy features. Supports Android, iOS and Web platforms with rich customization options.

example/lib/main.dart

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await EasyNotifications.init();
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Easy Notifications Example')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                onPressed: () async {
                  final hasPermission = await EasyNotifications.askPermission();
                  if (hasPermission) {
                    await EasyNotifications.showMessage(
                      title: 'Test Notification',
                      body: 'This is a test notification',
                    );
                  }
                },
                child: const Text('Show Notification'),
              ),
              const SizedBox(height: 16),
              ElevatedButton(
                onPressed: () async {
                  final scheduledDate = DateTime.now().add(
                    const Duration(seconds: 5),
                  );
                  await EasyNotifications.scheduleMessage(
                    title: 'Scheduled Notification',
                    body: 'This notification was scheduled 5 seconds ago',
                    scheduledDate: scheduledDate,
                  );
                },
                child: const Text('Schedule Notification (5s)'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
46
likes
140
points
164
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for handling local notifications with enhanced security and privacy features. Supports Android, iOS and Web platforms with rich customization options.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#notifications #scheduling #security #local-notifications #cross-platform

Documentation

API reference

License

MIT (license)

Dependencies

crypto, device_info_plus, flutter, flutter_local_notifications, flutter_web_plugins, http, json_annotation, path, path_provider, permission_handler, plugin_platform_interface, shared_preferences, timezone

More

Packages that depend on easy_notifications