I have been learning flutter for sometime now. I am developing an application and I am stuck with a problem now.
showModalBottomSheet(
context: context,
builder: (context) {
return StatefulBuilder(
builder: (BuildContext context, StateSetter bottomsheetstate){
return buildSheet(context, script,bottomsheetstate);
});
},
isScrollControlled: true,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(15.0)
)
),
).whenComplete((){
SSEClient.unsubscribeFromSSE();
});
},
the whencomplete((){}); function worked when the builder was returning a regular widget (say a container) but when I changed it to return a stateful widget, the whencomplete((){}); function is not working anymore. I am puzzled by this. I want to know what is happening behind the scene and a solution to this problem.
thanks in advance!