toJson method

  1. @override
Map<String, dynamic> toJson()

Returns a JSON-compatible representation of the internal data structure. For the returned format, see the fromDynamic function.

Implementation

@override
Map<String, dynamic> toJson() => {
      'id': id,
      if (image != null) 'image': base64Encode(image ?? <int>[]),
      if (values?.isNotEmpty == true) 'values': values,
    };