toJson method
Abstract function that concrete classes must implement. This must encode the internal data model to a JSON compatible representation.
While not required, it is suggested to call removeNull
before returning.
Implementation
@override
Map<String, dynamic> toJson([bool includeImageData = false]) => {
'captureTime': captureTime,
'goldenCompatible': goldenCompatible,
'hash': hash,
'id': id,
if (includeImageData == true && image != null)
'image': base64.encode(image ?? Uint8List(0)),
};