Skip to content

Commit

Permalink
fix: late initialization error (AppFlowy-IO#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 authored Mar 20, 2024
1 parent cbb3346 commit a571f2b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:appflowy_editor/src/editor/util/color_util.dart';
import 'package:appflowy_editor/src/editor_state.dart';
import 'package:appflowy_editor/src/extensions/text_style_extension.dart';
import 'package:appflowy_editor/src/render/selection/selectable.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

Expand Down Expand Up @@ -151,7 +152,7 @@ class _AppFlowyRichTextState extends State<AppFlowyRichText>
Position position, {
bool shiftWithBaseOffset = false,
}) {
if (_renderParagraph?.debugNeedsLayout == true) {
if (kDebugMode && _renderParagraph?.debugNeedsLayout == true) {
return null;
}
final textPosition = TextPosition(offset: position.offset);
Expand Down Expand Up @@ -227,7 +228,7 @@ class _AppFlowyRichTextState extends State<AppFlowyRichText>
Selection selection, {
bool shiftWithBaseOffset = false,
}) {
if (_renderParagraph?.debugNeedsLayout == true) {
if (kDebugMode && _renderParagraph?.debugNeedsLayout == true) {
return [];
}
final textSelection = textSelectionFromEditorSelection(selection);
Expand Down

0 comments on commit a571f2b

Please sign in to comment.