From 99248c2224259976222c01905b587ad99cbce20f Mon Sep 17 00:00:00 2001 From: Vincent Velociter Date: Mon, 31 Jul 2023 17:10:29 +0200 Subject: [PATCH] Add assertions to NonLinearSlider --- lib/src/widgets/non_linear_slider.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/widgets/non_linear_slider.dart b/lib/src/widgets/non_linear_slider.dart index e373d882f2..1b3dcd5e05 100644 --- a/lib/src/widgets/non_linear_slider.dart +++ b/lib/src/widgets/non_linear_slider.dart @@ -3,13 +3,14 @@ import 'package:flutter/material.dart'; /// Platform adaptive slider that allows for non-linear values. class NonLinearSlider extends StatefulWidget { - const NonLinearSlider({ + NonLinearSlider({ required this.value, required this.values, this.labelBuilder, this.onChangeEnd, super.key, - }); + }) : assert(values.length > 1), + assert(values.contains(value)); final num value; final List values;