tabler_icons_pro 0.1.0
tabler_icons_pro: ^0.1.0 copied to clipboard
Strongly-typed Tabler icons for Flutter with configurable stroke width.
tabler_icons_pro #
Strongly-typed Tabler icons for Flutter, with
configurable stroke width — an API that feels like Flutter's Icon/Icons.
TablerIcon(TablerIcons.home, size: 24, strokeWidth: 1.5)
TablerIcon(
TablerIcons.user,
size: 20,
strokeWidth: 2,
color: Colors.blue,
)
The icon itself is plain data:
const icon = TablerIcons.home;
icon.name; // 'home'
icon.assetPath; // 'tabler:home' (logical id)
icon.defaultStrokeWidth; // 2.0
icon.svg(1.5); // resolved SVG string
Why #
Flutter's font-based Icons can't vary stroke width. Tabler outline icons are
SVGs with a stroke-width attribute, so the weight can match any design system.
This package keeps that flexibility behind a familiar, strongly-typed API.
How it works #
- Each icon is a
const TablerIconDataholding an SVG template with astroke-width="<STROKE_WIDTH>"placeholder. TablerIconsubstitutes the resolved stroke width and renders viaflutter_svg'sSvgPicture.string, coloring with aColorFilter.- Icons are separate
constsymbols, so unused icons are tree-shaken out of your app binary. (No giant asset bundle, no runtime map.)
Resolution order #
Each of size, color, strokeWidth resolves:
explicit argument → TablerIconTheme → Material IconTheme → default.
Set app-wide defaults once:
TablerIconTheme(
data: const TablerIconThemeData(strokeWidth: 1.5),
child: MaterialApp(...),
)
Install #
flutter pub add tabler_icons_pro
Or add it to pubspec.yaml:
dependencies:
tabler_icons_pro: ^0.1.0
Local development / contributors
dependencies:
tabler_icons_pro:
path: ../tabler_icons_pro # local checkout
# git:
# url: https://github.com/tegarnugroho/tabler_icons_pro.git
Regenerating icons (maintainers) #
Icons are generated from the tabler_icons_next dev-dependency (not shipped at
runtime):
dart pub get
dart run tool/generate_icons.dart
Bump tabler_icons_next in pubspec.yaml to update the icon set. The default
stroke width is set in tool/generate_icons.dart (_defaultStrokeWidth).
License #
Code: MIT. Icons: Tabler Icons, MIT © Paweł Kuna.