我正在运行一个颤动的应用程序并试图从localhost接收一个json使用:
Future<String> getJson() async {
http.Response response = await http.get(
Uri.encodeFull("http://localhost:3000/get"),
headers: {
"Accept": "application/json"
}
);
Run Code Online (Sandbox Code Playgroud)
每当我运行应用程序时,我都会得到一个未处理的异常:
SocketException: OS Error: Connection refused, errno = 111, address = 127.0.0.1, port = 48134
Run Code Online (Sandbox Code Playgroud)
端口48134已打开.现在,我想到可能将我的侦听端口更改为上面的端口.这样做,将错误中的端口切换到其他随机端口并给出相同的错误.
我不明白为什么它甚至在寻找那个港口.它不是写在任何地方.
有人有什么想法吗?提前致谢.
我有一个具有 3 个条件的函数:
DataRow rowstate == Added!DataRow HasVersion(DataRowVersion.Original)DataRow rowstate == modified我的问题是第二个,有人能解释一下吗? 它与第一个条件有何不同?
我正在尝试为我的应用程序创建一个表单,该表单在一行中包含两列。应该是这样的:
但是当我运行这段代码时:
@override
Widget build(BuildContext context) {
return /*new Padding (
padding: const EdgeInsets.all(15.0),
child: */new ListView (
//mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[new Row (children: <Widget>[
// Goal + Amount
new ListTile (
title: new Column (
mainAxisSize: MainAxisSize.min,
children: <Widget>[new Expanded(child: new TextField(
controller: widget._NameController,
style: new TextStyle (
fontSize: 20.0,
color: Colors.black,
),
decoration: new InputDecoration(
labelText: 'Name'
),
)), new Expanded(child:
new FlatButton(
onPressed: _showDatePicker,
child: new Text(
PARTIAL_DATE_FORMAT.format(_pickedDate)),
)),
]
)
),
// Goal Deadline
new ListTile …Run Code Online (Sandbox Code Playgroud)