widget_to_html 1.0.0 copy "widget_to_html: ^1.0.0" to clipboard
widget_to_html: ^1.0.0 copied to clipboard

Simple package that uses widget to build html, specially for emails! It has custom widget-like classes makes you feel like you are building a flutter widget, like react-email does.

example/main.dart

import 'package:widget_to_html/widget_to_html.dart';

void main(List<String> args) {
  final email = HtmlDocument(
    body: HtmlContainer(
      padding: EdgeInsets.all(24),
      color: Color(0xFFF5F5F5),
      child: HtmlColumn(
        spacing: 16,
        children: [
          HtmlText(
            'Welcome!',
            style: TextStyle(
              fontSize: 24,
              fontWeight: FontWeight.bold,
              color: Color(0xFF333333),
            ),
          ),
          HtmlText('Thanks for signing up.'),
          HtmlButton(
            text: 'Get Started',
            href: 'https://example.com',
            backgroundColor: Color(0xFF007BFF),
          ),
        ],
      ),
    ),
  );

  final html = email.render();

  print(html);
}
2
likes
150
points
26
downloads

Publisher

verified publisherpolazzo.dev

Weekly Downloads

Simple package that uses widget to build html, specially for emails! It has custom widget-like classes makes you feel like you are building a flutter widget, like react-email does.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on widget_to_html