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

outdated

A static color generator

Hashbrown Static Color Generator #

The purpose of Hashbrown 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.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