eufemia library

Implementation of the DNB's Eufemia design system.

Contains different libraries split into different realms of the design system itself:

  • Typography
  • Spacing
  • Components
  • Palette

To set up Eufemia:

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

And to access Eufemia properties:

final typography = EufemiaTypography.of(context);
final palette = EufemiaPalette.of(context);
final spacing = EufemiaSpacing.of(context);

// Alternatively:
final eufemia = Eufemia.of(context);
final palette = eufemia.palette; // etc..

Classes

Bar
A higher-order Bar widget that can be used to display any kind of bar.
BottomBar
A bottom app bar from the Eufemia design system.
BottomSheetService
A wrapper around helper methods for showing native bottom sheets.
CardBase
A plain base/background for a PaymentCard
Cell
A list cell from the Eufemia design system.
CellAction
An action to display as a result of platform gestures on a Cell.
Checkmark
A checkmark from the Eufemia design system.
ColoredIcon
A widget wrapping its child with a colored box.
ColorJsonConverter
A converter class for converting Color to JSON and vice versa
ContentCard
A card from the Eufemia Design System.
DialogAction
An action to use with system dialogs.
DialogService
A wrapper around helper methods for showing system dialogs.
Eufemia
A widget wrapping its child with EufemiaData and providing an accessor to a context's nearest EufemiaData parent.
EufemiaButton
A generic button from the Eufemia design system used as a base for all buttons.
EufemiaButtonState<T>
A generic button state class used to provide different values for different states of an EufemiaButton
EufemiaButtonStyle
A style class for EufemiaButton that wraps EufemiaButtonState instances for the decorative parameters of a button.
EufemiaButtonTheme
A widget that provides its children with a EufemoaButtonThemeData instance.
EufemiaButtonThemeData
The ovverarching theme data each EufemiaButton derives its properties from.
EufemiaColors
Static class containing all colors defined in the Eufemia design system.
EufemiaColumn
A subclass of EufemiaFlex that lays its children out on the vertical axis.
EufemiaData
A bundle of all Eufemia theme components.
EufemiaFlex
A supercharged Flex widget with Eufemia-specific properties like padding and children spacing.
EufemiaFloatingActionButton
A floating action button (FAB) from the Eufemia design system.
EufemiaGap
An empty spacing widget used to create padding or space.
EufemiaIconData
Static access class for EufemiaIcons data.
EufemiaIcons
A wrapper around all possible EufemiaIconData code points.
EufemiaInsets
An immutable set of offsets in each of the four cardinal directions. [...]
EufemiaPadding
A widget providing its child with Eufemia-specific padding.
EufemiaPalette
Widget providing its children with EufemiaPaletteData as well as methods for loading and updating the palette during runtime.
EufemiaPaletteData
A class containing the color scheme used by the Eufemia design system.
EufemiaPaletteProvider
A provider wrapper around EufemiaPaletteData allowing its children to be notified and rebuilt when the palette changes.
EufemiaPrimaryButton
A primary button from the Eufemia design system.
EufemiaRow
A subclass of EufemiaFlex that lays its children out on the horizontal axis.
EufemiaSecondaryButton
A secondary button from the Eufemia design system.
EufemiaSides
A class defining an object which may or may not have a top, bottom, left or right side.
EufemiaSlider
Adaptive slider from the Eufemia Design System
EufemiaSpacing
Widget providing its children with EufemiaSpacingData as well as methods for loading and updating the palette during runtime.
EufemiaSpacingData
A class containing the collection of spacings defined by the Eufemia design system.
EufemiaSpacingProvider
A provider wrapper around EufemiaSpacingData allowing its children to be notified and rebuilt when the spacing changes.
EufemiaSwitch
Switch from the Eufemia design system.
EufemiaTab
Tab from the Eufemia design system.
EufemiaTabBar
A tab bar from the Eufemia design system.
EufemiaText
A Text wrapper that takes an EufemiaTextStyle instead of a Flutter TextStyle.
EufemiaTextButton
A text button from the Eufemia design system.
EufemiaTextStyle
A text style from the Eufemia design system.
EufemiaThemeAdapter
An adapter bridging Eufemia and ThemeData.
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.
EufemiaVividButton
A vivid button from the Eufemia design system.
EufemiaWrap
A supercharged Wrap with Eufemia-specific properties.
Flag
A flag illustration widget from the Eufemia design system.
FlagData
Wrapper for flag illustrations
GradientWidget
A widget masking its child with a gradient. Can be used for overlay effects like fades, color gradients etc.
InputField
An input field from the Eufemia design system.
Language
Convenience class for language-related methods
A logo from the Eufemia design system.
LogoData
Static class wrapping asset paths for logo data
MessageBox
A message box from the Eufemia design system.
ModalAction
Helper class for actions to show on a modal sheet
A header or navigation bar from the Eufemia design system.
PageIndicator
Page indicator from the Eufemia Design System
PaymentCard
A payment card widget from the Eufemia design system
PaymentCardBackContent
A configuration class that defines the back side of a PaymentCard.
PaymentCardFrontContent
A configuration class that defines the front side of a PaymentCard.
PickerAction
An action to be used with a picker component.
PickerService
A wrapper around helper methods for picker components.
ScrollableList
A wrapper around ListView with Eufemia-specific customizations.
SearchField
Search bar from the Eufemia design system.
SegmentedControl<T>
An adaptive segmented control from the Eufemia design system.
Shimmer
A shimmer/skeleton placeholder component from the Eufemia design system.
Snacks
Wrapper around SnackBar helper methods.
Spinner
A spinner from the Eufemia design system.
StaticList
A static (non-scrollable) list from the Eufemia design system.
Tag
Tag from the Eufemia design system
Toggle
Toggle label from the Eufemia Design System
Toolbar
A toolbar from the Eufemia design system.
UpdateIcon
An adaptive illustration to signal an available update.

Extensions

EufemiaButtonSizeExtensions
An extension that converts Eufemia-specific values to default Flutter-friendly values
EufemiaContextExtension
Quality-of-life extensions on BuildContext.
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.
EufemiaPaletteDataExtension
An extension that converts internal values from Eufemia to Flutter-friendly values.
EufemiaSpaceExtension
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.
Extra
BuildContext extensions for performing SnackBar-related actions on the context instance.
Snack
SnackBar extension simplifying tasks like showing a SnackBar in a given context or ScaffoldState.
WidgetIterableExtension
An extension that converts internal values from Eufemia to Flutter-friendly values.

Constants

goldenRatio → const double
{@category Components} {@subCategory Graphics} The golden ratio. In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities.
1.618

Functions

adaptiveShadows(BuildContext context, {double spreadRadius, double blurRadius, Offset offset}) List<BoxShadow>
Creates a shadow based on the current EufemiaPalette's shadow colors.
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.
paletteUrlLoader(String url, {Map<String, String> headers}) Future<EufemiaPaletteData>
Loads EufemiaPaletteData from the given url

Enums

CardDesign
A pre-defined card design for PaymentCard widgets
A type of card issuer logo to display
CardPreset
A pre-defined preset of a DNB credit/debit-card
CardProgram
Different DNB memberships available
CardType
A card issuer and type combination
CaseType
Different casing types for a string
EufemiaButtonSize
The size of the EufemiaButton, according to the Eufemia specifications
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.
EufemiaSpace
Defines the different spacing constants used within the design system. Often used in combination with the EufemiaGap or EufemiaPadding widgets. [...]
EufemiaTextPredefinedStyle
A predefined Eufemia text style.
InputState
A state for an InputField.

Typedefs

EufemiaPaletteLoader() Future<EufemiaPaletteData>
Type definition for an EufemiaPaletteLoader
EufemiaTextStyleWidgetBuilder(BuildContext context, Widget child) Widget
Type definition for a widget builder