1.

What do you mean by Null-aware operators?

Answer»

Null-aware operators in dart allow you to make computations based on whether or not a value is null. Dart provides some useful information to handle the null values.  

  • The "??=" assignment operator: It assigns a value to a variable only if it is null.
int a; // a is initialized with null value. a ??= 10; print(a); // It will print 10.
  • The "??" null-aware operator: This one computes and returns the value between two expressions. In the first step, expression 1 is checked for nullness, and if it is, its value is returned; otherwise, expression 2 is evaluated, and its value is returned.
print(5 ?? 10); // It will print 5. print(null ?? 10); // It will print 10.
  • The “?.” Safe Navigation Operator: It is also known as the Elvis operator. It is possible to USE the ?. operator when calling a method/getter on an object, as long as the object isn't null (otherwise, the method will return null).
obj?.child?.child?.getter //The expression returns null if obj, child1, or child2 are null. If not, the getter is CALLED and returned.Conclusion: 

Flutter is a MOBILE TECHNOLOGY that is among the most innovative and booming in the mobile market as the next revolutionary thing right now. Although it is a relatively new framework for developing cross-platform applications, its popularity is soaring due to which there is an INCREASE in demand for Flutter developers. 



Discussion

No Comment Found