Skip to content

Instantly share code, notes, and snippets.

@redbrogdon
Created August 1, 2018 17:29
Show Gist options
  • Select an option

  • Save redbrogdon/0269fdad2cdba23ec3761433bf8f7f02 to your computer and use it in GitHub Desktop.

Select an option

Save redbrogdon/0269fdad2cdba23ec3761433bf8f7f02 to your computer and use it in GitHub Desktop.
final dynamicListOfInts = json.decode(aJsonArrayOfInts);
// Create a strongly typed list with references to the data that are casted
// immediately. This is probably the better approach for data model classes.
final strongListOfInts = List<int>.from(dynamicListOfInts);
// Or create a strongly typed list with references that will be lazy-casted
// when used.
final anotherStrongListOfInts = List<int>.from(dynamicListOfInts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment