setTemplateWithBase64 method

  1. @override
void setTemplateWithBase64(
  1. String base64,
  2. bool isTemplate
)
override

setTemplateWithBase64(String, bool) takes a base64 string of data representing a template file and a boolean that tells the plugin if the file is a template.

If true, the back-end will treat the base64 string like a BWT or BWS file. If false, the back-end will treat the base64 string like a PNG, JPG, etc.

This is converted to useful information about the template in the back-end code. This method sets the current template being acted upon when setPlaceholderValue(String, String) or print() is called. Therefore, calling setTemplateWithBase64(String, bool) again will override any previous template that has been set.

Implementation

@override
void setTemplateWithBase64(String base64, bool isTemplate) {
  var sendMap = <String, dynamic>{"base64": base64, "isTemplate": isTemplate};
  methodChannel.invokeMethod('setTemplateWithBase64', sendMap);
}