title: Pass Freezed Constructor Tear-Off to Generic Widget
body: <p>What the title says. I have a freezed constructor tear-off that I'm trying to pass to a Widget and it's not returning null, and I'm trying to figure out what I'm doing wrong. Here is the freezed class:</p>
  <pre><code>@freezed
  class PatientField with SetFieldOption, _$PatientField {
    factory PatientField.firstName(String value) = PatientFirstName;
  }
  </code></pre>
  <p>This is a simplified version of my initial Widget (which actually displays properly):</p>
  <pre><code>class SinglePatientView2 extends ConsumerWidget {
    const SinglePatientView2({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context, WidgetRef ref) {
      print(PatientField.firstName('something'));
      return Theme(
          data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
          child: Expanded(
              child: DefaultTabController(
                  length: 1,
                  child: Scaffold(
                      body: TabBarView(children: [
                    PersonTabContent&lt;PatientField&gt;(
                      PatientField.firstName,
                    )
                  ])))));
    }
  }
  </code></pre>
  <p>Then Widget that's called above looks like (simplifed version anyway):</p>
  <pre><code>class PersonTabContent&lt;T&gt; extends StatelessWidget {
    const PersonTabContent(
      this.firstNameField, {
      Key? key,
    }) : super(key: key);
  
    final T Function(String) firstNameField;
  
    @override
    Widget build(BuildContext context) {
    print(firstNameField('something'));
      return Padding(
        padding: EdgeInsets.all(doubleBySize(context, 32)),
      );
    }
  }
  </code></pre>
  <p>Looking at the output, the above prints:</p>
  <pre><code>PatientField.firstName(value: something)
  null
  </code></pre>
  <p>I don't understand why I'm getting a null value in the second Widget's build method. Any insights as to what I'm doing wrong?</p>