generateCitizenship static method

String generateCitizenship([
  1. Citizenship? citizenship
])

Generates a citizenship code (C) based on the provided citizenship.

The citizenship parameter specifies the citizenship ('citizen' or 'resident'). Returns a string representing the generated citizenship code.

Implementation

static String generateCitizenship([Citizenship? citizenship]) {
  if (citizenship == null) {
    return Random().nextBool() ? '0' : '1';
  } else {
    return citizenship.value;
  }
}