如何在飞镖中使用 Get 方法?

How to use Get method in dart?

如何在 dart 中使用 Get 方法,然后将 json(从服务器返回)解码为变量? 有什么例子吗?

使用 http 和转换包轻松完成: htttp convert

 import 'dart:convert' as convert;
 import 'package:http/http.dart' as http;
 var url =
      Uri.https('your url', 'apiEndPoint', {'queryParameter': '{queryValue}'});

  // Await the http get response, then decode the json-formatted response.
  var response = await http.get(url);
  if (response.statusCode == 200) {
    var jsonResponse =
        convert.jsonDecode(response.body) as Map<String, dynamic>;
    var item = jsonResponse['itemName'];
    print('Item is : $item.');
  } else {
    print('Request failed with status: ${response.statusCode}.');
  }