Fix #1392: UnhandledFlutterException: Null check operator used on a null value in Container.insert(container.dart:127)

pull/1393/head
EgorK0rshun 2 years ago
parent 36d72c1987
commit 6be6fe0e6a
  1. 3
      CHANGELOG.md
  2. 10
      lib/src/models/documents/nodes/container.dart
  3. 2
      pubspec.yaml

@ -1,3 +1,6 @@
# [7.4.4]
- Fix #1392.
# [7.4.4] # [7.4.4]
- Fix #1311. - Fix #1311.

@ -108,9 +108,7 @@ abstract class Container<T extends Node?> extends Node {
Iterable<EmbedBuilder>? embedBuilders, Iterable<EmbedBuilder>? embedBuilders,
EmbedBuilder? unknownEmbedBuilder, EmbedBuilder? unknownEmbedBuilder,
]) => ]) =>
children children.map((e) => e.toPlainText(embedBuilders, unknownEmbedBuilder)).join();
.map((e) => e.toPlainText(embedBuilders, unknownEmbedBuilder))
.join();
/// Content length of this node's children. /// Content length of this node's children.
/// ///
@ -124,16 +122,16 @@ abstract class Container<T extends Node?> extends Node {
if (isNotEmpty) { if (isNotEmpty) {
final child = queryChild(index, false); final child = queryChild(index, false);
if (child.isNotEmpty) {
child.node!.insert(child.offset, data, style); child.node!.insert(child.offset, data, style);
return;
} }
} else {
// empty
assert(index == 0); assert(index == 0);
final node = defaultChild; final node = defaultChild;
add(node); add(node);
node?.insert(index, data, style); node?.insert(index, data, style);
} }
}
@override @override
void retain(int index, int? length, Style? attributes) { void retain(int index, int? length, Style? attributes) {

@ -1,6 +1,6 @@
name: flutter_quill name: flutter_quill
description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter. description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter.
version: 7.4.4 version: 7.4.5
homepage: https://1o24bbs.com/c/bulletjournal/108 homepage: https://1o24bbs.com/c/bulletjournal/108
repository: https://github.com/singerdmx/flutter-quill repository: https://github.com/singerdmx/flutter-quill

Loading…
Cancel
Save