isIncreasingVisibility static method

bool isIncreasingVisibility(
  1. String from,
  2. String to
)

Returns true when to is more exposed than from. Only increasing transitions need user confirmation — lowering visibility reduces access and does not.

Implementation

static bool isIncreasingVisibility(String from, String to) {
  const level = {'private': 0, 'shared': 1, 'public': 2};
  final fromLevel = level[from] ?? 0;
  final toLevel = level[to] ?? 0;
  return toLevel > fromLevel;
}