addImageSource method

void addImageSource(
  1. dynamic localFile
)

Add an image source.

Implementation

void addImageSource(final localFile) {
  if (state.currentScene == null) {
    throw AssertionError('currentScene must not be null');
  }
  DiveImageSource.create(localFile).then((source) {
    if (source != null) {
      updateState((state) => state.copyWith(imageSources: state.imageSources.toList()..add(source)));
      state.currentScene?.addSource(source);
    }
  });
}