From e7bdc2eb659bdebc0e20282897f14d867a919b96 Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Tue, 17 Oct 2023 15:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9FlutterLogo=E5=9C=A8ohos?= =?UTF-8?q?=E7=9A=84release=E6=A8=A1=E5=BC=8F=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hezhengyi --- packages/flutter/lib/src/painting/flutter_logo.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/painting/flutter_logo.dart b/packages/flutter/lib/src/painting/flutter_logo.dart index c394c108d6..bb66f3f0f8 100644 --- a/packages/flutter/lib/src/painting/flutter_logo.dart +++ b/packages/flutter/lib/src/painting/flutter_logo.dart @@ -247,7 +247,8 @@ class _FlutterLogoPainter extends BoxPainter { textDirection: TextDirection.ltr, ); _textPainter.layout(); - final ui.TextBox textSize = _textPainter.getBoxesForSelection(const TextSelection(baseOffset: 0, extentOffset: kLabel.length)).single; + final List boxList = _textPainter.getBoxesForSelection(const TextSelection(baseOffset: 0, extentOffset: kLabel.length)); + final ui.TextBox textSize = boxList.isNotEmpty ? boxList.single : ui.TextBox.fromLTRBD(0, 0, 0, 0, TextDirection.ltr); _textBoundingRect = Rect.fromLTRB(textSize.left, textSize.top, textSize.right, textSize.bottom); } -- Gitee