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 { ...@@ -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. /// A curve that is 0.0 until it hits the threshold, then it jumps to 1.0.
class Step extends Curve { class Threshold extends Curve {
/// Creates a step cruve. /// Creates a threshold curve.
/// ///
/// The [threshold] argument must not be null. /// 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. /// 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>> { ...@@ -125,7 +125,7 @@ class _DropDownMenuState<T> extends State<_DropDownMenu<T>> {
_resize = new CurvedAnimation( _resize = new CurvedAnimation(
parent: config.route.animation, parent: config.route.animation,
curve: const Interval(0.25, 0.5), 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>> { ...@@ -145,7 +145,7 @@ class _DropDownMenuState<T> extends State<_DropDownMenu<T>> {
for (int itemIndex = 0; itemIndex < route.items.length; ++itemIndex) { for (int itemIndex = 0; itemIndex < route.items.length; ++itemIndex) {
CurvedAnimation opacity; CurvedAnimation opacity;
if (itemIndex == route.selectedIndex) { 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 { } else {
final double start = (0.5 + (itemIndex + 1) * unit).clamp(0.0, 1.0); 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); final double end = (start + 1.5 * unit).clamp(0.0, 1.0);
......
...@@ -152,7 +152,7 @@ class SnackBar extends StatelessWidget { ...@@ -152,7 +152,7 @@ class SnackBar extends StatelessWidget {
if (action != null) if (action != null)
children.add(action); children.add(action);
CurvedAnimation heightAnimation = new CurvedAnimation(parent: animation, curve: _snackBarHeightCurve); 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); ThemeData theme = Theme.of(context);
return new ClipRect( return new ClipRect(
child: new AnimatedBuilder( child: new AnimatedBuilder(
......
...@@ -25,8 +25,8 @@ void main() { ...@@ -25,8 +25,8 @@ void main() {
expect(flippedEase, hasOneLineDescription); expect(flippedEase, hasOneLineDescription);
}); });
test('Step has a step', () { test('Threshold has a threshold', () {
Curve step = new Step(0.25); Curve step = new Threshold(0.25);
expect(step.transform(0.0), 0.0); expect(step.transform(0.0), 0.0);
expect(step.transform(0.24), 0.0); expect(step.transform(0.24), 0.0);
expect(step.transform(0.25), 1.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