Skip to content
pubscout

easy_dynamic_theme

2.3.1, released 4 years ago by rlazom.dev

Automatically sync app theme with OS and persist user choice

WASM-ready
$ flutter pub add easy_dynamic_theme
Source repository

What it does

EasyDynamicThemeWidget reads the system theme and applies it to your MaterialApp. It also lets you force light or dark mode and stores the preference with shared_preferences.

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

Use it when

  • You want your app to follow the device theme automatically
  • You need to persist the user’s theme choice across launches
  • You want quick, out‑of‑the‑box widgets to toggle theme

Skip it when

  • You need fine‑grained control over multiple custom themes
  • You are building a complex state‑management solution that requires custom logic

Strengths

  • Simple API, no boilerplate
  • Built‑in persistence
  • Provides ready‑made toggle widgets
  • Supports all Flutter platforms

Weaknesses

  • Only supports light/dark, no custom theme switching
  • No integration with advanced state‑management libraries
  • Limited customization of the toggle widgets

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
```dart
import 'package:flutter/material.dart';
import 'package:easy_dynamic_theme/easy_dynamic_theme.dart';

void main() => runApp(
  EasyDynamicThemeWidget(
    child: MyApp(),
  ),
);

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) => MaterialApp(
    theme: ThemeData.light(),
    darkTheme: ThemeData.dark(),
    themeMode: EasyDynamicTheme.of(context).themeMode,
    home: Scaffold(body: Center(child: Text('Hello'))),
  );
}
```

Alternatives

Packages that do the same job and could replace easy_dynamic_theme.

Works with

Packages commonly used together with easy_dynamic_theme: ones it builds on, ones built on it, and its own family.