小编Ami*_*ren的帖子

从localhost接收数据会引发"Connection Refused Error"

我正在运行一个颤动的应用程序并试图从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已打开.现在,我想到可能将我的侦听端口更改为上面的端口.这样做,将错误中的端口切换到其他随机端口并给出相同的错误.
我不明白为什么它甚至在寻找那个港口.它不是写在任何地方.
有人有什么想法吗?提前致谢.

sockets http dart flutter

9
推荐指数
0
解决办法
5575
查看次数

RowState.Added 和 DataRowVersion.Original 有什么区别

我有一个具有 3 个条件的函数:

  1. 如果 DataRow rowstate == Added
  2. 如果 !DataRow HasVersion(DataRowVersion.Original)
  3. 如果 DataRow rowstate == modified

我的问题是第二个,有人能解释一下吗? 它与第一个条件有何不同?

.net c# datatable datarow rowstate

4
推荐指数
1
解决办法
3294
查看次数

混合列和行解决错误

我正在尝试为我的应用程序创建一个表单,该表单在一行中包含两列。应该是这样的:

在此处输入图片说明

但是当我运行这段代码时:

@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)

dart flutter

1
推荐指数
1
解决办法
4623
查看次数

标签 统计

dart ×2

flutter ×2

.net ×1

c# ×1

datarow ×1

datatable ×1

http ×1

rowstate ×1

sockets ×1