JsonIgnore class

Excludes a field from JSON serialization and deserialization.

Fields annotated with @JsonIgnore will be skipped during JSON serialization and deserialization.

Example:

@DTO()
class UserDTO {
  final String id;
  final String name;

  @JsonIgnore()
  final String password; // Will not be included in JSON

  UserDTO({required this.id, required this.name, required this.password});
}

Constructors

JsonIgnore.new()
Creates a JsonIgnore annotation.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited