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'
      ])));
}

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!');
    });
  }
}

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));
}

Libraries

angular/component
angular/directives
enums
models
web_font_loader
Support for doing something awesome.
assets/webfont