Understanding the difference between deep and shallow copying

Photo by Kelly Sikkema

When you create a collection in Dart, the contents of the collection are mutable. You can see that in the following example:

final myList = ['sheep', 'cow'];
myList.add('horse'); // [sheep, cow, horse]
myList.remove('cow'); // [sheep, horse]
myList[0] = 'goat'; // [goat, horse]

Navigating null safety with no implicit casts or implicit dynamic types

Switching to Dart 2.12 with sound null safety was overall pretty painless…except for one thing: All my JSON to object conversions broke, and it was super difficult to figure out how to make the errors go away.

In this…

Suragch

Flutter and Dart developer. Twitter: @suragch1

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store