Pregunta
ThePregunta entity represents an inspection question that can be used during hive monitoring. Questions can be of different types (text, numeric, multiple choice, etc.) and can be customized per apiary.
Properties
Unique identifier for the question
The ID of the apiary this question belongs to
The question text displayed to the user during inspection
The type of answer expected. Valid values:
texto- Free text responsenumero- Numeric responseseleccion- Multiple choice (single selection)multiple- Multiple choice (multiple selections)rango- Range/slider response
Optional category to group related questions together (e.g., “Salud”, “Población”, “Producción”)
Whether this question must be answered during inspection
List of available options for
seleccion or multiple question typesMinimum value for
numero or rango question typesMaximum value for
numero or rango question typesDisplay order for the question (lower numbers appear first)
Whether this question is currently active and should be displayed
Usage Example
Methods
Creates a
Pregunta instance from a JSON map. Handles both API response formats (snake_case) and local formats.Converts the question to a JSON map for API requests. Uses snake_case field names.
Creates a copy of the question with optionally modified fields. Useful for updates.
Equality
ThePregunta entity extends Equatable, which means two instances are considered equal if all their properties are equal. This is useful for state management and testing.
Best Practices
Display Order: When creating multiple questions, use consistent ordering (e.g., increments of 10: 10, 20, 30) to allow easy reordering without conflicts.