Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart:convert包导入不了 #10

Open
junyao-yu opened this issue Dec 8, 2018 · 2 comments
Open

dart:convert包导入不了 #10

junyao-yu opened this issue Dec 8, 2018 · 2 comments

Comments

@junyao-yu
Copy link

如题:这是为何?

@Cecilia-Hee
Copy link

model/company.dart 文件中,下面的fromJson的参数,由之前的json改为jsonStr
因为是json.decode, 而不是JSON.decode

static List fromJson(String jsonStr) {
return json
.decode(jsonStr)['list']
.map((obj) => Company.fromMap(obj))
.toList();
}

@elinxer
Copy link

elinxer commented Jan 7, 2019

新版是
return jsonDecode(json)['list'] .map((obj) => Message.fromMap(obj)) .toList();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants