title: How do I refactor nest if-statements for this block of code?
body: <p>In what way can I refactor nested if statements like this? A condition is met, however there are some exceptions to the condition. I recognize that this starts to approach the <a href="http://wiki.c2.com/?ArrowAntiPattern" rel="nofollow noreferrer">Arrow Anti-Pattern</a>.</p>
  <p>Specifically, are there any dart language features that can help me refactor or re-write this code to be more clear?</p>
  <p>Let's use &quot;leap years&quot; as an example:</p>
  <pre class="lang-dart prettyprint-override"><code>// on every year that is evenly divisible by 4
  //   except every year that is evenly divisible by 100
  //     unless the year is also evenly divisible by 400
  bool isLeapYear(int year) {
    assert(!year.isNegative);
    if (year % 4 == 0) {
      if (year % 100 == 0) {
        if (year % 400 == 0) {
          return true;
        }
        return false;
      }
      return true;
    }
    return false;
  }
  </code></pre>