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

flutter 序列化 #298

Closed
smarthityou opened this issue Mar 5, 2019 · 1 comment
Closed

flutter 序列化 #298

smarthityou opened this issue Mar 5, 2019 · 1 comment

Comments

@smarthityou
Copy link

麻烦大神,flutter在序列化的时候是否可以支持通用类型数据 如:接口返回的数据{State: 200, Error: , Result: 泛型T},我搜索了下 貌似flutter不支持反射

@CarGuo
Copy link
Owner

CarGuo commented Mar 5, 2019

一般我都是

static List decodeListResult(String data) {
return json.decode(data);
}

static Map<String, dynamic> decodeMapResult(String data) {
return json.decode(data);
}

泛型你可以需要参考 https://yq.aliyun.com/articles/689249?spm=a2c4e.11153959.teamhomeleft.51.7eab2529HkOHBf

@CarGuo CarGuo closed this as completed Mar 13, 2019
@CarGuo CarGuo mentioned this issue Nov 21, 2019
@w497763094 w497763094 mentioned this issue Mar 10, 2020
@JevonShi JevonShi mentioned this issue Mar 10, 2020
@HaobinXu HaobinXu mentioned this issue Mar 20, 2020
@luan823230 luan823230 mentioned this issue Mar 24, 2020
@hzg1105 hzg1105 mentioned this issue Jun 14, 2020
@wangkr wangkr mentioned this issue Jul 4, 2020
@jayVRIY jayVRIY mentioned this issue Dec 8, 2022
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

2 participants