Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.
/ currency-rates Public archive

A sample Flutter application illustrating sealed classes usage.

Notifications You must be signed in to change notification settings

klisiewicz/currency-rates

Repository files navigation

Currency Rates

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.

Currency Rates

Events

  • CurrencyRatesLoadEvent - informs the BLoC that it needs to load the currency rates,
  • CurrencyRatesRefreshEvent - informs the BLoC that it needs to refresh the currency rates.

States

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.

Bloc

CurrencyRatesBloc in a response to the CurrencyRatesEvent retrieves currency rates from the repository and displays them on the UI.

Implementations