Make Function parameter optional in custom widget flutter

前端 未结 3 1311
半阙折子戏
半阙折子戏 2021-02-19 15:56

I try to create some custom widget with some parameter in the constructor. This widget has some optional and required parameter. how can make Function type paramete

3条回答
  •  忘掉有多难
    2021-02-19 16:17

    Another option if you don't like named parameters (like me :/) is:

    function_name (argument1, [argument2]) {
       // statements
    }
    

    arguments in brackets are optional.

    source

提交回复
热议问题