draw_text 0.0.2 copy "draw_text: ^0.0.2" to clipboard
draw_text: ^0.0.2 copied to clipboard

Add text to Flutter images with more control. draw_text offers an enriched text drawing function that builds upon the core Image package.

example/example.dart

import 'package:flutter/material.dart';
import 'package:image/image.dart' as img;
import 'package:draw_text/draw_text.dart';

void main() async {
  // Load your image (replace with your actual image loading logic)
  final image = img.Image(height: 200, width: 200);

  // Define your text style
  final textStyle = TextStyle(
    color: Colors.white,
    fontSize: 30.0,
    fontWeight: FontWeight.bold,
  );

  // Draw text on the image with optional positioning
  final drawnImage =
      await draw_text(image, textStyle, "Hello, world!", x: 50, y: 100);

  // Use the drawnImage for further processing or display (replace with your logic)
  print("Image with text drawn!");
}
3
likes
150
pub points
52%
popularity

Publisher

unverified uploader

Add text to Flutter images with more control. draw_text offers an enriched text drawing function that builds upon the core Image package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter, image

More

Packages that depend on draw_text