Skip to content

Commit 6b7cfa5

Browse files
SaadArdatiBirjuVachhani
authored andcommitted
🔧 Update Pack V1 #8
1 parent 40c0627 commit 6b7cfa5

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

example/lib/stories/counter_app.dart

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import 'dart:math';
2+
13
import 'package:flutter/material.dart';
2-
import 'package:google_fonts/google_fonts.dart';
34
import 'package:hyper_effects/hyper_effects.dart';
45

56
class CounterApp extends StatefulWidget {
@@ -32,19 +33,23 @@ class _CounterAppState extends State<CounterApp> {
3233
const Text(
3334
'You have pushed the button this many times:',
3435
),
35-
Text(
36-
'$_counter',
37-
style: Theme.of(context).textTheme.headlineMedium,
38-
),
39-
Text(
40-
'${_counter - 1}',
41-
style: Theme.of(context).textTheme.headlineMedium,
42-
).roll(
43-
'$_counter',
44-
tapeStrategy: const AllSymbolsTapeStrategy(),
45-
).animate(
46-
toggle: _counter,
47-
duration: const Duration(milliseconds: 1000),
36+
Container(
37+
width: double.infinity,
38+
alignment: Alignment.center,
39+
decoration: const BoxDecoration(),
40+
clipBehavior: Clip.hardEdge,
41+
child: Text(
42+
'${max(0, _counter - 1)}',
43+
style: Theme.of(context).textTheme.headlineMedium,
44+
)
45+
.roll(
46+
'$_counter',
47+
clipBehavior: Clip.none,
48+
)
49+
.animate(
50+
toggle: _counter,
51+
duration: const Duration(milliseconds: 1000),
52+
),
4853
),
4954
],
5055
),

0 commit comments

Comments
 (0)