hashbrowns 0.0.3 copy "hashbrowns: ^0.0.3" to clipboard
hashbrowns: ^0.0.3 copied to clipboard

outdated

A static color generator

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 Hashbrown hashbrown;
  GenrePill(this.genre) {
    this.hashbrown = Hashbrown.pastels();
  };

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

2
likes
0
points
23
downloads

Publisher

verified publishergetformative.com

Weekly Downloads

A static color generator

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on hashbrowns