Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hatemragab/platform_local_notifications
flutter platform local notifications support all platfroms https://pub.dev/packages/platform_local_notifications
https://github.com/hatemragab/platform_local_notifications
Last synced: about 2 months ago
JSON representation
flutter platform local notifications support all platfroms https://pub.dev/packages/platform_local_notifications
- Host: GitHub
- URL: https://github.com/hatemragab/platform_local_notifications
- Owner: hatemragab
- License: mit
- Created: 2023-02-20T15:42:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-08T20:56:18.000Z (4 months ago)
- Last Synced: 2024-11-01T07:42:47.814Z (2 months ago)
- Language: C++
- Homepage:
- Size: 462 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
- push local notifications any where in flutter
- for web add OverlaySupport
```dartOverlaySupport.global(
child: MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
darkTheme: ThemeData.dark(),
home: const Home( ),
),
);```
## first init
```dart
await PlatformNotifier.I.init(appName: "test app name");
```## Request notification permissions
```dart
bool? isAccepted = await PlatformNotifier.I.requestPermissions();
print("isAccepted $isAccepted");
```## to show normal notification
```dart
await PlatformNotifier.I.showPluginNotification(
ShowPluginNotificationModel(
id: DateTime.now().second,
title: "title",
body: "body",
payload: "test"),
```## to show chat notifications with action (Reply and mark as read) buttons
```dart
await PlatformNotifier.I.showChatNotification(
model: ShowPluginNotificationModel(
id: DateTime.now().second,
title: "title",
body: "body",
payload: "test",
),
userImage: "https://thumbs.dreamstime.com/b/default-avatar-profile-vector-user-profile-default-avatar-profile-vector-user-profile-profile-179376714.jpg",
conversationTitle: "conversationTitle",
userName: "userName",
);
```
## Listen for chick and actions stream
```dart
void _setUpStreams() {
PlatformNotifier.I.platformNotifierStream.listen(
(event) {
if (event is PluginNotificationClickAction) {
//handle when user click on the notification
}
if (event is PluginNotificationReplyAction) {
//handle when user choose reply action
}
if (event is PluginNotificationMarkRead) {
//handle when user submit value to reply textile
}
},
);
}```