tryToHide method

Future<void> tryToHide()

Try to hide the sheet if there are selected assets

Implementation

Future<void> tryToHide() async {
  if (dataStore.selectedAssets.value.isNotEmpty) {
    if (!_isAlertOpen) {
      _isAlertOpen = true;
      unawaited(animateSheet(0.3));
      final bool isClose = await dataStore.style.showCustomAlert?.call() ??
          await showCloseAlertDialog(
            style: dataStore.style.closeAlertStyle,
            context: sheet.currentContext!,
          );

      if (!isClose) {
        unawaited(animateSheet(initialChildSize));
      } else {}
      _isAlertOpen = false;
    }
  } else {
    await animateSheet(minChildSize);
  }
}