easy_local_notify 0.0.1 copy "easy_local_notify: ^0.0.1" to clipboard
easy_local_notify: ^0.0.1 copied to clipboard

Cross-platform local notification package for Flutter. Works on Android, iOS, Web, Windows, macOS, and Linux with a simple API.

example/lib/main.dart

// Import the necessary packages
import 'package:easy_local_notify/easy_local_notify.dart'; // Local notification package
import 'package:flutter/material.dart'; // Flutter Material Design widgets

// Main function: entry point of the app
void main() async {
  WidgetsFlutterBinding.ensureInitialized(); // Ensure Flutter is initialized
  await EasyLocalNotify.init(); // Initialize the notification system
  runApp(MyApp()); // Run the app
}

// Main App Widget
class MyApp extends StatelessWidget {
  const MyApp({super.key}); // Constructor

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App', // App title
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Material App Bar'), // Top AppBar title
        ),
        body: Center( // Center all content
          child: Column( // Arrange widgets vertically
            children: [
              IconButton(
                  onPressed: () {
                    // Show a local notification when pressed
                    EasyLocalNotify.show('Title', 'This appears immediately');
                  },
                  icon: Icon(Icons.abc)) // Button icon
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
130
points
29
downloads

Publisher

verified publishercinar.fun

Weekly Downloads

Cross-platform local notification package for Flutter. Works on Android, iOS, Web, Windows, macOS, and Linux with a simple API.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

firebase_messaging, flutter, flutter_local_notifications, permission_handler, timezone

More

Packages that depend on easy_local_notify