spring can be null drag must not be

This commit is contained in:
Hans Muller 2015-07-24 15:51:33 -07:00
parent 6c639ee389
commit 66f064eabf

View File

@ -18,12 +18,11 @@ class ScrollSimulation extends SimulationGroup {
double _offset = 0.0;
ScrollSimulation(double position, double velocity, double leading,
double trailing, [SpringDescription spring, double drag])
double trailing, SpringDescription spring, double drag)
: _leadingExtent = leading,
_trailingExtent = trailing,
_springDesc = spring,
_drag = drag {
assert((spring != null && drag != null) || (spring == null && drag == null));
_chooseSimulation(position, velocity, 0.0);
}