name property

  1. @override
String name
override

Returns a identifier name, which is ideally unique and valid.

Implementation

@override
String get name {
  // Omit root directory from the name if it is either asset or assets.
  // TODO(bramp): Maybe move this into the _flatStyleDefinition
  String p = path.replaceFirst(RegExp(r'^asset(s)?[/\\]'), '');
  if (basenameOnly) {
    p = basename(p);
  }
  if (!needExtension) {
    p = withoutExtension(p);
  }

  return style(convertToIdentifier(p)) + suffix;
}