类型'_InternalLinkedHashMap'不是'BuildContext'类型的子类型
未处理的异常:'package:flutter / src / widgets / page_view.dart':失败的断言:第97行pos 7:'positions.isNotEmpty':在使用PageView建立它之前,无法访问PageController.page
`返回新的GestureDetector( onTap :(){ Navigator.push(data,MaterialPageRoute(builder:(context){ 返回新的DetailPage(record1,record1); //在这里返回新页面/屏幕,我们在此处发送flat_name作为参数,您可以发送下一页所需的任何数据 })); }, 子卡: 海拔:1.5, 子:新列( crossAxisAlignment:CrossAxisAlignment.stretch, mainAxisSize:MainAxisSize.min, verticalDirection:VerticalDirection.down, 儿童:[ 新的Image.network(record1.img_room), 新填充( 填充:EdgeInsets.only(左:10.0), 子:新列( crossAxisAlignment:CrossAxisAlignment.start, 孩子:[
new Text( record1.flat_name),
new Text( record1.address),
],
),
)
],
),
)
);
} }`
答案 0 :(得分:0)
在ListTile
内用GestureDetector
包装_buildListItem
,即
在致电_buildListitem(document, context);
Widget _buildListItem(DcoumentSnapshot document, BuildContext context ){//new argument
return GestureDetector(
child: ListTile(
title: Text(document['flat_name']),
),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context){
return new DetailPage(document);//Here is location where we send our data to next page..
}));
},
);
}