inflate method
Set this widget context, build it’s child, and render the widget, updating
Context.element
When overriding pay attention that inflate need to call
build
and render
Implementation
@override
void inflate(BuildContext context) {
bool sameRunType = context.widget.runtimeType == runtimeType;
bool sameKey = context.widget?.key == key;
context.widget = this;
if (context.widgetState == null || !(sameRunType && sameKey)) {
context.widgetState = createState();
context.widgetState!.inflate(context);
} else {
context.widgetState!.inflate(context, runInitState: false);
}
render(context);
}