Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is support for mapping class with generic type? #85

Closed
putrautama007 opened this issue Mar 10, 2023 · 2 comments
Closed

Is support for mapping class with generic type? #85

putrautama007 opened this issue Mar 10, 2023 · 2 comments

Comments

@putrautama007
Copy link

Hello,
I want to ask is smartstruct support to mapping class with generic type?
Thank you

@namlxcntt
Copy link

I have using freezed and json

Same class

`
@freezed(genericArgumentFactories: true)
class ResponseWrapper with _$ResponseWrapper{
const factory ResponseWrapper ({
final int? status,
final T? data,
final String? message
}) = _ResponseWrapper;

factory ResponseWrapper.fromJson(Map<String, dynamic> json,
T Function(Object? json) fromJsonT)
=> _$ResponseWrapperFromJson(json, fromJsonT);
}`

@putrautama007
Copy link
Author

I have using freezed and json

Same class

` @freezed(genericArgumentFactories: true) class ResponseWrapper with _$ResponseWrapper{ const factory ResponseWrapper ({ final int? status, final T? data, final String? message }) = _ResponseWrapper;

factory ResponseWrapper.fromJson(Map<String, dynamic> json, T Function(Object? json) fromJsonT) => _$ResponseWrapperFromJson(json, fromJsonT); }`

okay thank you for help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants