Answer the question
In order to leave comments, you need to log in
Flutter (Dynamic Blocks) show/hide. How to split the disclosure blocks?
Please help me with point 1.
I have a list of objects displayed dynamically. Each of them has a button, when clicked, a block inside each element should open.
It looks like this:
At the moment, the following is implemented. way:
Visibility(
visible:_visible,
child: Container(
child: Column(
children: [
Html(
data: ('<ul><li>ТЕКСТ</li><li>ТЕКСТ</li></ul>'),
style: {
'ul':Style(
),
'li':Style(
color: Colors.black,
)
},
),
],
),
),
)
void _toggle() {
setState(() {
_visible = !_visible;
});
}
Answer the question
In order to leave comments, you need to log in
Resolved the issue.
Perhaps someone will come in handy.
void showHide(int i){
setState((){
showQty[i]=!showQty[i];
});
}
Visibility(
visible:showQty[position],
child: Container(
child: Column(
children: [
Html(
data: ('${article[position].description}'),
style: {
'ul':Style(
),
'li':Style(
color: Colors.black,
)
},
),
],
),
),
),
@override
void initState() {
for(int i=0;i<10;i++){
showQty.add(false);
}
super.initState();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question