OnBuilder<T>.bindingObserver constructor

OnBuilder<T>.bindingObserver({
  1. Key? key,
  2. IObservable<T>? listenTo,
  3. required Widget builder(),
  4. SideEffects<T>? sideEffects,
  5. ShouldRebuild? shouldRebuild,
  6. void didChangeAppLifecycleState(
    1. BuildContext context,
    2. AppLifecycleState state
    )?,
  7. void didChangeLocales(
    1. BuildContext context,
    2. List<Locale>? locale
    )?,
})

Create a widget that registers with the Widgets layer binding. Used to track the app life cycle (AppLifecycleState).

Implementation

factory OnBuilder.bindingObserver({
  Key? key,
  IObservable<T>? listenTo,
  required Widget Function() builder,
  // this.listenToMany,
  SideEffects<T>? sideEffects,
  ShouldRebuild? shouldRebuild,
  // this.watch,
  // this.debugPrintWhenRebuild,
  void Function(BuildContext context, AppLifecycleState state)?
      didChangeAppLifecycleState,
  void Function(BuildContext context, List<Locale>? locale)? didChangeLocales,
}) {
  return OnBuilderBindingObserver<T>(
    listenTo: listenTo,
    builder: builder,
    sideEffects: sideEffects,
    shouldRebuild: shouldRebuild,
    didChangeAppLifecycleState: didChangeAppLifecycleState,
    didChangeLocales: didChangeLocales,
  );
}