Skip to main content
Version: 0.7.0

Enums

Enums for Simplified API Requests and Response Handling​

Within the StadataFlutter SDK, you'll find several enums designed to streamline API requests and facilitate the handling of API responses.

DataLanguage Enum​

  • The DataLanguage enum is used to specify the language (lang) parameter when making API requests. It offers two options:

    EnumsParam ValueDescriptionStatus
    DataLanguage.idindRepresents the Indonesian language.Default
    DataLanguage.enengRepresents the English language.

DomainType Enum​

  • The DomainType enum simplifies domain type (type) parameters for Domain models in API requests. It includes the following options:

    EnumsActual ValueDescriptionStatus
    DomainType.allallRetrieve all domains, including provinces and regencies.Default
    DomainType.provinceprovRetrieve all province domains.
    DataLanguage.regencykabRetrieve all regency domains.
    DataLanguage.regencyByProvincekabbyprovRetrieve all regency domains within a specified province ID.

DataAvailability Enum​

  • The DataAvailability enum helps you check the data-availability key in API responses, making it easier to determine the availability of data. It includes the following options:

    EnumsActual ValueDescription
    DataAvailability.availableavailableIndicates that data is available.
    DataAvailability.listNotAvailablelist-not-availableIndicates that the list is not available.
    DataAvailability.notAvailablenot-availableIndicates that data is not available.

These enums serve as valuable tools to enhance the readability and manageability of your API-related code. Whether you're specifying language preferences, domain types, or checking data availability, these enums simplify the process and make your code more concise and expressive.