Skip to content
pubscout

themed

8.4.1, released 4 days ago by glasberg.dev

Define themes with const values and change them dynamically at runtime.

WASM-ready
$ flutter pub add themed
Source repository

What it does

Allows developers to define themes using const ColorRef and TextStyleRef values that can still be updated dynamically. It also provides widgets and extensions to modify color properties like brightness, saturation, and hue.

AI-written summary of version 8.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to use const values for theme references in constructors and default parameters
  • You need to change themes dynamically without relying exclusively on Theme.of(context)
  • You want to apply color adjustments like brightness, saturation, or contrast to specific widgets or images

Skip it when

  • You prefer sticking purely to Flutter's native ThemeData and Theme.of(context) architecture
  • You are not using Flutter

Strengths

  • Enables const theme references
  • No need to pass context for accessing theme values
  • Includes helpful color and text style extension methods and transformation tools

Weaknesses

  • Doesn't completely replace Flutter's native ThemeData system, meaning integration can sometimes require additional boilerplate

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Wrap your widget tree with the Themed widget above the MaterialApp.

static const myColor = ColorRef(Colors.white);

Container(
  color: myColor,
  child: const Text('Hello'),
);

Themed.currentTheme = {
  myColor: Colors.blue,
};

Alternatives

Packages that do the same job and could replace themed.