Sometimes, in code, we need to write check expressions to see when an object is null. This gives us a lot boilerplate code. With null-aware operators, we can reduce the amount of code to work with, using references that are potentially null.
- View Offline
- [Narrator] Welcome to the video on null-aware operators.…In the previous video,…we looked at formal and optional parameters.…That helps us in defining constructors and methods.…In this video, we are going to take a look…at null-aware operators.…With null-aware operators,…we can reduce the amount of code…to work with references that are potentially null.…We will see how to use these operators…on assigning values…and by calling methods of potential null objects.…
Null operators will help you in dealing with null objects.…First statement here on the slide…will look at the object…and use the object when it is not null.…Otherwise, the string will be used.…Second statement will assign the value of the string…only when the value is null.…Otherwise, it will keep its original value.…Third statement will try to access the property…of the object only when it is not null.…In the last statement,…the method will be executed…only when the method is not null.…
This will save you some boilerplate code…writing null checks with if-else causes.…
Dart is a new open-source programming language for the web. It is a single language for both client and server that can be used to build large-scale web, server, and mobile applications. Stop solving new challenges with the same old tools—let Dart show you a whole new way! In this course, author Joris Hermans guides you into the wonderful world of web development with the dartlang programming language. By following along, you get a more mature sense of how to build a great application and see all the facets needed to reach that goal.
Learn the important language features of Dart, along with some advanced features such as mixins and null-aware operators. Later on, see how to use unit tests, work with browser APIs, and set up of a web server. Finally, take a look at Angular 2, a great front-end framework also built by Google.
This course provides you with everything you need to know to start or enhance your career in web development with Dart.
- Installing Dart
- Creating a basic web application with Dart
- Creating DOM interactions
- Creating classes and objects
- Implementing a library
- Using parameters, null-aware operators, and mixins
- Testing your code
- Setting up APIs
- Using Dart localStorage
- Working with AngularJS
- Troubleshooting Dart applications