From 51e00b31dd0b91a0801944f8b8b5bf2c25d59a4f Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Sun, 5 Feb 2023 17:14:01 +0300 Subject: [PATCH] Update widget_dialog_picker_photography_value.dart --- .../widget_dialog_picker_photography_value.dart | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart b/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart index a8cc72a..0d30042 100644 --- a/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart +++ b/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart @@ -1,4 +1,3 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/data/models/photography_values/photography_value.dart'; @@ -37,19 +36,8 @@ class PhotographyValuePickerDialog extends StatefulW class _PhotographyValuePickerDialogState extends State> { late T _selectedValue = widget.initialValue; - late final _scrollController = ScrollController(); - - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addPostFrameCallback((_) { - _scrollController.jumpTo(clampDouble( - Dimens.grid56 * widget.values.indexOf(_selectedValue), - _scrollController.position.minScrollExtent, - _scrollController.position.maxScrollExtent, - )); - }); - } + late final _scrollController = + ScrollController(initialScrollOffset: Dimens.grid56 * widget.values.indexOf(_selectedValue)); @override void dispose() {