updateBadgeCount method

  1. @override
Future<bool> updateBadgeCount(
  1. int count, {
  2. bool postNotification = true,
  3. String? channelId,
  4. String? channelName,
  5. String? smallIcon,
})
override

Implementation

@override
Future<bool> updateBadgeCount(int count, {
  bool postNotification = true,
  String? channelId,
  String? channelName,
  String? smallIcon,
}) async {
  final args = <String, dynamic>{
    "count": count,
    "postNotification": postNotification,
  };
  if (channelId != null) args["channelId"] = channelId;
  if (channelName != null) args["channelName"] = channelName;
  if (smallIcon != null) args["smallIcon"] = smallIcon;

  final result = await _channel.invokeMethod<bool>('updateBadgeCount', args);
  return result ?? false;
}