Last active
February 7, 2023 00:05
-
-
Save timsneath/a75fd9f76b5b61c42676c9232160d14d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// A simple example of records and patterns | |
(double x, double y) getLocation(String name) { | |
if (name == 'Nairobi') { | |
return (1.2921, 36.8219); | |
} | |
else { | |
return (0, 0); | |
} | |
} | |
void main(List<String> args) { | |
final (lat, long) = getLocation('Nairobi'); | |
print('Current location: $lat, $long'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment