常用库展示
- http
_get() async {
var url = 'www.zouni.vip';
// Await the http get response, then decode the json-formatted response.
var response = await get(url);
if (response.statusCode == 200) {
var res = response.body.toString();
print('Number of books about http: $res');
} else {
print('Request failed with status: $ {response.statusCode}.');
}
}
- url_launcher;
_launchURL() async {
const url = 'https://flutter.dev';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}