barrierDismissible method

Future<bool?> barrierDismissible(
  1. Scene scene
)

Whether the top modal barrier closes its route when tapped; null when there is no barrier or the app would not say.

Implementation

Future<bool?> barrierDismissible(Scene scene) async {
  final entry = scene.topBarrier;
  if (entry == null) return null;
  final nodes = entry.walk().toList();
  final barrier = nodes.where((n) => n.baseLabel == 'ModalBarrier').firstOrNull ??
      nodes.where((n) => n.baseLabel == 'AnimatedModalBarrier').firstOrNull;
  if (barrier == null) return null;
  try {
    await _runtime.setInspectorSelection(
      inspectorId: barrier.inspectorId,
      groupName: scene.fullGroupName ?? scene.groupName,
    );
    return switch (await _runtime.evaluateString(GeometryExpr.barrierDismissible, rethrowErrors: true)) {
      'true' => true,
      'false' => false,
      _ => null,
    };
  } on Object {
    return null;
  }
}