【问题标题】:A function body must be provided. Try adding a function body必须提供函数体。尝试添加一个函数体
【发布时间】:2023-01-01 20:58:31
【问题描述】:

enter image description here

怎么了 必须提供函数体。尝试添加一个函数体。

【问题讨论】:

  • edit您的问题将代码包含为文本而不是图像。

标签: flutter dart dart-null-safety


【解决方案1】:

在构造函数后添加semiColon;或通过添加{}提供函数体

OnBoardingModel({
 required this.image,
 required this.title, 
 required this.body
});                     // ? add this semicolon

要么

OnBoardingModel({
 required this.image,
 required this.title, 
 required this.body
}){}                   // ? add the function body this way

【讨论】:

    猜你喜欢
    • 2019-06-13
    • 2015-05-17
    • 2015-07-04
    • 2018-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-01
    相关资源
    最近更新 更多