What does the empty parentheses after the onPressed property mean in Dart?

前端 未结 5 1400
情歌与酒
情歌与酒 2020-12-03 15:11

I know the syntax for calling a function after onPressed and onTap for a widget. There are two options We can use either the () => functio

5条回答
  •  臣服心动
    2020-12-03 15:51

    => (fat arrow) syntax is handy for functions that contain a single statement. This syntax is especially useful when passing anonymous functions as arguments.

提交回复
热议问题