flutter_custom_palette 0.0.5 copy "flutter_custom_palette: ^0.0.5" to clipboard
flutter_custom_palette: ^0.0.5 copied to clipboard

A flutter plugin to manage all the colors used in your app.

flutter_custom_palette #

A flutter plugin to manage all the colors used in your app.

Initialize the palette #

    FlutterCustomPalette palette = FlutterCustomPalette();
    await palette.init();

Store a color by key #

    palette.put(key: 'myFavColor', color: Colors.red);

Get a color by key #

    //color in string
    var colorString = palette.get(key: 'myFavColor');
    
    //convert it to Color
    var color = palette.getColor(color: colorString);

Listen for realtime changes to the palette #

     ValueListenableBuilder(
      valueListenable: palette.getListenable(),
      builder: (BuildContext context, Box value, Widget? child) {

          var myFavColor = palette.getColor(color: value.get('myFavColor'));
          return Container(height:100,width:100,color:myFavColor);
      },
    )

Listen for realtime changes to a specific color #

     ValueListenableBuilder(
      valueListenable: palette.getListenable(keys: ['myFavColor']),
      builder: (BuildContext context, Box value, Widget? child) {

          var myFavColor = value.get('myFavColor');
          return Container(height:100,width:100,color:myFavColor);
      },
    )
1
likes
80
pub points
0%
popularity

Publisher

verified publishercluxid.com

A flutter plugin to manage all the colors used in your app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter, hive, hive_flutter

More

Packages that depend on flutter_custom_palette