PackageTrack
Sign in Get early access

best_theme_annotation

Annotations for creating and managing theme color variables in Flutter applications.

2.0.0 dosty17/best_theme

What this package is like to depend on

Last release 2 months ago

19 Jun 2026

Ships fairly regularly

a new release about every 9 months

Nearly every release is documented

notes for 3 of 3 stable releases

Nothing withdrawn

no release was ever pulled

2 years old

3 releases · first in 2024

2 releases in the last 12 months

see the full history below

Release timeline

3 releases · Dec 2024 to Jun 2026
2025 2026
Release Pre-release

Releases

latest 3
  1. 2.0.0 19 Jun 2026
    Release notes

    Breaking Changes

    • Removed the vars parameter from the @BestTheme annotation.
    • The generator now automatically discovers theme tokens using compile-time static field analysis.
    • Manual variable registration is no longer required.

    Added

    • Support for automatic generation of:

      • BestColor
      • BestTextStyle
      • BestAsset
    • Improved compile-time performance.

    • Cleaner and more maintainable theme definitions.

    • Stronger type safety through static token discovery.

    Migration Guide

    Remove the vars parameter from your annotation and define your theme tokens as static const fields inside the theme class.

    Old (v1.x.x)

    @BestTheme(
      vars: ['primary', 'card'],
      extensionName: 'myColors',
    )
    class MyTheme extends _$MyTheme {}
    

    New (v2.0.0)

    @BestTheme(
      extensionName: 'myColors',
    )
    class MyTheme extends _$MyTheme {
      static const primary = BestColor(
        light: Colors.blue,
        dark: Colors.indigo,
      );
    
      static const card = BestColor(
        light: Colors.white,
        dark: Colors.black,
      );
    }
    

    Open source →
  2. 1.0.0 06 Mar 2026
    Release notes

    Added

    • Added extensionName parameter to @BestTheme annotation (default: 'bestTheme'). Allows customizing the BuildContext getter name generated for accessing theme colors. Example: @BestTheme(vars: [...], extensionName: 'appColors')context.appColors.color1.

    Changed

    • @BestTheme annotation now requires the companion best_theme_generator 2.0.0 which generates a ThemeExtension-based class instead of the previous singleton approach.
    • Generated code now uses Flutter's ThemeExtension system (ThemeData.extensions) for proper light/dark theme integration with MaterialApp.
    • Replaced the old ThemeMode-based singleton pattern with buildLightTheme / buildDarkTheme overridable hooks on the generated base class, allowing full ThemeData customization.
    Open source →
  3. 0.0.1 25 Dec 2024
    Release notes

    Added

    • Initial release of best_theme_annotation package.
    • @BestTheme annotation to define custom theme colors and modes.
    • Support for defining color variables that can be automatically generated with best_theme_generator.
    • Ability to specify light and dark color values for each DostyColor.
    • Flexible theme configuration with easy integration into theme management setups.

    Fixed

    • N/A (First release)

    Changed

    • N/A (First release)
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive