eufemia_spacing 1.1.1

  • Readme
  • Changelog
  • Installing
  • 72

DNB Design System 👨‍🎨 #

eufemia_flutter pub style: pedantic


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:

  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:

  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.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.

1.1.1 #

  • Allow non-text list titles
  • Update version constraints

[1.1.0+1] #

  • Update README

[1.1.0] #

  • Set Flutter version constraint to >1.17

[1.0.0] #

  • Initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  eufemia_spacing: ^1.1.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:eufemia_spacing/eufemia_spacing.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [eufemia_spacing] that is in a package requiring null.

Health suggestions

Fix lib/src/spacing_data.freezed.dart. (-0.50 points)

Analysis of lib/src/spacing_data.freezed.dart reported 1 hint:

line 15 col 23: The declaration '_' isn't referenced.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (freezed_annotation).

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and eufemia_spacing.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
freezed_annotation ^0.7.1 0.7.1 0.11.0
provider ^4.1.0 4.1.3
Transitive dependencies
collection 1.14.12 1.14.13
json_annotation 3.0.1
meta 1.1.8
nested 0.0.4
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
build_runner any
freezed ^0.10.7
json_serializable ^3.3.0
pedantic ^1.9.0