Is it possible to override the opacity value inside a child widget?
I have a list of items and based on an inactive status I'm making them partially transparent.
ListView.builder(
itemBuilder:(c,i) {
if(status) return MyCard(active:status);
else return Opacity(opacity: 0.5, child: MyCard(active: status);
},
itemCount: 5,
);
But now, all the widgets regardless of active or inactive need to show a download button with full visibility.
class MyCard extends StatelessWidget{
///
Widget build(c){
return Column(
children:[
WidgetA(),
WidgetB(),
// this should be always fully visible.
// Can we override the parent's opacity property somehow?
DownloadButton(),
]
);
}
}
Is this behavior possible using Opacity? Or do I need to visit each of the child items separately?