40723212 spring 協同產品設計實習

  • Home
    • Site Map
    • reveal
    • blog
  • weeks
    • week1-5
    • week6-10
    • week11-18
  • notes
    • Dart
      • object orientend  programming(OOP)
      • overview
      • environment
      • Data types
    • Class
  • About
environment << Previous Next >> Class

Data types

The Dart language supports the following types-

  • Numbers
  • Strings
  • Booleans
  • Lists
  • Maps

Numbers

Numbers in Dart can be divided in two ways.

  • Interger - Intergers values represent non fractional values.
  • Double - Dart also supports fractional numeric. The Double data type in Dart represents a 64-bit(double - precision) floating-point number.

String 

Strings represent a sequence of characters. A Dart string is a sequence of UTF-16 code units. Runes are used to represent a sequence of UTF-32 code units.

The keyword String is used to represent string literals. String values are embedded in either single or double quotes.

Boolean 

In dart Boolean values are data types that represents ture and false.

Lists and Maps

The data types list and map are used to represent a collection of objects. A List is an ordered group of objects. The List data type in Dart is synonymous to the concept of an array in other programming languages. The Map data type represents a set of values as key-value pairs. The dart: core library enables creation and manipulation of these collections through the predefined List and Map classes respectively.

Dynamic

If the type of a variable is not explicitly specified, the variable’s type is dynamic. The dynamic keyword can also be used as a type annotation explicitly.


environment << Previous Next >> Class

Copyright © All rights reserved | This template is made with by Colorlib