@@ -3,7 +3,7 @@ import 'dart:io' show Platform;
33import 'package:flutter_local_notifications/flutter_local_notifications.dart' ;
44
55class HrNotificationService {
6- static const _channelId = 'hr_osc_live ' ;
6+ static const _channelId = 'hr_push_live ' ;
77 static const _channelName = '心率常驻通知' ;
88 static const _channelDescription = '显示当前心率与连接状态' ;
99 static const _notificationId = 1001 ;
@@ -19,8 +19,10 @@ class HrNotificationService {
1919 const initSettings = InitializationSettings (android: androidInit);
2020 await _plugin.initialize (initSettings);
2121
22- final androidImpl = _plugin.resolvePlatformSpecificImplementation<
23- AndroidFlutterLocalNotificationsPlugin > ();
22+ final androidImpl = _plugin
23+ .resolvePlatformSpecificImplementation<
24+ AndroidFlutterLocalNotificationsPlugin
25+ > ();
2426 if (androidImpl != null ) {
2527 const channel = AndroidNotificationChannel (
2628 _channelId,
@@ -42,8 +44,10 @@ class HrNotificationService {
4244 if (! _initialized) {
4345 await initialize ();
4446 }
45- final androidImpl = _plugin.resolvePlatformSpecificImplementation<
46- AndroidFlutterLocalNotificationsPlugin > ();
47+ final androidImpl = _plugin
48+ .resolvePlatformSpecificImplementation<
49+ AndroidFlutterLocalNotificationsPlugin
50+ > ();
4751 if (androidImpl == null ) return true ;
4852 try {
4953 final granted = await androidImpl.requestNotificationsPermission ();
@@ -90,10 +94,7 @@ class HrNotificationService {
9094 } catch (_) {}
9195 }
9296
93- Future <void > _show ({
94- required String title,
95- required String body,
96- }) async {
97+ Future <void > _show ({required String title, required String body}) async {
9798 if (! _initialized) {
9899 try {
99100 await initialize ();
0 commit comments