dev/flutter

[Flutter] Timer, custom delay point

donguran 2024. 1. 15. 14:16
728x90
반응형

first you should make Timer class.

 

import 

import 'dart:async';

 

 

make timer instance, and if you want use your want point it will be create instance.

Timer? controllerHideDelayTimer;
if (controllerHideDelayTimer != null) {
  controllerHideDelayTimer!.cancel();
}

controllerHideDelayTimer = Timer(
  const Duration(seconds: 3),
  () {
    setState(() {
      isShowPlayerController = false;
    });
  },
);

 

 

 

728x90
반응형