icomoon_icons_generator 1.0.0+4
icomoon_icons_generator: ^1.0.0+4 copied to clipboard
CLI for generating icons from the website icomoon.io font to the Flutter Icon class.
Icon Font Generator #
Setup #
- download icon font from the website http://icomoon.io
Installing #
dart pub global activate icomoon_icons_generator
Run Package #
Note : #
- The CSS file will be obtained by downloading the icon font from the website http://icomoon.io.
dart pub global run icomoon_icons_generator <input CSS file> <output Dart file> <output Mapper Dart file> <Font Family> <Class Name>
Example CLI #
dart pub global run icomoon_icons_generator input.css output.dart mapper.dart "moonIcon" "MoonIcons"
Updated Flutter project's pubspec.yaml: #
flutter:
fonts:
- family: moonIcon
fonts:
- asset: fonts/icomoon.ttf
Example #
import 'package:flutter/material.dart';
class MoonIcons {
static const String _fontFamily = 'moonIcon';
static const add = IconData(0xe901, fontFamily: _fontFamily);
}
Map<String, IconData> getIcons() {
return {
"add": MoonIcons.add,
};
}