Skip to content

Instantly share code, notes, and snippets.

@serpicokhan
Created May 16, 2022 14:46
Show Gist options
  • Select an option

  • Save serpicokhan/affcceec77266845b2bde9dba18e0b97 to your computer and use it in GitHub Desktop.

Select an option

Save serpicokhan/affcceec77266845b2bde9dba18e0b97 to your computer and use it in GitHub Desktop.
typedef IntList = List<int>;
List<int> i1=[1,2,3]; // normal way.
IntList i2 = [1, 2, 3]; // Same thing but shorter and clearer.
//type alias can have type parameters
typedef ListMapper<X> = Map<X, List<X>>;
Map<String, List<String>> m1 = {}; // normal way.
ListMapper<String> m2 = {}; // Same thing but shorter and clearer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment