Skip to main content

Command Palette

Search for a command to run...

Dart Syntax: General Rules

Updated
1 min read
Dart Syntax: General Rules
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!"

If we are learn something then first we must aware about there basic rule. So today we discuss some basic rule of the Dart language.

  1. Dart keyword can no be declared as any variable name .

  2. Dart only recognize underscore ( _ ) and Dollar sing ($) in variable name so, you can use use only this two symbol in your variable name , if you use any other special character rather then this two you can face error in your code.

  3. Variable name cannot start from any number it must start from word.

  4. Dart differentiae between lowercase and uppercase so you can use both case to declare different type of variable name.

Here , are some example of Valid and Invalid Variable.

Valid identifiersInvalid identifiers
firstNameVar
first_namefirst name
afirst-name
$hello1number
lastname#num

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! 🚀"