When I'm writing golden tests, I need to import the tabler-icons.ttf font into my tests through the following code:
const _tablerIconsPath = [
'packages/flutter_tabler_icons/assets/fonts/tabler-icons.ttf'
];
// I will call _loadFonts() in my tests
Future<void> _loadFonts() async {
final tablerIconsFontLoader =
FontLoader('packages/flutter_tabler_icons/TablerIcons');
for (final path in _tablerIconsPath) {
tablerIconsFontLoader.addFont(rootBundle.load(path));
}
await tablerIconsFontLoader.load();
}
If I don't do this, the Tabler icons are not loaded into the screen and they show up as squares in my golden tests.
However, I'm unable to access the assets/fonts/tabler-icons.ttf because it's not within a lib folder. The Flutter docs state that the files need to be within the lib folder.
Is it possible to shift the tabler-icons.ttf into lib/fonts/ so that I can access them in my golden tests?
When I'm writing golden tests, I need to import the tabler-icons.ttf font into my tests through the following code:
If I don't do this, the Tabler icons are not loaded into the screen and they show up as squares in my golden tests.
However, I'm unable to access the
assets/fonts/tabler-icons.ttf
because it's not within alib
folder. The Flutter docs state that the files need to be within thelib
folder.Is it possible to shift the
tabler-icons.ttf
intolib/fonts/
so that I can access them in my golden tests?Thanks!