flutter_time_picker_spinner icon indicating copy to clipboard operation
flutter_time_picker_spinner copied to clipboard

onTimeChange() getting called without any user interaction

Open willhaslett opened this issue 4 years ago • 1 comments

The widget renders fine, but onTimeChange() is getting called upon the initial widget build, without the user having touched the screen. Can I prevent this?

willhaslett avatar Jan 07 '21 16:01 willhaslett

Just comment out this piece of code in the iniState() inside the package file

 if (widget.onTimeChange != null) {
      WidgetsBinding.instance!
          .addPostFrameCallback((_) => widget.onTimeChange!(getDateTime()));
    }

Mohsin0344 avatar Jan 24 '24 13:01 Mohsin0344