Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 连接到firebase时,贴图在颤振中出现问题_Flutter_Dart - Fatal编程技术网

Flutter 连接到firebase时,贴图在颤振中出现问题

Flutter 连接到firebase时,贴图在颤振中出现问题,flutter,dart,Flutter,Dart,我有一个Record3类,它从我的云firestore获取数据: class Record3 { final String name; final int ref; final bool display; final DocumentReference reference; Record3.fromMap(Map<String, dynamic> map, {this.reference}) : assert(map['name'] != null)

我有一个Record3类,它从我的云firestore获取数据:

class Record3 {
  final String name;
  final int ref;
  final bool display;
  final DocumentReference reference;

  Record3.fromMap(Map<String, dynamic> map, {this.reference})
      : assert(map['name'] != null),
        assert(map['ref'] != null),
        assert(map['display'] != null),
        name = map['name'],
        ref = map['ref'];
        display = map['display'];


  Record3.fromSnapshot(DocumentSnapshot snapshot)
      : this.fromMap(snapshot.data(), reference: snapshot.reference);

  @override
  String toString() => "Record<$name:$ref:$display>";
}
并且
map
抛出错误:

The name 'display' is already defined.
Try renaming one of the declarations.
Undefined name 'map'.
Try correcting the name to one that is defined, or defining the name.

我不太确定如何修复这些错误,因为这两个错误都是定义好的,所以我觉得这与添加
display
和不更改map中的变量有关?我不确定,所以任何帮助都将不胜感激

将显示分配前的行更改为
ref=map['ref'],
用逗号代替分号。

我不敢相信这就是我错过的哈哈,谢谢!!