https://github.com/mrtnetwork/flutter_windows_notification
A library for sending notifications on Windows using Flutter
https://github.com/mrtnetwork/flutter_windows_notification
flutter notification notifications windows
Last synced: about 2 months ago
JSON representation
A library for sending notifications on Windows using Flutter
- Host: GitHub
- URL: https://github.com/mrtnetwork/flutter_windows_notification
- Owner: mrtnetwork
- License: mit
- Created: 2022-12-04T09:23:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-20T06:41:30.000Z (11 months ago)
- Last Synced: 2025-03-31T13:28:00.733Z (3 months ago)
- Topics: flutter, notification, notifications, windows
- Language: C++
- Homepage:
- Size: 338 KB
- Stars: 18
- Watchers: 2
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
A library for sending notifications on Windows using Flutter
## Features
- Sending notifications by ready-made templates of the plugin
- Send notifications by user-created templates
- Receive notification events sent
- Delete all notifications sent by you from Windows Action Center
- Delete notifications group sent by you from Windows Action Center
- Add deep link to notification## Usage
### Send notification with plugin template
Sending notifications through the plugin's own templates, there are currently 3 template available in the plugin.
```
import 'package:windows_notification/notification_message.dart';
import 'package:windows_notification/windows_notification.dart';// Create an instance of Windows Notification with your application name
// application id must be null in packaged mode
final _winNotifyPlugin = WindowsNotification(applicationId: "r"{D65231B0-B2F1-4857-A4CE-A8E7C6EA7D27}\WindowsPowerShell\v1.0\powershell.exe"");// create new NotificationMessage instance with id, title, body, and images
NotificationMessage message = NotificationMessage.fromPluginTemplate(
"test1",
"TEXT",
"TEXT",
largeImage: file_path,
image: file_path
);// show notification
_winNotifyPlugin.showNotificationPluginTemplate(message);```
#### Notification with imge and large image
#### Notification with imge

#### notification without any image

### Send notification with custom template
You can use the template made by you to send the notification
You can find a lot of templates code with a simple search on the Internet#### Several examples of these templates
```
const String template = '''
Weather app
Expect rain today.
15°
Rainy
Mon
15°
Tue
17°
Wed
21°
''';
NotificationMessage message =
NotificationMessage.fromCustomTemplate("notificationid_1", group: "weather_group");
_winNotifyPlugin.showNotificationCustomTemplate(message, template);
```#### An image of the notification related to the above code

```
const String template = '''
ASGHAR CALL
Incoming Call
GHASEM
''';
NotificationMessage message =
NotificationMessage.fromCustomTemplate("notificationid_1", group: "weather_group");
_winNotifyPlugin.showNotificationCustomTemplate(message, template);
```#### An image of the notification related to the above code

### Delete all notifications sent by you from Windows Action Center
```
_winNotifyPlugin.clearNotificationHistory();
```### Delete notifications group sent by you from Windows Action Center
When creating an instance of NotificationMessage , it is possible to add group to the notification```
_winNotifyPlugin.removeNotificationGroup("groupname");
```### Delete single notification with id and group
When creating an instance of NotificationMessage , it is possible to add group and ID to the notification```
_winNotifyPlugin.removeNotificationId("notificationid", "groupname");
```### Events and argruments
To receive your notification events, you must use the ``` initNotificationCallBack ``` method```
_winNotifyPlugin.initNotificationCallBack(
(NotificationMessage data, EventType eventType, String? arguments) {});```
### Launch option
The Launch option allows you to embed your app's deep leak into the notification, and the target user will be redirected to the relevant page by tapping on the notification.
```
NotificationMessage message = NotificationMessage.fromPluginTemplate(
"test1", "You Win", "Tap to receive a gift",
launch: "my-app-schame://page1");
_winNotifyPlugin.showNotificationPluginTemplate(message);
```## Feature requests and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
If you want to contribute to this library, please submit a Pull Request.[tracker]: https://github.com/MohsenHaydari/flutter_windows_notification/issues/new