【问题标题】:I am getting an Error -error: The superclass 'xxxx' doesn't have a zero argument constructor我收到一个错误错误:超类“xxxx”没有零参数构造函数
【发布时间】:2021-08-17 20:23:45
【问题描述】:

我正在使用 flutter_local_notifications 并且此错误即将到来。第 450 行是

NotificationPlugin._() {
  init();
}

我是初学者,所以在超类中添加构造函数时遇到问题。我该怎么做? 还有其他一些错误,因为我不确定它是否仅与添加构造函数有关。

【问题讨论】:

    标签: android flutter dart constructor localnotification


    【解决方案1】:

    您应该在这里查看:https://dart.dev/guides/language/language-tour#constructors

    您应该调用超类构造函数之一。

    类似:

    NotificationPlugin._(): super.namedConstructor('some argument value') {
    
      init();
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-06
      • 2020-09-26
      • 2021-08-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-17
      • 2019-04-14
      相关资源
      最近更新 更多