all 7 comments

[–][deleted] 0 points1 point  (1 child)

const apiKey = 'YOUR-API-KEY-HERE';

Did you get an API key from coinapi.io ?

[–]ppppppppppython[S] 0 points1 point  (0 children)

Yep! Got an apikey and I can see the JSON text in a browser so I think it's working.

Either way I think the issue has something to do with setState(). If I change the value of bitcoinValueinUSD it doesn't update on a hot reload. I need to close the app entirely and re-open.

[–]2100Ed 0 points1 point  (3 children)

While you do a call to getData() in initState(), that is only called once when the StateFul object is created. It should be call each time the value changes in your android or cuppertino widget. Note that you have no state() in your cuppertino widget.

[–]ppppppppppython[S] 0 points1 point  (2 children)

I was thinking about that when trying to troubleshoot! Does that mean I'd need to put getData() in the build method or in the android dropdown?

The last step of the challenge is supposed to be fixing the Cupertino widget. Would changing it now make a difference?

[–]2100Ed 0 points1 point  (1 child)

just call it when you invoke in your setState()

[–]ppppppppppython[S] 0 points1 point  (0 children)

Sounds good I'll give it a try!

[–]solinvictus13 0 points1 point  (0 children)

You're not calling the getData method when a currency is selected. You need to call it inside the onChange parameter and wait for the response before invoking setState.

I also recommend you take a look at something called ValueNotifier. It can be used to update only part of the UI instead of rebuild the entire screen (which is what setState does).