0

How to get client's IP address from angulardart? I failed to find this out by google.

Andreas
  • 2,455
  • 10
  • 21
  • 24
sgon00
  • 4,879
  • 1
  • 43
  • 59
  • Maybe [this link](https://stackoverflow.com/questions/52411168/how-to-get-device-ip-in-dart-flutter) could help you. – ebelair Feb 15 '19 at 09:36
  • @ebelair I read that link. That link is talking about local IP address. But I want to get the remote IP address from the user. I don't think they are the same. Especially, that link is talking about Flutter app, not angulardart. Cheers. – sgon00 Feb 15 '19 at 11:27

1 Answers1

1

As alternative/temporary solution, you can use ipify api to retrieve the 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}');
ebelair
  • 844
  • 11
  • 27