Skip to content

arjablc/svg_bin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVG_BIN

A helper flutter pacakge that converts your .svg files to binary with the extension .vec using vector_graphics_compiler and provides a widget to render those .vec files using vector_graphics package.

Note: Under Construction

Features

  • generate .vec files
  • generate asset class
    • folder asset class
    • category class
  • add args parser to toggle category modes
  • add args parser to change assets directory (input) and assets class directory(output)
  • seperate converting files and creating the dart file.
  • seperate the bin folders out of the asset folder

Getting started

  • Install the package using following command inside your flutter project.
flutter pub add svg_bin
  • Generate the vec files using the following command
dart run svg_bin
  • The AppAsset class is generated inside /lib/src/core/app_assets/assets.dart (adding custom path is on the agenda)
  • Render the .vec with the SvgBin() widget

Usage

Currently this supports only one input direcotry which will be /assets in your flutter root.

  • Rename your assets to be in the following format:
assets/subfolder/category_name-asset_name.svg
  • This will generate the main asset class, the sub folder class and the category name class, with String getters that will have the actual path of the asset.
  • Make sure you have imported the bin folders into the pubspec.yml of your flutter project. (Don't want to mess with yml just yet).
  • Then just do dart run svg_bin at root of your flutter project.
  • To use the .vec assets use the SvgBin() widget
  • For the love of god don't make your category or folder name same as some of the inbuilt classes in Dart and Flutter.

for a asset like

assets/icons/finance-money.svg

after running the command

SvgBin(
    AppAsset.icons.finance.money,
)

Additional information

Very special thanks to Avishek Subedi dai.

About

A flutter package to convert svg to vec and display it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages