10 Commits

Author SHA1 Message Date
openapphub
f0da2a3397
doc: update docs/dart.md (#814)
### Current behavior
The current asynchronous login sample code has the following issues:
1. The `main` function tries to use `await userName()`, but `userName` is a string variable, not a function.
2. the `login` function should be called and `await` should be used to wait for its result.
### Expected behavior
The `main` function should correctly call the `login` function and use `await` to wait for the result, then print out the username.
### Sample code
Here is the corrected code:
```dart
Future<String> login() {
String userName = "Temidjoy";
return Future.delayed(
Duration(seconds: 4), () => userName
).
}
main() async {
print('Authenticating please wait...') The
String result = await login();
String result = await login(); print(result);
}
2024-08-15 09:09:47 +08:00
Apin
d7ea92c019
doc: update dart.md (#806)
* doc: update dart.md

* doc: update dart.md

完善 import 部分内容

* doc: update dart.md

修正翻译错误,将 “地图” 修改为 “映射”
2024-07-25 00:03:03 +08:00
Amos
a45e63a966
doc: update dart.md (#801) 2024-07-15 18:15:09 +08:00
jaywcjlove
4b22796c36 doc: update docs/dart.md 2024-06-25 23:22:03 +08:00
jaywcjlove
eb01adb655 doc: update docs/dart.md 2024-06-25 23:22:03 +08:00
萌新杰少
77b4802177
doc: update docs/dart.md (#516)
* 新增Kotlin的高阶函数用法

* 新增和调整若干Kotlin示例代码
[新增] 扩展函数
[新增] 运算符重载
[新增] 中缀表达式
[新增] 次构造函数
[新增] Data 数据类
[新增] 内部类
[新增] object 单例类
[修改] 主构造函数示范代码,调整了部分缩进和变量定义。

* 新增Dart部分示例代码
[新增] 扩展函数
[新增] 运算符重载函数
[新增] 延迟初始化
2024-02-12 22:21:24 +08:00
Jefferson
e4444148f1
docs: update dart.md (#147) 2022-11-19 22:22:55 +08:00
jaywcjlove
b67c2ed842 doc: update dart.md #145 2022-11-19 20:24:36 +08:00
Jefferson
3e1fd804db
docs: update dart.md (#145)
* doc: update dart.md

* doc: update dart.md
2022-11-19 20:10:13 +08:00
jaywcjlove
7dab4bc821 feat: add dart.md #58 2022-11-13 16:19:51 +08:00