Go to file
2021-05-31 22:19:49 +01:00
assets/editor feat: added editor specific features 2021-05-29 22:36:44 +01:00
example feat: added editor settings 2021-05-31 22:19:49 +01:00
lib feat: added editor settings 2021-05-31 22:19:49 +01:00
res chore: prepare release 2021-05-31 16:52:29 +01:00
test first commit 2021-05-26 23:42:34 +01:00
.gitignore first commit 2021-05-26 23:42:34 +01:00
.metadata first commit 2021-05-26 23:42:34 +01:00
CHANGELOG.md chore: prepare release 2021-05-31 16:52:29 +01:00
LICENSE feat: added editor settings 2021-05-31 22:19:49 +01:00
pubspec.lock feat: added font choosing for android 2021-05-31 13:53:10 +01:00
pubspec.yaml chore: prepare new release 2021-05-31 17:28:36 +01:00
README.md chore: prepare new release, added web and mac platforms 2021-05-31 17:18:49 +01:00

rich_editor

pub package pub points

WYSIWYG editor for Flutter with a rich set of supported formatting options.

Based on https://github.com/dankito/RichTextEditor, but for Flutter.

Features

  • Bold, Italic, Underline, Strike through, Subscript, Superscript
  • Heading 1 - 6, Text body, Preformatted, Block quote
  • Font (reads all system fonts) (Android only)
  • Font Size
  • Text Color
  • Text Background Color
  • Highlight text
  • Justify Left, Center, Right, Blockquote
  • Indent, Outdent
  • Undo, Redo
  • Unordered List (Bullets)
  • Ordered List (Numbers)
  • Insert local or remote Image
  • Insert Link
  • Insert Checkbox
  • Search
  • Icon indicators

📸 Screenshots

Usage

      // Insert widget into tree
      RichEditor(
        key: keyEditor,
        value: 'initial html here',
        // You can return a Link (maybe you need to upload the image to your
        // storage before displaying in the editor or you can also use base64
        getImageUrl: (image) {
          String link = 'https://avatars.githubusercontent.com/u/24323581?v=4';
          String base64 = base64Encode(image.readAsBytesSync());
          String base64String = 'data:image/png;base64, $base64';
          return base64String;
        },
      )

Get current HTML from editor

String? html = await keyEditor.currentState?.getHtml();
print(html);

Set Focus and Unfocus

await keyEditor.currentState?.focus();
await keyEditor.currentState?.unFocus();

Clear Editor content

await keyEditor.currentState?.clear();

License

Copyright 2021 JideGuru

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.