title: Freezed class with generic callback
body: <p>I would like to define a freezed class [https://pub.dev/packages/freezed] with a generic callback.</p>
  <p>Freezed class:</p>
  <pre><code>import 'package:freezed_annotation/freezed_annotation.dart';
  
  part 'foo.freezed.dart';
  
  @freezed
  abstract class Foo&lt;T&gt; with _$Foo {
    factory Foo({
      // String Function() callBackOne,
      String Function(T) callBackTwo,
    }) = _Foo;
  }
  </code></pre>
  <p>Widget using the Freezed class:</p>
  <pre><code>class MyHomePage extends StatelessWidget {
    // final fooOne = Foo&lt;int&gt;(callBackOne: () =&gt; 'Result: 42');
    final fooTwo = Foo&lt;int&gt;(callBackTwo: (value) =&gt; 'Result: ${value * 3}');
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Center(
          child: Text(fooTwo.callBackTwo(14)),
        ),
      );
    }
  }
  </code></pre>
  <p>Error:</p>
  <pre><code>lib/foo.freezed.dart:128:26: Error: The return type of the method '_Foo.callBackTwo' is 'String Function(T)', which does not match the return type, 'String Function(dynamic)', of the overridden method, '_$Foo.callBackTwo'.
  Change to a subtype of 'String Function(dynamic)'.
    String Function(T) get callBackTwo;
                           ^
  lib/foo.freezed.dart:31:26: Context: This is the overridden method ('callBackTwo').
    String Function(T) get callBackTwo;
  
                           ^
  </code></pre>
  <p>Do you know what is wrong with my code? Is it a limitation of Freezed? Do you know a workaround?</p>
  <p>Thank you!!!</p>