DEV Community

tkpranav for Innovation Incubator

Posted on • Originally published at Medium on

FLUTTER : DART CHEAT SHEET- Write Smart Code

FLUTTER : DART CHEAT SHEET- Write Smart Code

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:


Sentry blog image

The countdown to March 31 is on.

Make the switch from app center suck less with Sentry.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs