getPackageName method

String getPackageName()

Returns provided or deduced package name, throws Exception if none found.

Implementation

String getPackageName() {
  final String? name = _dartPackageName ?? deducePackageName(dartOut ?? '');
  if (name == null) {
    throw Exception(
      'Unable to deduce package name, and no package name supplied.\n'
      'Add a `dartPackageName` property to your `PigeonOptions` config,\n'
      'or add --dartPackageName={name_of_package} to your command line pigeon call.',
    );
  }
  return name;
}