removeSchemeSuffix function

String removeSchemeSuffix(
  1. String type
)

Implementation

String removeSchemeSuffix(String type) {
  if (type.startsWith('_') && type.endsWith('Scheme')) {
    type = type.substring(1);
  }

  if (type.endsWith('Scheme')) {
    return type.substring(0, type.length - 'Scheme'.length);
  } else {
    return type;
  }
}