Skip to content

Commit 61d753d

Browse files
author
CatHood0
committed
Merge 'master' into better_soft_keyboard_support
2 parents 44bdd3d + b3beaea commit 61d753d

File tree

11 files changed

+322
-118
lines changed

11 files changed

+322
-118
lines changed

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Changed
1414

15-
- Improve changes application from TextInputClient [#2509](https://github.com/singerdmx/flutter-quill/pull/2509).
15+
- Replace `TextInputClient` with `DeltaTextInputClient` [#2509](https://github.com/singerdmx/flutter-quill/pull/2509).
16+
17+
## [11.2.0] - 2025-03-26
18+
19+
### Added
20+
21+
- Cache for `toPlainText` in `Document` class to avoid unnecessary text computing [#2482](https://github.com/singerdmx/flutter-quill/pull/2482).
22+
23+
## [11.1.2] - 2025-03-24
24+
25+
### Fixed
26+
27+
- **[iOS]** `QuillEditor` doesn't respect the system keyboard brightness by default [#2522](https://github.com/singerdmx/flutter-quill/pull/2522).
28+
- Add a default empty list for `characterShortcutEvents` and `spaceShortcutEvents` in `QuillRawEditorConfig` [#2522](https://github.com/singerdmx/flutter-quill/pull/2522).
29+
- Deprecate `QuillEditorState.configurations` in favor of `QuillEditorState.config` [#2522](https://github.com/singerdmx/flutter-quill/pull/2522).
1630

1731
## [11.1.1] - 2025-03-19
1832

@@ -124,7 +138,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
124138
- Apple-specific font dependency for subscript and superscript functionality from the example.
125139
- **BREAKING**: The [`super_clipboard`](https://pub.dev/packages/super_clipboard) plugin, To restore legacy behavior for `super_clipboard`, use [`flutter_quill_extensions`](https://pub.dev/packages/flutter_quill_extensions) package and `FlutterQuillExtensions.useSuperClipboardPlugin()`.
126140

127-
[unreleased]: https://github.com/singerdmx/flutter-quill/compare/v11.1.1...HEAD
141+
[unreleased]: https://github.com/singerdmx/flutter-quill/compare/v11.2.0...HEAD
142+
[11.2.0]: https://github.com/singerdmx/flutter-quill/compare/v10.0.0...v11.2.0
143+
[11.1.2]: https://github.com/singerdmx/flutter-quill/compare/v10.0.0...v11.1.2
128144
[11.1.1]: https://github.com/singerdmx/flutter-quill/compare/v10.0.0...v11.1.1
129145
[11.1.0]: https://github.com/singerdmx/flutter-quill/compare/v10.0.0...v11.1.0
130146
[11.0.0]: https://github.com/singerdmx/flutter-quill/compare/v10.0.0...v11.0.0

example/pubspec.lock

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ packages:
55
dependency: transitive
66
description:
77
name: args
8-
sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6
8+
sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "2.6.0"
11+
version: "2.7.0"
1212
async:
1313
dependency: transitive
1414
description:
@@ -101,10 +101,10 @@ packages:
101101
dependency: transitive
102102
description:
103103
name: ffi
104-
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
104+
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
105105
url: "https://pub.dev"
106106
source: hosted
107-
version: "2.1.3"
107+
version: "2.1.4"
108108
file:
109109
dependency: transitive
110110
description:
@@ -191,10 +191,10 @@ packages:
191191
dependency: transitive
192192
description:
193193
name: flutter_keyboard_visibility_temp_fork
194-
sha256: cecc44a350a8a369efbc960bb2126386af53cb0597ca6789607cbfb88081b9f4
194+
sha256: e3d02900640fbc1129245540db16944a0898b8be81694f4bf04b6c985bed9048
195195
url: "https://pub.dev"
196196
source: hosted
197-
version: "0.1.4"
197+
version: "0.1.5"
198198
flutter_keyboard_visibility_windows:
199199
dependency: transitive
200200
description:
@@ -220,17 +220,17 @@ packages:
220220
dependency: transitive
221221
description:
222222
name: flutter_plugin_android_lifecycle
223-
sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e"
223+
sha256: "5a1e6fb2c0561958d7e4c33574674bda7b77caaca7a33b758876956f2902eea3"
224224
url: "https://pub.dev"
225225
source: hosted
226-
version: "2.0.24"
226+
version: "2.0.27"
227227
flutter_quill:
228228
dependency: "direct main"
229229
description:
230230
path: ".."
231231
relative: true
232232
source: path
233-
version: "11.1.1"
233+
version: "11.2.0"
234234
flutter_quill_delta_from_html:
235235
dependency: transitive
236236
description:
@@ -252,7 +252,7 @@ packages:
252252
path: "../flutter_quill_test"
253253
relative: true
254254
source: path
255-
version: "11.0.0"
255+
version: "11.1.0"
256256
flutter_test:
257257
dependency: "direct dev"
258258
description: flutter
@@ -304,10 +304,10 @@ packages:
304304
dependency: transitive
305305
description:
306306
name: image_picker_android
307-
sha256: b62d34a506e12bb965e824b6db4fbf709ee4589cf5d3e99b45ab2287b008ee0c
307+
sha256: "8bd392ba8b0c8957a157ae0dc9fcf48c58e6c20908d5880aea1d79734df090e9"
308308
url: "https://pub.dev"
309309
source: hosted
310-
version: "0.8.12+20"
310+
version: "0.8.12+22"
311311
image_picker_for_web:
312312
dependency: transitive
313313
description:
@@ -328,10 +328,10 @@ packages:
328328
dependency: transitive
329329
description:
330330
name: image_picker_linux
331-
sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa"
331+
sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9"
332332
url: "https://pub.dev"
333333
source: hosted
334-
version: "0.2.1+1"
334+
version: "0.2.1+2"
335335
image_picker_macos:
336336
dependency: transitive
337337
description:
@@ -485,10 +485,10 @@ packages:
485485
dependency: transitive
486486
description:
487487
name: quill_native_bridge
488-
sha256: bda0f0ad9bc160dcdd4bd2b378a7ae8bdb55c3d4b7301bf739d5e3b065ee5e82
488+
sha256: "00752aca7d67cbd3254709a47558be78427750cb81aa42cfbed354d4a079bcfa"
489489
url: "https://pub.dev"
490490
source: hosted
491-
version: "11.0.0"
491+
version: "11.0.1"
492492
quill_native_bridge_android:
493493
dependency: transitive
494494
description:
@@ -525,18 +525,18 @@ packages:
525525
dependency: transitive
526526
description:
527527
name: quill_native_bridge_platform_interface
528-
sha256: ea48bd12bf426741747ec8a575b122350971f338a75049099b349c63447582a2
528+
sha256: "8264a2bdb8a294c31377a27b46c0f8717fa9f968cf113f7dc52d332ed9c84526"
529529
url: "https://pub.dev"
530530
source: hosted
531-
version: "0.0.1+1"
531+
version: "0.0.2+1"
532532
quill_native_bridge_web:
533533
dependency: transitive
534534
description:
535535
name: quill_native_bridge_web
536-
sha256: e7e55047d68f1a88574c26dbe3f12988f49d07740590d8fc6280028bbde5b908
536+
sha256: "7c723f6824b0250d7f33e8b6c23f2f8eb0103fe48ee7ebf47ab6786b64d5c05d"
537537
url: "https://pub.dev"
538538
source: hosted
539-
version: "0.0.1"
539+
version: "0.0.2"
540540
quill_native_bridge_windows:
541541
dependency: transitive
542542
description:
@@ -634,10 +634,10 @@ packages:
634634
dependency: transitive
635635
description:
636636
name: url_launcher_android
637-
sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193"
637+
sha256: "1d0eae19bd7606ef60fe69ef3b312a437a16549476c42321d5dc1506c9ca3bf4"
638638
url: "https://pub.dev"
639639
source: hosted
640-
version: "6.3.14"
640+
version: "6.3.15"
641641
url_launcher_ios:
642642
dependency: transitive
643643
description:
@@ -698,18 +698,18 @@ packages:
698698
dependency: transitive
699699
description:
700700
name: video_player
701-
sha256: "4a8c3492d734f7c39c2588a3206707a05ee80cef52e8c7f3b2078d430c84bc17"
701+
sha256: "48941c8b05732f9582116b1c01850b74dbee1d8520cd7e34ad4609d6df666845"
702702
url: "https://pub.dev"
703703
source: hosted
704-
version: "2.9.2"
704+
version: "2.9.3"
705705
video_player_android:
706706
dependency: transitive
707707
description:
708708
name: video_player_android
709-
sha256: "7018dbcb395e2bca0b9a898e73989e67c0c4a5db269528e1b036ca38bcca0d0b"
709+
sha256: ae7d4f1b41e3ac6d24dd9b9d5d6831b52d74a61bdd90a7a6262a33d8bb97c29a
710710
url: "https://pub.dev"
711711
source: hosted
712-
version: "2.7.17"
712+
version: "2.8.2"
713713
video_player_avfoundation:
714714
dependency: transitive
715715
description:
@@ -746,10 +746,10 @@ packages:
746746
dependency: transitive
747747
description:
748748
name: web
749-
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
749+
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
750750
url: "https://pub.dev"
751751
source: hosted
752-
version: "1.1.0"
752+
version: "1.1.1"
753753
webdriver:
754754
dependency: transitive
755755
description:
@@ -762,10 +762,10 @@ packages:
762762
dependency: transitive
763763
description:
764764
name: win32
765-
sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e
765+
sha256: dc6ecaa00a7c708e5b4d10ee7bec8c270e9276dfcab1783f57e9962d7884305f
766766
url: "https://pub.dev"
767767
source: hosted
768-
version: "5.10.1"
768+
version: "5.12.0"
769769
sdks:
770-
dart: ">=3.7.0-0 <4.0.0"
770+
dart: ">=3.7.0 <4.0.0"
771771
flutter: ">=3.27.0"

lib/src/document/document.dart

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,26 @@ import 'style.dart';
2525
class Document {
2626
/// Creates new empty document.
2727
Document() : _delta = Delta()..insert('\n') {
28-
_loadDocument(_delta);
28+
loadDocument(_delta);
2929
}
3030

3131
/// Creates new document from provided JSON `data`.
3232
Document.fromJson(List data) : _delta = _transform(Delta.fromJson(data)) {
33-
_loadDocument(_delta);
33+
loadDocument(_delta);
3434
}
3535

3636
/// Creates new document from provided `delta`.
3737
Document.fromDelta(Delta delta) : _delta = delta {
38-
_loadDocument(delta);
38+
loadDocument(delta);
3939
}
4040

41+
/// Stores the plain text content of the entire document in memory for quick access.
42+
///
43+
/// It acts as a cache to avoid repeatedly extracting or generating the plain text.
44+
@visibleForTesting
45+
@internal
46+
String? cachedPlainText;
47+
4148
/// The root node of the document tree
4249
final Root _root = Root();
4350

@@ -465,16 +472,19 @@ class Document {
465472
throw StateError('_delta compose failed');
466473
}
467474
assert(_delta == _root.toDelta(), 'Compose failed');
475+
cachedPlainText = null;
468476
final change = DocChange(originalDelta, delta, changeSource);
469477
documentChangeObserver.add(change);
470478
history.handleDocChange(change);
471479
}
472480

473481
HistoryChanged undo() {
482+
cachedPlainText = null;
474483
return history.undo(this);
475484
}
476485

477486
HistoryChanged redo() {
487+
cachedPlainText = null;
478488
return history.redo(this);
479489
}
480490

@@ -539,11 +549,13 @@ class Document {
539549
Iterable<EmbedBuilder>? embedBuilders,
540550
EmbedBuilder? unknownEmbedBuilder,
541551
]) =>
542-
_root.children
552+
cachedPlainText ??= _root.children
543553
.map((e) => e.toPlainText(embedBuilders, unknownEmbedBuilder))
544554
.join();
545555

546-
void _loadDocument(Delta doc) {
556+
@visibleForTesting
557+
@internal
558+
void loadDocument(Delta doc) {
547559
if (doc.isEmpty) {
548560
throw ArgumentError.value(
549561
doc.toString(), 'Document Delta cannot be empty.');
@@ -570,6 +582,7 @@ class Document {
570582
_root.childCount > 1) {
571583
_root.remove(node);
572584
}
585+
cachedPlainText = null;
573586
}
574587

575588
bool isEmpty() {

lib/src/editor/config/editor_config.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class QuillEditorConfig {
4444
this.maxContentWidth,
4545
this.customStyles,
4646
this.textCapitalization = TextCapitalization.sentences,
47-
this.keyboardAppearance = Brightness.light,
47+
this.keyboardAppearance,
4848
this.scrollPhysics,
4949
this.onLaunchUrl,
5050
this.onTapDown,
@@ -312,17 +312,17 @@ class QuillEditorConfig {
312312
///
313313
/// Defaults to Material/Cupertino App Brightness.
314314
///
315-
/// The keyboardd appearance will set using the following:
315+
/// The keyboard appearance will set using the following:
316316
///
317317
/// ```dart
318-
/// widget.configurations.keyboardAppearance ??
318+
/// widget.config.keyboardAppearance ??
319319
/// CupertinoTheme.maybeBrightnessOf(context) ??
320320
/// Theme.of(context).brightness
321321
/// ```
322322
///
323323
/// See also: https://github.com/flutter/flutter/blob/06b9f7ba0bef2b5b44a643c73f4295a096de1202/packages/flutter/lib/src/services/text_input.dart#L621-L626
324324
/// and [QuillRawEditorConfig.keyboardAppearance]
325-
final Brightness keyboardAppearance;
325+
final Brightness? keyboardAppearance;
326326

327327
/// The [ScrollPhysics] to use when vertically scrolling the input.
328328
///

0 commit comments

Comments
 (0)