tabler_icons_next 4.0.1
tabler_icons_next: ^4.0.1 copied to clipboard
Yet another Tabler Icons package for Flutter that keeps updating with the latest version of the upstream.
Tabler Icons Next for Flutter #
Yet another Tabler Icons package for Flutter that keeps updating with the latest version of the upstream.
Upstream version: v3.49.0
🎨 Icons gallery #
https://tabler-icons-next.betakuang.me/
⚡️ Migrate to v4 #
v4 introduces a series of breaking changes. TL;DR: all the arguments inherited from flutter_svg are removed. Only 3 arguments are provided:
size(replacingwidth&height),strokeWidth, andcolor(replacingcolorFilter&colorBlendMode).
Basically all you need to do is:
- replace all
widths andheights withsizes, and - change
colorFilters back tocolors.
It is also worth noting that since 4.0.0, this package no longer follows the version tags of the upstream tabler-icon repository. This allows new features and bug fixes to rollout independently. Version of the upstream will be shown in the beginning of this readme FYI.
🎉 Getting started #
import 'package:tabler_icons_next/tabler_icons_next.dart' as tabler;
tabler.Check()
Names of some icons may conflict with other Flutter/Dart classes (for example Container and BorderRadius). It is recommended to add an alias to the import in order to avoid confusion.
Note:
A dollar sign (
$) prefix is added to icon names not allowed by Dart. Currently onlyFunctionis altered to$Function.
Adjust size & styles #
import 'package:tabler_icons_next/tabler_icons_next.dart' as tabler;
tabler.Check(
size: 18,
strokeWidth: 1.5,
color: Colors.teal,
)
Wrap inside an IconTheme #
Similar to the built-in Icon and IconTheme, Tabler Icons Next provides a way to customize the theme of icons from outside the widgets.
import 'package:tabler_icons_next/tabler_icons_next.dart' as tabler;
tabler.IconTheme(
data: tabler.IconThemeData(
size: 18,
strokeWidth: 1.5,
color: Colors.teal,
),
child: tabler.Check(),
)
This allows you to wrap the icons into your own widgets and customize the styles to your needs. For example:
import 'package:tabler_icons_next/tabler_icons_next.dart' as tabler;
class MyIconButton extends StatelessWidget {
const MyIconButton(
this.icon, {
super.key,
});
// Use tabler.Icon if you need a base class for all icons.
final tabler.Icon icon;
@override
Widget build(BuildContext context) {
return GestureDetector(
// ...
child: tabler.IconTheme(
// Customize the styles of the icon, no matter what icon is passed in.
data: tabler.IconThemeData(
color: Colors.amber,
),
child: icon,
),
);
}
}
License #
MIT