Commit 1633ac7f authored by Chinmay Garde's avatar Chinmay Garde

Use the more concise syntax for initialization of variables in the constructor

parent 7b77043e
...@@ -16,10 +16,8 @@ class SpringDescription { ...@@ -16,10 +16,8 @@ class SpringDescription {
/// constructor provided for this purpose /// constructor provided for this purpose
final double damping; final double damping;
SpringDescription({double mass, double springConstant, double damping}) SpringDescription(
: mass = mass, {double this.mass, double this.springConstant, double this.damping}) {
springConstant = springConstant,
damping = damping {
assert(mass != null); assert(mass != null);
assert(springConstant != null); assert(springConstant != null);
assert(damping != null); assert(damping != null);
......
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