build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Different controller sources are different widgets: when the source changes, Flutter itself disposes the previous state (and the own controller with it) and creates a new one, with no case analysis in didUpdateWidget.

Implementation

@override
Widget build(BuildContext context) => switch (_controllerSource) {
  _ExternalController(:final controller) => _ControllerView(controller: controller, page: this),
  final _OwnController own => _OwnedControllerView(settings: own, page: this),
};