PassportElementError.dataField constructor

  1. @Assert('source == PassportElementErrorSource.data', 'source must be PassportElementErrorSource.data')
const PassportElementError.dataField({
  1. @Default(PassportElementErrorSource.data) PassportElementErrorSource source,
  2. required PassportType type,
  3. required String message,
  4. @JsonKey(name: 'field_name') required String fieldName,
  5. @JsonKey(name: 'data_hash') required String dataHash,
})

Represents an error in data provided by the user

Implementation

@Assert(
  'source == PassportElementErrorSource.data',
  'source must be PassportElementErrorSource.data',
)
const factory PassportElementError.dataField({
  /// Error source, must be "data"
  @Default(PassportElementErrorSource.data) PassportElementErrorSource source,

  /// The section of the user's Telegram Passport which has the error
  required final PassportType type,

  /// Error message
  required final String message,

  /// Name of the data field which has the error
  @JsonKey(name: 'field_name') required final String fieldName,

  /// Base64-encoded data hash
  @JsonKey(name: 'data_hash') required final String dataHash,
}) = PassportElementErrorDataField;