xxxxxxxxxx
//This is a widget
SelectableText("Your text here")
//You can know select the text
xxxxxxxxxx
SelectableText(
"Copy me",
onTap: () {
// you can show toast to the user, like "Copied"
},
)
//If you want to have different styling for text, use
SelectableText.rich(
TextSpan(
children: [
TextSpan(text: "Copy me", style: TextStyle(color: Colors.red)),
TextSpan(text: " and leave me"),
],
),
)