The requirement is when the Text did not show all the data, detail dialog will show when use tap the Text widget.
Code just like:
class _DraftPage2State extends State<DraftPage2> {
var _showedAllData = false;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: BaseAppBar(titleText: '判断Text文本是否显示完'),
body: Center(
child: GestureDetector(
onTap: () {
if (!_showedAllData) {
// showDialog
}
},
child: Container(
width: 100,
height: 30,
color: Colors.red,
child: const Text(
'AAAAAAAAAAAAAAAAAAAA',
style: TextStyle(fontSize: 20),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
),
);
}
}
For example:
- not showed all data
- showed all data
So how can I detect the Text widget showed all data?