Comments (6)
@bogdannedelcu Did you get any further with your original issue reporting this? #146282
from flutter.
from flutter.
I've confirmed that setting the onSelectionChanged parameter fixes the exception.
from flutter.
@jimmyff Please check above possible solution and see if it helps in your case or not.
from flutter.
I'll add the parameter but also sent a PR with the fix
from flutter.
I observed a similar error log upon running below code sample and while trying to select text from the code blocks and seems to occur only when we pass selectable: true
. Without it, below error doesn't occur.
======== Exception caught by widgets ===============================================================
The following _TypeError was thrown while calling onSelectionChanged for SelectionChangedCause.longPress:
Null check operator used on a null value
When the exception was thrown, this was the stack:
#0 MarkdownBuilder._buildRichText.<anonymous closure> (package:flutter_markdown/src/builder.dart:966:35)
#1 _SelectableTextState._handleSelectionChanged (package:flutter/src/material/selectable_text.dart:628:32)
#2 EditableTextState._handleSelectionChanged (package:flutter/src/widgets/editable_text.dart:3972:34)
#3 EditableTextState._formatAndSetValue (package:flutter/src/widgets/editable_text.dart:4180:7)
#4 EditableTextState.userUpdateTextEditingValue (package:flutter/src/widgets/editable_text.dart:4550:5)
#5 RenderEditable._setTextEditingValue (package:flutter/src/rendering/editable.dart:719:27)
#6 RenderEditable._setSelection (package:flutter/src/rendering/editable.dart:738:5)
#7 RenderEditable.selectWordsInRange (package:flutter/src/rendering/editable.dart:2117:5)
#8 RenderEditable.selectWord (package:flutter/src/rendering/editable.dart:2098:5)
#9 _SelectableTextSelectionGestureDetectorBuilder.onSingleLongTapStart (package:flutter/src/material/selectable_text.dart:105:20)
#10 _TextSelectionGestureDetectorState._handleLongPressStart (package:flutter/src/widgets/text_selection.dart:3332:35)
#11 LongPressGestureRecognizer._checkLongPressStart.<anonymous closure> (package:flutter/src/gestures/long_press.dart:703:75)
#12 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:344:24)
#13 LongPressGestureRecognizer._checkLongPressStart (package:flutter/src/gestures/long_press.dart:703:11)
#14 LongPressGestureRecognizer.didExceedDeadline (package:flutter/src/gestures/long_press.dart:607:5)
#15 PrimaryPointerGestureRecognizer.didExceedDeadlineWithEvent (package:flutter/src/gestures/recognizer.dart:724:5)
#16 PrimaryPointerGestureRecognizer.addAllowedPointer.<anonymous closure> (package:flutter/src/gestures/recognizer.dart:667:41)
#20 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
(elided 3 frames from class _Timer and dart:async-patch)
====================================================================================================
D/EGL_emulation(14808): app_time_stats: avg=9575.93ms min=10.24ms max=19141.63ms count=2
code sample
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
void main() => runApp(const App());
class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: SelectionArea(
child: Center(
child: MarkdownBody(
selectable: true,
data: '''
# Hello, Markdown!
`sudo dnf install xorg-x11-xauth`
env XDG_SESSION_TYPE=x11
''',
),
),
),
),
);
}
}
from flutter.
Related Issues (20)
- [tool_crash] ShaderCompilerException HOT 3
- number keyboard doesn't work in TextField after update flutter to 3.22 HOT 2
- [Linux] FocusableActionDetector not working HOT 24
- [Web] Canvaskit raise errors on latest Chrome stable version HOT 24
- Adapt flutter tools to handle workspaces:
- Crash on linux HOT 6
- RangeError: RangeError: Value not in range: 226 HOT 4
- mac-10 & mac-26 lost external connection phone device. HOT 1
- mac-24 lost external connection phone device. HOT 2
- IOS Rendering Issue with Impeller on Version 3.22.2 HOT 3
- Skip Xcode automation handling with Xcode 16 and new deployment process
- Add support for pre-publish hooks for publishing first party Flutter packages HOT 1
- [android][platform view]investigate whether android has similar performance issue due to 1 px overlay HOT 3
- [Android] Build the engine against Android 35
- [Android] Maintain current (Android < 35) `SystemUiMode` behavior on Android >= 35 HOT 2
- Flutter supports Sensitive Content Protection HOT 2
- Image picker tests `testPickingFromGallery`, `testPickingWithContraintsFromGallery`, and `testSelectingFromGallery` failed on iOS 18 beta 1 HOT 2
- [tool_crash] _TypeError: (#0 MaterialFonts.updateInner (package:flutter_tools/src/flutter_cache.dart:151:49)) HOT 2
- LicensePage and LicenseRegistry.licenses have license from dev_dependencies in release HOT 1
- NSBundle: principal class is nil because all fallbacks have failed (Add-to-app, IOS 18, XCode 16 Beta 1) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.