rebuild method
Rebuilds the element.
Implementation
@override
void rebuild() {
final sl = widget as SafeLayout;
final fallbackWidget =
sl.fallback ??
Center(
child: Text(
'Screen too small!',
style: const Style(
foreground: Colors.red,
modifiers: Modifier.bold,
),
),
);
if (fallbackElement != null &&
fallbackElement!.widget.runtimeType == fallbackWidget.runtimeType) {
fallbackElement!.update(fallbackWidget);
} else {
fallbackElement?.unmount();
fallbackElement = fallbackWidget.createElement();
fallbackElement!.mount(this);
}
if (childElement != null &&
childElement!.widget.runtimeType == sl.child.runtimeType) {
childElement!.update(sl.child);
} else {
childElement?.unmount();
childElement = sl.child.createElement();
childElement!.mount(this);
}
}