validateFlavorArgs static method

void validateFlavorArgs({
  1. required String? flavorArg,
  2. required String? flavorsArg,
  3. required bool? allFlavorsArg,
})

Validate the flavor arguments

Throws an exception if the arguments are invalid.

Implementation

static void validateFlavorArgs({
  required String? flavorArg,
  required String? flavorsArg,
  required bool? allFlavorsArg,
}) {
  if ((flavorArg != null && flavorsArg != null) ||
      (flavorArg != null && allFlavorsArg == true) ||
      (flavorsArg != null && allFlavorsArg == true)) {
    throw Exception(
      'Cannot use multiple flavor options together. Please use only one of: --${ArgEnums.flavor.name}, --${ArgEnums.flavors.name}, or --${ArgEnums.allFlavors.name}.',
    );
  }
}