toggleVisible method
Function to auto hide the button class.
Implementation
void toggleVisible({int autoHideButtonTime = 5}) async {
if (!(value.visible)) {
value = value.copyWith(visible: !(value.visible));
timer = Timer(Duration(seconds: autoHideButtonTime), () {
if (!(value.visible)) return;
value = value.copyWith(visible: !(value.visible));
});
} else {
timer?.cancel();
value = value.copyWith(visible: !(value.visible));
}
}