Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting all the text and then scrolling will cause an error: Null check operator used on a null value #122

Open
wilinz opened this issue Jul 4, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@wilinz
Copy link

wilinz commented Jul 4, 2023

Describe the bug
Selecting all the text and then scrolling will cause an error: Null check operator used on a null value

To Reproduce
Steps to reproduce the behavior:

  1. long press
  2. select all
  3. Scroll
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

Environment(please complete the following information):
Please use flutter doctor -v to show your flutter environment, and add your markdown_widget version too

Platform
Android

Source data
https://github.com/wilinz/flutter_markdown_demo

@wilinz wilinz added the bug Something isn't working label Jul 4, 2023
@wilinz
Copy link
Author

wilinz commented Jul 4, 2023

Screenrecorder-2023-07-04-19-57-06-130.mp4

@wilinz
Copy link
Author

wilinz commented Jul 4, 2023

======== Exception caught by widgets library =======================================================
The following _TypeError was thrown building _OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#7f1ea](dirty, state: _OverlayEntryWidgetState#d9246):
Null check operator used on a null value
The relevant error-causing widget was:
MaterialApp MaterialApp:file:https:///C:/Users/wilinz/Desktop/gitee/flutter_markdown/lib/main.dart:18:12
When the exception was thrown, this was the stack:
0 SelectableRegionState.startGlyphHeight (package:flutter/src/widgets/selectable_region.dart:1028:56)
1 SelectableRegionState.contextMenuAnchors (package:flutter/src/widgets/selectable_region.dart:912:25)
2 new AdaptiveTextSelectionToolbar.selectableRegion (package:flutter/src/material/adaptive_text_selection_toolbar.dart:169:40)
3 SelectionArea._defaultContextMenuBuilder (package:flutter/src/material/selection_area.dart:96:41)
4 SelectableRegionState._showToolbar. (package:flutter/src/widgets/selectable_region.dart:769:42)
5 SelectionOverlay.showToolbar. (package:flutter/src/widgets/text_selection.dart:1347:36)
6 ContextMenuController.show. (package:flutter/src/widgets/context_menu_controller.dart:65:54)
7 _OverlayEntryWidgetState.build (package:flutter/src/widgets/overlay.dart:345:36)
8 StatefulElement.build (package:flutter/src/widgets/framework.dart:5198:27)
9 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5086:15)
10 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
11 Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
12 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2780:19)
13 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:903:21)
14 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:358:5)
15 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1284:15)
16 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1214:9)
17 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1072:5)
18 _invoke (dart:ui/hooks.dart:142:13)
19 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:359:5)
20 _drawFrame (dart:ui/hooks.dart:112:31)

Lost connection to device.

@asjqkkkk
Copy link
Owner

Hi @wilinz , I thinks this is not a bug of markdown_widget, you should remove the Expanded inside the Padding.

@Easy-AI-1688
Copy link

This is a bug in Flutter. Please upgrade Flutter to the latest version and this issue will be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants