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

Question - Generating Realm models with named parameters for required and optional fields #680

Closed
n-doton opened this issue Jun 20, 2022 · 2 comments
Assignees
Labels
O-Community Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@n-doton
Copy link

n-doton commented Jun 20, 2022

@RealmModel()
class _IceCream {
  late String flavour;
  late String cone;
  late int scoops;
}

When generating a Realm model from an _IceCream class as shown above, is there a way to force named fields for both required and optional parameters when creating or accessing an instance of IceCream? Currently, an instance is created like this:

IceCream iceCream = IceCream('vanilla', 'regular', 2)

However, we would prefer to name all parameters, as shown below:

IceCream iceCream = IceCream(flavour: 'vanilla', cone: 'regular', scoops: 2)
@lukaspili
Copy link

Seems like a duplicate of #292

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Jun 23, 2022
@desistefanova
Copy link
Contributor

Hi @n-doton,
You can find my answer and suggestion in duplicated issue here.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
O-Community Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
Development

No branches or pull requests

4 participants