Created
November 26, 2020 19:10
-
-
Save internetova/fe8b8fd9481b2c97d6e5a43c3ad191fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Future | |
Напишите функцию, которая считывает данные с клавиатуры. Функция должна возвращать Future<String>. | |
Напишите код, который дожидается выполнения функции и распечатывает на консоль "Введена строка stroke_name". | |
Поэкспериментируйте с async/await и listen | |
*/ | |
import 'dart:io'; | |
Future<void> main() async { | |
print(await printInput()); | |
} | |
Future<String> printInput() async { | |
print('Ожидаем ввод данных ...'); | |
final input = await stdin.readLineSync(); | |
return 'Введена строка: $input'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment