私は、カードのListview.builderの周りにラップされた拡張ウィジェットを持っています。私のカードはonTap
を検出するだけでなく、ナビゲーションの新しい.dartファイルに変数を渡すこともできます。私は現在、サイジングエラーが発生していますか?FlutterのListview.builderカードにGestureDectorを追加する適切な方法は?
はここ
は
The following assertion was thrown during performLayout():
RenderPointerListener object was given an infinite size during layout.
This probably means that it is a render object that tries to be as big as possible, but it was put
inside another render object that allows its children to pick their own size.
私はtitle[index]
に合格したいと思います...ここで
new Expanded(
child: new ListView.builder(
itemCount: id == null ? 0 : id.length,
itemBuilder: (BuildContext context, int index) {
return new Card(
child: new Column(
children: <Widget>[
new Image.network(video[index]),
new Padding(padding: new EdgeInsets.all(3.0)),
new Text(title[index],
style: new TextStyle(fontWeight: FontWeight.bold,
color: Colors.black),
),
new GestureDetector(onTap:(){
print(id[index]);
},)
],
),
);
}))
がスローされた例外である...私のコード* *コードで更新されますSWIFTの
didSelectRowAtIndexPath
に似た「ビデオ[インデックス]」
あなたがにコードを追加した場合も、それは良いでしょう、「私の新しい.dartに変数を渡す」この部分をしてください明確にすることができあなたが達成しようとしているものを見ることができます。 – aziza
@aziza私のコードを追加してエラー例外をスローしました。 –