title: How to return other condition based result in orElse in dart based firstWhere
body: <p>I have gone through some of the conditions based threads here on stack for the same type of questions but the output is not what I am looking for.</p>
  <p>below is what I am currently doing with my code which is working but is bad practice from my perspective though I can be wrong and is the way things needs to be done!</p>
  <p>method 1:</p>
  <pre><code>transData = data.translations.firstWhere(
              (element) =&gt; element.langCode == langCode,
              orElse: () =&gt; null);
          transData = (transData == null)
              ? data.translations.firstWhere(
                  (element) =&gt; element.langCode == 'en-IN',
                  orElse: () =&gt; null)
              : transData;
  </code></pre>
  <p>method 2:</p>
  <pre><code>transData = data.translations.firstWhere(
              (element) =&gt; element.langCode == langCode,
              orElse: () =&gt; data.translations.firstWhere(
                  (element) =&gt; element.langCode == 'en-IN',
                  orElse: () =&gt; null));
  
  </code></pre>
  <p>you can clearly see what I want is check if the given condition is true then return result based on that else based on default <code>langCode</code>. for this <code>orElse</code> is the best place to do so but getting error for the same if the code is as following:</p>
  <p>code:</p>
  <pre><code>transData = data.translations.firstWhere(
              (element) =&gt; element.langCode == langCode,
              orElse: (element) =&gt; element.langCode == 'en-IN');
  </code></pre>
  <p>error:</p>
  <pre><code>The argument type 'ModelName Function(dynamic)' can't be assigned to the parameter type 'ModelName Function()'.
  </code></pre>
  <p>I don't want a null result as because the default <code>langCode</code> based record always exist if a entry for a parent record exist.</p>