apply method

  1. @visibleForTesting
IconData apply(
  1. BuildContext context, {
  2. bool? rounded,
})

Returns the const round or sharp variant of this icon based on rounded (or the ambient BuildContext's rounded value).

Uses iconsRound / iconsSharp lookup maps so that only pre-existing const IconData values are returned — no non-constant IconData is ever created, which allows Flutter to tree-shake unused icon fonts.

Implementation

@visibleForTesting
IconData apply(BuildContext context, {bool? rounded}) {
  if (fontFamily == ZetaIcons.family) {
    final map = (rounded ?? context.rounded) ? iconsRound : iconsSharp;
    return map[codePoint] ?? this;
  }
  return this;
}