playx_theme 1.1.1
playx_theme: ^1.1.1 copied to clipboard
Simplify app theming in Flutter with Playx Theme. Effortlessly switch themes, enjoy smooth animations, and customize color schemes with ease.
Changelog #
1.1.1 #
- Bump
playx_coredependency to^0.7.4. - Wrap
PlayxThemeBuilder's child in aThemewidget to ensure correct theme data is applied down the widget tree. - Refactor
PlayxThemeSwitchingAreato usecontext.xThemefor better theme access.
1.1.0 #
Note: This release contains breaking changes.
- Updated to Flutter 3.27 / Dart 3.5.
- Updated dependencies.
- Added
context.themeDataandcontext.isDarkModeextensions. - Added
logThemeChangesoption toPlayxThemeConfigto log theme changes. - Theme update methods now support
animateparameter to enable animation or not:updateTo,updateByIndex,updateById,next,updateToDeviceMode,updateToLightMode,updateToDarkMode,updateByThemeMode.
1.0.4 #
- Update packages
- Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.
1.0.3 #
- Update packages
1.0.2 #
- Update packages
1.0.1 #
- Update packages
- Add test cases for the package
- refactor
_getCenterOffsetmethod inAnimationUtilsto be a publicgetCenterOffsetfunction.
1.0.0 #
Note: This release contains breaking changes.
New Features:
- Added new animation types: fade, horizontal slide, vertical slide, and scale.
- Introduced
PlayxThemeAnimationclass to manage animations. This class includes:- Specific animation types are represented by subclasses such as
[PlayxThemeClipperAnimation],[PlayxThemeFadeAnimation],[PlayxThemeScaleAnimation],[PlayxThemeHorizontalSlideAnimation], and[PlayxThemeVerticalSlideAnimation]. - Ability to reverse the animation.
- Set the duration of the animation.
- Handle specific animations settings and actions.
- Specific animation types are represented by subclasses such as
Enhancements:
- Migrated shared preferences to
SharedPreferencesAsyncfor improved performance and async handling. - Streamlined package by removing the GetX dependency, reducing the overall footprint.
- No need to call
PlayxCore.bootCore()anymore. The package now initializes automatically.
Breaking Changes:
- Theme Functions Update: All
PlayxThemefunctions now use the[PlayxThemeAnimation]parameter to specify animations. The previousanimateparameter has been removed. If[animation]isnull, the theme change will be instant. If[animation]is provided, the theme change will be animated based on the animation type. - Shared Preferences Migration: Migrated from
SharedPreferencestoSharedPreferencesAsync. If you're upgrading, setmigratePrefsToAsyncPrefstotrueinPlayxThemeConfigto ensure a smooth transition. - Theme Colors: Removed
background,onBackground,surfaceVariantcolors assurface,onSurface,surfaceContainerHighestshould be used instead based on latest material changes in flutter v3.22.0.
0.6.0 #
- Update
flex_seed_schemepackage to v3.0.0 - Update min flutter version to
3.22.0 - Added new colors [
primaryFixed,primaryFixedDim,onPrimaryFixed,onPrimaryFixedVariant,secondaryFixed,secondaryFixedDim,onSecondaryFixed,onSecondaryFixedVariant,tertiaryFixed,tertiaryFixedDim,onTertiaryFixed,onTertiaryFixedVariant,surfaceDim,surfaceBright,surfaceContainerLowest,surfaceContainerLow,surfaceContainer,surfaceContainerHigh,surfaceContainerHighest] based on latest material changes in flutter v3.22.0. - Deprecated
background,onBackground,surfaceVariantcolors assurface,onSurface,surfaceContainerHighestshould be used instead based on latest material changes in flutter v3.22.0.
0.5.0 #
Note: This release contains breaking changes.
New Features #
PlayxThemeBuilder
PlayxThemeBuilder now uses an InheritedWidget to provide themes to its child widgets, enhancing theme management and widget rebuilding.
- Theme Access:
- Use
XTheme.of(context)orcontext.xThemeto get the current theme. - Use
PlayxColors.of(context)orcontext.playxColorsto get the current theme colors.
- Use
Use these methods to access theme or color information in your widgets. This ensures widgets are rebuilt correctly when the theme changes.
- Legacy Access:
- You can still use
PlayxTheme.currentThemeto access the current theme when you don't have aBuildContext. However, note that usingPlayxTheme.currentThemewill not trigger a widget rebuild on theme changes.
- You can still use
Breaking Changes #
- Class Renaming for Consistency:
XColorsis nowPlayxColorsto maintain consistency with the package name.XThemeConfigis nowPlayxThemeConfigfor the same reason.
0.4.1 0.4.3 #
Note: This release has breaking changes.
New Features #
-
Introducing a unique theme animation feature to visualize theme changes within your app.
- Simply add
PlayxThemeSwitchingAreato the widget to animate the theme change. - Added new properties
childanddurationtoPlayxThemeBuilderfor customizing the child widget and animation duration. - Introduced
PlayxThemeSwitchingAreawidget for animating theme changes in specific areas of the app. - Added
PlayxThemeSwitcherwidget for animating theme changes starting from a specific widget.
- Simply add
-
Updated
XThemeControllerto useValueNotifierinstead ofGetxControllerto reduce dependency on theGetXpackage. -
Added test cases for
XThemeControllerandPlayxThemeto ensure the correct behavior of the theme controller and theme switcher.
BREAKING Changes #
XThemeConfigis no longer an abstract class and can now be instantiated directly.
Theme Updates #
- Removed
themeandcupertinoThemeproperties. - Introduced new properties
themeDataandcupertinoThemeDatafor specifying theme data and Cupertino theme data. - Added
themeBuilderandcupertinoThemeBuilderproperties for customizing theme data based on the current locale. - Modified
XThemeconstructor to require onlythemeData. - Added
Xtheme.builderfor customizing theme data based on the current locale.
PlayxTheme Updates #
- Renamed
PlayxTheme.xThemetoPlayxTheme.currentTheme. - Added
PlayxTheme.themeDatagetter to access current theme data. - Updated theme update methods (
updateTo,updateByIndex,updateById,next,updateToDeviceMode,updateToLightMode,updateToDarkMode,updateByThemeMode) to include more properties for controlling theme animation. - Added
clearLastSavedThememethod to clear the last saved theme from shared preferences.
0.3.2 #
- update packages
0.3.1 #
- update packages
- Bump minimum Dart version to 3.0.0
0.3.0 #
Note: This release has breaking changes.
- update packages
- Rename
XThemeConfigpropertydefaultThemeIndextoinitialThemeIndex. - Add
saveThemetoXThemeConfigto determine whether it should save the current theme index to shared preferences or not. - Add
isDarkproperty toXthemeto determine whether the theme is dark or not. - Add
updateToLightModemethod toPlayxThemewhich updates the theme to the first light theme in supported themes. - Add
updateToDarkModemethod toPlayxThemewhich updates the theme to the first dark theme in supported themes. - Add
updateToDeviceModemethod toPlayxThemewhich updates the theme to the first theme that matches the device mode. - Add
updateByThemeModemethod toPlayxThemewhich updates the theme to the first theme that matches the given mode. - Add
initialThemeproperty toPlayxThemewhich is the initial theme that will be used when the app starts.
0.2.3 #
- update packages
0.2.2 #
- Added material 3 colors to
XColorswhich can be configured through the app. - Added an optional
fromColorSchemetoXColorsto help with configuring material 3 style colors that can be used on the app. - XDefaultThemeConfig now uses the default
XColorsinstead of custom colors.
0.2.1 #
- Added an optional
cupertinoThemetoXThemeto help with configuring cupertino app theme.
0.2.0 #
Note: This release has breaking changes.
New features #
- PlayxTheme now has
isDeviceInDarkModeto indicate whether the user device is in dark mode or not. - XThemeConfig now has
defaultThemeIndexto specify the default theme index that will be used first time as default theme. - new
ImageThemewidget which is a widget that is themed by image content by providing image provider to be used with Material3 themes. - new utilities to be used like
getBlendedColorSchemewhich blends two color schemes together and returns a new color scheme to be used with Material3 themes. - Included
flex_seed_schemepackage which is more flexible and powerful version of Flutter's ColorScheme.fromSeed and uses multiple seed colors, custom chroma and tone mapping to enahce creating a color scheme for Material3.
BREAKING Changes #
XColorSchemewas renamed toXColors.- a Removed abstract colors like primary, secondary, background,surface, error ,onPrimary, Color get onSecondary, onBackground, onSurface, onError from
XColors. XThemecolors property now have default value which isDefaultColors.
0.1.0 -0.1.1 #
- BREAKING : Refactor
AppThemeto bePlayxTheme. - BREAKING : Refactor
XThemetheme property fromThemeDatatoThemeData Function( Locale locale) - Move
PlayxCore.boot()to be called individually.
0.0.8 -0.0.9 #
- update packages
0.0.6 -0.0.7 #
- update packages
- Add
disposefunction toAppThemeto clear unused resources.
0.0.5 #
- BREAKING : Refactor
XThemeConfig[nameBuilder] function to String [name] - Added [updateById]: Updates theme using it's id.
- Added [forceUpdateTheme] variable to change theme functions which force the app to rebuild all widget after changing the theme. Useful when depending on colorScheme in your widgets.
0.0.4 #
- Add support for Dart 3.0.0 and Flutter 3.10
- Add new
XColorSchemewhich is a new way to configure custom colors for each themes.
see Readme.md for more details about it.
0.0.2 #
- update packages
0.0.1+1 #
- fix typo
0.0.1 #
- initial release.