Merge pull request #5 from JideGuru/restyled/editor-settings-and-state
Restyle Editor settings
This commit is contained in:
commit
3e8ade5b18
16
README.md
16
README.md
@ -1,4 +1,5 @@
|
|||||||
# ✨ rich_editor
|
# ✨ rich_editor
|
||||||
|
|
||||||
[![pub package](https://img.shields.io/pub/v/rich_editor.svg)](https://pub.dartlang.org/packages/rich_editor)
|
[![pub package](https://img.shields.io/pub/v/rich_editor.svg)](https://pub.dartlang.org/packages/rich_editor)
|
||||||
[![pub points](https://badges.bar/rich_editor/pub%20points)](https://pub.dev/packages/rich_editor/score)
|
[![pub points](https://badges.bar/rich_editor/pub%20points)](https://pub.dev/packages/rich_editor/score)
|
||||||
|
|
||||||
@ -7,6 +8,7 @@ WYSIWYG editor for Flutter with a rich set of supported formatting options.
|
|||||||
Based on https://github.com/dankito/RichTextEditor, but for Flutter.
|
Based on https://github.com/dankito/RichTextEditor, but for Flutter.
|
||||||
|
|
||||||
## ✨ Features
|
## ✨ Features
|
||||||
|
|
||||||
- [x] Bold, Italic, Underline, Strike through, Subscript, Superscript
|
- [x] Bold, Italic, Underline, Strike through, Subscript, Superscript
|
||||||
- [x] Heading 1 - 6, Text body, Preformatted, Block quote
|
- [x] Heading 1 - 6, Text body, Preformatted, Block quote
|
||||||
- [x] Font (reads all system fonts) (Android only)
|
- [x] Font (reads all system fonts) (Android only)
|
||||||
@ -26,9 +28,12 @@ Based on https://github.com/dankito/RichTextEditor, but for Flutter.
|
|||||||
- [ ] Icon indicators
|
- [ ] Icon indicators
|
||||||
|
|
||||||
## 📸 Screenshots
|
## 📸 Screenshots
|
||||||
<img src="https://github.com/JideGuru/rich_editor/raw/master/res/1.png" width="400"> <img src="https://github.com/JideGuru/rich_editor/raw/master/res/2.png" width="400">
|
|
||||||
|
<img src="https://github.com/JideGuru/rich_editor/raw/master/res/1.png" width="400">
|
||||||
|
<img src="https://github.com/JideGuru/rich_editor/raw/master/res/2.png" width="400">
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
// Insert widget into tree
|
// Insert widget into tree
|
||||||
RichEditor(
|
RichEditor(
|
||||||
@ -57,24 +62,29 @@ Based on https://github.com/dankito/RichTextEditor, but for Flutter.
|
|||||||
```
|
```
|
||||||
|
|
||||||
Get current HTML from editor
|
Get current HTML from editor
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
String? html = await keyEditor.currentState?.getHtml();
|
String? html = await keyEditor.currentState?.getHtml();
|
||||||
print(html);
|
print(html);
|
||||||
```
|
```
|
||||||
|
|
||||||
Set Focus and Unfocus
|
Set Focus and Unfocus
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
await keyEditor.currentState?.focus();
|
await keyEditor.currentState?.focus();
|
||||||
await keyEditor.currentState?.unFocus();
|
await keyEditor.currentState?.unFocus();
|
||||||
```
|
```
|
||||||
|
|
||||||
Clear Editor content
|
Clear Editor content
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
await keyEditor.currentState?.clear();
|
await keyEditor.currentState?.clear();
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Toolbar
|
### Custom Toolbar
|
||||||
If you're interested in creating your own toolbar check the custom_toolbar_demo.dart in the example
|
|
||||||
|
If you're interested in creating your own toolbar check the
|
||||||
|
custom_toolbar_demo.dart in the example
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
@ -90,4 +100,4 @@ If you're interested in creating your own toolbar check the custom_toolbar_demo.
|
|||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
/// Position the inbuilt Toolbar or use your custom toolbar
|
/// Position the inbuilt Toolbar or use your custom toolbar
|
||||||
enum BarPosition { TOP, BOTTOM, CUSTOM }
|
enum BarPosition { TOP, BOTTOM, CUSTOM }
|
||||||
|
@ -38,4 +38,4 @@ enum CommandName {
|
|||||||
INSERTCHECKBOX,
|
INSERTCHECKBOX,
|
||||||
// pseudo commands for toggling grouped command views
|
// pseudo commands for toggling grouped command views
|
||||||
EXPANDING_SEARCH_VIEWING,
|
EXPANDING_SEARCH_VIEWING,
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,9 @@ dev_dependencies:
|
|||||||
|
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
flutter:
|
flutter:
|
||||||
|
|
||||||
# To add assets to your package, add an assets section, like this:
|
# To add assets to your package, add an assets section, like this:
|
||||||
assets:
|
assets:
|
||||||
- assets/editor/
|
- assets/editor/
|
||||||
#
|
#
|
||||||
# For details regarding assets in packages, see
|
# For details regarding assets in packages, see
|
||||||
# https://flutter.dev/assets-and-images/#from-packages
|
# https://flutter.dev/assets-and-images/#from-packages
|
||||||
|
Loading…
Reference in New Issue
Block a user