本文介绍: 类型“Future<int>”不是类型强制转换中类型“int”的子类型。这里不能强制转换,要拿到DatabaseHelper.dbhelper.getTaskGroupRelationOrde()返回结果可以使用DatabaseHelper.dbhelper.getTaskGroupRelationOrder().then((value) =>{})今天调试flutter程序时报错。
问题描述
今天有个同事调试flutter程序时报错,问我怎么解决,程序运行时报如下错误:
type ‘Future’ is not a subtype of type ‘int’ in type cast
错误源码
问题分析
类型“Future<int>”不是类型强制转换中类型“int”的子类型。这里不能强制转换,要拿到DatabaseHelper.dbhelper.getTaskGroupRelationOrde()返回结果可以使用DatabaseHelper.dbhelper.getTaskGroupRelationOrder().then((value) =>{})
解决方法
使用DatabaseHelper.dbhelper.getTaskGroupRelationOrder().then((value) =>{})
修改后的代码
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。