FLUTTER : DART CHEAT SHEET- Write Smart Code

Pranav Tk
Innovation Incubator
2 min readJun 20, 2020

While writing a long code for some functionality, you know that there will be an easier way to do it.

You might find a few of that in this post or maybe a hint.

This is just the icing, there are many of these functionality pre-built for you.

1. Cascades

Normal Way:

Smart Way:

2. Null -aware operator

Normal Way:

Smart Way:

3. Ternary Operator

Normal Way:

Smart Way:

4. Null -aware operator

Normal Way:

Smart Way:

5. Assert Statement

Normal Way:

Smart Way:

6. Index in List

Normal Way:

Smart Way:

7. Getters

Normal Way:

Smart Way:

8. Exceptions

Smart Way:

--

--