Skip to content

Commit 5b04c2d

Browse files
committed
release v0.0.4
1 parent 94cb4fe commit 5b04c2d

File tree

4 files changed

+32
-38
lines changed

4 files changed

+32
-38
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
## [0.0.4] - not yet released
1+
## [0.0.4] - 2021-04-28
22
- Support dark theme
3+
- Simpler usage with `PackagedHtmlEditor` #2
4+
- Select text foreground and background colors #12, $14
5+
- New strike through option
6+
- Bold, italic, underline text is now detected from inline CSS styles, too #5
7+
- Optionally specify your own context menu items using the `textSelectionMenuItems` parameter
8+
- Optionally specify your own widgets for the predefined `HtmlEditorControls` widget using the `prefix` and/or `suffix` parameters
9+
310

411
## [0.0.3] - 2021-03-13
512
- `enough_html_editor` is now [null safe](https://dart.dev/null-safety/tour) #6

README.md

+23-36
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# enough_html_editor
22

33
Slim HTML editor for Flutter with full API control and optional Flutter-based widget controls.
4+
![screenshot](editor.png)
45

56
## API Documentation
67
Check out the full API documentation at https://pub.dev/documentation/enough_html_editor/latest/
@@ -11,6 +12,7 @@ The current `enough_html_editor` package the following widgets:
1112
* `HtmlEditorControls` optional editor controls.
1213
* `SliverHeaderHtmlEditorControls` wrapper to use the editor controls within a `CustomScrollView` as a sticky header.
1314
* `HtmlEditorApi` - not a widget - the API to control the editor, use the API to access the edited HTML text or to set the current text bold, add an unordered list, etc.
15+
* `PackagedHtmlEditor` a simple to use Widget that contains both the `HtmlEditor` and the `HtmlEditorControls`
1416

1517
### Access API
1618
You choose between two options to access the API:
@@ -47,46 +49,31 @@ You choose between two options to access the API:
4749
4850
Either the API or the global key is required for creating the `HtmlEditorControls`.
4951
50-
## Quick example
52+
## Quick Start
53+
Use the `PackagedHtmlEditor` for a quick start. This contains both the default controls and the editor.
5154
```dart
5255
HtmlEditorApi _editorApi;
5356
5457
@override
5558
Widget build(BuildContext context) {
56-
return Scaffold(
57-
body: CustomScrollView(
58-
slivers: [
59-
if (_editorApi != null) ...{
60-
SliverHeaderHtmlEditorControls(editorApi: _editorApi),
61-
},
62-
SliverToBoxAdapter(
63-
child: FutureBuilder<String>(
64-
future: loadMailTextFuture,
65-
builder: (widget, snapshot) {
66-
switch (snapshot.connectionState) {
67-
case ConnectionState.none:
68-
case ConnectionState.waiting:
69-
case ConnectionState.active:
70-
return Row(children: [CircularProgressIndicator()]);
71-
break;
72-
case ConnectionState.done:
73-
return HtmlEditor(
74-
onCreated: (api) {
75-
setState(() {
76-
_editorApi = api;
77-
});
78-
},
79-
initialContent: snapshot.data,
80-
);
81-
break;
82-
}
83-
return Container();
84-
},
85-
),
86-
),
87-
],
88-
),
89-
);
59+
return PackagedHtmlEditor(
60+
onCreated: (api) {
61+
_editorApi = api;
62+
},
63+
initialContent: '''<p>Here is some text</p>
64+
<p>Here is <b>bold</b> text</p>
65+
<p>Here is <i>some italic sic</i> text</p>
66+
<p>Here is <i><b>bold and italic</b></i> text</p>
67+
<p style="text-align: center;">Here is <u><i><b>bold and italic and underline</b></i></u> text</p>
68+
<ul><li>one list element</li><li>another point</li></ul>
69+
<blockquote>Here is a quote<br/>
70+
that spans several lines<br/>
71+
<blockquote>
72+
Another second level blockqote
73+
</blockquote>
74+
</blockquote>
75+
''',
76+
);
9077
}
9178
```
9279

@@ -95,7 +82,7 @@ Add this dependency your pubspec.yaml file:
9582

9683
```
9784
dependencies:
98-
enough_html_editor: ^0.0.2
85+
enough_html_editor: ^0.0.4
9986
```
10087
The latest version or `enough_html_editor` is [![enough_html_editor version](https://img.shields.io/pub/v/enough_html_editor.svg)](https://pub.dartlang.org/packages/enough_html_editor).
10188

editor.png

43.7 KB
Loading

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: enough_html_editor
22
description: Slim HTML editor for Flutter with full API control and optional Flutter-based widget controls.
3-
version: 0.0.3
3+
version: 0.0.4
44
homepage: https://github.com/Enough-Software/enough_html_editor
55

66
environment:

0 commit comments

Comments
 (0)