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

标签 flutter dart

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/

相关文章:

flutter - 如何在 Flutter 中并排显示按钮?

firebase - Flutter:Crashlytics插件在崩溃时引发错误状态错误

android - Play商店中的“更新”按钮不适用于我的新更新

android - Flutter:下面的代码有更好的写法吗?

dart - 缺少 Pusher ChatKit Api 的 HTTPS header

android - Flutter Background 任务在每天午夜处理和安排当天的通知

flutter - 如何为 macos 桌面应用启用 Flutter 上网权限?

dart - 将 .dart.snapshot 反编译成 Dart 源码

flutter - SvgPicture 不能分配给 ImageProvider

dart - 谷歌地图使用 google_maps_flutter 插件显示空白 map