freezed icon indicating copy to clipboard operation
freezed copied to clipboard

Allow $ in class name

Open Kiruel opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. I'm looking for a way to allow $ in class when freeze generate class. Let me explain. I use Mutation/Query from https://pub.dev/packages/graphql_codegen. So I got class model like this Mutation$GetUserToken with a $. But when I try to use freezed like this:

@Freezed(makeCollectionsUnmodifiable: false)
class Success with _$Success {
  const factory Success.refreshToken(
      Mutation$GetUserToken token) = RefreshTokenSuccess;
}

Freeze generate this:

required TResult Function(GetUserToken token) refreshSendBirdToken,

Without the $. It should be:

required TResult Function(Mutation$GetUserSendBirdToken token) refreshSendBirdToken,

Describe the solution you'd like Could be good to allow $ for name separating, a solution can be found for the moment here , it allow to change the naming separator but by default is $.

Kiruel avatar Jul 22 '22 07:07 Kiruel