widget_to_html 1.1.0 copy "widget_to_html: ^1.1.0" to clipboard
widget_to_html: ^1.1.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' as html;

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

  final htmlOutput = email.render();

  print(htmlOutput);
}
2
likes
160
points
141
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