refactor: restructure project into modular architecture for flutter_quill (#2032)

* refactor: restructure project into modular architecture for flutter_quill

* refactor: move LineHeightAttribute class to custom_attributes.dart

* chore: remove nullable controller extension
pull/2033/head
Ellet 9 months ago committed by GitHub
parent af3679840b
commit 9764f75006
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      README.md
  2. 1
      analysis_options.yaml
  3. 5
      flutter_quill_extensions/lib/flutter_quill_extensions.dart
  4. 3
      flutter_quill_extensions/lib/services/clipboard/super_clipboard_service.dart
  5. 10
      lib/extensions.dart
  6. 76
      lib/flutter_quill.dart
  7. 2
      lib/markdown_quill.dart
  8. 0
      lib/src/common/extensions/uri_ext.dart
  9. 0
      lib/src/common/structs/image_url.dart
  10. 0
      lib/src/common/structs/offset_value.dart
  11. 0
      lib/src/common/structs/optional_size.dart
  12. 4
      lib/src/common/structs/segment_leaf_node.dart
  13. 0
      lib/src/common/structs/vertical_spacing.dart
  14. 0
      lib/src/common/utils/cast.dart
  15. 0
      lib/src/common/utils/color.dart
  16. 6
      lib/src/common/utils/embeds.dart
  17. 2
      lib/src/common/utils/font.dart
  18. 0
      lib/src/common/utils/platform.dart
  19. 0
      lib/src/common/utils/string.dart
  20. 0
      lib/src/common/utils/widgets.dart
  21. 19
      lib/src/controller/provider.dart
  22. 18
      lib/src/controller/quill_controller.dart
  23. 0
      lib/src/controller/quill_controller_configurations.dart
  24. 6
      lib/src/delta/delta_diff.dart
  25. 4
      lib/src/delta/delta_x.dart
  26. 24
      lib/src/document/attribute.dart
  27. 25
      lib/src/document/custom_attributes.dart
  28. 19
      lib/src/document/document.dart
  29. 6
      lib/src/document/history.dart
  30. 0
      lib/src/document/nodes/block.dart
  31. 4
      lib/src/document/nodes/container.dart
  32. 0
      lib/src/document/nodes/embeddable.dart
  33. 5
      lib/src/document/nodes/leaf.dart
  34. 4
      lib/src/document/nodes/line.dart
  35. 2
      lib/src/document/nodes/node.dart
  36. 2
      lib/src/document/structs/doc_change.dart
  37. 0
      lib/src/document/structs/history_changed.dart
  38. 0
      lib/src/document/style.dart
  39. 18
      lib/src/editor/config/editor_configurations.dart
  40. 0
      lib/src/editor/config/element_options.dart
  41. 0
      lib/src/editor/config/elements/code_block.dart
  42. 0
      lib/src/editor/config/elements/list/ordered_list.dart
  43. 0
      lib/src/editor/config/elements/list/unordered_list.dart
  44. 30
      lib/src/editor/editor.dart
  45. 4
      lib/src/editor/editor_builder.dart
  46. 15
      lib/src/editor/embed/embed_editor_builder.dart
  47. 78
      lib/src/editor/provider.dart
  48. 17
      lib/src/editor/raw_editor/config/raw_editor_configurations.dart
  49. 0
      lib/src/editor/raw_editor/quill_single_child_scroll_view.dart
  50. 10
      lib/src/editor/raw_editor/raw_editor.dart
  51. 10
      lib/src/editor/raw_editor/raw_editor_actions.dart
  52. 6
      lib/src/editor/raw_editor/raw_editor_render_object.dart
  53. 50
      lib/src/editor/raw_editor/raw_editor_state.dart
  54. 4
      lib/src/editor/raw_editor/raw_editor_state_selection_delegate_mixin.dart
  55. 6
      lib/src/editor/raw_editor/raw_editor_state_text_input_client_mixin.dart
  56. 6
      lib/src/editor/raw_editor/raw_editor_text_boundaries.dart
  57. 0
      lib/src/editor/raw_editor/scribble_focusable.dart
  58. 2
      lib/src/editor/style_widgets/bullet_point.dart
  59. 0
      lib/src/editor/style_widgets/checkbox_point.dart
  60. 4
      lib/src/editor/style_widgets/number_point.dart
  61. 0
      lib/src/editor/style_widgets/style_widgets.dart
  62. 2
      lib/src/editor/widgets/box.dart
  63. 2
      lib/src/editor/widgets/cursor.dart
  64. 8
      lib/src/editor/widgets/default_styles.dart
  65. 13
      lib/src/editor/widgets/delegate.dart
  66. 0
      lib/src/editor/widgets/float_cursor.dart
  67. 0
      lib/src/editor/widgets/keyboard_listener.dart
  68. 8
      lib/src/editor/widgets/link.dart
  69. 0
      lib/src/editor/widgets/proxy.dart
  70. 39
      lib/src/editor/widgets/text/text_block.dart
  71. 38
      lib/src/editor/widgets/text/text_line.dart
  72. 4
      lib/src/editor/widgets/text/text_selection.dart
  73. 0
      lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service.dart
  74. 0
      lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart
  75. 0
      lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart
  76. 5
      lib/src/editor_toolbar_controller_shared/quill_configurations.dart
  77. 12
      lib/src/editor_toolbar_shared/config/quill_shared_configurations.dart
  78. 13
      lib/src/editor_toolbar_shared/quill_configurations_ext.dart
  79. 84
      lib/src/extensions/quill_configurations_ext.dart
  80. 17
      lib/src/extensions/quill_controller_ext.dart
  81. 0
      lib/src/l10n/extensions/localizations_ext.dart
  82. 4
      lib/src/l10n/widgets/localizations.dart
  83. 28
      lib/src/models/config/others/animations.dart
  84. 4
      lib/src/models/config/quill_configurations.dart
  85. 2
      lib/src/packages/quill_markdown/custom_quill_attributes.dart
  86. 11
      lib/src/packages/quill_markdown/delta_to_markdown.dart
  87. 8
      lib/src/rules/delete.dart
  88. 6
      lib/src/rules/format.dart
  89. 12
      lib/src/rules/insert.dart
  90. 6
      lib/src/rules/rule.dart
  91. 2
      lib/src/toolbar/base_button/base_value_button.dart
  92. 10
      lib/src/toolbar/base_button/stateless_base_button.dart
  93. 12
      lib/src/toolbar/base_toolbar.dart
  94. 4
      lib/src/toolbar/buttons/alignment/select_alignment_button.dart
  95. 4
      lib/src/toolbar/buttons/alignment/select_alignment_buttons.dart
  96. 0
      lib/src/toolbar/buttons/arrow_indicated_list_button.dart
  97. 4
      lib/src/toolbar/buttons/clear_format_button.dart
  98. 8
      lib/src/toolbar/buttons/clipboard_button.dart
  99. 15
      lib/src/toolbar/buttons/color/color_button.dart
  100. 4
      lib/src/toolbar/buttons/color/color_dialog.dart
  101. Some files were not shown because too many files have changed in this diff Show More

@ -107,7 +107,7 @@ dependencies:
## 🛠 Platform Specific Configurations
Before using the package, we must inform you the package uses the following plugins:
The `flutter_quill` package uses the following plugins:
1. [`url_launcher`](https://pub.dev/packages/url_launcher) to open links.
2. [`device_info_plus`](https://pub.dev/packages/device_info_plus) to view info about the current device.

@ -12,7 +12,6 @@ linter:
avoid_empty_else: true
avoid_escaping_inner_quotes: true
avoid_print: true
avoid_redundant_argument_values: true
avoid_types_on_closure_parameters: true
avoid_void_async: true
cascade_invocations: true

@ -1,7 +1,7 @@
library flutter_quill_extensions;
// ignore: implementation_imports
import 'package:flutter_quill/src/services/clipboard/clipboard_service_provider.dart';
import 'package:flutter_quill/src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart';
import 'package:meta/meta.dart' show immutable;
import 'services/clipboard/super_clipboard_service.dart';
@ -38,6 +38,9 @@ export 'models/config/video/editor/video_web_configurations.dart';
export 'models/config/video/toolbar/video_configurations.dart';
export 'utils/utils.dart';
// TODO: Refactor flutter_quill_extensions to match the structure of flutter_quill
// Also avoid exposing all APIs as public. Use `src` as directory name
@immutable
class FlutterQuillExtensions {
const FlutterQuillExtensions._();

@ -3,7 +3,8 @@ import 'dart:convert' show utf8;
import 'package:flutter/foundation.dart';
// ignore: implementation_imports
import 'package:flutter_quill/src/services/clipboard/clipboard_service.dart';
import 'package:flutter_quill/src/editor_toolbar_controller_shared/clipboard/clipboard_service.dart';
import 'package:super_clipboard/super_clipboard.dart';
/// Implementation based on https://pub.dev/packages/super_clipboard

@ -1,7 +1,7 @@
library flutter_quill.extensions;
export 'src/models/documents/nodes/leaf.dart';
export 'src/models/rules/insert.dart';
export 'src/utils/platform.dart';
export 'src/utils/string.dart';
export 'src/utils/widgets.dart';
export 'src/common/utils/platform.dart';
export 'src/common/utils/string.dart';
export 'src/common/utils/widgets.dart';
export 'src/document/nodes/leaf.dart';
export 'src/rules/insert.dart';

@ -1,38 +1,42 @@
library flutter_quill;
export '/src/widgets/raw_editor/quill_single_child_scroll_view.dart';
export 'src/extensions/quill_configurations_ext.dart';
export 'src/models/config/quill_configurations.dart';
export 'src/models/config/raw_editor/raw_editor_configurations.dart';
export 'src/models/config/toolbar/toolbar_configurations.dart';
export 'src/models/documents/attribute.dart';
export 'src/models/documents/document.dart';
export 'src/models/documents/nodes/block.dart';
export 'src/models/documents/nodes/embeddable.dart';
export 'src/models/documents/nodes/leaf.dart';
export 'src/models/documents/nodes/line.dart';
export 'src/models/documents/nodes/node.dart';
export 'src/models/documents/style.dart';
export 'src/models/structs/doc_change.dart';
export 'src/models/structs/image_url.dart';
export 'src/models/structs/link_dialog_action.dart';
export 'src/models/structs/offset_value.dart';
export 'src/models/structs/optional_size.dart';
export 'src/models/structs/vertical_spacing.dart';
export 'src/models/themes/quill_dialog_theme.dart';
export 'src/models/themes/quill_icon_theme.dart';
export 'src/utils/embeds.dart';
export 'src/widgets/editor/editor.dart';
export 'src/widgets/others/cursor.dart';
export 'src/widgets/others/default_styles.dart';
export 'src/widgets/others/link.dart';
export 'src/widgets/quill/embeds.dart';
export 'src/widgets/quill/quill_controller.dart';
export 'src/widgets/raw_editor/raw_editor.dart';
export 'src/widgets/raw_editor/raw_editor_state.dart';
export 'src/widgets/style_widgets/style_widgets.dart';
export 'src/widgets/toolbar/base_toolbar.dart';
export 'src/widgets/toolbar/buttons/alignment/select_alignment_button.dart';
export 'src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart';
export 'src/widgets/toolbar/simple_toolbar.dart';
export 'src/widgets/utils/provider.dart';
export 'src/common/structs/image_url.dart';
export 'src/common/structs/offset_value.dart';
export 'src/common/structs/optional_size.dart';
export 'src/common/structs/vertical_spacing.dart';
export 'src/common/utils/embeds.dart';
export 'src/controller/provider.dart';
export 'src/controller/quill_controller.dart';
export 'src/document/attribute.dart';
export 'src/document/document.dart';
export 'src/document/nodes/block.dart';
export 'src/document/nodes/embeddable.dart';
export 'src/document/nodes/leaf.dart';
export 'src/document/nodes/line.dart';
export 'src/document/nodes/node.dart';
export 'src/document/structs/doc_change.dart';
export 'src/document/style.dart';
export 'src/editor/editor.dart';
export 'src/editor/embed/embed_editor_builder.dart';
export 'src/editor/provider.dart';
export 'src/editor/raw_editor/config/raw_editor_configurations.dart';
export 'src/editor/raw_editor/quill_single_child_scroll_view.dart';
export 'src/editor/raw_editor/raw_editor.dart';
export 'src/editor/raw_editor/raw_editor_state.dart';
export 'src/editor/style_widgets/style_widgets.dart';
export 'src/editor/widgets/cursor.dart';
export 'src/editor/widgets/default_styles.dart';
export 'src/editor/widgets/link.dart';
export 'src/editor_toolbar_controller_shared/quill_configurations.dart';
export 'src/editor_toolbar_shared/quill_configurations_ext.dart';
export 'src/toolbar/base_toolbar.dart';
export 'src/toolbar/buttons/alignment/select_alignment_button.dart';
export 'src/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart';
export 'src/toolbar/config/toolbar_configurations.dart';
export 'src/toolbar/embed/embed_button_builder.dart';
export 'src/toolbar/provider.dart';
export 'src/toolbar/simple_toolbar.dart';
export 'src/toolbar/simple_toolbar_provider.dart';
export 'src/toolbar/structs/link_dialog_action.dart';
export 'src/toolbar/theme/quill_dialog_theme.dart';
export 'src/toolbar/theme/quill_icon_theme.dart';

@ -1,5 +1,7 @@
library quill_markdown;
// TODO: Might avoid exposing the quill_markdown package
export 'src/packages/quill_markdown/delta_to_markdown.dart';
export 'src/packages/quill_markdown/embeddable_table_syntax.dart';
export 'src/packages/quill_markdown/markdown_to_delta.dart';

@ -1,7 +1,7 @@
import 'package:meta/meta.dart' show immutable;
import '../documents/nodes/leaf.dart';
import '../documents/nodes/line.dart';
import '../../document/nodes/leaf.dart';
import '../../document/nodes/line.dart';
@immutable
class SegmentLeafNode {

@ -1,8 +1,8 @@
import 'dart:math';
import '../models/documents/nodes/leaf.dart';
import '../models/structs/offset_value.dart';
import '../widgets/quill/quill_controller.dart';
import '../../controller/quill_controller.dart';
import '../../document/nodes/leaf.dart';
import '../structs/offset_value.dart';
OffsetValue<Embed> getEmbedNode(QuillController controller, int offset) {
var offset = controller.selection.start;

@ -1,4 +1,4 @@
import '../../flutter_quill.dart';
import '../../../flutter_quill.dart';
dynamic getFontSize(dynamic sizeValue) {
if (sizeValue is String &&

@ -0,0 +1,19 @@
import 'package:flutter/widgets.dart' show BuildContext;
import '../editor/provider.dart';
import '../toolbar/simple_toolbar_provider.dart';
import 'quill_controller.dart';
extension QuillControllerExt on BuildContext {
QuillController? get quilController {
return quillSimpleToolbarConfigurations?.controller ??
quillEditorConfigurations?.controller;
}
QuillController get requireQuillController {
return quillSimpleToolbarConfigurations?.controller ??
quillEditorConfigurations?.controller ??
(throw ArgumentError(
'The quill provider is required, you must only call requireQuillController inside the QuillToolbar and QuillEditor'));
}
}

@ -5,11 +5,19 @@ import 'package:flutter/widgets.dart';
import 'package:html/parser.dart' as html_parser;
import 'package:meta/meta.dart';
import '../../../flutter_quill.dart';
import '../../../quill_delta.dart';
import '../../models/documents/delta_x.dart';
import '../../services/clipboard/clipboard_service_provider.dart';
import '../../utils/delta.dart';
import '../../quill_delta.dart';
import '../common/structs/image_url.dart';
import '../common/structs/offset_value.dart';
import '../delta/delta_diff.dart';
import '../delta/delta_x.dart';
import '../document/attribute.dart';
import '../document/document.dart';
import '../document/nodes/embeddable.dart';
import '../document/nodes/leaf.dart';
import '../document/structs/doc_change.dart';
import '../document/style.dart';
import '../editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart';
import 'quill_controller_configurations.dart';
typedef ReplaceTextCallback = bool Function(int index, int len, Object? data);
typedef DeleteCallback = void Function(int cursorPosition, bool forward);

@ -1,11 +1,11 @@
import 'dart:math' as math;
import 'dart:ui';
import 'dart:ui' show TextDirection;
import 'package:meta/meta.dart' show immutable;
import '../../quill_delta.dart';
import '../models/documents/attribute.dart';
import '../models/documents/nodes/node.dart';
import '../document/attribute.dart';
import '../document/nodes/node.dart';
// Diff between two texts - old text and new text
@immutable

@ -1,8 +1,8 @@
import 'package:flutter_quill_delta_from_html/flutter_quill_delta_from_html.dart';
import 'package:markdown/markdown.dart' as md;
import 'package:meta/meta.dart';
import '../../../markdown_quill.dart';
import '../../../quill_delta.dart';
import '../../markdown_quill.dart';
import '../../quill_delta.dart';
@immutable
@experimental

@ -4,6 +4,9 @@ import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart' show immutable;
import 'package:quiver/core.dart';
import 'custom_attributes.dart';
export 'custom_attributes.dart';
enum AttributeScope {
inline, // refer to https://quilljs.com/docs/formats/#inline
block, // refer to https://quilljs.com/docs/formats/#block
@ -354,27 +357,6 @@ class HeaderAttribute extends Attribute<int?> {
: super('header', AttributeScope.block, level);
}
/// This attribute represents the space between text lines. The line height can be
/// adjusted using predefined constants or custom values
///
/// The attribute at the json looks like: "attributes":{"line-height": 1.5 }
class LineHeightAttribute extends Attribute<double?> {
const LineHeightAttribute({double? lineHeight})
: super('line-height', AttributeScope.block, lineHeight);
static const Attribute<double?> lineHeightNormal =
LineHeightAttribute(lineHeight: 1);
static const Attribute<double?> lineHeightTight =
LineHeightAttribute(lineHeight: 1.15);
static const Attribute<double?> lineHeightOneAndHalf =
LineHeightAttribute(lineHeight: 1.5);
static const Attribute<double?> lineHeightDouble =
LineHeightAttribute(lineHeight: 2);
}
class IndentAttribute extends Attribute<int?> {
const IndentAttribute({int? level})
: super('indent', AttributeScope.block, level);

@ -0,0 +1,25 @@
import 'attribute.dart';
// Attributes that don't conform to standard Quill Delta
// and are not compatible with https://quilljs.com/docs/delta/
/// This attribute represents the space between text lines. The line height can be
/// adjusted using predefined constants or custom values
///
/// The attribute at the json looks like: "attributes":{"line-height": 1.5 }
class LineHeightAttribute extends Attribute<double?> {
const LineHeightAttribute({double? lineHeight})
: super('line-height', AttributeScope.block, lineHeight);
static const Attribute<double?> lineHeightNormal =
LineHeightAttribute(lineHeight: 1);
static const Attribute<double?> lineHeightTight =
LineHeightAttribute(lineHeight: 1.15);
static const Attribute<double?> lineHeightOneAndHalf =
LineHeightAttribute(lineHeight: 1.5);
static const Attribute<double?> lineHeightDouble =
LineHeightAttribute(lineHeight: 2);
}

@ -1,16 +1,14 @@
import 'dart:async' show StreamController;
import 'package:meta/meta.dart';
import 'package:meta/meta.dart' show experimental;
import '../../../quill_delta.dart';
import '../../widgets/quill/embeds.dart';
import '../../quill_delta.dart';
import '../common/structs/offset_value.dart';
import '../common/structs/segment_leaf_node.dart';
import '../delta/delta_x.dart';
import '../editor/embed/embed_editor_builder.dart';
import '../rules/rule.dart';
import '../structs/doc_change.dart';
import '../structs/history_changed.dart';
import '../structs/offset_value.dart';
import '../structs/segment_leaf_node.dart';
import 'attribute.dart';
import 'delta_x.dart';
import 'history.dart';
import 'nodes/block.dart';
import 'nodes/container.dart';
@ -18,6 +16,8 @@ import 'nodes/embeddable.dart';
import 'nodes/leaf.dart';
import 'nodes/line.dart';
import 'nodes/node.dart';
import 'structs/doc_change.dart';
import 'structs/history_changed.dart';
import 'style.dart';
/// The rich text document
@ -251,7 +251,8 @@ class Document {
if (res.node is Line) {
return res;
}
final block = res.node as Block; // TODO: Can be nullable, handle this case
final block = res.node
as Block; // TODO: Can be nullable, handle this case to avoid cast exception
return block.queryChild(res.offset, true);
}

@ -1,7 +1,7 @@
import '../../../quill_delta.dart';
import '../structs/doc_change.dart';
import '../structs/history_changed.dart';
import '../../quill_delta.dart';
import 'document.dart';
import 'structs/doc_change.dart';
import 'structs/history_changed.dart';
class History {
History({

@ -1,6 +1,6 @@
import 'dart:collection';
import 'dart:collection' show LinkedList;
import '../../../widgets/quill/embeds.dart';
import '../../editor/embed/embed_editor_builder.dart';
import '../style.dart';
import 'leaf.dart';
import 'line.dart';

@ -1,7 +1,7 @@
import 'dart:math' as math;
import '../../../../quill_delta.dart';
import '../../../widgets/quill/embeds.dart';
import '../../editor/embed/embed_editor_builder.dart';
import '../style.dart';
import 'embeddable.dart';
import 'line.dart';
@ -154,7 +154,8 @@ abstract base class Leaf extends Node {
}
/// Splits this leaf node at [index] and returns new node.
///
///import '../style.dart';
/// If this is the last node in its list and [index] equals this node's
/// length then this method returns `null` as there is nothing left to split.
/// If there is another leaf node after this one and [index] equals this

@ -3,8 +3,8 @@ import 'dart:math' as math;
import 'package:collection/collection.dart';
import '../../../../quill_delta.dart';
import '../../../widgets/quill/embeds.dart';
import '../../structs/offset_value.dart';
import '../../common/structs/offset_value.dart';
import '../../editor/embed/embed_editor_builder.dart';
import '../attribute.dart';
import '../style.dart';
import 'block.dart';

@ -1,7 +1,7 @@
import 'dart:collection';
import '../../../../quill_delta.dart';
import '../../../widgets/quill/embeds.dart';
import '../../editor/embed/embed_editor_builder.dart';
import '../attribute.dart';
import '../style.dart';
import 'container.dart';

@ -1,7 +1,7 @@
import 'package:meta/meta.dart' show immutable;
import '../../../quill_delta.dart';
import '../documents/document.dart';
import '../document.dart';
@immutable
class DocChange {

@ -6,15 +6,15 @@ import 'package:flutter/material.dart'
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart' show experimental;
import '../../../widgets/editor/editor_builder.dart';
import '../../../widgets/others/default_styles.dart';
import '../../../widgets/others/delegate.dart';
import '../../../widgets/others/link.dart';
import '../../../widgets/quill/embeds.dart';
import '../../../widgets/quill/quill_controller.dart';
import '../../../widgets/raw_editor/raw_editor.dart';
import '../../themes/quill_dialog_theme.dart';
import '../quill_shared_configurations.dart';
import '../../controller/quill_controller.dart';
import '../../editor_toolbar_shared/config/quill_shared_configurations.dart';
import '../../toolbar/theme/quill_dialog_theme.dart';
import '../editor_builder.dart';
import '../embed/embed_editor_builder.dart';
import '../raw_editor/raw_editor.dart';
import '../widgets/default_styles.dart';
import '../widgets/delegate.dart';
import '../widgets/link.dart';
import 'element_options.dart';
export 'element_options.dart';

@ -9,22 +9,22 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import '../../l10n/widgets/localizations.dart';
import '../../models/config/editor/editor_configurations.dart';
import '../../models/config/raw_editor/raw_editor_configurations.dart';
import '../../models/documents/document.dart';
import '../../models/documents/nodes/container.dart' as container_node;
import '../../models/documents/nodes/leaf.dart';
import '../../utils/platform.dart';
import '../others/box.dart';
import '../others/cursor.dart';
import '../others/delegate.dart';
import '../others/float_cursor.dart';
import '../others/text_selection.dart';
import '../quill/embeds.dart';
import '../raw_editor/raw_editor.dart';
import '../utils/provider.dart';
import '../common/utils/platform.dart';
import '../document/document.dart';
import '../document/nodes/container.dart' as container_node;
import '../document/nodes/leaf.dart';
import '../l10n/widgets/localizations.dart';
import 'config/editor_configurations.dart';
import 'editor_builder.dart';
import 'embed/embed_editor_builder.dart';
import 'provider.dart';
import 'raw_editor/config/raw_editor_configurations.dart';
import 'raw_editor/raw_editor.dart';
import 'widgets/box.dart';
import 'widgets/cursor.dart';
import 'widgets/delegate.dart';
import 'widgets/float_cursor.dart';
import 'widgets/text/text_selection.dart';
/// Base interface for editable render objects.
abstract class RenderAbstractEditor implements TextLayoutMetrics {

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import '../raw_editor/raw_editor.dart';
import 'raw_editor/raw_editor.dart';
typedef QuillEditorBuilder = Widget Function(
BuildContext context,

@ -1,10 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import '../../../extensions.dart';
import '../../models/documents/nodes/leaf.dart' as leaf;
import '../../models/themes/quill_dialog_theme.dart';
import '../../models/themes/quill_icon_theme.dart';
import 'quill_controller.dart';
import '../../controller/quill_controller.dart';
import '../../document/nodes/leaf.dart' as leaf;
abstract class EmbedBuilder {
const EmbedBuilder();
@ -28,9 +26,4 @@ abstract class EmbedBuilder {
);
}
typedef EmbedButtonBuilder = Widget Function(
QuillController controller,
double toolbarIconSize,
QuillIconTheme? iconTheme,
QuillDialogTheme? dialogTheme,
);
typedef EmbedsBuilder = EmbedBuilder Function(Embed node);

@ -0,0 +1,78 @@
import 'package:flutter/foundation.dart' show debugPrint, kDebugMode;
import 'package:flutter/widgets.dart'
show BuildContext, InheritedWidget, Widget;
import 'config/editor_configurations.dart';
class QuillEditorProvider extends InheritedWidget {
const QuillEditorProvider({
required super.child,
required this.editorConfigurations,
super.key,
});
final QuillEditorConfigurations editorConfigurations;
@override
bool updateShouldNotify(covariant QuillEditorProvider oldWidget) {
return oldWidget.editorConfigurations != editorConfigurations;
}
static QuillEditorProvider? maybeOf(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<QuillEditorProvider>();
}
static QuillEditorProvider of(BuildContext context) {
final provider = maybeOf(context);
if (provider == null) {
if (kDebugMode) {
debugPrint(
'The quill editor provider must be provided in the widget tree.',
);
}
throw ArgumentError.checkNotNull(
'You are using a widget in the Flutter quill library that require '
'The Quill editor provider widget to be in the parent widget tree '
'because '
'The provider is $provider. Please make sure to wrap this widget'
' with'
' QuillEditorProvider widget. '
'You might using QuillEditor so make sure to'
' wrap them with the quill provider widget and setup the required '
'configurations',
'QuillEditorProvider',
);
}
return provider;
}
/// To pass the [QuillEditorProvider] instance as value instead of creating
/// new widget
static QuillEditorProvider value({
required QuillEditorProvider value,
required Widget child,
}) {
return QuillEditorProvider(
editorConfigurations: value.editorConfigurations,
child: child,
);
}
}
extension QuillEditorExt on BuildContext {
QuillEditorConfigurations get requireQuillEditorConfigurations {
return QuillEditorProvider.of(this).editorConfigurations;
}
QuillEditorConfigurations? get quillEditorConfigurations {
return QuillEditorProvider.maybeOf(this)?.editorConfigurations;
}
QuillEditorElementOptions? get quillEditorElementOptions {
return quillEditorConfigurations?.elementOptions;
}
QuillEditorElementOptions get requireQuillEditorElementOptions {
return requireQuillEditorConfigurations.elementOptions;
}
}

@ -28,14 +28,15 @@ import 'package:flutter/widgets.dart'
SystemMouseCursors;
import 'package:meta/meta.dart' show immutable;
import '../../../widgets/others/cursor.dart';
import '../../../widgets/others/default_styles.dart';
import '../../../widgets/others/delegate.dart';
import '../../../widgets/others/link.dart';
import '../../../widgets/quill/quill_controller.dart';
import '../../../widgets/raw_editor/raw_editor.dart';
import '../../../widgets/raw_editor/raw_editor_state.dart';
import '../../themes/quill_dialog_theme.dart';
import '../../../controller/quill_controller.dart';
import '../../../editor/embed/embed_editor_builder.dart';
import '../../../editor/raw_editor/raw_editor.dart';
import '../../../editor/raw_editor/raw_editor_state.dart';
import '../../../editor/widgets/cursor.dart';
import '../../../editor/widgets/default_styles.dart';
import '../../../editor/widgets/delegate.dart';
import '../../../editor/widgets/link.dart';
import '../../../toolbar/theme/quill_dialog_theme.dart';
@immutable
class QuillRawEditorConfigurations extends Equatable {

@ -1,4 +1,4 @@
import 'dart:ui';
import 'dart:ui' show Offset;
import 'package:flutter/widgets.dart'
show
@ -11,10 +11,10 @@ import 'package:flutter/widgets.dart'
Widget;
import 'package:meta/meta.dart' show immutable;
import '../../models/config/raw_editor/raw_editor_configurations.dart';
import '../../models/structs/offset_value.dart';
import '../editor/editor.dart';
import '../others/text_selection.dart';
import '../../common/structs/offset_value.dart';
import '../editor.dart';
import '../widgets/text/text_selection.dart';
import 'config/raw_editor_configurations.dart';
import 'raw_editor_state.dart';
class QuillRawEditor extends StatefulWidget {

@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import '../../../translations.dart';
import '../../models/documents/attribute.dart';
import '../editor/editor.dart';
import '../others/link.dart';
import '../toolbar/buttons/link_style2_button.dart';
import '../toolbar/buttons/search/search_dialog.dart';
import '../../document/attribute.dart';
import '../../toolbar/buttons/link_style2_button.dart';
import '../../toolbar/buttons/search/search_dialog.dart';
import '../editor.dart';
import '../widgets/link.dart';
import 'raw_editor_state.dart';
import 'raw_editor_text_boundaries.dart';

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show ViewportOffset;
import '../../models/documents/document.dart';
import '../editor/editor.dart';
import '../others/cursor.dart';
import '../../document/document.dart';
import '../editor.dart';
import '../widgets/cursor.dart';
class QuillRawEditorMultiChildRenderObject
extends MultiChildRenderObjectWidget {

@ -20,30 +20,30 @@ import 'package:flutter/services.dart'
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'
show KeyboardVisibilityController;
import '../../models/documents/attribute.dart';
import '../../models/documents/document.dart';
import '../../models/documents/nodes/block.dart';
import '../../models/documents/nodes/embeddable.dart';
import '../../models/documents/nodes/leaf.dart' as leaf;
import '../../models/documents/nodes/line.dart';
import '../../models/documents/nodes/node.dart';
import '../../models/structs/offset_value.dart';
import '../../models/structs/vertical_spacing.dart';
import '../../services/clipboard/clipboard_service_provider.dart';
import '../../utils/cast.dart';
import '../../utils/delta.dart';
import '../../utils/embeds.dart';
import '../../utils/platform.dart';
import '../editor/editor.dart';
import '../others/cursor.dart';
import '../others/default_styles.dart';
import '../others/keyboard_listener.dart';
import '../others/link.dart';
import '../others/proxy.dart';
import '../others/text_selection.dart';
import '../quill/quill_controller.dart';
import '../quill/text_block.dart';
import '../quill/text_line.dart';
import '../../common/structs/offset_value.dart';
import '../../common/structs/vertical_spacing.dart';
import '../../common/utils/cast.dart';
import '../../common/utils/embeds.dart';
import '../../common/utils/platform.dart';
import '../../controller/quill_controller.dart';
import '../../delta/delta_diff.dart';
import '../../document/attribute.dart';
import '../../document/document.dart';
import '../../document/nodes/block.dart';
import '../../document/nodes/embeddable.dart';
import '../../document/nodes/leaf.dart' as leaf;
import '../../document/nodes/line.dart';
import '../../document/nodes/node.dart';
import '../../editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart';
import '../editor.dart';
import '../widgets/cursor.dart';
import '../widgets/default_styles.dart';
import '../widgets/keyboard_listener.dart';
import '../widgets/link.dart';
import '../widgets/proxy.dart';
import '../widgets/text/text_block.dart';
import '../widgets/text/text_line.dart';
import '../widgets/text/text_selection.dart';
import 'quill_single_child_scroll_view.dart';
import 'raw_editor.dart';
import 'raw_editor_actions.dart';
@ -1774,8 +1774,6 @@ class QuillRawEditorState extends EditorState
}
}
// TODO: Review those
@override
bool get liveTextInputEnabled => false;

@ -3,8 +3,8 @@ import 'dart:math' as math;
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import '../../models/documents/document.dart';
import '../../utils/delta.dart';
import '../../delta/delta_diff.dart';
import '../../document/document.dart';
import 'raw_editor.dart';
mixin RawEditorStateSelectionDelegateMixin on EditorState

@ -7,9 +7,9 @@ import 'package:flutter/material.dart' show Theme;
import 'package:flutter/scheduler.dart' show SchedulerBinding;
import 'package:flutter/services.dart';
import '../../models/documents/document.dart';
import '../../utils/delta.dart';
import '../editor/editor.dart';
import '../../delta/delta_diff.dart';
import '../../document/document.dart';
import '../editor.dart';
import 'raw_editor.dart';
mixin RawEditorStateTextInputClientMixin on EditorState

@ -135,8 +135,7 @@ class QuillEditorWordBoundary extends QuillEditorTextBoundary {
return TextPosition(
offset: textLayout.getWordBoundary(position).start,
// Word boundary seems to always report downstream on many platforms.
affinity:
TextAffinity.downstream, // ignore: avoid_redundant_argument_values
affinity: TextAffinity.downstream,
);
}
@ -145,8 +144,7 @@ class QuillEditorWordBoundary extends QuillEditorTextBoundary {
return TextPosition(
offset: textLayout.getWordBoundary(position).end,
// Word boundary seems to always report downstream on many platforms.
affinity:
TextAffinity.downstream, // ignore: avoid_redundant_argument_values
affinity: TextAffinity.downstream,
);
}
}

@ -1,6 +1,6 @@
import 'package:flutter/widgets.dart';
import '../../extensions/quill_configurations_ext.dart';
import '../provider.dart';
class QuillEditorBulletPoint extends StatelessWidget {
const QuillEditorBulletPoint({

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import '../../../flutter_quill.dart';
import '../quill/text_block.dart';
import '../widgets/text/text_block.dart';
class QuillEditorNumberPoint extends StatelessWidget {
const QuillEditorNumberPoint({

@ -1,6 +1,6 @@
import 'package:flutter/rendering.dart';
import '../../models/documents/nodes/container.dart';
import '../../document/nodes/container.dart';
/// A common interface to render boxes which represent a piece of rich text
/// content.

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:flutter/widgets.dart';
import '../../utils/platform.dart';
import '../../common/utils/platform.dart';
import 'box.dart';
/// Style properties of editing cursor.

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import '../../models/documents/attribute.dart';
import '../../models/documents/style.dart';
import '../../models/structs/vertical_spacing.dart';
import '../../utils/platform.dart';
import '../../common/structs/vertical_spacing.dart';
import '../../common/utils/platform.dart';
import '../../document/attribute.dart';
import '../../document/style.dart';
import '../style_widgets/checkbox_point.dart';
class QuillStyles extends InheritedWidget {

@ -3,15 +3,12 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import '../../models/documents/attribute.dart';
import '../../models/documents/nodes/leaf.dart';
import '../../utils/platform.dart';
import '../editor/editor.dart';
import '../quill/embeds.dart';
import '../../common/utils/platform.dart';
import '../../document/attribute.dart';
import '../../document/nodes/leaf.dart';
import '../editor.dart';
import '../raw_editor/raw_editor.dart';
import 'text_selection.dart';
typedef EmbedsBuilder = EmbedBuilder Function(Embed node);
import 'text/text_selection.dart';
typedef CustomStyleBuilder = TextStyle Function(Attribute attribute);

@ -2,10 +2,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../../l10n/extensions/localizations.dart';
import '../../models/documents/attribute.dart';
import '../../models/documents/nodes/node.dart';
import '../../widgets/quill/quill_controller.dart';
import '../../controller/quill_controller.dart';
import '../../document/attribute.dart';
import '../../document/nodes/node.dart';
import '../../l10n/extensions/localizations_ext.dart';
const linkPrefixes = [
'mailto:', // email

@ -1,26 +1,27 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import '../../extensions/quill_configurations_ext.dart';
import '../../models/documents/attribute.dart';
import '../../models/documents/nodes/block.dart';
import '../../models/documents/nodes/line.dart';
import '../../models/structs/vertical_spacing.dart';
import '../../utils/delta.dart';
import '../../utils/font.dart';
import '../editor/editor.dart';
import '../others/box.dart';
import '../others/cursor.dart';
import '../others/default_styles.dart';
import '../others/delegate.dart';
import '../others/link.dart';
import '../others/text_selection.dart';
import '../style_widgets/bullet_point.dart';
import '../style_widgets/checkbox_point.dart';
import '../style_widgets/number_point.dart';
import '../toolbar/base_toolbar.dart';
import 'quill_controller.dart';
import '../../../common/structs/vertical_spacing.dart';
import '../../../common/utils/font.dart';
import '../../../controller/quill_controller.dart';
import '../../../delta/delta_diff.dart';
import '../../../document/attribute.dart';
import '../../../document/nodes/block.dart';
import '../../../document/nodes/line.dart';
import '../../../toolbar/base_toolbar.dart';
import '../../editor.dart';
import '../../embed/embed_editor_builder.dart';
import '../../provider.dart';
import '../../style_widgets/bullet_point.dart';
import '../../style_widgets/checkbox_point.dart';
import '../../style_widgets/number_point.dart';
import '../box.dart';
import '../cursor.dart';
import '../default_styles.dart';
import '../delegate.dart';
import '../link.dart';
import 'text_line.dart';
import 'text_selection.dart';
const List<int> arabianRomanNumbers = [
1000,

@ -1,24 +1,26 @@
import 'dart:collection';
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/gestures.dart'
show GestureRecognizer, LongPressGestureRecognizer, TapGestureRecognizer;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../flutter_quill.dart';
import '../../models/documents/nodes/container.dart' as container_node;
import '../../models/documents/nodes/leaf.dart' as leaf;
import '../../utils/color.dart';
import '../../utils/font.dart';
import '../../utils/platform.dart';
import '../others/box.dart';
import '../others/delegate.dart';
import '../others/keyboard_listener.dart';
import '../others/proxy.dart';
import '../others/text_selection.dart';
import 'package:flutter/rendering.dart'
show BoxParentData, PipelineOwner, BoxHitTestResult, RenderObjectVisitor;
import 'package:flutter/services.dart' show ClipboardData, Clipboard;
import 'package:url_launcher/url_launcher_string.dart' show launchUrlString;
import '../../../../flutter_quill.dart';
import '../../../common/utils/color.dart';
import '../../../common/utils/font.dart';
import '../../../common/utils/platform.dart';
import '../../../document/nodes/container.dart' as container_node;
import '../../../document/nodes/leaf.dart' as leaf;
import '../box.dart';
import '../delegate.dart';
import '../keyboard_listener.dart';
import '../proxy.dart';
import 'text_selection.dart';
class TextLine extends StatefulWidget {
const TextLine({
@ -536,7 +538,7 @@ class _TextLineState extends State<TextLine> {
}
Future<void> _launchUrl(String url) async {
await launchUrl(Uri.parse(url));
await launchUrlString(url);
}
void _tapNodeLink(Node node) {

@ -6,8 +6,8 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import '../../models/documents/nodes/node.dart';
import '../editor/editor.dart';
import '../../../document/nodes/node.dart';
import '../../editor.dart';
TextSelection localSelection(Node node, TextSelection selection, fromParent) {
final base = fromParent ? node.offset : node.documentOffset;

@ -0,0 +1,5 @@
export '../controller/quill_controller_configurations.dart';
export '../editor/config/editor_configurations.dart';
export '../editor_toolbar_shared/config/quill_shared_configurations.dart';
export '../toolbar/config/simple_toolbar_configurations.dart';
export '../toolbar/config/toolbar_configurations.dart';

@ -1,12 +1,11 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart' show Color, Colors, Locale;
import '../themes/quill_dialog_theme.dart';
import 'editor/editor_configurations.dart' show QuillEditorConfigurations;
import 'toolbar/simple_toolbar_configurations.dart'
import '../../editor/config/editor_configurations.dart'
show QuillEditorConfigurations;
import '../../toolbar/config/simple_toolbar_configurations.dart'
show QuillSimpleToolbarConfigurations;
export './others/animations.dart';
import '../../toolbar/theme/quill_dialog_theme.dart';
/// The shared configurations between [QuillEditorConfigurations] and
/// [QuillSimpleToolbarConfigurations] so we don't duplicate things
@ -34,7 +33,8 @@ class QuillSharedConfigurations extends Equatable {
/// `MaterialApp` or `WidgetsApp`
final Locale? locale;
/// Store custom configurations in here and use it in the widget tree
/// Store custom configurations in here and use it in the widget tree.
/// Useful for `flutter_quill_extensions` to store additional configurations.
final Map<String, Object?> extraConfigurations;
@override

@ -0,0 +1,13 @@
import 'package:flutter/widgets.dart' show BuildContext;
import '../editor/provider.dart';
import '../toolbar/simple_toolbar_provider.dart';
import 'config/quill_shared_configurations.dart';
extension QuillSharedExt on BuildContext {
/// return nullable [QuillSharedConfigurations]
QuillSharedConfigurations? get quillSharedConfigurations {
return quillSimpleToolbarConfigurations?.sharedConfigurations ??
quillEditorConfigurations?.sharedConfigurations;
}
}

@ -1,84 +0,0 @@
import 'package:flutter/widgets.dart' show BuildContext;
import '../../flutter_quill.dart';
extension QuillControllerExt on BuildContext {
/// return nullable [QuillController]
QuillController? get quilController {
return quillSimpleToolbarConfigurations?.controller ??
quillEditorConfigurations?.controller;
}
/// return [QuillController] as not null
QuillController get requireQuillController {
return quillSimpleToolbarConfigurations?.controller ??
quillEditorConfigurations?.controller ??
(throw ArgumentError(
'The quill provider is required, you must only call requireQuillController inside the QuillToolbar and QuillEditor'));
}
}
extension QuillSharedExt on BuildContext {
/// return nullable [QuillSharedConfigurations]
QuillSharedConfigurations? get quillSharedConfigurations {
return quillSimpleToolbarConfigurations?.sharedConfigurations ??
quillEditorConfigurations?.sharedConfigurations;
}
}
extension QuillEditorExt on BuildContext {
/// return [QuillEditorConfigurations] as not null
QuillEditorConfigurations get requireQuillEditorConfigurations {
return QuillEditorProvider.of(this).editorConfigurations;
}
/// return nullable [QuillEditorConfigurations]
QuillEditorConfigurations? get quillEditorConfigurations {
return QuillEditorProvider.maybeOf(this)?.editorConfigurations;
}
/// return nullable [QuillToolbarBaseButtonOptions]. Since the quill
/// quill editor block options is in the [QuillEditorProvider] then we need to
/// get the provider widget first and then we will return block options
/// throw exception if [QuillEditorProvider] is not in the widget tree
QuillEditorElementOptions? get quillEditorElementOptions {
return quillEditorConfigurations?.elementOptions;
}
/// return [QuillToolbarBaseButtonOptions] as not null. Since the quill
/// quill editor block options is in the [QuillEditorProvider] then we need to
/// get the provider widget first and then we will return block options
/// don't throw exception if [QuillEditorProvider] is not in the widget tree
QuillEditorElementOptions get requireQuillEditorElementOptions {
return requireQuillEditorConfigurations.elementOptions;
}
}
extension QuillSimpleToolbarExt on BuildContext {
/// return [QuillSimpleToolbarConfigurations] as not null
QuillSimpleToolbarConfigurations get requireQuillSimpleToolbarConfigurations {
return QuillSimpleToolbarProvider.of(this).toolbarConfigurations;
}
/// return nullable [QuillSimpleToolbarConfigurations]
QuillSimpleToolbarConfigurations? get quillSimpleToolbarConfigurations {
return QuillSimpleToolbarProvider.maybeOf(this)?.toolbarConfigurations;
}
/// return nullable [QuillToolbarBaseButtonOptions].
QuillToolbarBaseButtonOptions? get quillToolbarBaseButtonOptions {
return quillSimpleToolbarConfigurations?.buttonOptions.base;
}
}
extension QuillToolbarExt on BuildContext {
/// return [QuillToolbarConfigurations] as not null
QuillToolbarConfigurations get requireQuillToolbarConfigurations {
return QuillToolbarProvider.of(this).toolbarConfigurations;
}
/// return nullable [QuillToolbarConfigurations].
QuillToolbarConfigurations? get quillToolbarConfigurations {
return QuillToolbarProvider.maybeOf(this)?.toolbarConfigurations;
}
}

@ -1,17 +0,0 @@
import 'package:flutter/widgets.dart' show BuildContext;
import '../../flutter_quill.dart' show QuillController;
import 'quill_configurations_ext.dart';
extension QuillControllerNullableExt on QuillController? {
/// Simple logic to use the current passed controller if not null
/// if null then we will have to use the default one
/// using the [context]
QuillController notNull(BuildContext context) {
final controller = this;
if (controller != null) {
return controller;
}
return context.requireQuillController;
}
}

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import '../../extensions/quill_configurations_ext.dart';
import '../extensions/localizations.dart';
import '../../editor_toolbar_shared/quill_configurations_ext.dart';
import '../extensions/localizations_ext.dart';
/// A widget that check if [FlutterQuillLocalizations.delegate] is provided
/// in the widgets app (e.g, [MaterialApp] or [WidgetsApp]).

@ -1,28 +0,0 @@
// import 'package:equatable/equatable.dart';
// import 'package:meta/meta.dart' show experimental, immutable;
// @immutable
// @experimental
// class QuillAnimationConfigurations extends Equatable {
// const QuillAnimationConfigurations({
// required this.checkBoxPointItem,
// });
// factory QuillAnimationConfigurations.disableAll() =>
// const QuillAnimationConfigurations(
// checkBoxPointItem: false,
// );
// factory QuillAnimationConfigurations.enableAll() =>
// const QuillAnimationConfigurations(
// checkBoxPointItem: true,
// );
// /// This currently has issue which the whole checkbox list will rebuilt
// /// and the animation will replay when some value changes
// /// which is why disabled by default
// final bool checkBoxPointItem;
// @override
// List<Object?> get props => [];
// }

@ -1,4 +0,0 @@
export 'editor/editor_configurations.dart';
export 'quill_controller_configurations.dart';
export 'quill_shared_configurations.dart';
export 'toolbar/simple_toolbar_configurations.dart';

@ -1,4 +1,4 @@
import '../../../flutter_quill.dart';
import '../../document/attribute.dart';
/// Custom attribute to save the language of codeblock
class CodeBlockLanguageAttribute extends Attribute<String?> {

@ -1,9 +1,16 @@
import 'dart:convert';
import 'dart:ui';
import 'package:collection/collection.dart';
import '../../../flutter_quill.dart';
import 'package:collection/collection.dart' show IterableExtension;
import '../../../quill_delta.dart';
import '../../document/attribute.dart';
import '../../document/document.dart';
import '../../document/nodes/block.dart';
import '../../document/nodes/embeddable.dart';
import '../../document/nodes/leaf.dart';
import '../../document/nodes/line.dart';
import '../../document/nodes/node.dart';
import './custom_quill_attributes.dart';
import './utils.dart';

@ -1,9 +1,9 @@
import 'package:meta/meta.dart' show immutable;
import '../../../quill_delta.dart';
import '../../models/documents/document.dart';
import '../documents/attribute.dart';
import '../documents/nodes/embeddable.dart';
import '../../quill_delta.dart';
import '../document/attribute.dart';
import '../document/document.dart';
import '../document/nodes/embeddable.dart';
import 'rule.dart';
/// A heuristic rule for delete operations.

@ -1,8 +1,8 @@
import 'package:meta/meta.dart' show immutable;
import '../../../quill_delta.dart';
import '../../models/documents/document.dart';
import '../documents/attribute.dart';
import '../../quill_delta.dart';
import '../document/attribute.dart';
import '../document/document.dart';
import 'rule.dart';
/// A heuristic rule for format (retain) operations.

@ -1,11 +1,11 @@
import 'package:meta/meta.dart' show immutable;
import '../../../quill_delta.dart';
import '../../extensions/uri_ext.dart';
import '../../models/documents/document.dart';
import '../documents/attribute.dart';
import '../documents/nodes/embeddable.dart';
import '../documents/style.dart';
import '../../quill_delta.dart';
import '../common/extensions/uri_ext.dart';
import '../document/attribute.dart';
import '../document/document.dart';
import '../document/nodes/embeddable.dart';
import '../document/style.dart';
import 'rule.dart';
/// A heuristic rule for insert operations.

@ -1,8 +1,8 @@
import 'package:meta/meta.dart' show immutable;
import '../../../quill_delta.dart';
import '../documents/attribute.dart';
import '../documents/document.dart';
import '../../quill_delta.dart';
import '../document/attribute.dart';
import '../document/document.dart';
import 'delete.dart';
import 'format.dart';
import 'insert.dart';

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import '../../../../flutter_quill.dart';
import '../../../flutter_quill.dart';
/// The [T] is the options for the button
/// The [E] is the extra options for the button

@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
import '../../../extensions/quill_configurations_ext.dart';
import '../../../models/themes/quill_icon_theme.dart';
import '../../quill/quill_controller.dart';
import '../base_toolbar.dart';
import '../../controller/quill_controller.dart';
import '../config/simple_toolbar_configurations.dart';
import '../simple_toolbar_provider.dart';
import '../theme/quill_icon_theme.dart';
// TODO: Use this later or remove it
/// The [T] is the options for the button, usually should refresnce itself
/// it's used in [childBuilder] so the developer can custmize this when using it

@ -1,14 +1,12 @@
import 'package:flutter/material.dart';
import '../../../flutter_quill.dart'
import '../../flutter_quill.dart'
show QuillToolbarProvider, kDefaultToolbarSize;
import '../../l10n/widgets/localizations.dart';
import '../../models/config/toolbar/simple_toolbar_configurations.dart';
import '../../models/config/toolbar/toolbar_configurations.dart';
import '../l10n/widgets/localizations.dart';
import 'config/simple_toolbar_configurations.dart';
import 'config/toolbar_configurations.dart';
import 'simple_toolbar.dart';
export '../../models/config/toolbar/base_button_configurations.dart';
export '../../models/config/toolbar/simple_toolbar_configurations.dart';
export 'buttons/clear_format_button.dart';
export 'buttons/clipboard_button.dart';
export 'buttons/color/color_button.dart';
@ -27,6 +25,8 @@ export 'buttons/search/search_button.dart';
export 'buttons/select_line_height_dropdown_button.dart';
export 'buttons/toggle_check_list_button.dart';
export 'buttons/toggle_style_button.dart';
export 'config/base_button_configurations.dart';
export 'config/simple_toolbar_configurations.dart';
typedef QuillBaseToolbarChildrenBuilder = List<Widget> Function(
BuildContext context,

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import '../../../../models/documents/attribute.dart';
import '../../../quill/quill_controller.dart';
import '../../../controller/quill_controller.dart';
import '../../../document/attribute.dart';
enum _AlignmentOptions {
left(attribute: Attribute.leftAlignment),

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import '../../../../models/documents/attribute.dart';
import '../../../quill/quill_controller.dart';
import '../../../controller/quill_controller.dart';
import '../../../document/attribute.dart';
import '../../base_toolbar.dart';
class QuillToolbarSelectAlignmentButtons extends StatelessWidget {

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import '../../../l10n/extensions/localizations.dart';
import '../../../models/documents/attribute.dart';
import '../../document/attribute.dart';
import '../../l10n/extensions/localizations_ext.dart';
import '../base_button/stateless_base_button.dart';
import '../base_toolbar.dart';

@ -3,10 +3,10 @@ import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../../../../extensions.dart';
import '../../../../flutter_quill.dart';
import '../../../l10n/extensions/localizations.dart';
import '../../../services/clipboard/clipboard_service_provider.dart';
import '../../../extensions.dart';
import '../../../flutter_quill.dart';
import '../../editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart';
import '../../l10n/extensions/localizations_ext.dart';
import '../base_button/base_value_button.dart';
enum ClipboardAction { cut, copy, paste }

@ -1,13 +1,14 @@
import 'package:flutter/material.dart';
import '../../../../extensions/quill_configurations_ext.dart';
import '../../../../l10n/extensions/localizations.dart';
import '../../../../l10n/widgets/localizations.dart';
import '../../../../models/documents/attribute.dart';
import '../../../../models/documents/style.dart';
import '../../../../utils/color.dart';
import '../../../common/utils/color.dart';
import '../../../document/attribute.dart';
import '../../../document/style.dart';
import '../../../editor_toolbar_shared/quill_configurations_ext.dart';
import '../../../l10n/extensions/localizations_ext.dart';
import '../../../l10n/widgets/localizations.dart';
import '../../base_button/base_value_button.dart';
import '../../base_toolbar.dart';
import '../../config/buttons/color_configurations.dart';
import '../quill_icon_button.dart';
import 'color_dialog.dart';
typedef QuillToolbarColorBaseButton = QuillToolbarBaseButton<

@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_colorpicker/flutter_colorpicker.dart'
show ColorPicker, MaterialPicker, colorToHex;
import '../../../../../translations.dart';
import '../../../../models/documents/style.dart';
import '../../../../translations.dart';
import '../../../document/style.dart';
import 'color_button.dart' show hexToColor;
enum _PickerType {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save