getCodePageId method

int getCodePageId(
  1. String? codePage
)

Implementation

int getCodePageId(String? codePage) {
  if (codePages == null) {
    throw Exception("The CapabilityProfile isn't initialized");
  }

  return codePages
      .firstWhere((cp) => cp.name == codePage,
          // ignore: unnecessary_cast
          orElse: (() => throw Exception(
                  "Code Page '$codePage' isn't defined for this profile"))
              as CodePage Function()?)
      .id;
}