flutter_hashicon 0.0.4 copy "flutter_hashicon: ^0.0.4" to clipboard
flutter_hashicon: ^0.0.4 copied to clipboard

Hashicon is a unique avatar generator that creates a beautiful icon based on any string you provide.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_hashicon/hashicon.dart';

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    const rowCount = 4;
    const colCount = 6;
    const double size = 100;

    var i = 0;

    List<Widget> cols = [];
    for (var r = 0; r < rowCount; r++) {
      List<Widget> rows = [];
      for (var c = 0; c < colCount; c++) {
        var hashicon = CustomPaint(
          painter: HashiconPainter(hash: i.toString()),
          size: const Size(size, size),
        );
        rows.add(Padding(
          padding: const EdgeInsets.fromLTRB(0, 0, 20, 20),
          child: hashicon,
        ));
        i++;
      }

      var column = Row(
        children: rows,
      );

      cols.add(column);
    }

    var col = Column(
      children: cols,
    );

    return MaterialApp(
      home: Scaffold(
        body: Padding(
          padding: const EdgeInsets.all(20),
          child: col,
        ),
      ),
    );
  }
}

void main() {
  runApp(const MyApp());
}
0
likes
140
points
28
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Hashicon is a unique avatar generator that creates a beautiful icon based on any string you provide.

Repository (GitHub)

License

MIT (license)

Dependencies

flutter, hashlib, image

More

Packages that depend on flutter_hashicon