In FlutterFlow, in my custom code Widget I want to pass in a Component (ExhibitCellStatic) as a Widget Builder and use it as an overlay. However, I want to modify its data before including it in my custom code Widget's build() method. I have a "title" parameter specified in the custom code Widget's Widget Builder params:
It seems that when instantiating the Widget Builder (ExhibitCellStatic) in the custom code, it's ignoring any parameters...
class CustomComp extends StatefulWidget {
const CustomComp({
super.key,
this.width,
this.height,
required this.exhibitCellWidget,
final double? width;
final double? height;
final Widget Function(String? title) exhibitCellWidget;
});
@override
State<CustomComp> createState() => _CustomCompState();
}
class _CustomCompState extends State<CustomComp> {
@override
Widget build(BuildContext context) {
return widget.exhibitCellWidget("Hello Title") // shows "Title From FF Layout"
}
}
...instead, it seems to only use what was passed in from where it was specified in the FF layout editor:
Is there any other way to modify the data being displayed in the Widget Builder from within the parent custom code? I thought maybe I could modify the Widget Builder's state variables but having trouble connecting the dots there. Something like:
var exhibitCell = widget.exhibitCellWidget("Ignored Title");
exhibitCell.setState((){
this.title = "Hello World!";
});
Ideally the widget parameters would just be overridden in the custom code. Is this not supported?