svg_to_flutter 1.0.0%2B4

SDKdartflutter
Platformandroidioswindowslinuxmacos

A tool for converting svg files to a font. To facilitate developers to quickly generate icon font (.ttf) and Flutter icon class, We developed the svg_to_flutter library.

SvgToFlutter

GitHub stars Pub Version Pub Likes Pub Points MIT Licence

A tool for converting SVG files to font files.

Table of Contents

Background

To facilitate developers to quickly generate icon font (.ttf) and Flutter icon class, We developed the svg_to_flutter library.

Then you can use icons like the font.

Requirements

Node.JS V10+ . Install Node

Get Started

Install

dart pub global activate svg_to_flutter

An Example

  1. Put all of your icon SVG into some folder(example/assets);

  2. Generated camus_icons.dart in example/lib and camus_icons.ttf in example/assets

    svg_to_flutter generate  --input=./example/assets --font-output=./example/assets/fonts --class-output=./example/lib
    
  3. Add some code to pubspec.yaml

  fonts:
    - family: CamusIcons
      fonts:
        - asset: assets/fonts/camus_icons.ttf

Params

parameterdescriptiondefault
--helpPrint this usage information--
--inputInput your svg file path--
--font-outputOutput your fonts dir path--
--class-outputFlutter icons Class output dir--
--nameFlutter icons class NameCamusIcons
--delete-inputIs delete your input svg, if false, can preview svgfalse