PhotoManager.withPlugin constructor

  1. @visibleForTesting
PhotoManager.withPlugin([
  1. PhotoManagerPlugin? photoManagerPlugin
])

Creates a new instance of the PhotoManagerPlugin class with an optional plugin instance to use instead of the global singleton.

This is primarily intended for use in testing scenarios where you need to inject a mock or stubbed plugin instance.

Implementation

@visibleForTesting
PhotoManager.withPlugin([base.PhotoManagerPlugin? photoManagerPlugin]) {
  if (photoManagerPlugin != null && photoManagerPlugin != base.plugin) {
    base.plugin = photoManagerPlugin;
  }
}