Commit 691c25fa authored by Dragoș Tiselice's avatar Dragoș Tiselice Committed by GitHub

Renamed Step curve to Threshold. (#5755)

In the interest of using the name in the case of Material steppers,
this commit renames Step curve to Threshold.
parent e47a421e
......@@ -112,11 +112,11 @@ class Interval extends Curve {
}
/// A curve that is 0.0 until it hits the threshold, then it jumps to 1.0.
class Step extends Curve {
/// Creates a step cruve.
class Threshold extends Curve {
/// Creates a threshold curve.
///
/// The [threshold] argument must not be null.
const Step(this.threshold);
const Threshold(this.threshold);
/// The value before which the curve is 0.0 and after which the curve is 1.0.
///
......
......@@ -125,7 +125,7 @@ class _DropDownMenuState<T> extends State<_DropDownMenu<T>> {
_resize = new CurvedAnimation(
parent: config.route.animation,
curve: const Interval(0.25, 0.5),
reverseCurve: const Step(0.0)
reverseCurve: const Threshold(0.0)
);
}
......@@ -145,7 +145,7 @@ class _DropDownMenuState<T> extends State<_DropDownMenu<T>> {
for (int itemIndex = 0; itemIndex < route.items.length; ++itemIndex) {
CurvedAnimation opacity;
if (itemIndex == route.selectedIndex) {
opacity = new CurvedAnimation(parent: route.animation, curve: const Step(0.0));
opacity = new CurvedAnimation(parent: route.animation, curve: const Threshold(0.0));
} else {
final double start = (0.5 + (itemIndex + 1) * unit).clamp(0.0, 1.0);
final double end = (start + 1.5 * unit).clamp(0.0, 1.0);
......
......@@ -152,7 +152,7 @@ class SnackBar extends StatelessWidget {
if (action != null)
children.add(action);
CurvedAnimation heightAnimation = new CurvedAnimation(parent: animation, curve: _snackBarHeightCurve);
CurvedAnimation fadeAnimation = new CurvedAnimation(parent: animation, curve: _snackBarFadeCurve, reverseCurve: const Step(0.0));
CurvedAnimation fadeAnimation = new CurvedAnimation(parent: animation, curve: _snackBarFadeCurve, reverseCurve: const Threshold(0.0));
ThemeData theme = Theme.of(context);
return new ClipRect(
child: new AnimatedBuilder(
......
......@@ -25,8 +25,8 @@ void main() {
expect(flippedEase, hasOneLineDescription);
});
test('Step has a step', () {
Curve step = new Step(0.25);
test('Threshold has a threshold', () {
Curve step = new Threshold(0.25);
expect(step.transform(0.0), 0.0);
expect(step.transform(0.24), 0.0);
expect(step.transform(0.25), 1.0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment