JsonAdapter<T> constructor

JsonAdapter<T>({
  1. required T fromJson(
    1. Map<String, dynamic> json
    ),
  2. required Map<String, dynamic> toJson(
    1. T object
    ),
})

Creates a new JSON adapter with the specified conversion functions.

fromJson converts a JSON map to the target type T. toJson converts an instance of T to a JSON map.

Implementation

JsonAdapter({required this.fromJson, required this.toJson});