initialize method

void initialize()

Runs blocBuilders and repositoryBuilders if they haven't been ran before. You can access these using the read function.

Implementation

void initialize() {
  if (initialized) {
    return;
  }

  _initializedMap[BlocEventChannel] = repositorySource.channel;
  repositoryBuilders.forEach((element) {
    final repo = element.builder(
      ReadableFromFunc(<T>() => read<T>(allowUninitialized: true)),
    );
    _initializedMap[element.builderType] = repo;
    repo.initialize(eventChannel);
  });

  blocBuilders.forEach((element) {
    final bloc = element.builder(
      ReadableFromFunc(<T>() => read<T>(allowUninitialized: true)),
      eventChannel,
    );
    _initializedMap[element.builderType] = bloc;
    _initializedMap[BlocEventChannel] = bloc.eventChannel;
  });

  initialized = true;
}