Search packages, repositories and app categories

GitHub repositoryEyrisCrafts/wordSelectableText

wordSelectableText

EyrisCrafts/wordSelectableText open-source repository details.

wordSelectableText project cover
Stars
16
Forks
2
Last push (UTC)
Aug 1, 2021
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

WordSelectableText

This is a Text Widget that supports word highlighting and selection. It provides an onWordTapped function that gives you access to the word selected by the user.

HighLight Word

You can highlight the word in any color using the highlightColor argument.

Language support

The widget uses a regex of alphabet set to select words. For English, regex used is [a-zA-Z]

Example

@override
Widget  build(BuildContext context) {
    String textToShow =
    "Dermatology is the branch of medicine dealing with the skin. It is a speciality with both medical and surgical aspects. A dermatologist is a specialist doctor who manages diseases related to skin, hair and nails and some cosmetic problems.";
    
    return  Scaffold(
	    appBar:  AppBar(title:  Text("widget testing"),),
	    body:  Container(
		    padding:  EdgeInsets.all(40),
		    width:  double.infinity,
		    child:  WordSelectableText(
			    selectable:  true,
			    highlight:  true,
			    text: textToShow,
			    onWordTapped: (word, index) {},
			    style:  TextStyle(fontSize:  20)
	    )),
    );
}

Waleed GitHub avatar
GitHub author

Waleed ↗

Stardew fisher and dota2 feeder.

Oslo
LanguagesDart

Dependencies used

Dependency list 2 items

  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗