mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Merge pull request #1380 from LucasXu0/appflowy_editor_0_0_7
appflowy editor 0.0.7
This commit is contained in:
commit
9c24597bbd
@ -16,7 +16,6 @@ Widget build(BuildContext context) {
|
|||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: AppFlowyEditor(
|
child: AppFlowyEditor(
|
||||||
editorState: EditorState.empty(),
|
editorState: EditorState.empty(),
|
||||||
editorStyle: EditorStyle.defaultStyle(),
|
|
||||||
shortcutEvents: const [],
|
shortcutEvents: const [],
|
||||||
customBuilders: const {},
|
customBuilders: const {},
|
||||||
),
|
),
|
||||||
@ -93,7 +92,7 @@ ShortcutEventHandler _underscoreToItalicHandler = (editorState, event) {
|
|||||||
// Delete the previous 'underscore',
|
// Delete the previous 'underscore',
|
||||||
// update the style of the text surrounded by the two underscores to 'italic',
|
// update the style of the text surrounded by the two underscores to 'italic',
|
||||||
// and update the cursor position.
|
// and update the cursor position.
|
||||||
TransactionBuilder(editorState)
|
final transaction = editorState.transaction
|
||||||
..deleteText(textNode, firstUnderscore, 1)
|
..deleteText(textNode, firstUnderscore, 1)
|
||||||
..formatText(
|
..formatText(
|
||||||
textNode,
|
textNode,
|
||||||
@ -108,8 +107,8 @@ ShortcutEventHandler _underscoreToItalicHandler = (editorState, event) {
|
|||||||
path: textNode.path,
|
path: textNode.path,
|
||||||
offset: selection.end.offset - 1,
|
offset: selection.end.offset - 1,
|
||||||
),
|
),
|
||||||
)
|
);
|
||||||
..commit();
|
editorState.apply(transaction);
|
||||||
|
|
||||||
return KeyEventResult.handled;
|
return KeyEventResult.handled;
|
||||||
};
|
};
|
||||||
@ -125,7 +124,6 @@ Widget build(BuildContext context) {
|
|||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: AppFlowyEditor(
|
child: AppFlowyEditor(
|
||||||
editorState: EditorState.empty(),
|
editorState: EditorState.empty(),
|
||||||
editorStyle: EditorStyle.defaultStyle(),
|
|
||||||
customBuilders: const {},
|
customBuilders: const {},
|
||||||
shortcutEvents: [
|
shortcutEvents: [
|
||||||
underscoreToItalic,
|
underscoreToItalic,
|
||||||
@ -138,7 +136,7 @@ Widget build(BuildContext context) {
|
|||||||
|
|
||||||
![After](./images/customize_a_shortcut_event_after.gif)
|
![After](./images/customize_a_shortcut_event_after.gif)
|
||||||
|
|
||||||
Check out the [complete code](https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/underscore_to_italic.dart) file of this example.
|
Check out the [complete code](https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/markdown_syntax_to_styled_text.dart) file of this example.
|
||||||
|
|
||||||
|
|
||||||
## Customizing a Component
|
## Customizing a Component
|
||||||
@ -156,7 +154,6 @@ Widget build(BuildContext context) {
|
|||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: AppFlowyEditor(
|
child: AppFlowyEditor(
|
||||||
editorState: EditorState.empty(),
|
editorState: EditorState.empty(),
|
||||||
editorStyle: EditorStyle.defaultStyle(),
|
|
||||||
shortcutEvents: const [],
|
shortcutEvents: const [],
|
||||||
customBuilders: const {},
|
customBuilders: const {},
|
||||||
),
|
),
|
||||||
@ -180,7 +177,7 @@ We'll use `network_image` in this case. And we add `network_image_src` to the `a
|
|||||||
|
|
||||||
Then, we create a class that inherits [NodeWidgetBuilder](../lib/src/service/render_plugin_service.dart). As shown in the autoprompt, we need to implement two functions:
|
Then, we create a class that inherits [NodeWidgetBuilder](../lib/src/service/render_plugin_service.dart). As shown in the autoprompt, we need to implement two functions:
|
||||||
1. one returns a widget
|
1. one returns a widget
|
||||||
2. the other verifies the correctness of the [Node](../lib/src/document/node.dart).
|
2. the other verifies the correctness of the [Node](../lib/src/core/document/node.dart).
|
||||||
|
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
@ -308,7 +305,7 @@ return AppFlowyEditor(
|
|||||||
|
|
||||||
Check out the [complete code](https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/network_image_node_widget.dart) file of this example.
|
Check out the [complete code](https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/network_image_node_widget.dart) file of this example.
|
||||||
|
|
||||||
## Customizing a Theme (New Feature in 0.0.5, Alpha)
|
## Customizing a Theme (New Feature in 0.0.7)
|
||||||
|
|
||||||
We will use a simple example to illustrate how to quickly customize a theme.
|
We will use a simple example to illustrate how to quickly customize a theme.
|
||||||
|
|
||||||
@ -322,7 +319,6 @@ Widget build(BuildContext context) {
|
|||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: AppFlowyEditor(
|
child: AppFlowyEditor(
|
||||||
editorState: EditorState.empty(),
|
editorState: EditorState.empty(),
|
||||||
editorStyle: EditorStyle.defaultStyle(),
|
|
||||||
shortcutEvents: const [],
|
shortcutEvents: const [],
|
||||||
customBuilders: const {},
|
customBuilders: const {},
|
||||||
),
|
),
|
||||||
@ -338,44 +334,41 @@ At this point, the editor looks like ...
|
|||||||
Next, we will customize the `EditorStyle`.
|
Next, we will customize the `EditorStyle`.
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
EditorStyle _customizedStyle() {
|
ThemeData customizeEditorTheme(BuildContext context) {
|
||||||
final editorStyle = EditorStyle.defaultStyle();
|
final dark = EditorStyle.dark;
|
||||||
return editorStyle.copyWith(
|
final editorStyle = dark.copyWith(
|
||||||
cursorColor: Colors.white,
|
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 150),
|
||||||
selectionColor: Colors.blue.withOpacity(0.3),
|
cursorColor: Colors.red.shade600,
|
||||||
textStyle: editorStyle.textStyle.copyWith(
|
selectionColor: Colors.yellow.shade600.withOpacity(0.5),
|
||||||
defaultTextStyle: GoogleFonts.poppins().copyWith(
|
textStyle: GoogleFonts.poppins().copyWith(
|
||||||
|
fontSize: 14,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 14.0,
|
|
||||||
),
|
),
|
||||||
defaultPlaceholderTextStyle: GoogleFonts.poppins().copyWith(
|
placeholderTextStyle: GoogleFonts.poppins().copyWith(
|
||||||
color: Colors.white.withOpacity(0.5),
|
fontSize: 14,
|
||||||
fontSize: 14.0,
|
color: Colors.grey.shade400,
|
||||||
),
|
),
|
||||||
bold: const TextStyle(fontWeight: FontWeight.w900),
|
code: dark.code?.copyWith(
|
||||||
code: TextStyle(
|
backgroundColor: Colors.lightBlue.shade200,
|
||||||
fontStyle: FontStyle.italic,
|
fontStyle: FontStyle.italic,
|
||||||
color: Colors.red[300],
|
|
||||||
backgroundColor: Colors.grey.withOpacity(0.3),
|
|
||||||
),
|
),
|
||||||
highlightColorHex: '0x6FFFEB3B',
|
highlightColorHex: '0x60FF0000', // red
|
||||||
),
|
);
|
||||||
pluginStyles: {
|
|
||||||
'text/quote': builtInPluginStyle
|
final quote = QuotedTextPluginStyle.dark.copyWith(
|
||||||
..update(
|
textStyle: (_, __) => GoogleFonts.poppins().copyWith(
|
||||||
'textStyle',
|
fontSize: 14,
|
||||||
(_) {
|
color: Colors.blue.shade400,
|
||||||
return (EditorState editorState, Node node) {
|
|
||||||
return TextStyle(
|
|
||||||
color: Colors.blue[200],
|
|
||||||
fontStyle: FontStyle.italic,
|
fontStyle: FontStyle.italic,
|
||||||
fontSize: 12.0,
|
fontWeight: FontWeight.w700,
|
||||||
);
|
|
||||||
};
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return Theme.of(context).copyWith(extensions: [
|
||||||
|
editorStyle,
|
||||||
|
...darkPlguinStyleExtension,
|
||||||
|
quote,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -389,7 +382,7 @@ Widget build(BuildContext context) {
|
|||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: AppFlowyEditor(
|
child: AppFlowyEditor(
|
||||||
editorState: EditorState.empty(),
|
editorState: EditorState.empty(),
|
||||||
editorStyle: _customizedStyle(),
|
themeData: customizeEditorTheme(context),
|
||||||
shortcutEvents: const [],
|
shortcutEvents: const [],
|
||||||
customBuilders: const {},
|
customBuilders: const {},
|
||||||
),
|
),
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 528 KiB |
Binary file not shown.
Before Width: | Height: | Size: 343 KiB After Width: | Height: | Size: 1.1 MiB |
@ -1,13 +1,14 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:example/plugin/code_block_node_widget.dart';
|
import 'package:example/plugin/editor_theme.dart';
|
||||||
import 'package:example/plugin/horizontal_rule_node_widget.dart';
|
|
||||||
import 'package:example/plugin/tex_block_node_widget.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
import 'package:example/plugin/code_block_node_widget.dart';
|
||||||
|
import 'package:example/plugin/horizontal_rule_node_widget.dart';
|
||||||
|
import 'package:example/plugin/tex_block_node_widget.dart';
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
@ -26,22 +27,16 @@ class MyApp extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return const MaterialApp(
|
||||||
localizationsDelegates: const [
|
localizationsDelegates: [
|
||||||
GlobalMaterialLocalizations.delegate,
|
GlobalMaterialLocalizations.delegate,
|
||||||
GlobalCupertinoLocalizations.delegate,
|
GlobalCupertinoLocalizations.delegate,
|
||||||
GlobalWidgetsLocalizations.delegate,
|
GlobalWidgetsLocalizations.delegate,
|
||||||
AppFlowyEditorLocalizations.delegate,
|
AppFlowyEditorLocalizations.delegate,
|
||||||
],
|
],
|
||||||
supportedLocales: const [Locale('en', 'US')],
|
supportedLocales: [Locale('en', 'US')],
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
theme: ThemeData(
|
home: MyHomePage(title: 'AppFlowyEditor Example'),
|
||||||
primarySwatch: Colors.blue,
|
|
||||||
// extensions: [HeadingPluginStyle.light],
|
|
||||||
),
|
|
||||||
darkTheme: ThemeData.dark(),
|
|
||||||
themeMode: ThemeMode.dark,
|
|
||||||
home: const MyHomePage(title: 'AppFlowyEditor Example'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,25 +55,13 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
bool darkMode = false;
|
bool darkMode = false;
|
||||||
Future<String>? _jsonString;
|
Future<String>? _jsonString;
|
||||||
|
|
||||||
|
ThemeData? _editorThemeData;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
body: _buildEditor(context),
|
body: _buildEditor(context),
|
||||||
// body: Center(
|
|
||||||
// child: ContextMenu(editorState: EditorState.empty(), items: [
|
|
||||||
// [
|
|
||||||
// ContextMenuItem(name: 'ABCDEFGHIJKLM', onPressed: (editorState) {}),
|
|
||||||
// ContextMenuItem(name: 'A', onPressed: (editorState) {}),
|
|
||||||
// ContextMenuItem(name: 'A', onPressed: (editorState) {})
|
|
||||||
// ],
|
|
||||||
// [
|
|
||||||
// ContextMenuItem(name: 'B', onPressed: (editorState) {}),
|
|
||||||
// ContextMenuItem(name: 'B', onPressed: (editorState) {}),
|
|
||||||
// ContextMenuItem(name: 'B', onPressed: (editorState) {})
|
|
||||||
// ]
|
|
||||||
// ]),
|
|
||||||
// ),
|
|
||||||
floatingActionButton: _buildExpandableFab(),
|
floatingActionButton: _buildExpandableFab(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -92,10 +75,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
rootBundle.loadString('assets/example.json'),
|
rootBundle.loadString('assets/example.json'),
|
||||||
);
|
);
|
||||||
} else if (_pageIndex == 1) {
|
} else if (_pageIndex == 1) {
|
||||||
return _buildEditorWithJsonString(
|
|
||||||
rootBundle.loadString('assets/big_document.json'),
|
|
||||||
);
|
|
||||||
} else if (_pageIndex == 2) {
|
|
||||||
return _buildEditorWithJsonString(
|
return _buildEditorWithJsonString(
|
||||||
Future.value(
|
Future.value(
|
||||||
jsonEncode(EditorState.empty().document.toJson()),
|
jsonEncode(EditorState.empty().document.toJson()),
|
||||||
@ -126,32 +105,19 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
_editorState!.transactionStream.listen((event) {
|
_editorState!.transactionStream.listen((event) {
|
||||||
debugPrint('Transaction: ${event.toJson()}');
|
debugPrint('Transaction: ${event.toJson()}');
|
||||||
});
|
});
|
||||||
final themeData = darkMode
|
_editorThemeData ??= Theme.of(context).copyWith(extensions: [
|
||||||
? ThemeData.dark().copyWith(extensions: [
|
if (darkMode) ...darkEditorStyleExtension,
|
||||||
HeadingPluginStyle.dark,
|
if (darkMode) ...darkPlguinStyleExtension,
|
||||||
CheckboxPluginStyle.dark,
|
if (!darkMode) ...lightEditorStyleExtension,
|
||||||
NumberListPluginStyle.dark,
|
if (!darkMode) ...lightPlguinStyleExtension,
|
||||||
QuotedTextPluginStyle.dark,
|
]);
|
||||||
BulletedListPluginStyle.dark,
|
|
||||||
EditorStyle.dark,
|
|
||||||
])
|
|
||||||
: ThemeData.light().copyWith(
|
|
||||||
extensions: [
|
|
||||||
HeadingPluginStyle.light,
|
|
||||||
CheckboxPluginStyle.light,
|
|
||||||
NumberListPluginStyle.light,
|
|
||||||
QuotedTextPluginStyle.light,
|
|
||||||
BulletedListPluginStyle.light,
|
|
||||||
EditorStyle.light,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
return Container(
|
return Container(
|
||||||
color: darkMode ? Colors.black : Colors.white,
|
color: darkMode ? Colors.black : Colors.white,
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
child: AppFlowyEditor(
|
child: AppFlowyEditor(
|
||||||
editorState: _editorState!,
|
editorState: _editorState!,
|
||||||
themeData: themeData,
|
|
||||||
editable: true,
|
editable: true,
|
||||||
|
themeData: _editorThemeData,
|
||||||
customBuilders: {
|
customBuilders: {
|
||||||
'text/code_block': CodeBlockNodeWidgetBuilder(),
|
'text/code_block': CodeBlockNodeWidgetBuilder(),
|
||||||
'tex': TeXBlockNodeWidgetBuidler(),
|
'tex': TeXBlockNodeWidgetBuidler(),
|
||||||
@ -190,10 +156,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
icon: const Icon(Icons.abc),
|
icon: const Icon(Icons.abc),
|
||||||
onPressed: () => _switchToPage(1),
|
onPressed: () => _switchToPage(1),
|
||||||
),
|
),
|
||||||
ActionButton(
|
|
||||||
icon: const Icon(Icons.abc),
|
|
||||||
onPressed: () => _switchToPage(2),
|
|
||||||
),
|
|
||||||
ActionButton(
|
ActionButton(
|
||||||
icon: const Icon(Icons.print),
|
icon: const Icon(Icons.print),
|
||||||
onPressed: () => _exportDocument(_editorState!),
|
onPressed: () => _exportDocument(_editorState!),
|
||||||
@ -203,13 +165,22 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
onPressed: () async => await _importDocument(),
|
onPressed: () async => await _importDocument(),
|
||||||
),
|
),
|
||||||
ActionButton(
|
ActionButton(
|
||||||
icon: const Icon(Icons.color_lens),
|
icon: const Icon(Icons.dark_mode),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
darkMode = !darkMode;
|
darkMode = !darkMode;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
ActionButton(
|
||||||
|
icon: const Icon(Icons.color_lens),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_editorThemeData = customizeEditorTheme(context);
|
||||||
|
darkMode = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -269,6 +240,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
void _switchToPage(int pageIndex) {
|
void _switchToPage(int pageIndex) {
|
||||||
if (pageIndex != _pageIndex) {
|
if (pageIndex != _pageIndex) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
_editorThemeData = null;
|
||||||
_editorState = null;
|
_editorState = null;
|
||||||
_pageIndex = pageIndex;
|
_pageIndex = pageIndex;
|
||||||
});
|
});
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
|
ThemeData customizeEditorTheme(BuildContext context) {
|
||||||
|
final dark = EditorStyle.dark;
|
||||||
|
final editorStyle = dark.copyWith(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 150),
|
||||||
|
cursorColor: Colors.red.shade600,
|
||||||
|
selectionColor: Colors.yellow.shade600.withOpacity(0.5),
|
||||||
|
textStyle: GoogleFonts.poppins().copyWith(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
placeholderTextStyle: GoogleFonts.poppins().copyWith(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
code: dark.code?.copyWith(
|
||||||
|
backgroundColor: Colors.lightBlue.shade200,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
highlightColorHex: '0x60FF0000', // red
|
||||||
|
);
|
||||||
|
|
||||||
|
final quote = QuotedTextPluginStyle.dark.copyWith(
|
||||||
|
textStyle: (_, __) => GoogleFonts.poppins().copyWith(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.blue.shade400,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return Theme.of(context).copyWith(extensions: [
|
||||||
|
editorStyle,
|
||||||
|
...darkPlguinStyleExtension,
|
||||||
|
quote,
|
||||||
|
]);
|
||||||
|
}
|
@ -15,6 +15,7 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:intl/message_lookup_by_library.dart';
|
import 'package:intl/message_lookup_by_library.dart';
|
||||||
import 'package:intl/src/intl_helpers.dart';
|
import 'package:intl/src/intl_helpers.dart';
|
||||||
|
|
||||||
|
import 'messages_bn_BN.dart' as messages_bn_bn;
|
||||||
import 'messages_ca.dart' as messages_ca;
|
import 'messages_ca.dart' as messages_ca;
|
||||||
import 'messages_cs-CZ.dart' as messages_cs_cz;
|
import 'messages_cs-CZ.dart' as messages_cs_cz;
|
||||||
import 'messages_de-DE.dart' as messages_de_de;
|
import 'messages_de-DE.dart' as messages_de_de;
|
||||||
@ -39,6 +40,7 @@ import 'messages_zh-TW.dart' as messages_zh_tw;
|
|||||||
|
|
||||||
typedef Future<dynamic> LibraryLoader();
|
typedef Future<dynamic> LibraryLoader();
|
||||||
Map<String, LibraryLoader> _deferredLibraries = {
|
Map<String, LibraryLoader> _deferredLibraries = {
|
||||||
|
'bn_BN': () => new Future.value(null),
|
||||||
'ca': () => new Future.value(null),
|
'ca': () => new Future.value(null),
|
||||||
'cs_CZ': () => new Future.value(null),
|
'cs_CZ': () => new Future.value(null),
|
||||||
'de_DE': () => new Future.value(null),
|
'de_DE': () => new Future.value(null),
|
||||||
@ -64,6 +66,8 @@ Map<String, LibraryLoader> _deferredLibraries = {
|
|||||||
|
|
||||||
MessageLookupByLibrary? _findExact(String localeName) {
|
MessageLookupByLibrary? _findExact(String localeName) {
|
||||||
switch (localeName) {
|
switch (localeName) {
|
||||||
|
case 'bn_BN':
|
||||||
|
return messages_bn_bn.messages;
|
||||||
case 'ca':
|
case 'ca':
|
||||||
return messages_ca.messages;
|
return messages_ca.messages;
|
||||||
case 'cs_CZ':
|
case 'cs_CZ':
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||||
|
// This is a library that provides messages for a bn_BN locale. All the
|
||||||
|
// messages from the main program should be duplicated here with the same
|
||||||
|
// function name.
|
||||||
|
|
||||||
|
// Ignore issues from commonly used lints in this file.
|
||||||
|
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
|
||||||
|
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
|
||||||
|
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
|
||||||
|
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
|
||||||
|
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes
|
||||||
|
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:intl/message_lookup_by_library.dart';
|
||||||
|
|
||||||
|
final messages = new MessageLookup();
|
||||||
|
|
||||||
|
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
|
||||||
|
|
||||||
|
class MessageLookup extends MessageLookupByLibrary {
|
||||||
|
String get localeName => 'bn_BN';
|
||||||
|
|
||||||
|
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||||
|
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||||
|
"bold": MessageLookupByLibrary.simpleMessage("বল্ড ফন্ট"),
|
||||||
|
"bulletedList": MessageLookupByLibrary.simpleMessage("বুলেট তালিকা"),
|
||||||
|
"checkbox": MessageLookupByLibrary.simpleMessage("চেকবক্স"),
|
||||||
|
"embedCode": MessageLookupByLibrary.simpleMessage("এম্বেড কোড"),
|
||||||
|
"heading1": MessageLookupByLibrary.simpleMessage("শিরোনাম 1"),
|
||||||
|
"heading2": MessageLookupByLibrary.simpleMessage("শিরোনাম 2"),
|
||||||
|
"heading3": MessageLookupByLibrary.simpleMessage("শিরোনাম 3"),
|
||||||
|
"highlight": MessageLookupByLibrary.simpleMessage("হাইলাইট"),
|
||||||
|
"image": MessageLookupByLibrary.simpleMessage("ইমেজ"),
|
||||||
|
"italic": MessageLookupByLibrary.simpleMessage("ইটালিক ফন্ট"),
|
||||||
|
"link": MessageLookupByLibrary.simpleMessage("লিঙ্ক"),
|
||||||
|
"numberedList":
|
||||||
|
MessageLookupByLibrary.simpleMessage("সংখ্যাযুক্ত তালিকা"),
|
||||||
|
"quote": MessageLookupByLibrary.simpleMessage("উদ্ধৃতি"),
|
||||||
|
"strikethrough": MessageLookupByLibrary.simpleMessage("স্ট্রাইকথ্রু"),
|
||||||
|
"text": MessageLookupByLibrary.simpleMessage("পাঠ্য"),
|
||||||
|
"underline": MessageLookupByLibrary.simpleMessage("আন্ডারলাইন")
|
||||||
|
};
|
||||||
|
}
|
@ -219,6 +219,7 @@ class AppLocalizationDelegate
|
|||||||
List<Locale> get supportedLocales {
|
List<Locale> get supportedLocales {
|
||||||
return const <Locale>[
|
return const <Locale>[
|
||||||
Locale.fromSubtags(languageCode: 'en'),
|
Locale.fromSubtags(languageCode: 'en'),
|
||||||
|
Locale.fromSubtags(languageCode: 'bn', countryCode: 'BN'),
|
||||||
Locale.fromSubtags(languageCode: 'ca'),
|
Locale.fromSubtags(languageCode: 'ca'),
|
||||||
Locale.fromSubtags(languageCode: 'cs', countryCode: 'CZ'),
|
Locale.fromSubtags(languageCode: 'cs', countryCode: 'CZ'),
|
||||||
Locale.fromSubtags(languageCode: 'de', countryCode: 'DE'),
|
Locale.fromSubtags(languageCode: 'de', countryCode: 'DE'),
|
||||||
|
@ -117,7 +117,13 @@ class CheckboxPluginStyle extends ThemeExtension<CheckboxPluginStyle> {
|
|||||||
|
|
||||||
static final light = CheckboxPluginStyle(
|
static final light = CheckboxPluginStyle(
|
||||||
padding: (_, __) => const EdgeInsets.symmetric(vertical: 8.0),
|
padding: (_, __) => const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
textStyle: (editorState, textNode) => const TextStyle(),
|
textStyle: (editorState, textNode) {
|
||||||
|
final isCheck = textNode.attributes.check;
|
||||||
|
return TextStyle(
|
||||||
|
decoration: isCheck ? TextDecoration.lineThrough : null,
|
||||||
|
color: isCheck ? Colors.grey.shade400 : null,
|
||||||
|
);
|
||||||
|
},
|
||||||
icon: (editorState, textNode) {
|
icon: (editorState, textNode) {
|
||||||
final isCheck = textNode.attributes.check;
|
final isCheck = textNode.attributes.check;
|
||||||
const iconSize = Size.square(20.0);
|
const iconSize = Size.square(20.0);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: appflowy_editor
|
name: appflowy_editor
|
||||||
description: A highly customizable rich-text editor for Flutter
|
description: A highly customizable rich-text editor for Flutter
|
||||||
version: 0.0.6
|
version: 0.0.7
|
||||||
homepage: https://github.com/AppFlowy-IO/AppFlowy
|
homepage: https://github.com/AppFlowy-IO/AppFlowy
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
|
Loading…
Reference in New Issue
Block a user