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

outdated

Library to create CLI wizards

example/main.dart

import 'package:prompter_mh/prompter_mh.dart';

void main() {
  // Instantiate a prompter instance
  Prompter prompter = Prompter();

  // Generate your list of propmts with emphasis on the prompt type
  var prompts = [
    {
      'prompt': 'What Color Do You Want?',
      'type': 'multiple',
      'options': <Option>[
        Option(label: 'I want red', value: '#f44141'),
        Option(label: 'I want blue', value: '#4158f4'),
        Option(label: 'I want green', value: '#42f47d'),
        Option(label: 'I want yellow', value: '#f4f441'),
      ]
    },
    {
      'prompt': 'Do you like banana?',
      'type': 'binary',
    },
    {
      'prompt': 'What is your name?',
      'type': 'text',
    }
  ];
  
  // Ask the prompter all your questions
  prompts.forEach((prompt) {
    prompter.ask(prompt['prompt'], prompt['type'], prompt['options']);
  });
  

  print(prompter.result());
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Library to create CLI wizards

Homepage

License

unknown (LICENSE)

More

Packages that depend on prompter_mh