Skip to content

Instantly share code, notes, and snippets.

@chalin
Created December 12, 2018 00:39
Show Gist options
  • Save chalin/04bb4334985107cddcd021322398c918 to your computer and use it in GitHub Desktop.
Save chalin/04bb4334985107cddcd021322398c918 to your computer and use it in GitHub Desktop.
import 'dart:convert';
import 'dart:html';
void main() {
_getIPAddress() async {
final url = 'https://httpbin.org/ip';
var request = await HttpRequest.request(url);
String ip = json.decode(request.responseText)['origin'];
print(ip);
}
_getIPAddress();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment