上面提出警告,以插入,更新,删除方法,即:'categorydao。插入'(“future
函数(类别义)”)不是'daoInterface的有效替代。插入'(“未来函数(t)”)。 (文档) 成员被覆盖(dao_interface。Dart:9)。 我尝试使用对象基类,仿制药等和nothign似乎允许这种行为。我希望将此接口实现为其他DAO,这些DAO会参加不同的实体类,以减少代码重复(使用人格等)。想法?我是在错误地接近这个吗?
飞镖分析仪显示错误消息,因为:
如果有充分的理由使用子类型作为参数,则可以使用关键字
来做到这一点。
@override
Future<CategoryEntity?> insert(covariant CategoryEntity entity) {
// TODO: implement insert
throw UnimplementedError();
}
其他选项是更改为:有关更多信息,请参见couse-sound-sound参数类型 - 当时 - 越过的方法。
DaoInterface