setupFactories function
void
setupFactories({
- AudioRecorderModel recorder()?,
- LocalStorageModel localStorage()?,
- TTSModel tts()?,
- SimpleAudioPlayer simplePlayerFactory(
- 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;
}