Is there any limitation in BottomSheet that we cannot update the widget states? As you can see in the example below I'm using a Switch but its display is not changing, although the value update, it's just that it doesn't get re-render again.
This is part of StatefulWidget right now.
This same problem I'm experiencing with the DropdownButton widget. These both work in normal page fine.
Does anybody have the idea?
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return BottomSheet(
onClosing: () {},
builder: (BuildContext context) {
return Switch(
onChanged: (bool v) {
debugPrint('v is ${v.toString()}');
// b = v; <<-- This is also not working when using StatelessWidget
setState(() => b = v);
debugPrint(b.toString());
},
value: b,
);
},
);
},
);