参数类型'String'不能分配给参数类型"AndroidNotificationSound"



这是dart分析信息:

error: The argument type 'String' can't be assigned to the parameter type 'AndroidNotificationSound'. (argument_type_not_assignable at [mediminder] lib/src/ui/new_entry/new_entry.dart:335)

和文件"new_entry.dart"还是原来的那个

Future _showNotificationWithSound() async {
var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
'your channel id', 'your channel name',
sound: 'sneezenotification',
importance: Importance.max,
priority: Priority.high);
var platformChannelSpecifics = new NotificationDetails(
android: androidPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(
0,
'New Post',
'How to Show Notification in Flutter',
platformChannelSpecifics,
payload: 'Custom_Sound',
);
}

错误在

行声音:"sneezenotification"。注意:我已经在android>app>res>raw中添加了打喷嚏通知。mp3

sound: RawResourceAndroidNotificationSound('sneezenotification'),

像这样更改并更改"channel_id 3"这是我的工作

相关内容

  • 没有找到相关文章

最新更新