encoder method

String encoder(
  1. dynamic value, {
  2. Encoding? charset,
  3. Format? format,
})

Encodes a value to a String.

Uses the provided encoder if available, otherwise uses Utils.encode.

Implementation

String encoder(dynamic value, {Encoding? charset, Format? format}) =>
    _encoder?.call(
      value,
      charset: charset ?? this.charset,
      format: format ?? this.format,
    ) ??
    Utils.encode(
      value,
      charset: charset ?? this.charset,
      format: format ?? this.format,
    );