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

Make it easier to construct a single-bit LogicValues and LogicValue from a single bool #34

Closed
mkorbel1 opened this issue Oct 26, 2021 · 5 comments · Fixed by #71
Closed
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mkorbel1
Copy link
Contributor

Is your feature request related to a problem? Please describe.
To build a LogicValues using existing constructors from a bool can be a bit verbose:

LogicValues.from([myBool ? LogicValue.one : LogicValue.zero]);

Describe the solution you'd like
It would be nice to do something like:

LogicValues.fromBool(myBool);

Something similar in LogicValue would be nice too.

@mkorbel1 mkorbel1 added enhancement New feature or request good first issue Good for newcomers labels Oct 26, 2021
@soham4abc
Copy link

Can I work on this issue? If possible pls assign then.

@mkorbel1
Copy link
Contributor Author

@soham4abc yes, thanks for volunteering!

@soham4abc
Copy link

LogicValues.from([myBool ? LogicValue.one : LogicValue.zero]); I Could not find this implementation in the codebase. It would be helpful if you point out the exact file that needs to be changed

@mkorbel1
Copy link
Contributor Author

You'll need to change code in these two files:
lib/src/values/logic_values.dart
lib/src/values/logic_value.dart

Note that LogicValues is an abstract class with three different implementations. You can look at LogicValues.filled for reference on how to add a new one. Let me know if you need any additional guidance!

@mkorbel1
Copy link
Contributor Author

mkorbel1 commented Nov 2, 2021

@soham4abc let me know if you need any help or have any questions!

@mkorbel1 mkorbel1 linked a pull request Dec 23, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants