F

flutter_local_notifications_aurora

Flutter плагин для платформы ОС Аврора.

flutter_local_notifications_aurora

The Aurora implementation of flutter_local_notifications.

Usage

This package is not an endorsed implementation of flutter_local_notifications. Therefore, you have to include flutter_local_notifications_aurora alongside flutter_local_notifications as dependencies in your pubspec.yaml file.

pubspec.yaml

dependencies:
  flutter_local_notifications: ^18.0.1
  flutter_local_notifications_aurora:
    git:
      url: https://developer.auroraos.ru/git/flutter/flutter-community-plugins/flutter_local_notifications_aurora.git
      ref: v0.5.4

Basic Usage

Standard method

import 'package:flutter_local_notifications/flutter_local_notifications.dart';

final notificationID = 1;
final FlutterLocalNotificationsPlugin notification = FlutterLocalNotificationsPlugin();

await flutterLocalNotificationsPlugin.show(
  notificationID,
  "Title notification",
  "My long body text notification",
  null, // payload
);

Advanced method with payload models

import 'package:flutter_local_notifications_aurora/models/notification_models.dart';

await flutterLocalNotificationsPlugin.showWithPayload(
  notificationID,
  "Title notification",
  "Body notification",
  payload: const Payload(
    hints: Hints(
      sound: Sound.messageNewInstant,
      urgency: 2, // critical
      desktopEntry: 'my_app.desktop',
    ),
  ),
);

Hints Specification

The package supports standard notification hints according to the Desktop Notifications Specification.

Supported Hints

Name Type Description
urgency byte Urgency level (0-low, 1-normal, 2-critical)
category string Notification category
desktop-entry string Desktop file name (e.g. 'my_app.desktop')
sound-file string Path to sound file (automatically set when using Sound enum)
suppress-sound boolean Disable sound playback
x int X screen coordinate (requires y)
y int Y screen coordinate (requires x)

Predefined Sounds

The package provides enum with common notification sounds:

enum Sound {
  bell,
  complete,
  dialogError,
  dialogInformation,
  dialogWarning,
  messageNewInstant,
  message,
  networkConnectivityEstablished,
  networkConnectivityLost,
  phoneIncomingCall,
}

Additional Methods

// Cancel specific notification
await flutterLocalNotificationsPlugin.cancel(notificationID);

// Cancel all notifications
await flutterLocalNotificationsPlugin.cancelAll();

Models Reference

The package provides strongly-typed models for notifications:

  • Payload - Main notification container
    • hints: Hints - Notification hints
  • Hints - Notification hints model
    • sound: Sound - Predefined sound enum
    • urgency: int - Urgency level
    • Other standard hint properties

These models help avoid errors when working with notification payloads.