generateFlutterClass function

String generateFlutterClass(
  1. {@required List<GenericGlyph> glyphList,
  2. String className,
  3. String familyName,
  4. String fontFileName,
  5. String package,
  6. int indent}
)

Generates a Flutter-compatible class for a list of glyphs.

  • glyphList is a list of non-default glyphs.
  • className is generated class' name (preferably, in PascalCase).
  • familyName is font's family name to use in IconData.
  • package is the name of a font package. Used to provide a font through package dependency.
  • fontFileName is font file's name. Used in generated docs for class.
  • indent is a number of spaces in leading indentation for class' members. Defaults to 2.

Returns content of a class file.

Implementation

String generateFlutterClass({
  @required List<GenericGlyph> glyphList,
  String className,
  String familyName,
  String fontFileName,
  String package,
  int indent,
}) {
  final generator = FlutterClassGenerator(
    glyphList,
    className: className,
    indent: indent,
    fontFileName: fontFileName,
    familyName: familyName,
    package: package,
  );

  return generator.generate();
}