interactive_text 0.0.4 interactive_text: ^0.0.4 copied to clipboard
A package that allow you to interact with phone number and web links in your text
Interactive Text
Features #
This package allows you to interact with your simple text. like dial a phone number which is in the text or opening a web link,
Getting started #
Usage #
final String sampleText = 'Mr. John L.\nweb: https://www.google.com/ \nPh: 2564824154';
final TextStyle textStyle = const TextStyle(color: Colors.black);
final TextStyle linkStyle = const TextStyle(color: Colors.blue, fontStyle: FontStyle.italic);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: InteractiveText(
text: sampleText,
textStyle: textStyle,
linkStyle: linkStyle,
onPhoneClick: (number) { // optional, use this if you want to define custom task on any phone number click
print('todo: define your custom action on $number');
},
onUrlClick: (url) { // optional, use this if you want to define custom task on any url click
print('todo: define your custom action on $url');
},
),
),
),
);
}
Additional information #
Currently this package only support phone number and web links