diff --git a/CHANGELOG.md b/CHANGELOG.md index 48bdf7b..0b001ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index a5d32a6..7fbd584 100644 --- a/README.md +++ b/README.md @@ -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/ @@ -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: @@ -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( - 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: '''

Here is some text

+

Here is bold text

+

Here is some italic sic text

+

Here is bold and italic text

+

Here is bold and italic and underline text

+ +
Here is a quote
+ that spans several lines
+
+ Another second level blockqote +
+
+''', + ); } ``` @@ -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). diff --git a/editor.png b/editor.png new file mode 100644 index 0000000..ef5f959 Binary files /dev/null and b/editor.png differ diff --git a/pubspec.yaml b/pubspec.yaml index 24b532f..7e90174 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: