DataOption<T extends DataClass> class
Constructors
-
DataOption({required DataClassBuilder<T> instanceBuilder, required String route, IdentifierGetter<T>? idFieldGetter, OnSend? onSend, OnReceive? onReceive, String? customOrigin, bool parseAfterDelete = false, bool parseAfterGet = true, bool parseAfterPost = true, bool parseAfterPut = false, bool logExceptions = true, bool throwErrors = true})
-
const
Properties
-
customOrigin
→ String?
-
The custom origin for this data class, in case it is different from the origin defined in the DataContext
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
idFieldGetter
→ IdentifierGetter<T>?
-
This property should be used to retrieve the id field of the dataclass passed as parameter, if there is one.
In case the class does not have a identifier field, just leave this property null;
final
-
instanceBuilder
→ DataClassBuilder<T>
-
This property will be used to store a procedure that instantiates the dataclass in question.
It will be called whenever the engine needs to create an instance of this dataclass with default values
final
-
logExceptions
→ bool
-
Determines if errors thrown inside the dataset should be logged;
final
-
onReceive
→ OnReceive?
-
This function is used to store a procedure that will listen to every API response. If set, it will be called right before the global OnSend function, declared in the DataContext
final
-
onSend
→ OnSend?
-
This function is used to store a procedure that will listen to every API request. If set, it will be called right before the global OnSend function, declared in the DataContext
final
-
Pagination options to allow the engine to fetch data in divided sets. Leave it null if the API does not support it.
final
-
parseAfterDelete
→ bool
-
Determines if the data fetcher engine is allowed to parse the response body of a DELETE request to this endpoint into this data class
final
-
parseAfterGet
→ bool
-
Determines if the data fetcher engine is allowed to parse the response body of a GET request to this endpoint into this data class
final
-
parseAfterPost
→ bool
-
Determines if the data fetcher engine is allowed to parse the response body of a POST request to this endpoint into this data class
final
-
parseAfterPut
→ bool
-
Determines if the data fetcher engine is allowed to parse the response body of a PUT request to this endpoint into this data class
final
-
route
→ String
-
The route for the endpoint of this data class
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
throwErrors
→ bool
-
Determines if errors should be thrown even after logged;
final
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited