htmlencodedtext 0.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 14

htmlencodedtext

A Flutter plugin that makes it easier to show HTML Encoded Text (from outside APIs perhaps) in your Material Flutter apps.

Dependencies

This project used html_unescape to help facilitate converting HTML entities:

  • Named Character References ( ) (2099 of them)
  • Decimal Character References (á)
  • Hexadecimal Character References (&#xE3)

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

Usage

class MyApp extends StatelessWidget {
  static final String html =
      '<b>Lorem</b> <i>ipsum</i> <u>dolor</u> <span style="color: #FF0000">sit</span> ' +
          '<span style="text-decoration: underline; font-weight: bold; font-style: italic">amet</span>, ' +
          '<a hef="#">consectetur adipiscing elit</a>, sed do eiusmod tempor incididunt ut ' +
          'labore Foo &#xA9; bar 😀 baz &#x2603; qux et dolore magna aliqua. Ut enim ad &#1F600; minim veniam, quis nostrud exercitation' +
          '<h2>I will display &spades;</h2>' +
          '<p>I will display &#9824;</p>' +
          '<p>I will display &#x2660;</p>';

  final htmlWidg = new HtmlEncodedText(rawHtml: html);
  Widget build(BuildContext context) {
    return Container(
      child: htmlWidg.build(context),
    );
  }
}

implement our main method

void main() {
  runApp(MaterialApp(
    home: MyApp(),
    builder: (context, snapshot) {
      return Scaffold(
        appBar: AppBar(),
        body: MyApp(),
      );
    },
  ));
}

Issues

Don't hesitate to create pull requests.

Roadmap

  • Support block status for HTML heading tags
  • Find and handle invalid HTML (ie: "<This is a poorly formatted paragraph tag</p >>)

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  htmlencodedtext: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:htmlencodedtext/htmlencodedtext.dart';
  
Version Uploaded Documentation Archive
0.0.2 Jul 20, 2018 Go to the documentation of htmlencodedtext 0.0.2 Download htmlencodedtext 0.0.2 archive
0.0.1 Jul 20, 2018 Go to the documentation of htmlencodedtext 0.0.1 Download htmlencodedtext 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
28
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
14
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <2.0.0