prompter_ck 0.0.1 prompter_ck: ^0.0.1 copied to clipboard
Library to create CLI wizards - Stephen Grider's Flutter course
import 'package:prompter_ck/prompter_ck.dart';
void main() {
//create instance of terminal.dart Terminal class
//var terminal = new Terminal();
//terminal.clearScreen();
// terminal.printPrompt('Hello BunnyBearboo');
// var input = terminal.collectInput();
// print('you just entered: $input');
final options = [
new Option('I want red', '#f00'),
new Option('I want blue', '#00f'),
];
// no longer needed this is in prompter.dart
// terminal.printOptions(options);
// var response = terminal.collectInput();
// print('you just entered: $response');
// final prompter = new Prompter();
// prompter.ask('What colour do you want', options);
//how are we using terminal.dart code without importing it?
//because its in prompter.dart which is imported above.
// if you dont' want to make all fuctions in prompter.dart available make them private
//terminal is now private - see prompter.dart so cannot be used here
//terminal.printOptions(options);
final prompter = new Prompter();
// final usersPick = prompter.askMultiple('What colour do you like?', options);
// print(usersPick);
//print(prompter.askBinary('Do you like dart'));
String colourCode = prompter.askMultiple('Select a colour', options);
bool answer = prompter.askBinary('Do you like this lib?');
print(colourCode);
print(answer);
}