eufemia_typography 1.1.3

Flutter Android iOS web

A provider of typography and text-related utilities and components from DNB's design system

DNB Design System 👨‍🎨 #

eufemia_flutter pub style: pedantic

preview

DISCLAIMER: This package is in an early stage

Eufemia #

pub

How to use #

Wrap your app in an Eufemia widget, and provide the EufemiaData with the palette, spacing, button and optionally darkPalette parameters:

Eufemia(
  data: EufemiaData(
    palette: EufemiaPaletteData.standard(),
    spacing: EufemiaSpacingData.fallback(),
    button: EufemiaButtonThemeData.fallback(),
    darkPalette: EufemiaPaletteData.dark(),
  ),
),

To use Material widgets, e.g. in a MaterialApp tree, use the provided adapter to provide a Material Theme:

final adapter = EufemiaThemeAdapter(context);

return MaterialApp(
  theme: adapter.theme,
  ...
);

The Eufemia provider with all the theming data can be accessed using

final eufemia = Eufemia.of(context)

Components #

pub

There are multiple UI components

Palette #

pub

This API is subject to change

The EufemiaPaletteData class is a collection of colors that are used throughout the library of components. You can create your own, or use several presets, like the saga, standard, dark and privateBanking factories.

The palette provider can be accessed using

final palette = EufemiaPalette.of(context)

Typography #

pub

If using the included themes, fonts are automatically set up. Otherwise, specify the fontFamily and package properties:

TextStyle(
  fontFamily: 'DNB Sans',
  package: 'eufemia_typography',
)

The typography provider can be accessed using

final typography = EufemiaTypography.of(context)

Spacing #

pub

The EufemiaSpacingData class defines the different kinds of spacing used throughout the app. By default, it provides the standard spacings defined by the Eufemia design system:

  • extraSmall: 4.0
  • small: 8.0
  • medium : 16.0
  • large: 24.0
  • extraLarge: 32.0
  • extraExtraLarge: 40.0

The spacing provider can be accessed using

final spacing = EufemiaSpacing.of(context)

Desktop #

Desktop targets are supported but not currently tested extensively, but may be prioritized in the future. a

Web #

Web targets are supported, but the Web APIs are unstable, and the target is not tested at all. If building a web application, check out eufemia for web for a web native version.

2
likes
80
pub points
44%
popularity

A provider of typography and text-related utilities and components from DNB's design system

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

arneolaim@gmail.com

License

unknown (LICENSE)

Dependencies

derived_colors, eufemia_palette, flutter, freezed_annotation

More

Packages that depend on eufemia_typography