gpt4 book ai didi

flutter - dart 中的 .. 运算符是什么?

转载 作者:IT王子 更新时间:2023-10-29 07:11:17 25 4
gpt4 key购买 nike

Widget customWidget(int position){
return Transform(
transform: Matrix4.identity()..rotateY(position),
child: Container(
color: position % 2 == 0 ? Colors.lightBlueAccent: Colors.black87,
),
)
}

Matrix4.identity()..rotateY(position) 中的.. 是什么?

最佳答案

Cascade notation

来自官方文档

Cascades (..) allow you to make a sequence of operations on the same object.

In addition to function calls, you can also access fields on that same object. This often saves you the step of creating a temporary variable and allows you to write more fluid code.

关于flutter - dart 中的 .. 运算符是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56521571/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com