Skip to content

Commit d1fa308

Browse files
SaadArdatiBirjuVachhani
authored andcommitted
🔧 Update Pack V1 #11
1 parent 11aa429 commit d1fa308

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

example/lib/stories/text_animation.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,13 @@ class _TextAnimationState extends State<TextAnimation> {
128128
color: const Color(0xFF272727),
129129
borderRadius: BorderRadius.circular(32),
130130
),
131-
child: const Text('Hello😀😃😄😁😆😅😂🤣🥲🥹️😊😇🙂🙃😉😌Sexy')
131+
child: const Text('Hello😀😃😄😁😆😅😂🤣🥲🥹️😊😇🙂🙃😉😌Sexy')
132132
.roll(
133-
'World🧳🌂☂️🧵🪡🪢🪭🧶👓🕶🥽🥼🦺👔👕👖🧣Effect',
133+
'World🧳🌂☂️🧵🪡🪢🪭🧶👓🕶🥽🥼🦺👔👖🧣Effect',
134134
tapeStrategy: const ConsistentSymbolTapeStrategy(4),
135135
tapeCurve: Curves.easeInOutQuart,
136136
widthCurve: Curves.easeOutQuart,
137137
symbolDistanceMultiplier: 2,
138-
clipBehavior: Clip.none,
139138
)
140139
.animate(
141140
toggle: translation,

lib/src/effects/text/symbol_tape_strategy.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ class ConsistentSymbolTapeStrategy extends SymbolTapeStrategy {
188188
return a;
189189
}
190190
}
191-
if (length <= 2) return tape;
191+
if (length <= 2) {
192+
final int halfDist = maxDistance ~/ 2;
193+
return a * (halfDist + 1) + b * (halfDist + 1);
194+
}
192195

193196
final StringBuffer newKit = StringBuffer();
194197

@@ -198,7 +201,7 @@ class ConsistentSymbolTapeStrategy extends SymbolTapeStrategy {
198201
final progress = maxDistance - distance;
199202
if (fromStart) {
200203
final int start = min(progress, maxIndex - 1);
201-
newKit.write(tape.characters.elementAt(1 + start));
204+
newKit.write(tape.characters.elementAt(start + 1));
202205
// if (newKit.length >= maxDistance + 2) break;
203206
} else {
204207
final int end = max(maxIndex - progress, 1);

0 commit comments

Comments
 (0)