description

# JsonEncoder constructor

const JsonEncoder([

1. Object? toEncodable(
   1. dynamic
   )?

])

Creates a JSON encoder.

The JSON encoder handles numbers, strings, booleans, null, lists and maps with string keys directly.

Any other object is attempted converted by `toEncodable` to an object that is of one of the convertible types.

If `toEncodable` is omitted, it defaults to calling `.toJson()` on the object.

## Implementation

    const JsonEncoder([Object? Function(dynamic object)? toEncodable])
      : indent = null,
        _toEncodable = toEncodable;