Skip to content

Commit 0a4c2c3

Browse files
authored
Merge pull request #240 from aagarwal1012/v4.2.0
Bump version to `v4.2.0`
2 parents 1d31bec + 21679e9 commit 0a4c2c3

File tree

9 files changed

+203
-2
lines changed

9 files changed

+203
-2
lines changed

.all-contributorsrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,26 @@
140140
"contributions": [
141141
"code"
142142
]
143+
},
144+
{
145+
"login": "Koniiro",
146+
"name": "Koniiro",
147+
"avatar_url": "https://avatars.githubusercontent.com/u/81352867?v=4",
148+
"profile": "https://github.com/Koniiro",
149+
"contributions": [
150+
"doc"
151+
]
152+
},
153+
{
154+
"login": "CoderInTheWoods",
155+
"name": "Kalgi Sheth",
156+
"avatar_url": "https://avatars.githubusercontent.com/u/25412142?v=4",
157+
"profile": "https://github.com/CoderInTheWoods",
158+
"contributions": [
159+
"code",
160+
"example",
161+
"doc"
162+
]
143163
}
144164
],
145165
"contributorsPerLine": 7,

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 4.2.0
2+
3+
**New Animated Text**
4+
5+
- Flicker Animated Text by [@CoderInTheWoods](https://github.com/CoderInTheWoods).
6+
17
## 4.1.1
28

39
- `TypewriterAnimatedText` may now be customized to adjust the cursor.

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
- [Colorize](#colorize)
7171
- [TextLiquidFill](#textliquidfill)
7272
- [Wavy](#wavy)
73+
- [Flicker](#flicker)
7374
- [Create your own Animations](#create-your-own-animations)
7475
- [Bugs or Requests](#bugs-or-requests)
7576
- [Donate](#donate)
@@ -83,7 +84,7 @@ Add this to your package's `pubspec.yaml` file:
8384

8485
```yaml
8586
dependencies:
86-
animated_text_kit: ^4.1.1
87+
animated_text_kit: ^4.2.0
8788
```
8889
8990
### 2. Install it
@@ -427,6 +428,40 @@ return DefaultTextStyle(
427428
);
428429
```
429430

431+
## Flicker
432+
433+
<img src="https://github.com/aagarwal1012/Animated-Text-Kit/blob/master/display/flicker.gif?raw=true" align = "right" height = "300px">
434+
435+
```dart
436+
return SizedBox(
437+
width: 250.0,
438+
child: DefaultTextStyle(
439+
style: const TextStyle(
440+
fontSize: 35,
441+
color: Colors.white,
442+
shadows: [
443+
Shadow(
444+
blurRadius: 7.0,
445+
color: Colors.white,
446+
offset: Offset(0, 0),
447+
),
448+
],
449+
),
450+
child: AnimatedTextKit(
451+
repeatForever: true,
452+
animatedTexts: [
453+
FlickerAnimatedText('Flicker Frenzy'),
454+
FlickerAnimatedText('Night Vibes On'),
455+
FlickerAnimatedText("C'est La Vie !"),
456+
],
457+
onTap: () {
458+
print("Tap Event");
459+
},
460+
),
461+
),
462+
);
463+
```
464+
430465
## Create your own Animations
431466

432467
You can easily create your own animations by creating new classes that extend
@@ -486,6 +521,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
486521
<td align="center"><a href="https://medium.com/@abhayvashokan"><img src="https://avatars1.githubusercontent.com/u/35297280?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Abhay V Ashokan</b></sub></a><br /><a href="https://github.com/aagarwal1012/Animated-Text-Kit/commits?author=AbhayVAshokan" title="Code">💻</a></td>
487522
<td align="center"><a href="https://linktr.ee/ritvij14"><img src="https://avatars.githubusercontent.com/u/51456744?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ritvij Kumar Sharma</b></sub></a><br /><a href="https://github.com/aagarwal1012/Animated-Text-Kit/commits?author=ritvij14" title="Code">💻</a></td>
488523
</tr>
524+
<tr>
525+
<td align="center"><a href="https://github.com/Koniiro"><img src="https://avatars.githubusercontent.com/u/81352867?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Koniiro</b></sub></a><br /><a href="https://github.com/aagarwal1012/Animated-Text-Kit/commits?author=Koniiro" title="Documentation">📖</a></td>
526+
<td align="center"><a href="https://github.com/CoderInTheWoods"><img src="https://avatars.githubusercontent.com/u/25412142?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kalgi Sheth</b></sub></a><br /><a href="https://github.com/aagarwal1012/Animated-Text-Kit/commits?author=CoderInTheWoods" title="Code">💻</a> <a href="#example-CoderInTheWoods" title="Examples">💡</a> <a href="https://github.com/aagarwal1012/Animated-Text-Kit/commits?author=CoderInTheWoods" title="Documentation">📖</a></td>
527+
</tr>
489528
</table>
490529

491530
<!-- markdownlint-restore -->

display/flicker.gif

205 KB
Loading

example/lib/main.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class AnimatedTextExample {
9898
final String label;
9999
final Color? color;
100100
final Widget child;
101+
101102
const AnimatedTextExample({
102103
required this.label,
103104
required this.color,
@@ -311,6 +312,32 @@ List<AnimatedTextExample> animatedTextExamples({VoidCallback? onTap}) =>
311312
),
312313
),
313314
),
315+
AnimatedTextExample(
316+
label: 'Flicker',
317+
color: Colors.pink[300],
318+
child: DefaultTextStyle(
319+
style: const TextStyle(
320+
fontSize: 35,
321+
color: Colors.white,
322+
shadows: [
323+
Shadow(
324+
blurRadius: 7.0,
325+
color: Colors.white,
326+
offset: Offset(0, 0),
327+
),
328+
],
329+
),
330+
child: AnimatedTextKit(
331+
repeatForever: true,
332+
animatedTexts: [
333+
FlickerAnimatedText('Flicker Frenzy'),
334+
FlickerAnimatedText('Night Vibes On'),
335+
FlickerAnimatedText("C'est La Vie !"),
336+
],
337+
onTap: onTap,
338+
),
339+
),
340+
),
314341
AnimatedTextExample(
315342
label: 'Combination',
316343
color: Colors.pink,

lib/animated_text_kit.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ export 'src/colorize.dart';
1010
export 'src/scale.dart';
1111
export 'src/text_liquid_fill.dart';
1212
export 'src/wavy.dart';
13+
export 'src/flicker.dart';

lib/src/flicker.dart

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import 'package:flutter/material.dart';
2+
import 'animated_text.dart';
3+
4+
/// Animated Text that displays a [Text] element, as a flickering glow text.
5+
///
6+
/// ![Flicker example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/flicker.gif)
7+
class FlickerAnimatedText extends AnimatedText {
8+
/// Marks ending of flickering entry interval of text
9+
final double entryEnd;
10+
final Duration speed;
11+
12+
FlickerAnimatedText(
13+
String text, {
14+
TextAlign textAlign = TextAlign.start,
15+
TextStyle? textStyle,
16+
this.speed = const Duration(milliseconds: 1600),
17+
this.entryEnd = 0.5,
18+
}) : super(
19+
text: text,
20+
textStyle: textStyle,
21+
duration: speed,
22+
);
23+
24+
late Animation<double> _entry;
25+
26+
@override
27+
void initAnimation(AnimationController controller) {
28+
_entry = Tween<double>(begin: 0.0, end: 1.0).animate(
29+
CurvedAnimation(
30+
parent: controller,
31+
curve: Interval(0.0, entryEnd, curve: Curves.bounceIn),
32+
),
33+
);
34+
}
35+
36+
@override
37+
Widget completeText(BuildContext context) => SizedBox.shrink();
38+
39+
@override
40+
Widget animatedBuilder(BuildContext context, Widget? child) {
41+
return Opacity(
42+
opacity: _entry.value != 1.0 ? _entry.value : _entry.value,
43+
child: textWidget(text),
44+
);
45+
}
46+
}
47+
48+
@Deprecated('Use AnimatedTextKit with FlickerAnimatedText instead.')
49+
class FlickerAnimatedTextKit extends AnimatedTextKit {
50+
FlickerAnimatedTextKit({
51+
Key? key,
52+
required List<String> text,
53+
TextAlign textAlign = TextAlign.start,
54+
TextStyle? textStyle,
55+
TextDirection textDirection = TextDirection.ltr,
56+
Duration speed = const Duration(milliseconds: 1600),
57+
double entryEnd = 0.5,
58+
VoidCallback? onTap,
59+
void Function(int, bool)? onNext,
60+
void Function(int, bool)? onNextBeforePause,
61+
VoidCallback? onFinished,
62+
bool isRepeatingAnimation = true,
63+
int totalRepeatCount = 3,
64+
bool repeatForever = false,
65+
bool displayFullTextOnTap = false,
66+
bool stopPauseOnTap = false,
67+
}) : super(
68+
key: key,
69+
animatedTexts:
70+
_animatedTexts(text, textAlign, textStyle, speed, entryEnd),
71+
onTap: onTap,
72+
onNext: onNext,
73+
onNextBeforePause: onNextBeforePause,
74+
onFinished: onFinished,
75+
isRepeatingAnimation: isRepeatingAnimation,
76+
totalRepeatCount: totalRepeatCount,
77+
repeatForever: repeatForever,
78+
displayFullTextOnTap: displayFullTextOnTap,
79+
stopPauseOnTap: stopPauseOnTap,
80+
);
81+
82+
static List<AnimatedText> _animatedTexts(
83+
List<String> text,
84+
TextAlign textAlign,
85+
TextStyle? textStyle,
86+
Duration speed,
87+
double entryEnd,
88+
) =>
89+
text
90+
.map((_) => FlickerAnimatedText(
91+
_,
92+
textAlign: textAlign,
93+
textStyle: textStyle,
94+
speed: speed,
95+
entryEnd: entryEnd,
96+
))
97+
.toList();
98+
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: animated_text_kit
22
description: A flutter package project which contains a collection of cool and beautiful text animations.
3-
version: 4.1.1
3+
version: 4.2.0
44
homepage: https://github.com/aagarwal1012/Animated-Text-Kit/
55
maintainer: Ayush Agarwal (@aagarwal1012)
66

test/smoke_test.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:animated_text_kit/animated_text_kit.dart';
22
import 'package:flutter/material.dart';
33
import 'package:flutter_test/flutter_test.dart';
4+
45
// ignore: avoid_relative_lib_imports
56
import '../example/lib/main.dart';
67

@@ -102,6 +103,15 @@ void main() {
102103
tapped = true;
103104
},
104105
),
106+
// ignore: deprecated_member_use_from_same_package
107+
FlickerAnimatedTextKit(
108+
text: tripleText,
109+
textStyle: textStyle,
110+
displayFullTextOnTap: true,
111+
onTap: () {
112+
tapped = true;
113+
},
114+
),
105115
];
106116

107117
for (var widget in tapableWidgets) {

0 commit comments

Comments
 (0)