generate static method

String generate({
  1. required IconEntity icon,
  2. required String className,
})

Implementation

static String generate({
  required IconEntity icon,
  required String className,
}) {
  final name = icon.name.camelCase;
  final code = icon.code.toRadixString(16);

  var template = _template.replaceAll('%CLASS_NAME%', className.pascalCase);
  template = template.replaceFirst('%ICON_NAME%', name);
  return template.replaceFirst('%ICON_CODE%', code);
}