Does this resolve your issue?
@freezed
class CounterState with _$CounterState {
const factory CounterState({required int count}) = _CounterState;
factory CounterState.initial() => const CounterState(count: 0);
}
Instead of required count
, replace that with required int count
.