File tree Expand file tree Collapse file tree 1 file changed +19
-14
lines changed
Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Original file line number Diff line number Diff line change 1+ import 'dart:math' ;
2+
13import 'package:flutter/material.dart' ;
2- import 'package:google_fonts/google_fonts.dart' ;
34import 'package:hyper_effects/hyper_effects.dart' ;
45
56class 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 ),
You can’t perform that action at this time.
0 commit comments