import ‘dart:convert‘;import ‘dart:HTML‘;voID main() {_getIPAddress() { final url = ‘https://httpbin.org/ip‘; httpRequest.request(url).then((value) { print(Json.decode(value.responseText)[‘origin‘]); }).catchError((error) => print(error));} _getIPAddress();}
114.92.6.153,114.92.6.153
async
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();}总结
以上是内存溢出为你收集整理的dart 函数练习全部内容,希望文章能够帮你解决dart 函数练习所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)