gpt4 book ai didi

dart - 无法加载源 'dart:core/runtime/libobject_patch.dart' :

转载 作者:行者123 更新时间:2023-12-05 06:28:22 25 4
gpt4 key购买 nike

我收到这个错误:

Could not load source 'dart:core/runtime/libobject_patch.dart': <source not available\>

description of problem

description of problem

Project on GitHub

我有两个下拉列表(一个关于体育项目的下拉列表,另一个关于国家/地区的列表)和一个关于联赛的列表。在下拉列表中选择项目时应该对带有联赛的列表进行排序,当我在下拉列表中选择城市时会弹出此错误。

Future<List<ListTile>> _getListLeagues() async {
http.Response data;
String _str = "countrys";
List<ListTile> listTiles = [];

if ((_choiseCountry == null) & (_choisesport == null)) {
data = await http
.get("https://www.thesportsdb.com/api/v1/json/1/all_leagues.php");
_str = "leagues";
} else if ((_choisesport != null) & (_choiseCountry == null)) {
data = await http.get(
"https://www.thesportsdb.com/api/v1/json/1/search_all_leagues.php?s=$_choisesport");
} else if ((_choiseCountry != null) & (_choisesport == null)) {
data = await http.get(
"https://www.thesportsdb.com/api/v1/json/1/search_all_leagues.php?c=$_choiseCountry");
} else {
data = await http.get(
"https://www.thesportsdb.com/api/v1/json/1/search_all_leagues.php?c=$_choiseCountry&s=$_choisesport");
}

var jsonData = json.decode(data.body);

for (var index in jsonData[_str]) {
if (((_choisesport != null) & (_choisesport == index["strSport"])) |
(_choisesport == null)) {
ListTile list = ListTile(
title: Text(index["strLeague"]),
subtitle: Text(index["strSport"]),
);
listTiles.add(list);
}
}
return listTiles;
}
}

Future<List<DropdownMenuItem<String>>> _sports() async {
var data = await http
.get("https://www.thesportsdb.com/api/v1/json/1/all_sports.php");
var jsonData = json.decode(data.body);

List<DropdownMenuItem<String>> droplist = [];

for (var sport in jsonData["sports"]) {
droplist.add(DropdownMenuItem(
child: Row(children: <Widget>[
Text(sport["strSport"].toString()),
]),
value: sport["strSport"],
));
}
return droplist;
}

最佳答案

NoSuchMethodError 问题通常发生在调用方法的类尚未初始化或方法本身不存在的情况下。在这种情况下,正如之前评论中提到的那样,问题似乎与此类似 ticket发布在 GitHub 上。检查线程,问题应该已经解决。我建议更新您的应用中使用的 Dart 和 Flutter SDK 以解决此问题。

关于dart - 无法加载源 'dart:core/runtime/libobject_patch.dart' : <source not available>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54390922/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com