Cascade Operator in Dart

Vijay R
vijaycreations
Published in
3 min readJun 11, 2022

--

In this article we will discuss about cascade operator and how to use them in dart programs.

📚 Summary

Cascades (..) allow you to perform a sequence of operations on the same object.

In other words we can make operations like multiple function call or multiple value assignment sequentially over objects in a single statement.

🔭 Implementation

Consider the following Student class having two attributes (name , id ) and two different methods.

👉 Sample code without cascade operator:

In order to understand cascade operator, let’s first try to access the attributes and methods in this Student class without using cascade operator.

--

--

Vijay R
vijaycreations

Hai👋 I’m a flutter developer experienced in designing and developing stunning mobile apps. Reach out for freelance projects: calico.takeoff_01@icloud.com