@@ -8,6 +8,12 @@ class IndicatorController extends Animation<double>
88 ClampingWithOverscrollPhysicsState {
99 double _value;
1010
11+ /// Represents the **minimum** value that an indicator can have.
12+ static double get minValue => 0.0 ;
13+
14+ /// Represents the **maximum** value that an indicator can have.
15+ static double get maxValue => 1.5 ;
16+
1117 /// Current indicator value / progress
1218 @override
1319 double get value => _value;
@@ -211,7 +217,7 @@ class IndicatorController extends Animation<double>
211217 @override
212218 AnimationStatus get status => state.isIdle ? AnimationStatus .dismissed : AnimationStatus .forward;
213219
214- /// Returns a [ClampedAnimation] that constrains the animation value of its parent
220+ /// Returns [ClampedAnimation] that constrains the animation value of its parent
215221 /// within the given [min] and [max] range.
216222 ///
217223 /// - [min] represents the smallest value the animation can have. If the parent
@@ -223,4 +229,22 @@ class IndicatorController extends Animation<double>
223229 min: min,
224230 max: max,
225231 );
232+
233+ /// Returns [TransformedAnimation] , which transforms the animation value of its parent
234+ /// to the specified [min] and [max] range.
235+ ///
236+ /// - [min] represents the smallest value the animation can have.
237+ /// - [max] represents the largest value the animation can have.
238+ ///
239+ /// If instead of transforming the entire range of controller values, you want to use only a specific range, see the [clamp] method.
240+ Animation <double > transform (double min, double max) => TransformedAnimation (
241+ parent: this ,
242+ fromMin: minValue,
243+ fromMax: maxValue,
244+ toMin: min,
245+ toMax: max,
246+ );
247+
248+ /// Returns a new animation with the controller value transformed to the range from `0.0` to `1.0` inclusive.
249+ Animation <double > normalize () => transform (0.0 , 1.0 );
226250}
0 commit comments