saveBundle method

Future<void> saveBundle()

Persists lastBundle through the export gateway and stores the returned path as savedPath. Ignored while a save is in flight or no bundle exists.

Implementation

Future<void> saveBundle() async {
  final bundle = _bundle;
  if (_isSaving || bundle == null) {
    return;
  }
  _isSaving = true;
  notifyListeners();
  try {
    _savedPath = await _exportGateway.persist(bundle);
    _lastError = null;
  } on Object catch (error) {
    _lastError = error.toString();
  } finally {
    _isSaving = false;
  }
  notifyListeners();
}