eufemia_palette 1.1.2

  • Readme
  • Changelog
  • Installing
  • 72

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.

1.1.2 #

  • Add navbarTitle palette property

1.1.1 #

  • Allow for non-text titles on list components
  • 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:


dependencies:
  eufemia_palette: ^1.1.2

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_palette/eufemia_palette.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
52
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Jul 8, 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 does not support Flutter platform android

Because of import path [package:eufemia_palette/eufemia_palette.dart, package:eufemia_palette/src/palette.dart, package:shared_preferences/shared_preferences.dart, package:shared_preferences_linux/shared_preferences_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform ios

Because of import path [package:eufemia_palette/eufemia_palette.dart, package:eufemia_palette/src/palette.dart, package:shared_preferences/shared_preferences.dart, package:shared_preferences_linux/shared_preferences_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform macos

Because of import path [package:eufemia_palette/eufemia_palette.dart, package:eufemia_palette/src/palette.dart, package:shared_preferences/shared_preferences.dart, package:shared_preferences_linux/shared_preferences_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform web

Because of import path [package:eufemia_palette/eufemia_palette.dart, package:eufemia_palette/src/palette.dart, package:shared_preferences/shared_preferences.dart, package:shared_preferences_linux/shared_preferences_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform windows

Because of import path [package:eufemia_palette/eufemia_palette.dart, package:eufemia_palette/src/palette.dart, package:shared_preferences/shared_preferences.dart] that declares support for platforms: android, ios, linux, macos, web

Package not compatible with SDK dart

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

Health issues and suggestions

Document public APIs. (-0.57 points)

137 out of 139 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/palette_data.g.dart. (-1 points)

Analysis of lib/src/palette_data.g.dart reported 2 hints:

line 9 col 23: Name non-constant identifiers using lowerCamelCase.

line 65 col 22: Name non-constant identifiers using lowerCamelCase.

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_palette.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
derived_colors ^0.2.4 0.2.4
flutter 0.0.0
freezed_annotation ^0.7.1 0.7.1 0.11.0
http ^0.12.1 0.12.1
json_annotation ^3.0.1 3.0.1
provider ^4.1.0 4.2.0
shared_preferences ^0.5.7 0.5.8
Transitive dependencies
charcode 1.1.3
collection 1.14.12 1.14.13
file 5.2.1
flutter_web_plugins 0.0.0
http_parser 3.1.4
intl 0.16.1
meta 1.1.8 1.2.1
nested 0.0.4
path 1.7.0
path_provider_linux 0.0.1+2
path_provider_platform_interface 1.0.2
platform 2.2.1
plugin_platform_interface 1.0.2
process 3.0.13
shared_preferences_linux 0.0.2+1
shared_preferences_macos 0.0.1+10
shared_preferences_platform_interface 1.0.4
shared_preferences_web 0.1.2+7
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
vector_math 2.0.8
xdg_directories 0.1.0
Dev dependencies
build_runner ^1.9.0
flutter_test
freezed ^0.10.7
json_serializable ^3.3.0
pedantic ^1.9.0 1.9.0 1.9.1