Pot*_*ato 2 facebook-graph-api dart flutter
我正在使用http.get获取用户的fb个人资料图片,但图片非常小且模糊,我怎样才能获得更好的图片?目前这是我获取图像并存储它的代码:
final token = result.accessToken.token;
final graphResponse = await http.get('https://graph.facebook.com/v3.3/me?fields=name,picture,friends,email&access_token=${token}');
final profile = JSON.jsonDecode(graphResponse.body);
print(profile);
setState(() {
userProfile = profile;
_isLoggedIn = true;
});
Run Code Online (Sandbox Code Playgroud)
然后当我在我的数据库中设置数据时:
'photoUrl':userProfile["picture"]["data"]["url"],
Run Code Online (Sandbox Code Playgroud)
图片非常小且模糊,因为我在 url idk 中得到了 50 的宽度和高度,但是如何更改它?
有关指定维度的示例 URL,请参见下文。
final graphResponse = await http.get(
'https://graph.facebook.com/v2.12/me?fields=name,picture.width(800).height(800),first_name,last_name,email&access_token=${fbToken}');
Run Code Online (Sandbox Code Playgroud)
这确实是一个 FB Graph API 问题,之前在这里回答过:获取全尺寸个人资料图片
| 归档时间: |
|
| 查看次数: |
4235 次 |
| 最近记录: |