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

A Flutter package to generate customizable 5x5 grid images based on a 15-bit binary string. Define background and square colors, and receive the generated image as a Uint8List for reuse or further pro [...]

example/lib/main.dart

import 'dart:typed_data';

import 'package:binary_image_generator/binary_image_generator.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Binary Image Generator Example')),
        body: const Center(
          child: BinaryImageTester(),
        ),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    // Binary string must be exactly 15 bits
    const binaryString = '111110000000011';
    
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        ClipOval(
          child: BinaryImageGenerator(
            binaryString: binaryString,
            backgroundColor: Colors.yellow, // Customize background color
            squareColor: Colors.black, // Customize square color
            onImageReady: (Uint8List imageData) {
              // This callback gets called when the image is ready
              // You could also display the image, save it, or send it to a server, etc.
            },
          ),
        ),
      ],
    );
  }
}
0
likes
150
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to generate customizable 5x5 grid images based on a 15-bit binary string. Define background and square colors, and receive the generated image as a Uint8List for reuse or further processing. Uses efficient Canvas rendering for optimal performance, making it ideal for creating unique binary-pattern visuals in your app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on binary_image_generator