hashbrowns

Last updated:

0 purchases

hashbrowns Image
hashbrowns Images
Add to Cart

Description:

hashbrowns

Hashbrowns Static Color Generator #
The purpose of Hashbrowns is to generate consistent colors based on the hashcode of an object.
Usage #
class Genre {
String name;
Genre(this.name);
}

class GenrePill extends StatelessWidget {
final Genre genre;
late final Hashbrowns hashbrowns;
GenrePill(this.genre) {
this.hashbrowns = Hashbrowns.pastels();
};

@override
Widget build(BuildContext context) {
final color = hashbrowns.generateColor(genre);
return Container(
color: color.surfaceColor,
child: Text(genre.name, style: TextStyle(color: color.onSurfaceColor))
);
}
}

copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.