didUpdateWidget method

  1. @override
void didUpdateWidget(
  1. covariant ArcaneApp oldWidget
)
override

Responds to widget updates, refreshing theme if changed.

This override checks for theme differences from the previous widget and reinitializes _theme accordingly, ensuring consistency during hot reloads or parent updates. Integrates with Flutter's lifecycle for seamless theme transitions without data loss, supporting components reliant on ArcaneTheme like MutableText or IconButton.

Implementation

@override
void didUpdateWidget(ArcaneApp oldWidget) {
  super.didUpdateWidget(oldWidget);
  if (oldWidget.theme != widget.theme) {
    _theme = widget.theme ?? const ArcaneTheme();
  }
}