-
Notifications
You must be signed in to change notification settings - Fork 0
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
Function not creating Set #1
Comments
@Entrebear |
It was accidentally closed and has been reopened. |
@Entrebear void debug1() {
print('==debug1==');
final Map<String, num> tempcatmap = {
'cat1': 1,
'cat2': 2,
'cat3': 2,
'cat4': 3
};
final tempset = randomMultipleWeightedChoice(tempcatmap, 1, null);
print(tempset);
final tempstring = tempset.elementAt(0);
print(tempstring);
} Result:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to use the randomMultipleWeightedChoice function to get a weighted random element as a result, from a Map of Strings and integers. However it does not seem to be creating the resulting Set. I am using the latest version of Flutter and package. When I try print the resulting set it doesn't show anything.
Code
Map that I'm passing in (result of print of the Map)
{cat1: 4, cat2: 2, cat3: 2, cat4: 3}
Error from console
The text was updated successfully, but these errors were encountered: