GithubHelp home page GithubHelp logo

tianzhiyuanemail / flutter_html_widget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ztj666/flutter_html_widget

0.0 1.0 0.0 11 KB

flutter widget to render simple html segments.

License: Other

Dart 100.00%

flutter_html_widget's Introduction

flutter_html_widget

This widget turn html string into flutter widgets like Text, RichText and Table.

This is so not a webview alternative. Think this as a read mode for simple html elements.

The widget is extracted from wiki-flutter, and is initially designed for html segments in the mobile version of wikipedia articles only, so there's gonna be many, many issues for arbitrary html segments.

demo

import 'package:flutter_html_widget/flutter_html_widget.dart';

final html = """
<section class="homepage__key_points card">
  <h1 class="homepage__title">
    Build beautiful native apps in record time
  </h1>

  <div class="homepage__tagline">
    Flutter is Google’s mobile app SDK for crafting high-quality native interfaces on iOS and Android in record time. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.
  </div>
</section>
""";

new MaterialApp(
  home: new Material(
    child: new HtmlWidget(html: html, key: key)
  ),
);

will produce widgets like

new Wrap(
  children: <Widget>[
    new Container(
      padding: EdgeInsets.all(8.0),
      child: new RichText(
        text: new TextSpan(
          children: [
            new TextSpan(text: "Build beautiful native apps in record time")
          ]
        ),
      )
    )
  ],
)

features

supported

  • basic text, link, paragraph, list, image, caption, etc.

on the roadmap

  • styles for <b> <i> <small> <section> <h12345> etc
  • inline images
  • video element
  • more options

not for now

  • complex table

flutter_html_widget's People

Contributors

namiwang avatar tianzhiyuanemail avatar ztj666 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.