load static method

Future<CapabilityProfile> load({
  1. String name = 'default',
})

Public factory

Implementation

static Future<CapabilityProfile> load({String name = 'default'}) async {
  ///
  await ensureProfileLoaded();

  var profile = printCapabilities['profiles'][name];

  if (profile == null) {
    throw Exception("The CapabilityProfile '$name' does not exist");
  }

  List<CodePage> list = [];
  (profile['codePages'] as Map).forEach((k, v) {
    list.add(CodePage(int.parse(k), v));
  });

  // Call the private constructor
  return CapabilityProfile._internal(name, list);
}