setupFactories function

void setupFactories({
  1. AudioRecorderModel recorder()?,
  2. LocalStorageModel localStorage()?,
  3. TTSModel tts()?,
  4. SimpleAudioPlayer simplePlayerFactory(
    1. File file
    )?,
})

Sets up the factories for components that required them. Such as classes or methods needing the recorder to have been set.

If you don't use components that require a factory, you don't need to set it up.

localStorage is required by many usecases so you may set a factory for it.

Implementation

void setupFactories({
  AudioRecorderModel Function()? recorder,
  LocalStorageModel Function()? localStorage,
  TTSModel Function()? tts,
  SimpleAudioPlayer Function(File file)? simplePlayerFactory,
}) {
  DynamicFactories._recorderFactory = recorder;
  DynamicFactories._localStorageFactory = localStorage;
  DynamicFactories._playerFactory = simplePlayerFactory;
  DynamicFactories.tts = tts;
}