I would like to create a new widget class with a container size of 250x500 with the rest of the class/widget 0.5 opacity - allowing the prior widget - we launched from - to be partially visible.
Is this possible ? if so how ?
-Thanks
Below is the Stateful class I am calling
class ShowMyTitles extends StatefulWidget {
@override
_ShowMyTitlesState createState() => _ShowMyTitlesState();
}
class _ShowMyTitlesState extends State<ShowMyTitles> {
List<Map<String, bool>> myListOfMapTitles;
Map<String, bool> valuesHeaders;
int trueCount = 0;
@override
void initState() {
// TODO: implement initState
super.initState();
SettingsForMap SFM = new SettingsForMap();
myListOfMapTitles = SFM.myListOfMapTitles;
valuesHeaders = SFM.valuesHeaders;
}
@override
Widget build(BuildContext context) {
List myTitles = [];
return new WillPopScope(
onWillPop: (){
myListOfMapTitles.forEach((valuesAll) {
valuesAll.forEach((s,b){
if(b == true) {
myTitles.add(s);
print('My Selecteed titles are = ' + s.toString());
}
});
});
Navigator.pop(context, myTitles);
},
child: new Container(
child: new GestureDetector(
onTap: (){
myListOfMapTitles.forEach((valuesAll) {
valuesAll.forEach((s,b){
if(b == true) {
myTitles.add(s);
print('My Selecteed titles are = ' + s.toString());
}
});
});
Navigator.pop(context, myTitles);
},
child: _titlesDialog(context, 'Select 2 Titles (Max)'),
),
),
);
}
There is an Opacity
widget. Wrap the widget you want to be transparent within it.
Opacity(child:MyTransparentWidget(),opacity:0.45)
You can use Stack widget for that.
Surround the widget which you want to change the opacity
and the container
with Stack
widget.
Then wrap the widget which you want to change the opacity
with Opacity
widget and mention required opacity.
Make sure you put the container after the widget which you want to change the opacity
then only it will sit above the transparent widget
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With