File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
lib/screens/events_timeline/desktop Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -359,7 +359,13 @@ class Timeline extends ChangeNotifier {
359
359
DateTime get currentDate => date.add (currentPosition);
360
360
361
361
void seekTo (Duration position) {
362
- currentPosition = position;
362
+ if (position < Duration .zero) {
363
+ currentPosition = Duration .zero;
364
+ } else if (position > endPosition) {
365
+ currentPosition = endPosition;
366
+ } else {
367
+ currentPosition = position;
368
+ }
363
369
notifyListeners ();
364
370
365
371
forEachEvent ((tile, event) async {
@@ -375,8 +381,6 @@ class Timeline extends ChangeNotifier {
375
381
});
376
382
}
377
383
378
- // TODO(bdlukaa): Only make it possible to seek between bounds.
379
- // Currently, is is possible to seek before and after the day.
380
384
/// Seeks forward by [duration]
381
385
void seekForward ([Duration duration = const Duration (seconds: 15 )]) =>
382
386
seekTo (currentPosition + duration);
You can’t perform that action at this time.
0 commit comments