yako_theme_switch 3.0.1
yako_theme_switch: ^3.0.1 copied to clipboard
Custom switch that looks good for changing the theme of the app
3.0.1 [September 26, 2026] #
- README: a More from Yako grid with an animated preview of each of our other packages.
3.0.0 [September 25, 2026] #
Breaking Changes #
- Migrated to
package:material_ui. Flutter 3.47 moved Material out of the SDK into thematerial_uipackage, so the switch now importspackage:material_ui/material_ui.dartinstead ofpackage:flutter/material.dartand depends onmaterial_ui: ^1.4.0. The switch reads nothing from the Material theme (Material only supplies its two default colors,Colors.grey.shade300andColors.amberAccent.shade700), so nothing visible changes, whether your app usesmaterial_uior still usespackage:flutter/material.dart. NoMaterialUiCompatibilityBridgeis needed. - Minimum SDK raised to Dart 3.13.0 / Flutter 3.47.0 (from Dart 3.4.0 / Flutter 3.27.0). Apps on older Flutter keep resolving the previous major, 2.x (2.0.1).
Maintenance #
- The example app and the tests import
package:material_uitoo.
2.0.1 [September 25, 2026] #
Fixes #
- New
enabledBackgroundColor,disabledBackgroundColor,enabledToggleColoranddisabledToggleColorvalues from the parent are now applied. They were read only once, when the switch was created. - A new
animationDurationfrom the parent is now used. - Right-to-left layouts: the switch is now mirrored, with the dark side on the right. Before, the light-mode thumb was drawn outside the track.
- Screen readers now announce the switch and whether it is on or off.
- The internal
CurvedAnimationis now disposed. - Apps no longer bundle the 685 KB README animation
(
assets/showcase_animation.gif). Only the moon icon is declared as an asset.
Maintenance #
- Added
analysis_options.yamlwithflutter_lints. The package listedflutter_lintsbut never applied it. - The library exports
src/yako_theme_switch.dartinstead of../src/yako_theme_switch.dart. - Removed the unused
mocktaildev dependency. - Added pub.dev topics:
widget,switch,theme,dark-mode. - Added
.pubignoreand refreshed.gitignore. - CI: replaced the Very Good workflows with a CI workflow (analyze, format check and tests on stable, a non-blocking beta job and a weekly run), a PR title check, and a publish workflow that uses pub.dev automated publishing (OIDC) with the Flutter SDK. The old publish workflow used Node 20 actions.
- Example: fixed the
onChangedcallback, which no longer compiled with 2.0.0, and regenerated the platform folders so the app builds with current Flutter, Gradle and Xcode.
Tests #
- Added regression tests for parent color and duration changes, RTL layout, toggled semantics and animation disposal.
2.0.0 [Apr 9, 2026] #
Improvements #
- Added
super.keyto constructor — widgets can now be identified by key. - State class fields are now private (
_animationController,_turnState, etc.). createStateusesState<YakoThemeSwitch>return type annotation.const Color(...)used for default color literals.- Removed redundant
addPostFrameCallbackanimation trigger ininitState— eliminates a visual flash on initial render. onChangedcallback is now called outsidesetState, following Flutter best practices.- Replaced bare
ContainerwithSizedBoxfor the toggle hit area (semantic clarity).
Dependency Updates #
flutter_svgbumped from^2.0.7to^2.2.3mocktailbumped from^0.3.0to^1.0.4flutter_lintsbumped from^2.0.0to^6.0.0- Minimum Flutter SDK raised from
>=3.10.0to>=3.27.0 - Minimum Dart SDK raised from
>=3.0.0to>=3.4.0
Tests #
- Replaced empty/commented test suite with 11 widget tests covering: rendering, default state, enabled state, tap callbacks, external prop updates, custom width, custom colors, custom duration, border radius, key support, and multi-tap alternation.
1.0.0+1 [Jul 9, 2023] #
- First release
