Home > Software design >  i want to add to the default value
i want to add to the default value

Time:11-17

i want to add 10 to $counter. It works when i change it from counter 10 to counter but it will increment by 1

int counter = 0;
   
 _incrementCounter10() {
    setState(() {
      counter   10;
    });
  }

Text('$counter')

 InkWell(onTap: (){_incrementCounter10;})

CodePudding user response:

To add 10 in your $counter variable you can edit your setState() function from

counter   10;

to

counter  = 10;
  • Related