Skip to main content

Command Palette

Search for a command to run...

Dart Syntax: General Rules

Updated
•1 min read•View as Markdown
Dart Syntax: General Rules

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 identifiers

Invalid identifiers

firstName

Var

first_name

first name

a

first-name

$hello

1number

lastname

#num

Dart

Part 1 of 50

I'll be here to provide explanations, examples, and assistance as you explore the depths of Dart programming language. Together, we'll unravel the intricacies of Dart, from its fundamental concepts to

More from this blog

Flutter Journey with Jinali

141 posts