-
+
*
==
[]
${}
查看全部 -
```dart
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2019-01-01
*
* @description
* @augments
* @example
*
*/
void main() {
String single_quote = 'signle quote string';
print("single_quote = ${single_quote}");
String double_quote = "double quote string";
print("double_quote = ${double_quote}");
String signle_multi_lines = '''
signle
multi lines
multi lines string
''';
print("signle_multi_lines = ${signle_multi_lines}");
String double_multi_lines = """
double
multi lines
multi lines string
""";
print("double_multi_lines = ${double_multi_lines}");
String backslash_n = "string line1\nstring line2\nstring line3";
print("backslash_n = ${backslash_n}");
String raw_string = r"string line1\nstring line2\nstring line3";
print("raw_string = ${raw_string}");
}
```
查看全部 -
```dart
dynamic even = 2;
dynamic odd = 3;
print("\neven = ${even.isEven}");
print("odd = ${odd.isOdd}");
// double: static const double nan = 0.0 / 0.0;
// dynamic nan = 0 / 0;
dynamic nan = 0.0 / 0.0;
print("nan = ${nan.isNaN}");
```
查看全部 -
属性: isNaN, isEven, isOdd
even 偶数
odd 奇数
方法: abs(), round(), floor(), ceil(), toInt(), toDouble()
查看全部 -
~/ 取整
% 取余
/ 除
+
-
* 乘
查看全部 -
// Number / num
int
double
// Boolean
bool
String
// Dart 字符串是 UTF-16 编码的字符序列。可以使用单引号或者双引号来创建字符串
List
Map
Set
Runes
Symbols
查看全部 -
踩个点!!
查看全部 -
Dart 数据类型
查看全部 -
```dart
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2019-01-01
*
* @description
* @augments
* @example
*
*/
void main() {
// main() {
print("Hello Dart! ?");
// do something...
// return void;
}
```
查看全部 -
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2019-01-01
*
* @description
* @augments
* @example
*
*/
void main() {
final name = "xgqfrms";
print("final name ${name}");
/*
name = "dart";
// Error: Can't assign to the final variable 'name'.
print("new final name ${name}");
*/
/*
final year;
// Error: The final variable ';' must be initialized.
year = 2018;
print("final year ${year}");
*/
// return null;
}
查看全部 -
查看全部
-
VS Code
查看全部 -
```sh
$ brew tap dart-lang/dart
$ brew install dart
```
https://dart.dev/get-dart
查看全部 -
2018.08 Dart 1.x Dart VM version: 2.8.4 (stable) (Wed Jun 3 12:26:04 2020 +0200) on "macos_x64" Flutter
查看全部 -
1、Google发布的开源语言
2、最初是为了代替web语言
3、现在可以支持web开发、脚本开发、全平台开发,flutter开发
4、是一门面向对象语言查看全部
举报