I am trying to make all subtitle invisible (or make a hint ) and when Clint click on the subtitle (or a hint) I want to show them the subtitle only that subtitle who have clicked to be shown
note: my list is from database locally
here is a picture enter image description here
and here is my code
body: FutureBuilder(
future: getData(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
List snap = snapshot.data;
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
}
if (snapshot.hasError) {
return Center(
child: Text("error"),
);
}
return ListView.builder(
itemCount: snap.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(
" ${snap[index]['text']}",
textDirection: TextDirection.rtl,
style: TextStyle(fontSize: 22),
),
subtitle: Text(
" ${snap[index]['answer']}",
textDirection: TextDirection.rtl,
style: TextStyle(fontSize: 18),
),
);
});
},
),
),
);
}