Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jifalops/shared_theme
Share a theme between Flutter and Web apps.
https://github.com/jifalops/shared_theme
Last synced: 2 months ago
JSON representation
Share a theme between Flutter and Web apps.
- Host: GitHub
- URL: https://github.com/jifalops/shared_theme
- Owner: jifalops
- License: mit
- Created: 2018-09-16T22:00:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-23T14:14:38.000Z (over 6 years ago)
- Last Synced: 2023-07-27T19:17:59.890Z (over 1 year ago)
- Language: CSS
- Size: 1.95 MB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 `FontFace`s, 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`](https://pub.dartlang.org/packages/shared_theme_flutter) package's [`themeData()`](https://pub.dartlang.org/documentation/shared_theme_flutter/latest/shared_theme_flutter/themeData.html) function.
## Example
There is a complete [example](https://github.com/jifalops/shared_theme/tree/master/example)
included, and in particular, see its
[ThemeSet definition](https://github.com/jifalops/shared_theme/blob/master/example/packages/base/lib/themes.dart).## Screenshots
Mobile light | Mobile dark
-|-
![mobile-light](example/images/mobile-light.png) | ![mobile-dark](example/images/mobile-dark.png)Web light | Web dark
-|-
![web-light](example/images/web-light.png) | ![web-dark](example/images/web-dark.png)