Hello,
I suggest that the child function must be typed as T :
class NyListView<T> extends StatefulWidget {
final Function() data;
final dynamic Function(List<T> data)? transform;
final Widget Function(BuildContext context, T data) child; /// <- Dynamic is replaced by T