Flutter: blinking_text

When creating a blinking text, you need to know how long to blink the text for and how often to blink it. It can be difficult to get this timing just right, especially if you’re not a developer.

blinking_text is a simple plugin that makes it easy to create blinking text. You can adjust the duration of the blink and the number of times the text blinks.

Table of Contents

Install

The package can be downloaded on https://pub.dev/packages/blinking_text.

blinking_text: ^1.0.2

Properties

Besides Text’s properties, the BlinkText supports 4 more properties for blinking animation:

  • beginColor: This set the default color of the text. It overrides Text widget’s TextStyle’s color property.
  • endColor: This determine the color you want to text to animate its color to. If you don’t use the endColor property, the widget will animate its opacity to 0.
  • duration: This is the Interval between color switching animation.
  • times: Number of times a text blinks. If there is no value input, it blinks infinite.

Examples

//blink with opacity
BlinkText('Blink Text Using Opacity');
//blink from a color to another  color.
BlinkText(
	'Blink Me Text',
	style: TextStyle(fontSize: 24.0),
	beginColor: Colors.yellow,
	endColor: Colors.green,
	times: 25,
	durtaion: Duration(milliseconds: 100)
);

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close