logo
  • 教程列表
  • SO官方文檔
  • 功能
    • 具有命名引數的函式
    • 功能範圍
  1. StackOverflow 文件
  2. dart 教程
  3. 功能
  4. 具有命名引數的函式

具有命名引數的函式

Created: November-22, 2018

定義函式時,使用{param1,param2,…}指定命名引數:

void enableFlags({bool bold, bool hidden}) {
  // ...
}

呼叫函式時,可以使用 paramName:value 指定命名引數

enableFlags(bold: true, hidden: false);
  • 功能範圍
  • 功能

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明