samarthagarwal / FlutterScreens

A collection of Screens and attractive UIs built with Flutter ready to be used in your applications. No external libraries are used. Just download, add to your project and use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to use timer.cancel() ? and it not work

liuchuancong opened this issue · comments

      setState(() {
        tweenIndex = (tweenIndex + 1) % colors.length;
      });
    });

and I add this code

floatingActionButton: FloatingActionButton(
        child: Icon(Icons.refresh),
        onPressed: (){
          timer.cancel();
        },
      ),

i try to cancel timer but it not work