Skip to content

Instantly share code, notes, and snippets.

@palaniraja palaniraja/main.dart
Last active Oct 15, 2018

Embed
What would you like to do?
Flutter - Asynchronous programming snippet
import 'dart:convert';
import 'dart:async';
import 'dart:html';
void main(){
_getIPAddress() {
final url = 'https://httpbin.org/ip';
Future<HttpRequest> request = HttpRequest.request(url);
request.then((value) {
print(json.decode(value.responseText)['origin']);
}).catchError((error) => print(error));
}
_getIPAddress();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.