overrideWithBuild method

Override overrideWithBuild(
  1. EditBuffer build<T extends Object>(
    1. Ref ref,
    2. EntityCrud<T> notifier
    )
)

Overrides the build method of a notifier, allowing you to replace the default implementation with a custom one for testing or specific use cases.

This override affects only the build method of the notifier, leaving the rest of the provider's behavior unchanged. It is useful when you want to customize the notifier's initialization logic without altering other aspects of the provider.

Implementation

Override overrideWithBuild(
  EditBuffer Function<T extends Object>(Ref ref, EntityCrud<T> notifier)
  build,
) => $FamilyOverride(
  from: this,
  createElement: (pointer) {
    final provider = pointer.origin as EntityCrudProvider;
    return provider._captureGenerics(<T extends Object>() {
      provider as EntityCrudProvider<T>;
      return provider
          .$view(runNotifierBuildOverride: build<T>)
          .$createElement(pointer);
    });
  },
);