Configuration constructor

Configuration({
  1. required ProjectType projectType,
  2. required List<FeatureConfiguration> features,
  3. String? projectDirPath,
})

Create a Configuration with the projectType list of features and projectDirPath.

Implementation

Configuration({
  required this.projectType,
  required this.features,
  String? projectDirPath,
}) : projectDirPath = projectDirPath ?? Directory.current.path {
  if (this.projectDirPath.trim().isEmpty == true ||
      !Directory(this.projectDirPath).existsSync()) {
    throw ArgumentError.value(
      this.projectDirPath,
      'Project dir path',
      'Not specified or does not exist',
    );
  }

  if (features.isEmpty == true) {
    throw ArgumentError.value(
      features,
      'features',
      'At least one feature need to be specified',
    );
  }
}