0

I'm trying to create a Variable List from the JSON source crypoUrl using the data from _currencies.name from the files crypto_data.dart and crypto_data_prod.dart from this Git Repo.

If possible could you show me how to do this all in home_page.dart, then how to print the results to the debug terminal using something like print(...);

Thanks, Jake

5
  • It looks you are done with what you want. Can you please tell what you want in detail? Commented Sep 19, 2018 at 13:59
  • Sorry, instead of saying 'I'm figuring out' I should have said 'Im trying to create'. I've not made any progress on this yet Commented Sep 19, 2018 at 14:30
  • I looked into code. I am very sorry. Can you please explain what problem you are facing? Commented Sep 19, 2018 at 14:36
  • When the app loads, a List in variable format needs to be created of the currency names as defined in 'crypto_data.dart' and 'crypto_data_prod.dart'. Thanks Commented Sep 19, 2018 at 14:45
  • Hey Dinesh, any luck with this? Commented Sep 20, 2018 at 11:44

1 Answer 1

1

I cloned and ran your app. There was one compilation error in crypto_data_prod.dart.

If you are using named import, use like

import 'dart:convert' as JSON; // named import (importing convert lib as JSON)

final List responseBody = JSON.jsonDecode(response.body); // using with name

If you want without named import, then use like

import 'dart:convert'; // importing the lib without any name

final List responseBody = jsonDecode(response.body); // using the method directly

And after that i got this screen,

enter image description here

Do you want to solve somthing else?

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks Dinesh, this looks promising. I’ll get back to you about this in a few hours, I’m out at the moment
Thanks Dinesh, I now understand where the list is saved :)
Cool.. Happy coding

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.