You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The models generated by Freezed are very useful for many developers, including me ! So first of all, thank you for this package.
However, there's one feature that might be nice to implement, that's the ability to switch from a model M1 to a model M2 :
We will therefore have a method for switching from UserToInsert to UserData and vice versa.
Note : Similar fields do not need to be redefined.
const userToInsert =UserToInsert(username:'toto');
final newUserData = userToInsert.toUserData(
id:'1-e5',
// No need to redefine username
createdAt:DateTime.now(),
);
Using this method, you can have models for insertions into databases (where the id and other fields are given directly in the backend) and easily convert them into a "normal" model.
However, static metaprogramming may be mandatory for this type of method.
The text was updated successfully, but these errors were encountered:
Hello,
The models generated by Freezed are very useful for many developers, including me ! So first of all, thank you for this package.
However, there's one feature that might be nice to implement, that's the ability to switch from a model M1 to a model M2 :
We will therefore have a method for switching from UserToInsert to UserData and vice versa.
Note : Similar fields do not need to be redefined.
Currently the workaround is :
Using this method, you can have models for insertions into databases (where the id and other fields are given directly in the backend) and easily convert them into a "normal" model.
However, static metaprogramming may be mandatory for this type of method.
The text was updated successfully, but these errors were encountered: