encodeToBytes static method

Uint8List encodeToBytes(
  1. Object? o, {
  2. bool pretty = false,
  3. JsonFieldMatcher? maskField,
  4. String maskText = '***',
  5. JsonFieldMatcher? removeField,
  6. bool removeNullFields = false,
  7. ToEncodableJsonProvider? toEncodableProvider,
  8. ToEncodable? toEncodable,
  9. EntityHandlerProvider? entityHandlerProvider,
  10. EntityCache? entityCache,
  11. bool? autoResetEntityCache,
})

Sames as encode but returns a Uint8List.

Implementation

static Uint8List encodeToBytes(Object? o,
    {bool pretty = false,
    JsonFieldMatcher? maskField,
    String maskText = '***',
    JsonFieldMatcher? removeField,
    bool removeNullFields = false,
    ToEncodableJsonProvider? toEncodableProvider,
    ToEncodable? toEncodable,
    EntityHandlerProvider? entityHandlerProvider,
    EntityCache? entityCache,
    bool? autoResetEntityCache}) {
  var jsonEncoder = _buildJsonEncoder(
      maskField,
      maskText,
      removeField,
      removeNullFields,
      toEncodableProvider,
      toEncodable,
      entityHandlerProvider,
      entityCache);

  return jsonEncoder.encodeToBytes(o,
      pretty: pretty, autoResetEntityCache: autoResetEntityCache);
}