Skip to content

Instantly share code, notes, and snippets.

@ThinkDigitalSoftware
Created October 17, 2019 00:41
Show Gist options
  • Save ThinkDigitalSoftware/daad02b4d63342e05e12daa615150caf to your computer and use it in GitHub Desktop.
Save ThinkDigitalSoftware/daad02b4d63342e05e12daa615150caf to your computer and use it in GitHub Desktop.
multiple maps example
void main() async {
print(people);
print("Changing color to light Blue");
colors[1] = 'Light Blue';
print(people);
}
class Person{
String name;
int colorIndex;
Person({this.name, this.colorIndex});
toString()=> "Person{name: $name, color: ${colors[colorIndex]}}";
}
List<Person> people = [Person(name: "Jon", colorIndex:1)];
Map<int, String> colors = {1: 'Blue', 2: 'Red'};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment