v1.0.2
gradient_text
一個用於顯示具有漸變效果文字的 Flutter 小部件。接受 TextStyle 和 TextAlign,因此可以非常類似於 Text 小部件使用。
31喜歡 27近 30 天下載40Pub 分數
平台暫無資料
用於顯示漸變文字的 Flutter 小部件
{"sdk":"flutter"}{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
A Flutter Widget for displaying gradient text, text with a gradient drawn through it.
GradientTextScreenshot
Add the plugin (pub coming soon):
dependencies:
...
gradient_text: ^1.0.2
Import it:
import 'package:gradient_text/gradient_text.dart';
Use it:
GradientText("this is my text",
gradient: LinearGradient(
colors: [Colors.deepPurple, Colors.deepOrange, Colors.pink]),
style: TextStyle(fontSize: 42),
textAlign: TextAlign.center);
Parameters:
data :: (required) :: The String to be used in the Text Widget
gradient :: (required) :: A gradient to be drawn through the text
style :: (optional) :: TextStyle to be used in the Text Widget. Color is ignored, as the text must be white to have the gradient drawn.
textAlign :: (optional) :: TextAlign to be used in the Text Widget. Default is left.
The idea to use ShaderMask came from Reddit user boformer. Thanks boformer.