I am using SelectionArea
on top of a ListView
with Texts.
Is there a way to access the selected text in the SelectionArea
Class?
Looking for a callback method like onSelectionChanged
from the SelectableText
Class.
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SelectionArea(
child: ListView.separated(
itemBuilder: (context, index) => Text(
List.generate(index + 1, (index) => 'Lorem Ipsum').join(' '),
),
separatorBuilder: (_, __) => const SizedBox(height: 20),
itemCount: 50,
),
),
);
}
}