I’ve been using Dart for more than 2 years now and after jumping in and out of Kotlin and some other languages, I realized something, Dart has a ton of syntactic sugar that I use daily without even realizing it — and these features quietly make my life somuch easier.
Whenever I switch to another language, I start to miss these tiny conveniences — from the power of named/unnamed parameters,to null-aware operators, to the spread operator that makes Flutter codebase so clean.
Below are some of my everyday favorites
1. Constructor Shorthand (Initializer Parameters)
Instead of this:
class Person {
String name;
int age;
Person(String name, int age) {
this.name = name;
this.age = age;
}
}
You can simply write:
class Person {
String name;
int age;
Person(this.name, this.age);
}
Clean, readable, and less boilerplate.
2. Arrow Functions (=>)
Verbose version:
int add(int a, int b) {
return a + b;
}
Dart style:
int add(int a, int b) => a + b;
Perfect for short functions and callbacks.
3. Cascade Operator (..)
Allows chaining multiple operations on the same object.
var person = Person()
..name = 'John'
..age = 30
..sayHello();
Equivalent to:
var person = Person();
person.name = 'John';
person.age = 30;
person.sayHello();
This is especially powerful in Flutter widget trees.
4. Null‑Aware Operators
Dart makes null handling expressive and safe:
?.→ Avoids null exceptions??→ Provides a default value??=→ Assigns only if null
String? name;
print(name?.toUpperCase() ?? 'No name');
name ??= 'Guest';
Once you get used to this, it’s hard to go back.
5. Collection if / for (Inside Lists, Sets, Maps)
var isLoggedIn = true;
var menu = [
'Home',
if (isLoggedIn) 'Profile',
for (var i = 1; i <= 3; i++) 'Item $i'
];
This keeps UI code declarative and readable.
6. Named & Optional Parameters
void greet({String name = 'Guest'}) {
print('Hello, $name');
}
greet(); // Hello, Guest
greet(name: 'Dev'); // Hello, Dev
This is a huge win for APIs and Flutter widgets.
7. Spread Operator (... and ...?)
var list1 = [1, 2, 3];
var list2 = [...list1, 4, 5];
var list3 = [...?list1, null]; // handles null safely
Combines beautifully with collection if/for.
8. Getter & Setter Shorthand
class Circle {
double radius;
Circle(this.radius);
double get area => 3.14 * radius * radius;
}
Simple, expressive, and readable.
9. String Interpolation
print('Hello, $name! You are ${age + 1} next year.');
Much cleaner than string concatenation.
Things I Still Miss from Kotlin
Destructuring Declarations
Being able to unpack values directly is extremely convenient.
✅ Powerful when Expressions
Kotlin’s when is more expressive than Dart’s switch:
when (value) {
in 1..10 -> ...
is String -> ...
}
It supports ranges, type checks, and multiple conditions out of the box.
Final Thoughts
Dart may not always get credit for it, but its developer experience is one of the reasons Flutter feels so productive.
These small syntactic sugars add up — and once you’re used to them, you really feel their absence in other languages.
If you’re a Flutter/Dart developer, you probably relate. And if you’re not — give Dart a try 😉
