create<T> static method
Implementation
static Response<T> create<T>({
required T? Function() builder,
required bool Function(T?) isError,
ErrorDetails? error,
}) {
var payload = builder();
if (isError(payload)) {
return Responses.failure([error ?? ErrorDetails(id: 0)]);
}
return Responses.success<T>(payload!);
}