packageName method

  1. @override
String packageName(
  1. String package
)
override

Implementation

@override
String packageName(String package) {
  final index = int.tryParse(package);
  final isIndex = index != null;
  if (isIndex && index >= Packages.values.length) {
    throw const NotExistsResource(cause: 'Unknown Package Index');
  }
  final packageName =
      isIndex ? InputConverter.enumToString(Packages.values[index]) : package;

  return packageName;
}