How To Add Single Line Multiple Line Comments In Flutter Dart

admin_img Posted By Bajarangi soft , Posted On 05-11-2020

Comments are the way to explain code using simple text which cannot be readable by programming language compiler. We have seen comments in many programming languages and used by millions of programmers to make programming easier for himself and other programmers.

How To Add Single Line Multiple Line Comments In Flutter Dart

Single Line Multiple Line Comments
1. Using Double Forword Slash(//):
  -
The First method to add comment in flutter Dart is commenting single line only. so to make single line as comment we would use Double forward slash at the beginning of that particular line.
Example: 


  // This is Single Line Comment.
  // double number = 12345 ;

  var hello = 'hello world' ; 


2. Using Forward Sign with Asterisk Sign ( /* * / ) :-
 - 
This is another method to add comments in dart flutter. Using forward slash and Asterisk sign we can comment multiple lines together in flutter dart. In below code the complete Container widget along with Raised Button widget will be written as comment.


Example: 

          /*  Container(
              child: RaisedButton(
              onPressed: () => callStaticMember(),
              child: Text(' Click Here To Call Static Variable '),
              textColor: Colors.white,
              color: Colors.red,
            )
          ), */

Related Post