build method

  1. @override
bool build()

Implementation

@override
bool build () {
  stdout.writeln('${theme.inputPrefix} $sentence ${theme.booleanPrefix}');

  final lines = stdin.readLineSync();
  if (lines!.isEmpty) {
    _submit(false);
    return false;
  }

  if (!yes.contains(lines) && !no.contains(lines)) {
    throw Exception(error);
  }

  final value = yes.contains(lines) ? true : false;
  _submit(value);
  return value;
}