Last active
October 31, 2019 21:58
-
-
Save bsutton/a5175401516dbb9242a0edec4c89fef6 to your computer and use it in GitHub Desktop.
Future sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
List<Future<Option>> options = [Future.value(Option(2)), Future.value(Option(3)), Future.value(Option(1))]; | |
options.sort((lhs, rhs) => lhs.ordinal - rhs.ordinal); | |
} | |
class Option | |
{ | |
int _ordinal; | |
Option(this._ordinal); | |
int get ordinal | |
{ | |
return _ordinal; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment