Skip to content

Commit f575c79

Browse files
committed
release v0.0.2
1 parent 4940e36 commit f575c79

File tree

4 files changed

+67
-5
lines changed

4 files changed

+67
-5
lines changed

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [0.0.2] - 2021-02-27
2+
3+
* Improve documentation.
4+
* Retrieve the full HTML document's text with `await editorApi.getFullHtml()`
5+
* Add any custom CSS styles with `editorApi.customStyles` setter, for example
6+
```dart
7+
editorApi.customStyles =
8+
'''
9+
blockquote {
10+
font: normal helvetica, sans-serif;
11+
margin-top: 10px;
12+
margin-bottom: 10px;
13+
margin-left: 20px;
14+
padding-left: 15px;
15+
border-left: 3px solid #ccc;
16+
}
17+
''';
18+
```
19+
* Replace all CSS styles with the `editorApi.styles` setter.
20+
* Use the minimum height specified in `HtmlEditor.minHeight`.
21+
122
## [0.0.1] - 2021-02-27
223

324
* Basic HTML editor with Flutter-native control widgets.

README.md

+44-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The current `enough_html_editor` package the following widgets:
1212
* `SliverHeaderHtmlEditorControls` wrapper to use the editor controls within a `CustomScrollView` as a sticky header.
1313
* `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.
1414

15-
### Simple usage
15+
### Access API
1616
You choose between two options to access the API:
1717
1. Use the `onCreated(HtmlEditorApi)` callback:
1818
```dart
@@ -47,14 +47,55 @@ You choose between two options to access the API:
4747
4848
Either the API or the global key is required for creating the `HtmlEditorControls`.
4949
50-
50+
## Quick example
51+
```dart
52+
HtmlEditorApi _editorApi;
53+
54+
@override
55+
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+
);
90+
}
91+
```
5192

5293
## Installation
5394
Add this dependency your pubspec.yaml file:
5495

5596
```
5697
dependencies:
57-
enough_html_editor: ^0.0.1
98+
enough_html_editor: ^0.0.2
5899
```
59100
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).
60101

example/pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ packages:
5656
path: ".."
5757
relative: true
5858
source: path
59-
version: "0.0.1"
59+
version: "0.0.2"
6060
fake_async:
6161
dependency: transitive
6262
description:

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.1
3+
version: 0.0.2
44
homepage: https://github.com/Enough-Software/enough_html_editor
55

66
environment:

0 commit comments

Comments
 (0)