Skip to content

Commit 23e71cd

Browse files
committed
.
0 parents  commit 23e71cd

13 files changed

+971
-0
lines changed

.flutter-plugins

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
url_launcher=/Users/nami/vendor/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.1/

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
.dart_tool/
3+
4+
.packages
5+
.pub/
6+
7+
build/
8+
ios/.generated/
9+
ios/Flutter/Generated.xcconfig
10+
ios/Runner/GeneratedPluginRegistrant.*

.idea/libraries/Dart_SDK.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## [0.0.1]

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO: Add your license here.

README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# flutter_html_widget
2+
3+
This widget turn html string into flutter widgets like Text, RichText and Table.
4+
5+
This is **so not a webview alternative**. Think this as a **read mode** for simple html elements.
6+
7+
The widget is extracted from [wiki-flutter](https://github.com/namiwang/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.
8+
9+
## demo
10+
11+
````dart
12+
import 'package:flutter_html_widget/flutter_html_widget.dart';
13+
14+
final html = """
15+
<section class="homepage__key_points card">
16+
<h1 class="homepage__title">
17+
Build beautiful native apps in record time
18+
</h1>
19+
20+
<div class="homepage__tagline">
21+
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.
22+
</div>
23+
</section>
24+
""";
25+
26+
new MaterialApp(
27+
home: new Material(
28+
child: new HtmlWidget(html: html, key: key)
29+
),
30+
);
31+
````
32+
33+
will produce widgets like
34+
35+
```dart
36+
new Wrap(
37+
children: <Widget>[
38+
new Container(
39+
padding: EdgeInsets.all(8.0),
40+
child: new RichText(
41+
text: new TextSpan(
42+
children: [
43+
new TextSpan(text: "Build beautiful native apps in record time")
44+
]
45+
),
46+
)
47+
)
48+
],
49+
)
50+
```
51+
52+
## features
53+
54+
### supported
55+
56+
- basic text, link, paragraph, list, image, caption, etc.
57+
58+
### on the roadmap
59+
60+
- styles for `<b>` `<i>` `<small>` `<section>` `<h12345>` etc
61+
- inline images
62+
- video element
63+
- more options
64+
65+
### not for now
66+
67+
- complex table

flutter_html_widget.iml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
7+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
8+
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
9+
<excludeFolder url="file://$MODULE_DIR$/.idea" />
10+
<excludeFolder url="file://$MODULE_DIR$/.pub" />
11+
<excludeFolder url="file://$MODULE_DIR$/build" />
12+
</content>
13+
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
14+
<orderEntry type="sourceFolder" forTests="false" />
15+
<orderEntry type="library" name="Dart Packages" level="project" />
16+
<orderEntry type="library" name="Dart SDK" level="project" />
17+
<orderEntry type="library" name="Flutter Plugins" level="project" />
18+
</component>
19+
</module>

0 commit comments

Comments
 (0)