Captured Field

Defined in library scandit_datacapture_label

LabelField
class LabelField

Added in version 7.2.0

name
String get name

Added in version 7.2.0

The field name. Unique within a label, for example barcode-a, or price. The names are defined when defining the label.

type
LabelFieldType get type

Added in version 7.2.0

Identifies the type of the captured field type. This either returns LabelFieldType.barcode, or LabelFieldType.text. Depending on the type, further information such as captured data is available through the following properties:

predictedLocation
Quadrilateral get predictedLocation

Added in version 7.2.0

The location of the captured field inside the image. These coordinates will need to be converted to view coordinates before they can be visualized. When the field’s state is LabelFieldState.unknown, a quadrilateral with all points set to (0,0) is returned.

state
LabelFieldState get state

Added in version 7.2.0

The field state. For fields that have been captured LabelFieldState.captured is returned. For fields whose location has been predicted, LabelFieldState.predicted is returned. For fields whose location could not be predicted, LabelFieldState.unknown is returned.

isRequired
bool get isRequired

Added in version 7.2.0

Whether the captured field is required. This property is false for optional fields.

barcode
Barcode? get barcode

Added in version 7.2.0

The barcode associated to this captured field. This property is null when the type is not equal to LabelFieldType.barcode.

text
String? get text

Added in version 7.2.0

The text associated to this captured field. This property is null when the type is not equal to LabelFieldType.text.

asDate()
LabelDateResult? asDate()

Added in version 7.2.0

Returns a LabelDateResult if the field is parseable as a date using the LabelDateFormat provided, null otherwise or if no LabelDateFormat was provided.