flutter中dart的基础语法

Number

  • int 整形
int score = 23;
 print(score);
  • double 浮点型
  double test = 1.43434;
  print(test);

Bloolean

bool isValid = true;
print(isValid);

String

  • 转义
String s1 = 'i\'m henry';
  • 拼接
  String myName = 'test';
  print('my name is' + myName);
  • 转类型
  print(100.toString());
  • $变量
  int a = 20;
  int b = 10;
  print("total${a + b}");
发布了96 篇原创文章 · 获赞 15 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_35958891/article/details/103525970