PreventNullToAbsent class

Prevents null values from being converted to absent values in generated code for body.

@PreventNullToAbsent()
@POST("/post")
Future<String> example(@Field('foo') String? foo);

Here, if foo is null, the generated code will not convert it to absent. It'll send null as the value of foo.

It is useful when you want to send null as the value to the server. Such as, when you want to delete a field's value from the database.

Annotations
  • @immutable

Constructors

PreventNullToAbsent()
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