eufemia_typography 1.1.2
eufemia_typography: ^1.1.2 copied to clipboard
A provider of typography and text-related utilities and components from DNB's design system
DNB Design System 👨🎨 #

DISCLAIMER: This package is in an early stage
Eufemia #
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 #
There are multiple UI components
Palette #
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 #
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 #
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.0small: 8.0medium : 16.0large: 24.0extraLarge: 32.0extraExtraLarge: 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.