DH
//JS
async function foo() {
return 1
}
//может синхронный вызов, а может и нет
let bar = foo()
console.log(bar)
//Promise { 1 }
//Dart
Future<int> foo() async {
return 1;
}
// Не сработает: A value of type 'Future<int>' can't be assigned to a variable of type 'int'.
//int bar = foo();
//тоже самое, может синхронный, а может и нет
var bar = foo();
print(bar);
//Instance of '_Future<int>'