Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 472 Bytes

CSharp_to_Dart_quick_reference.md

File metadata and controls

31 lines (20 loc) · 472 Bytes

C# to Dart (quick reference)


Nulls

Everything is null in Dart

To check if something is null, we can use something like

if (myVariable != null) {
  // ...
}

If our variable is null, we can assign a default value too

myVariable = myVariable ?? 0;

And we can get the null value avoiding an error using ?

var myVariable = null;
print(myVariable?.toString());