Giter Site home page Giter Site logo

iscuixin / flutter_html Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sub6resources/flutter_html

0.0 1.0 0.0 1.12 MB

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)

Home Page: https://pub.dev/packages/flutter_html

License: MIT License

Dart 94.72% Java 0.38% Kotlin 0.35% Ruby 3.29% Objective-C 0.83% Swift 0.42%

flutter_html's Introduction

flutter_html

pub package codecov CircleCI MIT License

A Flutter widget for rendering html and css as Flutter widgets.

A Screenshot of flutter_html Another Screenshot of flutter_html Yet another Screenshot of flutter_html

Installing:

Add the following to your pubspec.yaml file:

dependencies:
  flutter_html: ^1.0.0

Currently Supported HTML Tags:

a, abbr, acronym, address, article, aside, b, bdi, bdo, big, blockquote, body, br, caption, cite, code, data, dd, del, dfn, div, dl, dt, em, figcaption, figure, footer, h1, h2, h3, h4, h5, h6, header, hr, i, img, ins, kbd, li, main, mark, nav, noscript, ol, p, pre, q, rp, rt, ruby, s, samp, section, small, span, strike, strong, sub, sup, table, tbody, td, template, tfoot, th, thead, time, tr, tt, u, ul, var

Currently Supported CSS Attributes:

Coming soon!

Elements with planned support:

See the development roadmap for the list of elements and css attributes I plan on supporting.

Why this package?

This package is designed with simplicity in mind. Originally created to allow basic rendering of HTML content into the Flutter widget tree, this project has expanded to include support for basic styling as well!.

Example Usage:

(For a much more extensive example, look at example.

    Widget html = Html(
      data: """
        <div>
          <h1>Demo Page</h1>
          <p>This is a fantastic product that you should buy!</p>
          <h3>Features</h3>
          <ul>
            <li>It actually works</li>
            <li>It exists</li>
            <li>It doesn't cost much!</li>
          </ul>
          <!--You can pretty much put any html in here!-->
        </div>
      """,
      //Optional parameters:
      backgroundColor: Colors.white70,
      onLinkTap: (url) {
        // open url in a webview
      },
      style: {
        "div": Style(
          block: Block(
            margin: EdgeInsets.all(16),
            border: Border.all(width: 6),
            backgroundColor: Colors.grey,
          ),
          textStyle: TextStyle(
            color: Colors.red,
          ),
        ),
      },
      onImageTap: (src) {
        // Display the image in large form.
      },
    );

Migration Guides

Contribution Guide

Coming soon!

Meanwhile, PRs are always welcome

flutter_html's People

Contributors

sub6resources avatar ryan-berger avatar jeffmikels avatar kieferlam avatar hey24sheep avatar amake avatar the-redhat avatar dotneet avatar jacobwrenn avatar ngaurav avatar edward608 avatar ominibyte avatar aarajput avatar wwwdata avatar chandrabezzo avatar edwardaux avatar emagnier avatar geertjohan avatar gorniv avatar jeuler avatar vanlooverenkoen avatar loitran avatar lucasreiners avatar lukepighetti avatar momvart avatar namiwang avatar docmarty84 avatar sgara avatar jesktop avatar jlcool avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.