Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dart declare multiple variables on one line

Tags:

flutter

dart

I want to declare multiple variables on one line in Dart. I tried:

var a = 1, var b = 2;

but my IDE said it expected a ; where the comma was so I guess that's a no go. Of course if I do use a semi colon like this:

var a = 1; var b = 2;

My IDE will format them like this instead:

var a = 1;
var b = 2;

How can I make them all on one line?

like image 433
Hasen Avatar asked Aug 06 '19 05:08

Hasen


1 Answers

var a = 1, b = 2, c = {}, d = [];
like image 109
BIS Tech Avatar answered Oct 17 '22 19:10

BIS Tech