theme_toggle_animation
2.0.0, released 14 days ago by hirdaya-shrestha.com.np
Smooth animated theme switching for Flutter with circle, line, and custom GIF mask effects.
What it does
Provides animated transitions when switching between different themes in a Flutter application. It supports circle reveals, scanning lines, and custom GIF mask animations with configurable durations, curves, and blur effects.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want smooth visual transitions when toggling between light and dark modes.
- You need custom reveal animations such as a scanning line or GIF mask for theme changes.
Skip it when
- You do not need animated theme transitions and prefer instantaneous switching.
- Your project cannot use the `material_ui` package dependency.
Strengths
- Offers multiple animation types including circle, line, and custom GIF masks.
- State management agnostic (works with Provider, Riverpod, Bloc, GetX, or setState).
- Optimized with RepaintBoundary and content caching for smooth performance.
Weaknesses
- Depends on `material_ui` instead of standard `package:flutter/material.dart` in version 2.0.0.
- Limited to theme transition visual effects.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add theme_toggle_animation to pubspec.yaml and update imports to use package:material_ui/material_ui.dart.
ThemeToggleAnimation(
currentTheme: _isDark ? ThemeData.dark() : ThemeData.light(),
onToggle: () => setState(() => _isDark = !_isDark),
builder: (context, toggle) => MaterialApp(
home: Scaffold(
appBar: AppBar(
actions: [
IconButton(
icon: Icon(_isDark ? Icons.light_mode : Icons.dark_mode),
onPressed: toggle,
),
],
),
body: const Center(child: Text('Hello World')),
),
),
child: const SizedBox.expand(),
)Alternatives
Packages that do the same job and could replace theme_toggle_animation.
- xdg_icons
XDG theme icons for Flutter.
62Compare - random_color_scheme
Generates random light and dark Material Design color schemes respecting WCAG guidelines.
57Compare - reactive_theme
Toggles between light and dark mode and persists the preference.
40Compare
Works with
Packages commonly used together with theme_toggle_animation: ones it builds on, ones built on it, and its own family.