Git Product home page Git Product logo

jideguru / rich_editor Goto Github PK

View Code? Open in Web Editor NEW
123.0 5.0 34.0 2.92 MB

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

Home Page: https://pub.dev/packages/rich_editor

License: Apache License 2.0

HTML 4.30% CSS 2.30% JavaScript 22.66% Kotlin 0.12% Ruby 2.64% Swift 1.25% Objective-C 0.04% Dart 66.68%
flutter editor flutter-html-editor text-editor html-editor

rich_editor's Introduction

✨ 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',
        editorOptions: RichEditorOptions(
          placeholder: 'Start typing',
          // backgroundColor: Colors.blueGrey, // Editor's bg color
          // baseTextColor: Colors.white,
          // editor padding
          padding: EdgeInsets.symmetric(horizontal: 5.0),
          // font name
          baseFontFamily: 'sans-serif',
          // Position of the editing bar (BarPosition.TOP or BarPosition.BOTTOM)
          barPosition: BarPosition.TOP,
        ),
        // 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();

Custom Toolbar

If you're interested in creating your own toolbar check the custom_toolbar_demo.dart in the example

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.

rich_editor's People

Contributors

imgbotapp avatar jideguru avatar restyled-commits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rich_editor's Issues

异常

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.inputmethod.InputConnection android.view.View.onCreateInputConnection(android.view.inputmethod.EditorInfo)' on a null object reference
W/System.err(32191): at io.flutter.plugin.editing.TextInputPlugin.createInputConnection(TextInputPlugin.java:305)
W/System.err(32191): at io.flutter.embedding.android.FlutterView.onCreateInputConnection(FlutterView.java:710)
W/System.err(32191): at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:1855)
W/System.err(32191): at android.view.inputmethod.InputMethodManager.restartInput(InputMethodManager.java:1768)
W/System.err(32191): at org.chromium.content.browser.input.ImeAdapterImpl.r0(HwWebview-11.1.5.315.3337:4)
W/System.err(32191): at org.chromium.content.browser.input.ImeAdapterImpl.updateState(HwWebview-11.1.5.315.3337:30)
W/System.err(32191): at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(32191): at android.os.MessageQueue.next(MessageQueue.java:363)
W/System.err(32191): at android.os.Looper.loop(Looper.java:176)
W/System.err(32191): at android.app.ActivityThread.main(ActivityThread.java:8668)
W/System.err(32191): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(32191): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
W/System.err(32191): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
F/hwschromium-3337(32191): [FATAL:jni_android.cc(249)] Please include Java exception stack in crash report

配置清除问题

当我关闭页面之后重新进入页面 上一次设置配置并没有清除 比如字体加粗等

how to get json response from editor

after entering the data it return the html response as

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

but instead of this i want the json response like in flutter_quill

Image issue

Hello JideGuru,
First, thank you for your work, this package look amazing, but there is an issue on image, image can scroll, can you fix this please

Upgrade dependencies

Image picker has moved on quite a bit (0.8.3). Please upgrade dependencies so we can try this

No interface to listen for text and/or HTML changes on the editor

I have combined through the API docs and noticed that there are no provisions to listen for text and/or HTML changes on the editor. Correct me if i am wrong @JideGuru but this is a serious pain for me right now. I am trying to update some String when the text or HTML changes but I can't. Currently looking for a work around for the time being

Keyboard not showing on ios v.0.0.4

Hi, i'm unable to find any other people with this issue, but i am having trouble getting the editor to work properly on ios.

The keyboard does not appear and I cannot type into the editor.

flutter: WebView Message: {message: SyntaxError: Unexpected identifier 'font'. Expected ')' to end an argument list., messageLevel: 3}
flutter: Unable to load asset: packages/rich_editor/assets/editor/interact.min.js.map

Are there additional steps to configure this package on ios?

I would love to try version .0.0.5, but i have another plugin(form_builder) that depends on a different version of the color picker.

Thanks in advance

Please help

1 last update please

@pruthvi1698
Author
pruthvi1698 commented 5 minutes ago
Only this issue.
Error:
android:exported needs to be explicitly specified for element <activity#app.ruthumana.MainActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined

@pruthvi1698
Author
pruthvi1698 commented 5 minutes ago
I have pushed the ios release. struck with android. please help

Not working in iOS

Uncategorized (Xcode): Command CompileSwift failed with a nonzero exit code

Swift Compiler Error (Xcode): Cannot call value of non-function type 'String?'
/Users/ris-m1-mac/Desktop/fluttersdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.7.2+3/ios/Classes/MyCookieManager.swift:259:43

Could not build the application for the simulator.
Error launching application on iPad Pro (9.7-inch).

获取焦点问题

keyEditor.currentState.javascriptExecutor.focus(); 能够唤起键盘 但是编辑器没有获取到焦点

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.