jaywcjlove 6a18428838 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);
} f0da2a3397
2024-08-15 01:10:54 +00:00
2024-08-15 01:10:54 +00:00
2024-08-15 01:10:54 +00:00
2024-08-15 01:10:54 +00:00
2024-08-15 01:10:54 +00:00
2023-11-26 12:05:35 +00:00

Website: https://jaywcjlove.github.io/reference

Docker

Buy me a coffee Docker Image Version (latest by date) Docker Image Size (latest by date) Docker Pulls

轻松通过 docker 部署 Quick Reference 网站。

docker pull wcjiang/reference
docker run --name reference --rm -d -p 9667:3000 wcjiang/reference:latest
# Or
docker run --name reference -itd -p 9667:3000 wcjiang/reference:latest

在浏览器中访问以下 URL

http://localhost:9667/
Description
为开发人员分享快速参考备忘清单(速查表)
Readme MIT 492 MiB
Languages
md 99.9%