如何从angulardart获取客户的IP地址?我无法通过Google找到。
答案 0 :(得分:1)
作为替代/临时解决方案,您可以使用ipify api检索ip:
var client = new BrowserClient();
var response = await client.get('https://api.ipify.org?format=json');
print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');