可选择单词的文本
EyrisCrafts/wordSelectableText open-source repository details.
- 星标
- 16
- 复刻
- 2
- 最近推送(UTC)
- 2021年8月1日
- 项目状态
- 未归档
原始 README
以下为英文项目原文快照,最新内容请访问 GitHub。
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)
)),
);
}

语言Dart
使用的依赖
依赖清单 2 项
- flutter
{"sdk":"flutter"} - flutter_test开发依赖
{"sdk":"flutter"}
如何选择适合项目的代码仓?
先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
- 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
- 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
- 使用前在 GitHub 核对 README、许可证与 Issues。
来源与维护
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗