If you've managed to complete the level 1 - bronze challenge without looking at the solution code, then it's time to push yourself and increase the difficulty. Complete this level 2 challenge to get the silver medal.


1. Start by cloning a fresh copy of the app that includes all the code up until this point:

https://github.com/londonappbrewery/bitcoin-flutter-silver-start


2. Run the app, notice that it can only fetch the bitcoin price in US dollars.

3. Using what you have learnt in previous modules to display the latest price of 1 Bitcoin (BTC) in any currency selected by the user.

You'll need to look inside the onChanged for the DropdownButton and the onSelectedItemChanged for the CupertinoPicker to see what the user selected as the currency.

The Bitcoin Average API supports all the currencies in our currenciesList.

The URL is structured like this:

https://apiv2.bitcoinaverage.com/indices/global/ticker/BTC<Currency>

e.g. For GBP (UK Pounds), the URL would look like this.

https://apiv2.bitcoinaverage.com/indices/global/ticker/BTCGBP

Goal: By the end of this challenge, this is the functionality you should end up with:

 


You can check your answer against the solution by cloning this repository. Go through the comments in order starting from //1

Solution: https://github.com/londonappbrewery/bitcoin-flutter-silver-solution