From d078aea32be4b53856b5c854bc8331591e05349d Mon Sep 17 00:00:00 2001 From: Sergey Kondrikov Date: Mon, 26 Jun 2023 19:54:08 +0300 Subject: [PATCH] Normalize progress bar value (#2967) --- mobile/lib/modules/asset_viewer/views/gallery_viewer.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart b/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart index ba0f44ad09..add28eae46 100644 --- a/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart +++ b/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'dart:math'; import 'package:easy_localization/easy_localization.dart'; import 'package:auto_route/auto_route.dart'; import 'package:cached_network_image/cached_network_image.dart'; @@ -310,9 +311,12 @@ class GalleryViewerPage extends HookConsumerWidget { child: Slider( value: playerValue.duration == Duration.zero ? 0.0 - : playerValue.position.inMicroseconds / - playerValue.duration.inMicroseconds * + : min( + playerValue.position.inMicroseconds / + playerValue.duration.inMicroseconds * + 100, 100, + ), min: 0, max: 100, thumbColor: Colors.white,