A sample Flutter
app illustrating Sealed Classes
usage.
The application displays currency rates from the National Bank of Poland via REST
api. It uses Bloc library for the state management.
CurrencyRatesLoadEvent
- informs theBLoC
that it needs to load the currency rates,CurrencyRatesRefreshEvent
- informs theBLoC
that it needs to refresh the currency rates.
The UI can be in one of the following states:
CurrencyRatesLoading
- when currency rates are being loaded,CurrencyRatesLoaded
- after the currency rates have been loaded successfully,CurrencyRatesRefreshing
- when currency rates are being refreshed,CurrencyRatesError
- when the currency rates haven't been loaded, because of an error.
CurrencyRatesBloc
in a response to the CurrencyRatesEvent
retrieves currency rates from the repository
and displays them on the UI.