Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Your First Dart Application | First Acquaintance with Dart
Introduction to Dart

bookYour First Dart Application

Consider the most straightforward program on Dart.

main.dart

main.dart

copy
123
void main() { print('Hello, World!'); }

As you can see, this program prints the phrase Hello, world!.

  1. Every program needs the main() function, from which code execution begins. The void is a type of function. We will talk about types of functions in the future;

  2. Dart code is written in the function's body, that is, in curly braces {}. The space in the curly brackets {} is the function's body, in which we will write all the commands that will work in this function;

  3. Look at the semicolon ;. After each line of code, we put a semicolon. Otherwise, the development environment will report an error to us. Such line separation is necessary so that the dart interpreter knows where one instruction ends and where another begins.

question mark

What is the role of the main() function in a Dart application?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 2

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain more about the `main()` function in Dart?

What other types of functions are there in Dart?

Why is the semicolon important in Dart syntax?

Awesome!

Completion rate improved to 4.55

bookYour First Dart Application

Deslize para mostrar o menu

Consider the most straightforward program on Dart.

main.dart

main.dart

copy
123
void main() { print('Hello, World!'); }

As you can see, this program prints the phrase Hello, world!.

  1. Every program needs the main() function, from which code execution begins. The void is a type of function. We will talk about types of functions in the future;

  2. Dart code is written in the function's body, that is, in curly braces {}. The space in the curly brackets {} is the function's body, in which we will write all the commands that will work in this function;

  3. Look at the semicolon ;. After each line of code, we put a semicolon. Otherwise, the development environment will report an error to us. Such line separation is necessary so that the dart interpreter knows where one instruction ends and where another begins.

question mark

What is the role of the main() function in a Dart application?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 2
some-alt