interpolate 1.0.2+2 copy "interpolate: ^1.0.2+2" to clipboard
interpolate: ^1.0.2+2 copied to clipboard

discontinuedreplaced by: remaths

A dart plugin to interpolate values. This plugin interpolates the values within a range of values.

interpolate #

A dart plugin to interpolate range of values

Usage #

import 'package:interpolate/interpolate.dart';

Interpolate interpolate = Interpolate(
    inputRange: [10, 20, 30],
    outputRange: [1, 0, 1],
    extrapolate: Extrapolate.clamp,
);
interpolate.eval(15); // returns 0.5

NOTE #

The inputRange have to be increasing else it might not get the expected result of might throw an error or returns null; The length of the outputRange have to be equal to the output range

The Extrapolate Enum #

enum Extrapolate {
  extend, // No clamping
  clamp, // Clamps both ends
  clampStart, // clamps the value to the start and extend the end
  clampEnd, // clamps the value to the end and extend the start
}

6
likes
30
pub points
35%
popularity

Publisher

unverified uploader

A dart plugin to interpolate values. This plugin interpolates the values within a range of values.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on interpolate