Skip to content

Commit

Permalink
release v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-virkus committed Feb 27, 2021
1 parent 4940e36 commit f575c79
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## [0.0.2] - 2021-02-27

* Improve documentation.
* Retrieve the full HTML document's text with `await editorApi.getFullHtml()`
* Add any custom CSS styles with `editorApi.customStyles` setter, for example
```dart
editorApi.customStyles =
'''
blockquote {
font: normal helvetica, sans-serif;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 20px;
padding-left: 15px;
border-left: 3px solid #ccc;
}
''';
```
* Replace all CSS styles with the `editorApi.styles` setter.
* Use the minimum height specified in `HtmlEditor.minHeight`.

## [0.0.1] - 2021-02-27

* Basic HTML editor with Flutter-native control widgets.
47 changes: 44 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The current `enough_html_editor` package the following widgets:
* `SliverHeaderHtmlEditorControls` wrapper to use the editor controls within a `CustomScrollView` as a sticky header.
* `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.

### Simple usage
### Access API
You choose between two options to access the API:
1. Use the `onCreated(HtmlEditorApi)` callback:
```dart
Expand Down Expand Up @@ -47,14 +47,55 @@ You choose between two options to access the API:
Either the API or the global key is required for creating the `HtmlEditorControls`.
## Quick example
```dart
HtmlEditorApi _editorApi;
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: [
if (_editorApi != null) ...{
SliverHeaderHtmlEditorControls(editorApi: _editorApi),
},
SliverToBoxAdapter(
child: FutureBuilder<String>(
future: loadMailTextFuture,
builder: (widget, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.none:
case ConnectionState.waiting:
case ConnectionState.active:
return Row(children: [CircularProgressIndicator()]);
break;
case ConnectionState.done:
return HtmlEditor(
onCreated: (api) {
setState(() {
_editorApi = api;
});
},
initialContent: snapshot.data,
);
break;
}
return Container();
},
),
),
],
),
);
}
```

## Installation
Add this dependency your pubspec.yaml file:

```
dependencies:
enough_html_editor: ^0.0.1
enough_html_editor: ^0.0.2
```
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).

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.1"
version: "0.0.2"
fake_async:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: enough_html_editor
description: Slim HTML editor for Flutter with full API control and optional Flutter-based widget controls.
version: 0.0.1
version: 0.0.2
homepage: https://github.com/Enough-Software/enough_html_editor

environment:
Expand Down

0 comments on commit f575c79

Please sign in to comment.