title: How to deal with null parameters in ui event handlers where null makes no sense
body: <p>Before I updated my dart version to support only non-null that code was working fine:</p>
  <pre><code>Radio(
                value: ExcerciseType.weight,
                groupValue: type,
                onChanged: (ExcerciseType value) {
                  appState.exerciseType = value;
                },
              ),
  </code></pre>
  <p>Now the compiler complaints:</p>
  <pre><code>&quot;The argument type 'void Function(ExcerciseType)' can't be assigned to the parameter type 'void Function(ExcerciseType?)?'.&quot;,
  </code></pre>
  <p>This would fix it:</p>
  <pre><code> onChanged: (ExcerciseType? value) {
                      appState.exerciseType = value as ExcerciseType;
        },
  </code></pre>
  <p>but that fix is not logical at all. With the as cast I just say value might be null at runtime and appState.exerciseType can accept null values but that is not true at all! appState.ExerciseType is of type ExcerciseType and not ExcerciseType?.</p>
  <p>What do I not understand here?</p>