【发布时间】:2021-06-13 06:25:42
【问题描述】:
我在我的应用程序中使用这个包https://pub.dev/packages/stop_watch_timer 来跟踪正在播放的音乐。但是,如果我想通过更改秒表上的时间来更改歌曲,它会说我必须先重置计时器,我已经完成了。如果我第二次按下按钮,它就会起作用。这是代码:
final StopWatchTimer _stopWatchTimer = StopWatchTimer(
mode: StopWatchMode.countUp,
onChangeRawSecond: (value) => print('onChangeRawSecond $value'),
);
void change_timer_value(int song_index) {
int new_time = TimerState(
song_index: song_index,
record_side: current_side_list(
record_sides[selectedValue], widget.album_data))
.get_start_value();
print(new_time);
_stopWatchTimer.onExecute.add(StopWatchExecute.reset);
_stopWatchTimer.setPresetSecondTime(new_time); // this is where I set new time
}
我不知道如何解决这个问题。我已经在创作者 GitHub 上创建了一个问题,但没有任何回应。所以这里有人可以帮助我
【问题讨论】:
标签: flutter dart timer package