dynamic_color
2.1.0, released 3 months ago by material.io
Create Material color schemes based on a platform's implementation of dynamic color.
What it does
It provides a widget called DynamicColorBuilder that supplies light and dark ColorSchemes based on the host platform's dynamic colors. It also includes extensions for color and color scheme harmonization.
AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want your Flutter app to respect user wallpaper colors on Android S+
- You want to utilize system accent colors on desktop platforms like Windows, macOS, and Linux
Skip it when
- You require a strict custom brand color palette that must not be influenced by platform settings
Strengths
- Supports multiple platforms including Android, Windows, macOS, and Linux
- Provides built-in color harmonization to keep custom colors cohesive with dynamic colors
- Offers a dedicated DynamicColorBuilder widget for ease of use
Weaknesses
- Dynamic color availability is dependent on OS version and platform features
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Add the dependency to pubspec.yaml and use DynamicColorBuilder in your app.
DynamicColorBuilder(
builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
return MaterialApp(
theme: ThemeData(colorScheme: lightDynamic),
darkTheme: ThemeData(colorScheme: darkDynamic),
);
},
)Alternatives
Packages that do the same job and could replace dynamic_color.
- dynamic_system_colors
Create Material color schemes based on the platform's dynamic color implementation.
69Compare - flex_color_scheme
Builds matched light and dark ThemeData for Flutter with Material design themes and seed colors.
89Compare - flutter_color
Flutter plugin for working with color schemes like hex, hsl, xyz, and cielab.
82Compare - color_blindness
Simulate color blindness across Material 3 color schemes or individual colors in Flutter.
69Compare
Works with
Packages commonly used together with dynamic_color: ones it builds on, ones built on it, and its own family.
- material_color_utilitiesdynamic_color depends on itAlgorithms and utilities for the Material Design 3 color system.
- material_uidynamic_color depends on itOfficial Flutter Material UI library implementing Google’s Material Design system.
- adaptive_dialogBuilt on dynamic_colorShows platform‑adaptive alert dialogs and action sheets
- material_3_expressiveBuilt on dynamic_colorA faithful Flutter implementation of the Material 3 Expressive component set.