Shared Theme

Easily share a theme between Flutter and the web.

Synopsis

A Theme is a ColorSet, FontSet, and an ElementSet, which are abstract containers for defining properties such as border, padding, etc.

Themes are typically combined into a single ThemeSet per application. ThemeSet adds support for bundled FontFaces, and ThemeSet.toString() returns an SCSS string that fully represents it.

In Flutter, a Theme is converted into Flutter's ThemeData by using the shared_theme_flutter package's themeData() function.

Example

There is a complete example included, and in particular, see its ThemeSet definition.

Screenshots

Mobile lightMobile dark
mobile-lightmobile-dark
Web lightWeb dark
web-lightweb-dark

Libraries

shared_theme
Write your themes once and easily use them in Flutter and on the web. [...]