getRequiredSection method

ConfigurationSection getRequiredSection(
  1. String key
)

Gets a configuration sub-section with the specified key.

If no matching sub-section is found with the specified key, an exception is raised.

Implementation

ConfigurationSection getRequiredSection(String key) {
  var section = getSection(key);
  if (section.exists()) {
    return section;
  }
  throw Exception('Section $key not found in configuration.');
}