flutter_notification 1.0.7
flutter_notification: ^1.0.7 copied to clipboard

A cross platform plugin for displaying and scheduling notifications for Flutter applications with the ability to customise for each platform.

flutter_notifications #

A cross platform plugin for displaying local notifications.

Supported platforms #

  • Android

Android Setup #

<activity
    android:showWhenLocked="true"
    android:turnScreenOn="true">

Example app #

The example directory has a sample application that demo the features of this plugin.

Initialisation #

FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
    FlutterLocalNotificationsPlugin();
// initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project
const AndroidInitializationSettings initializationSettingsAndroid =
    AndroidInitializationSettings('app_icon');
final IOSInitializationSettings initializationSettingsIOS =
    IOSInitializationSettings(
        onDidReceiveLocalNotification: onDidReceiveLocalNotification);
final MacOSInitializationSettings initializationSettingsMacOS =
    MacOSInitializationSettings();
final InitializationSettings initializationSettings = InitializationSettings(
    android: initializationSettingsAndroid,
    iOS: initializationSettingsIOS,
    macOS: initializationSettingsMacOS);
await flutterLocalNotificationsPlugin.initialize(initializationSettings,
    onSelectNotification: selectNotification);
Future selectNotification(String payload) async {
    if (payload != null) {
      debugPrint('payload: $payload');
    }
    await Navigator.push(
      context,
      MaterialPageRoute<void>(builder: (context) => SecondScreen(payload)),
    );
}
1
likes
80
pub points
34%
popularity

A cross platform plugin for displaying and scheduling notifications for Flutter applications with the ability to customise for each platform.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter, flutter_local_notifications_platform_interface, platform, timezone

More

Packages that depend on flutter_notification