Last updated:
0 purchases
flutter custom palette
flutter_custom_palette #
A flutter plugin to manage all the colors used in your app.
Initialize the palette #
FlutterCustomPalette palette = FlutterCustomPalette();
await palette.init();
copied to clipboard
Store a color by key #
palette.put(key: 'myFavColor', color: Colors.red);
copied to clipboard
Get a color by key #
//color in string
var colorString = palette.get(key: 'myFavColor');
//convert it to Color
var color = palette.getColor(color: colorString);
copied to clipboard
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);
},
)
copied to clipboard
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);
},
)
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.