captureAssetSelection method

Future<void> captureAssetSelection(
  1. AssetEntity asset
)

Select asset and return it to the caller

Implementation

Future<void> captureAssetSelection(AssetEntity asset) async {
  dataStore.selectedAssets.value.clear();
  dataStore.selectedAssets.addAsset(await AssetModel.fromAssetEntity(asset));
  final List<XFile> assets = <XFile>[];
  dataStore.selectedAssets.value.forEach((AssetModel element) {
    assets.add(element.file);
  });
  dataStore.selectedAssets.value.clear();
  dataStore.availablePath.value.clear();
  unawaited(dataStore.cameraController.dispose());
  dataStore.isPreviewCameraReady.value = false;
  dataStore.mainCompleter.complete(assets);
}