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
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