BuildOwner constructor Null safety

BuildOwner(
  1. {VoidCallback? onBuildScheduled,
  2. FocusManager? focusManager}
)

Creates an object that manages widgets.

If the focusManager argument is not specified or is null, this will construct a new FocusManager and register its global input handlers via FocusManager.registerGlobalHandlers, which will modify static state. Callers wishing to avoid altering this state can explicitly pass a focus manager here.

Implementation

BuildOwner({ this.onBuildScheduled, FocusManager? focusManager }) :
    focusManager = focusManager ?? (FocusManager()..registerGlobalHandlers());