getTemplateById method

  1. @override
Future<MessageTemplateV1?> getTemplateById(
  1. String? correlationId,
  2. String id
)
override

Gets a template by its unique id.

  • correlationId (optional) transaction id to trace execution through call chain.
  • id an id of template to be retrieved. Return Future that receives template or error.

Implementation

@override
Future<MessageTemplateV1?> getTemplateById(
    String? correlationId, String id) async {
  var result = await callCommand(
      'get_template_by_id', correlationId, {'template_id': id});
  if (result == null) return null;
  var item = MessageTemplateV1();
  item.fromJson(json.decode(result));
  return item;
}