从 Dart 2.3 开始,您现在可以进行扩展操作。
var a = [0,1,2,3,4];
var b = [6,7,8,9];
var c = [...a,5,...b];
print(c); // prints: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sync*
和 yield*
。Iterable<Widget> _buildChildren sync* {
yield MyHeader();
yield* _buildListOfWidgetForBody();
yield MyCustomFooter();
}
编辑: 在Dart 2.3中,您现在可以执行以下操作:
Widget build(BuildContext context) {
return Column(
children: <Widget>[
MyHeader(),
..._buildListOfWidgetForBody(),
MyCustomFooter(),
],
);
}
自从Dart 2.3发布以来,现在可以使用扩展运算符。
List<int> a = [0,1,2,3,4];
List<int> b = [6,7,8,9];
List<int> c = [...a,5,...b];
...[
在列表括号之前:https://github.com/rrousselGit/river_pod/blob/d9a8b4a7ef358cacbe3938411835086b7aa3b468/examples/todos/lib/main.dart#L113 - mLstudent33FireStore 在模型中使用另一个字段
authInstance
.collection('fav_product')
.add(
{
...product.toMap(),
'field':'value',
}
);