diff --git a/lib/features/scene/widgets/alert_dialogs/alert_dialog_slider_steps.dart b/lib/features/scene/widgets/alert_dialogs/alert_dialog_slider_steps.dart index 2b6b594..989df8c 100644 --- a/lib/features/scene/widgets/alert_dialogs/alert_dialog_slider_steps.dart +++ b/lib/features/scene/widgets/alert_dialogs/alert_dialog_slider_steps.dart @@ -70,19 +70,41 @@ class _AlertDialogSliderStepsState extends State { selectedColor: Colors.white, color: ColorsManager.blackColor, fillColor: ColorsManager.primaryColorWithOpacity, - constraints: const BoxConstraints(minHeight: 30, minWidth: 30), - children: const [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 30.0), - child: Text("<"), + borderColor: ColorsManager.greyColor, + constraints: BoxConstraints.tight(const Size(70, 30)), + children: [ + SizedBox( + width: 70, + height: 30, + child: Container( + color: selectedToggleIndex == 0 + ? ColorsManager.primaryColorWithOpacity + : ColorsManager.greyColor, + alignment: Alignment.center, + child: const Text("<"), + ), ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 30.0), - child: Text("="), + SizedBox( + width: 70, + height: 30, + child: Container( + color: selectedToggleIndex == 1 + ? ColorsManager.primaryColorWithOpacity + : ColorsManager.greyColor, + alignment: Alignment.center, + child: const Text("="), + ), ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 30.0), - child: Text(">"), + SizedBox( + width: 70, + height: 30, + child: Container( + color: selectedToggleIndex == 2 + ? ColorsManager.primaryColorWithOpacity + : ColorsManager.greyColor, + alignment: Alignment.center, + child: const Text(">"), + ), ), ], ), @@ -97,7 +119,11 @@ class _AlertDialogSliderStepsState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ TitleMedium( - text: groupValue?.toStringAsFixed(1) ?? "0", + text: groupValue != null + ? (groupValue! % 1 == 0 + ? groupValue!.toStringAsFixed(0) + : groupValue!.toStringAsFixed(1)) + : "0", style: context.titleMedium.copyWith( color: ColorsManager.primaryColorWithOpacity, fontSize: 30, @@ -114,22 +140,26 @@ class _AlertDialogSliderStepsState extends State { ], ), const SizedBox(height: 8), - Slider( - value: groupValue ?? 0, - min: operation.minValue?.toDouble() ?? 0, - max: operation.maxValue?.toDouble() ?? 0, - inactiveColor: ColorsManager.primaryColorWithOpacity, - divisions: operation.stepValue != null - ? ((operation.maxValue!.toDouble() - - operation.minValue!.toDouble()) / - operation.stepValue!.toDouble()) - .round() - : null, - onChanged: (value) { - setState(() { - groupValue = value; - }); - }, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Slider( + value: groupValue ?? 0, + min: operation.minValue?.toDouble() ?? 0, + max: operation.maxValue?.toDouble() ?? 0, + inactiveColor: ColorsManager.primaryColorWithOpacity + .withOpacity(0.2), + divisions: operation.stepValue != null + ? ((operation.maxValue!.toDouble() - + operation.minValue!.toDouble()) / + operation.stepValue!.toDouble()) + .round() + : null, + onChanged: (value) { + setState(() { + groupValue = value; + }); + }, + ), ), const SizedBox(height: 12), ],