Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Data Types in Dart | Variables and Data Types in Dart
Introduction to Dart

bookData Types in Dart

Dart supports different data types for different tasks. Like in life, we use words to communicate and numbers to calculate. Dart allows us to use numbers for mathematical operations:

main.dart

main.dart

copy
123
void main() { print(22 + 33); }

In Dart, you can join strings:

main.dart

main.dart

copy
123
void main() { print("Name " + "Alex"); }

You can use the bool data type to print whether a statement is true or false:

main.dart

main.dart

copy
1234
void main() { print(true); print(false); }

For example, you can perform mathematical operations between int and double because both are numbers.

Note
Note

Both int and double represent numbers. Use int for whole values like counts or years, and double for values with decimals such as prices or measurements.

However, you cannot add a String to an int or double because a String is simply a sequence of characters.

main.dart

main.dart

copy
123
void main() { print("String example " + 44); }
question mark

Find the line of code with the error.

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 1

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 how to use each data type in Dart?

What happens if I try to add a String and an int in Dart?

Can you give examples of joining strings in Dart?

Awesome!

Completion rate improved to 4.55

bookData Types in Dart

Deslize para mostrar o menu

Dart supports different data types for different tasks. Like in life, we use words to communicate and numbers to calculate. Dart allows us to use numbers for mathematical operations:

main.dart

main.dart

copy
123
void main() { print(22 + 33); }

In Dart, you can join strings:

main.dart

main.dart

copy
123
void main() { print("Name " + "Alex"); }

You can use the bool data type to print whether a statement is true or false:

main.dart

main.dart

copy
1234
void main() { print(true); print(false); }

For example, you can perform mathematical operations between int and double because both are numbers.

Note
Note

Both int and double represent numbers. Use int for whole values like counts or years, and double for values with decimals such as prices or measurements.

However, you cannot add a String to an int or double because a String is simply a sequence of characters.

main.dart

main.dart

copy
123
void main() { print("String example " + 44); }
question mark

Find the line of code with the error.

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

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