prompter_ck 0.0.1 copy "prompter_ck: ^0.0.1" to clipboard
prompter_ck: ^0.0.1 copied to clipboard

Library to create CLI wizards - Stephen Grider's Flutter course

example/main.dart

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);
}
0
likes
25
pub points
0%
popularity

Publisher

unverified uploader

Library to create CLI wizards - Stephen Grider's Flutter course

Homepage

License

unknown (LICENSE)

More

Packages that depend on prompter_ck