Skip to content

Commit

Permalink
release v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-virkus committed Apr 28, 2021
1 parent 94cb4fe commit 5b04c2d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 38 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## [0.0.4] - not yet released
## [0.0.4] - 2021-04-28
- Support dark theme
- Simpler usage with `PackagedHtmlEditor` #2
- Select text foreground and background colors #12, $14
- New strike through option
- Bold, italic, underline text is now detected from inline CSS styles, too #5
- Optionally specify your own context menu items using the `textSelectionMenuItems` parameter
- Optionally specify your own widgets for the predefined `HtmlEditorControls` widget using the `prefix` and/or `suffix` parameters


## [0.0.3] - 2021-03-13
- `enough_html_editor` is now [null safe](https://dart.dev/null-safety/tour) #6
Expand Down
59 changes: 23 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# enough_html_editor

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

## API Documentation
Check out the full API documentation at https://pub.dev/documentation/enough_html_editor/latest/
Expand All @@ -11,6 +12,7 @@ The current `enough_html_editor` package the following widgets:
* `HtmlEditorControls` optional editor controls.
* `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.
* `PackagedHtmlEditor` a simple to use Widget that contains both the `HtmlEditor` and the `HtmlEditorControls`

### Access API
You choose between two options to access the API:
Expand Down Expand Up @@ -47,46 +49,31 @@ You choose between two options to access the API:
Either the API or the global key is required for creating the `HtmlEditorControls`.
## Quick example
## Quick Start
Use the `PackagedHtmlEditor` for a quick start. This contains both the default controls and the editor.
```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();
},
),
),
],
),
);
return PackagedHtmlEditor(
onCreated: (api) {
_editorApi = api;
},
initialContent: '''<p>Here is some text</p>
<p>Here is <b>bold</b> text</p>
<p>Here is <i>some italic sic</i> text</p>
<p>Here is <i><b>bold and italic</b></i> text</p>
<p style="text-align: center;">Here is <u><i><b>bold and italic and underline</b></i></u> text</p>
<ul><li>one list element</li><li>another point</li></ul>
<blockquote>Here is a quote<br/>
that spans several lines<br/>
<blockquote>
Another second level blockqote
</blockquote>
</blockquote>
''',
);
}
```

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

```
dependencies:
enough_html_editor: ^0.0.2
enough_html_editor: ^0.0.4
```
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
Binary file added editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.3
version: 0.0.4
homepage: https://github.com/Enough-Software/enough_html_editor

environment:
Expand Down

0 comments on commit 5b04c2d

Please sign in to comment.