html_to_flutter_table 0.0.1-dev.2 copy "html_to_flutter_table: ^0.0.1-dev.2" to clipboard
html_to_flutter_table: ^0.0.1-dev.2 copied to clipboard

An extension to html_to_flutter package to convert html tables to flutter widgets.

html_to_flutter_table #

pub package MIT License

html_to_flutter_table is a Flutter package that leverages the flutter_layout_grid package to render HTML tables. It supports basic tables as well as advanced features like colspan and rowspan.

Features #

  • Convert HTML table elements to Flutter widgets.
  • Support for colspan and rowspan attributes.
  • Utilizes flutter_layout_grid for flexible table layouts.

Usage #

import 'package:flutter/material.dart';
import 'package:html_to_flutter/html_to_flutter.dart';
import 'package:html_to_flutter_table/html_to_flutter_table.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('HTML to Flutter Table Demo'),
        ),
        body: Html(
          data: """
            <div>
              <h1>Sample Table</h1>
              <table>
                <tr>
                  <th>Header 1</th>
                  <th>Header 2</th>
                  <th>Header 3</th>
                </tr>
                <tr>
                  <td>Data 1</td>
                  <td colspan="2">Data 2 with colspan</td>
                </tr>
                <tr>
                  <td rowspan="2">Data 3 with rowspan</td>
                  <td>Data 4</td>
                  <td>Data 5</td>
                </tr>
                <tr>
                  <td>Data 6</td>
                  <td>Data 7</td>
                </tr>
              </table>
            </div>
          """,
          extensions: const [
            TableExtension(),
          ],
        ),
      ),
    );
  }
}

Installation #

Add html_to_flutter_table to your pubspec.yaml:

dependencies:
  html_to_flutter_table: ^0.0.1-dev.1

Then run flutter pub get to install the package.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

0
likes
0
pub points
36%
popularity

Publisher

verified publisheraryak.dev

An extension to html_to_flutter package to convert html tables to flutter widgets.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, flutter, flutter_layout_grid, html_to_flutter

More

Packages that depend on html_to_flutter_table