Skip to content

chandresh204/interactive_text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Add interactive_text: ^0.0.6 in your pubspec.yaml file in dependencies section

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');
          },
        ),
      ),
    ),
  );
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages