ApiResponse class

Envelope de retorno padrão de toda chamada de API do Flenx. Mesma forma em sucesso e erro, com meta de paginação quando aplicável.

JSON: { "success": bool, "data": ..., "error": str?, "meta": {...}? }

Constructors

ApiResponse({required bool success, Object? data, String? error, PageMeta? meta})
const
ApiResponse.fail(String error)
Erro padronizado.
factory
ApiResponse.ok(Object? data)
Sucesso simples (objeto/valor).
factory
ApiResponse.page(List<Object?> items, PageMeta meta)
Sucesso de listagem paginada.
factory

Properties

data Object?
final
error String?
final
hashCode int
The hash code for this object.
no setterinherited
meta PageMeta?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
success bool
final

Methods

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

Operators

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