Skip to main content

Command Palette

Search for a command to run...

Dart : Null

Updated
1 min read
Dart : Null
V

"Hello World, I'm Vinit Mepani, a coding virtuoso driven by passion, fueled by curiosity, and always poised to conquer challenges. Picture me as a digital explorer, navigating through the vast realms of code, forever in pursuit of innovation.

In the enchanting kingdom of algorithms and syntax, I wield my keyboard as a magical wand, casting spells of logic and crafting solutions to digital enigmas. With each line of code, I embark on an odyssey of learning, embracing the ever-evolving landscape of technology.

Eager to decode the secrets of the programming universe, I see challenges not as obstacles but as thrilling quests, opportunities to push boundaries and uncover new dimensions in the realm of possibilities.

In this symphony of zeros and ones, I am Vinit Mepani, a coder by passion, an adventurer in the digital wilderness, and a seeker of knowledge in the enchanting world of code. Join me on this quest, and let's create digital wonders together!"

  • Dart provide many unique function compare to other language , therefore dart is popular language among the developer.

  • One of the unique function of dart in Unsafety, which means dart also support the Null value in variable.

  • Null safety make code safer and run faster.

  • in null safety we use two symbol " ? ! " .

  • Where " ? " indicate that we can assign the variable to null.

  • Here, I am providing the example of Null safety.

        void main()
      {
       int? x;
       print(x); // null
      }
    
      void main()
      {
       int? x;
       print(x);
       int y =x!;
      }
    
    • In this we get the error like " Null check operator used on a null value " due to here x is nullable type where is notnullable type but we force to run this program by putting " ! ".

Learn Dart

Part 1 of 50

Dive into the Dart Language Series for an easy grasp of Dart programming essentials.

More from this blog

Vinit Mepani (Flutter Developer)

270 posts

"Vinit Mepani, passionate coder! Dive into my Dart and Flutter journey on the blog. Let's master these tech wonders together. Happy coding! 🚀"