JsonString.encode constructor

JsonString.encode(
  1. Object? value, {
  2. ToEncodable? encoder,
})

Constructs a JsonString converting value into a valid JSON.

Attention: this is just a wrapper around the Dart built-in function json.encode(), you should use this in special cases only. Check the other encoding functions for more common usages.

Implementation

JsonString.encode(Object? value, {ToEncodable? encoder})
    : source = _encodeSafely(value, encoder: encoder),
      _cachedValue = null;