widget property
Supply the widget through the controller.
Implementation
@override
WebPageWidget? get widget {
if (_widget == null) {
final stateWidget = state?.widget;
// Flutter errors if you cast a null
if (stateWidget != null) {
_widget = stateWidget as WebPageWidget;
}
}
return _widget;
}
Free to explicitly assign the widget.
Implementation
set widget(WebPageWidget? widget) {
if (widget != null) {
_widget = widget;
}
}