我正在Dart中发送发帖请求。当我在Postman等API测试工具上进行测试时,它会给出响应。但是当我运行该应用程序时。它给了我以下错误:
E/flutter ( 6264): HandshakeException: Handshake error in client (OS Error: E/flutter ( 6264): CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:363))
Run Code Online (Sandbox Code Playgroud)
这是我的函数代码-
Future getAccessToken(String url) async {
try {
http.post('url',
body: {
"email": "xyz@xyz.com",
"password": "1234"
}).then((response) {
print("Reponse status : ${response.statusCode}");
print("Response body : ${response.body}");
var myresponse = jsonDecode(response.body);
String token = myresponse["token"];
});
} catch (e) {
print(e.toString());
}
Run Code Online (Sandbox Code Playgroud)
这是完整的错误正文-
E/flutter ( 6264): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception: E/flutter ( 6264): HandshakeException: Handshake error in client (OS Error: …Run Code Online (Sandbox Code Playgroud) 我使用 flutter 中的 charts_flutter 包渲染了条形图。但是 x 轴上的域标签彼此重叠。有没有办法解决这个问题?有没有办法倾斜文本或增加图表的宽度以使其可水平滚动?
我曾尝试搜索 labelspecs 之类的任何解决方案,但无法找到解决方案。这是我的代码 -
double maxheight = .80 * MediaQuery.of(context).size.height;
var series = [
new charts.Series(
domainFn: (BarChartConfig barchartconfig, _) => barchartconfig.name,
measureFn: (BarChartConfig barchartconfig, _) => barchartconfig.rowcount,
colorFn: (BarChartConfig barchartconfig, _) => barchartconfig.color,
id: 'Count',
data: datacharts,
)
];
var chart = new charts.BarChart(
series,
animate: true,
animationDuration: Duration(seconds: 2),
);
return SizedBox(
height: maxheight,
child: chart,
);
Run Code Online (Sandbox Code Playgroud) charts google-visualization dart flutter flutter-dependencies