Closed farmerswalker closed 1 year ago
can't reproduce at my side
I've also encountered this situation version: flutter 3.10.0 extended_text: ^11.0.0 platform: Simulator iPhone 14 Pro Max
i need a simple runnable demo to reproduce it.
It appears that wrapping with ScrollView enables the onTap to succeed.
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: CustomTextOverflowDemo(),
);
}
}
class CustomTextOverflowDemo extends StatefulWidget {
@override
_CustomTextOverflowDemoState createState() => _CustomTextOverflowDemoState();
}
class _CustomTextOverflowDemoState extends State<CustomTextOverflowDemo> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('test'),
),
body: Column(
children: [
Card(
child: _buildExtendedText(),
),
Card(
child: SingleChildScrollView(
child: _buildExtendedText(),
),
),
],
),
);
}
ExtendedText _buildExtendedText() {
return ExtendedText.rich(
TextSpan(children: <TextSpan>[
BackgroundTextSpan(
text: 'paint background end of line 错误演示12345'*3,
style: const TextStyle(color: Colors.red),
background: Paint()..color = Colors.red.withOpacity(0.1),
),
]),
maxLines: 2,
overflow: TextOverflow.ellipsis,
overflowWidget: TextOverflowWidget(
maxHeight: 30,
child: InkWell(
onTap: () {
print('more');
},
child: const Text(
' more',
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline,
)
),
),
),
);
}
}
11.0.1 is ready, reopen if still has problem
Version
11.0.0
Platforms
Android, iOS
Device Model
iPhone 14
flutter info
How to reproduce?
From Flutter 3.10, I'm experiencing an issue where the onTap event of GestureDetector is not being triggered when it's placed inside a TextOverflowWidget. Here is a simplified code snippet:
Logs
No response
Example code (optional)
Contact
No response