title: Dart: What's the best practice between using ternary and if conditions in a widget tree
body: <p>I've been wondering what's the best practice for conditional widget trees between using ternaries and if-else-blocks.</p>
  <p>Following guides online, I feel people use mostly ternaries but I find them quite unreadable when they exceed a single line :</p>
  <p><a href="https://i.stack.imgur.com/R62OQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R62OQ.png" alt="double ternary" /></a></p>
  <p>So I tend to create a fonction and make an if-else-block when my ternary are too long :</p>
  <pre><code>floatingActionButton: selectedLicences.isEmpty //
            ? Container()
            : LicencesWidget(selectedLicences: selectedLicences)
  </code></pre>
  <pre><code>Widget _buildFAB(List&lt;X&gt; licences) {
      if (licences.isEmpty) {
        return Container();
      } else {
        return LicencesWidget(selectedLicences: licences);
      }
    }
  </code></pre>
  <p>What's the best practice?</p>