輸入這些內容
一個旨在透過豐富的文本效果和其他操作(重設、凍結、解凍)簡化多樣化打字動畫的 Flutter 套件。
- 星標
- 8
- 分支
- 4
- 最近推送(UTC)
- 2025年8月3日
- 專案狀態
- 未封存
原始 README
以下為英文專案原文快照,最新內容請造訪 GitHub。
TypeThis
A flutter package that aims to simplify versatile typing animation with rich text effects and other operations (reset, freeze, unfreeze).
Create and style TypeThis widget
The TypeThis widget requires only one essential parameter: string. This parameter represents the text that will undergo animation.
Additionally, you can customize the animation speed using the optional speed parameter, with a default value of 50 milliseconds. This implies that each character in the provided text will be rendered at intervals of 50 milliseconds, creating a dynamic and engaging typing effect.
Here is an example:
TypeThis(
string: 'An example string with typing animation.',
speed: 150,
);
The TypeThis widget gives users the complete control over text rendering, offering all the parameters available in the standard Text widget.
TypeThis(
string: 'An example string with typing animation.',
speed: 150,
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.indigo,
),
textAlign: TextAlign.center,
);
Control the animation
To control the typing animation, create a TypeThisController and supply it to the TypeThis widget.
📘 Important
Call
disposeof theTypeThisControllerwhen you’ve finished using it. This ensures that you discard any resources used by the object.
// Define a custom widget.
class MyTypingWidget extends StatefulWidget { ... }
class _MyTypingWidgetState extends State<MyTypingWidget> {
// Create a typethis controller.
final myController = TypeThisController();
@override
void dispose() {
// Clean up the controller when the widget is disposed.
myController.dispose();
super.dispose();
}
}
Now that you have a TypeThisController, wire it up to a text field using the controller property.
TypeThis(
string: 'An example string with typing animation.',
controller: myController,
);
After supplying the TypeThisController, begin controlling the typing animation. Use the reset() method provided by the TypeThisController to resets the typing animation and restart it from the beginning.
Similarly, use the freeze() and unfreeze() methods to pause/freeze and resume/unfreeze the animation respectively.
// Reset
myController.reset();
// Freeze / Pause
myController.freeze();
// Unfreeze / Resume
myController.unfreeze();
Bring in RichText effects
One standout feature of this package is the ability to incorporate rich text styling within the typing animation.
Add rich text effects within typing animation using TypeThisMatcher that works with regex pattern.
TypeThis(
string: 'Welcome to the typethis package.',
richTextMatchers: const [
TypeThisMatcher(
'typethis',
style: TextStyle(
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic,
),
),
],
);
Use the TypeThisController to manage and control the animations as well. Read here.
Demo
License
The project is released under the MIT License. Learn more about it, here.
Developed and Maintained with 💜 by Sandip Pramanik
分類
使用的依賴
依賴清單 3 項
- flutter
{"sdk":"flutter"} - flutter_lints開發依賴
^2.0.0 - flutter_test開發依賴
{"sdk":"flutter"}
如何選擇適合專案的儲存庫?
先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
- 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
- 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
- 使用前在 GitHub 確認 README、授權條款與 Issues。
來源與維護
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗
