Dart (programming language): Difference between revisions

Content deleted Content added
m Added a loop example
fixed formatting issues caused by previous revision
Line 275:
print(distance);
}
</syntaxhighlight>
 
}A simple [[for-loop]]:<ref>{{Cite web | title=Loops in Dart {{!}} Fluter World {{!}} Dart and Flutter Tutorials | url=https://www.flutterworld.tech/tutorials/dart-tutorials/dart-basics/loops-in-dart/#for-loop]}}</ref>
Example of simple loop:
 
<ref>void main() {
<syntaxhighlight lang="dart">
for (var i = 1; i <= 10; i++) {
<ref>void main() {
print(i);
for (var i = 1; i <= 10; i++) {
}
print(i);
}[https://www.flutterworld.tech/tutorials/dart-tutorials/dart-basics/loops-in-dart/#for-loop]</ref>
}
}
</syntaxhighlight>