typography library

Provides font assets, typography and text styling features.

The EufemiaTypographyData class is a collection of text styles that are used throughout the library of components. You can create your own, but the default fallback styles are as specified by the Eufemia design system.

The typography provider can be accessed using

final typography = EufemiaTypography.of(context)

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

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

Classes

EufemiaText
A Text wrapper that takes an EufemiaTextStyle instead of a Flutter TextStyle.
EufemiaTextStyle
A text style from the Eufemia design system.
EufemiaTypography
Widget providing its children with EufemiaTypographyData as well as methods for loading and updating the typography during runtime.
EufemiaTypographyData
A class containing the collection of styles, sizes, families, heights and weights from the Eufemia design system.
EufemiaTypographyFamilies
A data class containing the different typography families for the different styles.
EufemiaTypographyHeights
A data class containing the different typography height for the different styles.
EufemiaTypographyProvider
A provider wrapper around EufemiaTypographyData allowing its children to be notified and rebuilt when the typography changes.
EufemiaTypographySizes
A data class containing the different typography sizes for the different styles.
EufemiaTypographyStyles
A data class containing the different typography styles.
EufemiaTypographyWeights
A data class containing the different typography weights for the different styles.

Extensions

EufemiaFontFamilyExtensions
An extension that converts internal values from Eufemia to Flutter-friendly values.
EufemiaFontSizeExtensions
An extension that converts internal values from Eufemia to Flutter-friendly values.
EufemiaFontWeightExtensions
An extension that converts internal values from Eufemia to Flutter-friendly values.
EufemiaLineHeightExtensions
An extension that converts internal values from Eufemia to Flutter-friendly values.
EufemiaTextPredefinedStyleExtension
An extension on EufemiaTextPredefinedStyle that converts internal Eufemia values to Flutter-friendly values.
EufemiaTextStyleExtensions
An extension that converts internal values from Eufemia to Flutter-friendly values.

Functions

fallbackTypography({Color captionColor, Color captionEmphasizedColor, Color footnoteColor, Color footnoteEmphasizedColor, Color subheadColor, Color subheadEmphasizedColor, Color bodyColor, Color bodyEmphasizedColor, Color titleColor, Color titleDemiColor, Color titleEmphasizedColor, Color titleMediumColor, Color titleMediumEmphasizedColor, Color titleLargeColor, Color buttonColor, Color buttonEmphasizedColor, Color buttonSmallColor, Color buttonSmallEmhpasizedColor}) EufemiaTypographyData
Returns a default EufemiaTypographyData instance with Eufemia-specified default values.

Enums

EufemiaFontFamily
A family of the DNB font.
EufemiaFontSize
A font size from the Eufemia design system.
EufemiaFontWeight
A font weight from the Eufemia design system.
EufemiaLineHeight
A specific type of line height for a certain style.
EufemiaTextPredefinedStyle
A predefined Eufemia text style.

Typedefs

EufemiaTextStyleWidgetBuilder(BuildContext context, Widget child) → Widget
Type definition for a widget builder