unSelect method

Future<void> unSelect(
  1. {bool success = false}
)

Implementation

Future<void> unSelect({bool success = false}) async {
  setState(() {
    selected = false;
    selectionRepeat = false;
  });
  if (success) {
    t = Timer.periodic(const Duration(milliseconds: 1), (Timer timer) {
      setState(() {
        buttonColor = CupertinoColors.lightBackgroundGray;
      });
    });
    setState(() {
      buttonColor = CupertinoColors.lightBackgroundGray;
    });
    await Future<void>.delayed(const Duration(milliseconds: 300), () {
      setState(() {
        t.cancel();
        buttonColor = colors[widget.resultValueNotifier.cross
            .getGrid[widget.position.first][widget.position.second]];
        // buttonColor = CupertinoColors.systemGrey;
      });
    });
  }
}