TrackedBarcode.fromJSON constructor

TrackedBarcode.fromJSON(
  1. Map<String, dynamic> json, {
  2. int? sessionFrameSequenceId,
})

Implementation

factory TrackedBarcode.fromJSON(Map<String, dynamic> json, {int? sessionFrameSequenceId}) {
  var barcode = Barcode.fromJSON(json['barcode']);
  var location = Quadrilateral.fromJSON(json['location']);
  var identifier = int.parse(json['identifier'] as String);
  var shouldAnimateFromPreviousToNextState = false;

  if (json.containsKey('shouldAnimateFromPreviousToNextState')) {
    shouldAnimateFromPreviousToNextState = json['shouldAnimateFromPreviousToNextState'] as bool;
  }

  return TrackedBarcode._(barcode, location, identifier, sessionFrameSequenceId,
      shouldAnimateFromPreviousToNextState: shouldAnimateFromPreviousToNextState);
}