native_font 1.1.1 copy "native_font: ^1.1.1" to clipboard
native_font: ^1.1.1 copied to clipboard

A plugin for lazily loading fonts from native side, supporting ttf and otf formats.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:native_font/native_font.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Native Fonts'),
        ),
        body: Column(
          children: <Widget>[
            Text(
              'Caveat (Download in native after 3s)',
              style: nativeFontTextStyle(
                fontFamily: 'Caveat',
                fontSize: 30,
              ),
            ),
            Text(
              'Roboto',
              style: nativeFontTextStyle(
                fontFamily: 'Roboto',
                fontSize: 30,
              ),
            ),
            Text(
              'Roboto Italic',
              style: nativeFontTextStyle(
                fontFamily: 'Roboto',
                fontSize: 30,
                fontStyle: FontStyle.italic,
              ),
            ),
            Text(
              'Roboto Medium',
              style: nativeFontTextStyle(
                fontFamily: 'Roboto',
                fontSize: 30,
                fontWeight: FontWeight.w500,
              ),
            ),
            Text(
              'Roboto Bold',
              style: nativeFontTextStyle(
                fontFamily: 'Roboto',
                fontSize: 30,
                fontWeight: FontWeight.w700,
              ),
            ),
            Text(
              'Roboto Bold Italic',
              style: nativeFontTextStyle(
                fontFamily: 'Roboto',
                fontSize: 30,
                fontWeight: FontWeight.w700,
                fontStyle: FontStyle.italic,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
8
likes
150
pub points
61%
popularity

Publisher

unverified uploader

A plugin for lazily loading fonts from native side, supporting ttf and otf formats.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on native_font