web_font_loader

Creator: coderz1093

Last updated:

0 purchases

web_font_loader Image
web_font_loader Images

Languages

Categories

Add to Cart

Description:

web font loader

Web Font Loader #
You can use the interface directly:
import 'package:web_font_loader/web_font_loader.dart';

void main() {
load(Options(
google: GoogleFonts(families: [
'Lato'
])));
}
copied to clipboard
Use the service:
class MyComponent {
MyComponent(this._font);

final FontService _font;

void main() {
final family = GoogleFontFamilyImpl('Lato')
..styles.add(FontStyleImpl(family, 'Regular 400',
FontWeight.regular));

// can safely be called multiple times without
// downloading the fonts more than once
_font.use(family).then((ev) {
print('Font loaded!');
});
}
}
copied to clipboard
There is also a directive:
@Component(
//...
template: '<div [font-loader]="family">hello</div>',
directives: [FontLoaderComponent]
)
class MyComponent {
final family = GoogleFontFamilyImpl('Lato')
..styles.add(FontStyleImpl(family, 'Regular 400',
FontWeight.regular));
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.