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
I hope Dart devs will add range of values and range checking in switch/case operators - check if value is in range, check array elements, check multiple variables with same switch operator.
For example:
int i=27;
switch (i) {
case 1..30:
break;
default:
}
List<int> a=[1,5,7,14,25,30];
switch (a) {
case a.contains(5):
break;
case a[1..4]>0:
break;
}
switch ([a,i] /*(or just a,i)*/ ) {
case i==5:
case a[1..4]>0:
break;
case a[i] !=0:
break;
}
The text was updated successfully, but these errors were encountered:
mit-mit
added
request
Requests to resolve a particular developer problem
and removed
feature
Proposed language feature that solves one or more problems
labels
Feb 3, 2020
I hope Dart devs will add range of values and range checking in switch/case operators - check if value is in range, check array elements, check multiple variables with same switch operator.
For example:
The text was updated successfully, but these errors were encountered: