update method

Future<void> update(
  1. String activityId,
  2. Map<String, dynamic> contentState
)

Implementation

Future<void> update(String activityId, Map<String, dynamic> contentState) async {
  if (_platform() == 'ios') {
    await NexusPlatform.instance.liveActivityUpdate(activityId: activityId, contentState: contentState);
  } else if (_platform() == 'android') {
    final template = _localTemplates[activityId];
    await renderNexusLiveActivity({
      'event': 'update',
      'activityId': activityId,
      'template': ?template,
      if (template != null) 'data': contentState else 'contentState': contentState,
    });
  }
}