我正在尝试创建一个包含搜索栏,无限滚动产品页面和按钮(添加产品,删除产品和通知)的页面。以下语句有误...
<span id="value" style="margin: 3px;">
<?php
if(get_forum_likes($id_forum, $pdo) < 0){
echo '<span style="color:#fb3f6c;">'.number(get_forum_likes($id_forum, $pdo))."</span>";
} elseif(get_forum_likes($id_forum, $pdo) > 0){
echo '<span style="color:#25804a;">'.number(get_forum_likes($id_forum, $pdo))."</span>";
} else {
echo number(get_forum_likes($id_forum, $pdo));
}
?>
</span>
<i id="<?php echo $id_forum; ?>" class="vote_up fas fa-angle-up"></i>
<script>
$(document).ready(function(){
$("i.vote_up").click(function(){
var value_no = document.getElementById("value");
var forum_id = $(this).attr('id');
$.post("game/forum/vote_post.php",
{
forum_id: forum_id,
type: 0
},
function(res, status){
$("#value").html();
value_no++
}
);
});
});
</script>
请帮助我纠正此代码。
The getter 'visible' was called on null,
Receiver : null,
Tried calling : null
答案 0 :(得分:1)
感谢您的帮助@Mobina和@JohnJoe。 我用柔韧性包装了ListView.builder,从而解决了这个问题,并添加了COntainer将其放在灰色背景中。
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 10.0, bottom: 10.0),
height: 450,
width: 350,
decoration: BoxDecoration(
color: Color(0xFF707070),
borderRadius: BorderRadius.all(
Radius.circular(
10.0,
),
)),
child: Flexible(
child: ListView.builder(
controller: _scrollController,
itemCount: prd.length + 1,
itemExtent: 42.5,
itemBuilder: (context, i) {
if (i == prd.length) {
return CupertinoActivityIndicator();
}
return ListTile(
title: AutoSizeText(prd[i]),
);
}),
),
);
}