MConfigOption.init constructor

MConfigOption.init({
  1. String env = "",
  2. String configPath = "configs",
  3. required String configName,
  4. String configType = "yaml",
})

Implementation

MConfigOption.init({
  String env = "",
  this.configPath = "configs",
  required this.configName,
  this.configType = "yaml",
}) {
  String e = Platform.environment["ENV"] ?? "";
  if (env.isNotEmpty) {
    e = env;
  }
  if (e.isEmpty || configName.isEmpty) {
    throw "invalid config option";
  }

  this.env = e;
}