isConfigValid method

String? isConfigValid(
  1. Map<String, dynamic> config
)

Check whether the given configuration is valid. If the configuration is valid, returns null. Otherwise, returns a description of the reason the configuration is invalid. This should always return null if !inConfig(config).

Implementation

String? isConfigValid(final Map<String, dynamic> config) {
  if (!inConfig(config)) {
    return null; // No issue if not in the configuration file.
  }

  if (!config.containsKey('image_path_' + platformConfigKey) &&
      !config.containsKey('image_path')) {
    return 'Configuration requests $platformConfigKey icons, but does not provide an image path.';
  }

  return null; // No issues.
}