chore: rename flowy_editor to appflowy_editor

This commit is contained in:
Lucas.Xu 2022-08-17 16:40:21 +08:00
parent 68f983ed2a
commit 2adde7c173
30 changed files with 56 additions and 57 deletions

@ -11,7 +11,7 @@ and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
<h1 align="center"><b>FlowyEditor</b></h1>
<h1 align="center"><b>AppFlowyEditor</b></h1>
<p align="center">An completely customize, test-covered rich text editing component for Flutter</p>
@ -45,7 +45,7 @@ flutter pub get
Creates editor with empty document
```dart
final editorState = EditorState.empty();
final editor = FlowyEditor(
final editor = AppFlowyEditor(
editorState: editorState,
keyEventHandlers: const [],
customBuilders: const {},
@ -56,7 +56,7 @@ Creates editor from JSON file
```dart
final json = ...;
final editorState = EditorState(StateTree.fromJson(data));
final editor = FlowyEditor(
final editor = AppFlowyEditor(
editorState: editorState,
keyEventHandlers: const [],
customBuilders: const {},

@ -14,4 +14,4 @@ We welcome and appreciate your pull request submissions, and we have many good-f
As [README](../README.md) said, we want to make sure that the code you submit will not affect the existing code logic and functionality, so please attach the corresponding test for each PR submission, and it is recommended to add a brief description of the test case and scope to the test. For more details, please see [TESTING.md](./testing.md)
Finally, to repeat, since the FlowyEditor is a community-driven open source editor, we take every PR seriously and feel very much for everyone's contribution.
Finally, to repeat, since the AppFlowyEditor is a community-driven open source editor, we take every PR seriously and feel very much for everyone's contribution.

@ -13,7 +13,7 @@ Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.topCenter,
child: FlowyEditor(
child: AppFlowyEditor(
editorState: EditorState.empty(),
keyEventHandlers: const [],
),
@ -29,7 +29,7 @@ Nothing will happen after typing `_xxx_`.
Next, we will create a function to handler underscore input.
```dart
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -102,7 +102,7 @@ Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.topCenter,
child: FlowyEditor(
child: AppFlowyEditor(
editorState: EditorState.empty(),
keyEventHandlers: [
underscoreToItalicHandler,
@ -130,7 +130,7 @@ Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.topCenter,
child: FlowyEditor(
child: AppFlowyEditor(
editorState: EditorState.empty(),
keyEventHandlers: const [],
),
@ -156,7 +156,7 @@ Then, we create a class that inherits [NodeWidgetBuilder](). As shown in the aut
```dart
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
class NetworkImageNodeWidgetBuilder extends NodeWidgetBuilder {
@ -266,7 +266,7 @@ final editorState = EditorState(
],
),
);
return FlowyEditor(
return AppFlowyEditor(
editorState: editorState,
customBuilders: {
'network_image': NetworkImageNodeWidgetBuilder(),

@ -94,7 +94,7 @@ print(attributes);
完整的例子
```dart
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../infra/test_editor.dart';

@ -7,7 +7,7 @@ import 'package:example/expandable_floating_action_button.dart';
import 'package:example/plugin/image_node_widget.dart';
import 'package:example/plugin/youtube_link_node_widget.dart';
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
void main() {
runApp(const MyApp());
@ -32,7 +32,7 @@ class MyApp extends StatelessWidget {
// is not restarted.
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'FlowyEditor Example'),
home: const MyHomePage(title: 'AppFlowyEditor Example'),
);
}
}
@ -72,11 +72,11 @@ class _MyHomePageState extends State<MyHomePage> {
Widget _buildBody() {
if (page == 0) {
return _buildFlowyEditorWithExample();
return _buildAppFlowyEditorWithExample();
} else if (page == 1) {
return _buildFlowyEditorWithEmptyDocument();
return _buildAppFlowyEditorWithEmptyDocument();
} else if (page == 2) {
return _buildFlowyEditorWithBigDocument();
return _buildAppFlowyEditorWithBigDocument();
}
return Container();
}
@ -116,9 +116,9 @@ class _MyHomePageState extends State<MyHomePage> {
);
}
Widget _buildFlowyEditorWithEmptyDocument() {
Widget _buildAppFlowyEditorWithEmptyDocument() {
final editorState = EditorState.empty();
final editor = FlowyEditor(
final editor = AppFlowyEditor(
editorState: editorState,
keyEventHandlers: const [],
customBuilders: const {},
@ -126,13 +126,13 @@ class _MyHomePageState extends State<MyHomePage> {
return editor;
}
Widget _buildFlowyEditorWithExample() {
Widget _buildAppFlowyEditorWithExample() {
return FutureBuilder<String>(
future: rootBundle.loadString('assets/example.json'),
builder: (context, snapshot) {
if (snapshot.hasData) {
final data = Map<String, Object>.from(json.decode(snapshot.data!));
return _buildFlowyEditor(EditorState(
return _buildAppFlowyEditor(EditorState(
document: StateTree.fromJson(data),
));
} else {
@ -144,13 +144,13 @@ class _MyHomePageState extends State<MyHomePage> {
);
}
Widget _buildFlowyEditorWithBigDocument() {
Widget _buildAppFlowyEditorWithBigDocument() {
return FutureBuilder<String>(
future: rootBundle.loadString('assets/big_document.json'),
builder: (context, snapshot) {
if (snapshot.hasData) {
final data = Map<String, Object>.from(json.decode(snapshot.data!));
return _buildFlowyEditor(EditorState(
return _buildAppFlowyEditor(EditorState(
document: StateTree.fromJson(data),
));
} else {
@ -162,10 +162,10 @@ class _MyHomePageState extends State<MyHomePage> {
);
}
Widget _buildFlowyEditor(EditorState editorState) {
Widget _buildAppFlowyEditor(EditorState editorState) {
return Container(
padding: const EdgeInsets.only(left: 20, right: 20),
child: FlowyEditor(
child: AppFlowyEditor(
key: editorKey,
editorState: editorState,
keyEventHandlers: const [],

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
/// 1. define your custom type in example.json

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
class NetworkImageNodeWidgetBuilder extends NodeWidgetBuilder {

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:pod_player/pod_player.dart';

@ -1,5 +1,5 @@
/// FlowyEditor library
library flowy_editor;
/// AppFlowyEditor library
library appflowy_editor;
export 'src/document/node.dart';
export 'src/document/path.dart';

@ -1,5 +1,4 @@
import 'package:flowy_editor/src/document/attributes.dart';
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
abstract class Operation {
factory Operation.fromJson(Map<String, dynamic> map) {

@ -26,8 +26,8 @@ NodeWidgetBuilders defaultBuilders = {
'text/quote': QuotedTextNodeWidgetBuilder(),
};
class FlowyEditor extends StatefulWidget {
const FlowyEditor({
class AppFlowyEditor extends StatefulWidget {
const AppFlowyEditor({
Key? key,
required this.editorState,
this.customBuilders = const {},
@ -43,10 +43,10 @@ class FlowyEditor extends StatefulWidget {
final List<FlowyKeyEventHandler> keyEventHandlers;
@override
State<FlowyEditor> createState() => _FlowyEditorState();
State<AppFlowyEditor> createState() => _AppFlowyEditorState();
}
class _FlowyEditorState extends State<FlowyEditor> {
class _AppFlowyEditorState extends State<AppFlowyEditor> {
EditorState get editorState => widget.editorState;
@override
@ -57,7 +57,7 @@ class _FlowyEditorState extends State<FlowyEditor> {
}
@override
void didUpdateWidget(covariant FlowyEditor oldWidget) {
void didUpdateWidget(covariant AppFlowyEditor oldWidget) {
super.didUpdateWidget(oldWidget);
if (editorState.service != oldWidget.editorState.service) {

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/infra/html_converter.dart';
import 'package:flowy_editor/src/document/node_iterator.dart';
import 'package:flutter/material.dart';
@ -106,7 +106,7 @@ _pasteMultipleLinesInText(
if (tailNodes.last.type == "text") {
final tailTextNode = tailNodes.last as TextNode;
tailTextNode.delta = tailTextNode.delta + remain;
} else if (remain.length > 0) {
} else if (remain.isNotEmpty) {
tailNodes.add(TextNode(type: "text", delta: remain));
}
} else {

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
KeyEventResult _handleBackspace(EditorState editorState, RawKeyEvent event) {
var selection = editorState.service.selectionService.currentSelection.value;

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/service/toolbar_service.dart';
import 'package:flutter/material.dart';

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/render/selection/toolbar_widget.dart';
import 'package:flowy_editor/src/extensions/object_extensions.dart';

@ -1,6 +1,6 @@
import 'dart:collection';
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
@ -26,7 +26,7 @@ class EditorWidgetTester {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: FlowyEditor(
body: AppFlowyEditor(
editorState: _editorState,
),
),

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/render/rich_text/default_selectable.dart';
import 'package:flowy_editor/src/render/rich_text/rich_text_style.dart';
import 'package:flowy_editor/src/extensions/text_node_extensions.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/render/rich_text/rich_text_style.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/render/rich_text/rich_text_style.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../infra/test_editor.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../infra/test_editor.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../infra/test_editor.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/service/internal_key_event_handlers/slash_handler.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/render/rich_text/rich_text_style.dart';
import 'package:flowy_editor/src/extensions/text_node_extensions.dart';
import 'package:flutter/services.dart';

@ -1,4 +1,4 @@
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flowy_editor/appflowy_editor.dart';
import 'package:flowy_editor/src/render/rich_text/rich_text_style.dart';
import 'package:flowy_editor/src/service/internal_key_event_handlers/whitespace_handler.dart';
import 'package:flutter/services.dart';