boolConverter top-level constant Null safety

Converter<bool> const boolConverter

Converter to convert input to bools.

This checks two lists of truthy/falsy values, listed below:

  • Truthy: ['y', 'yes', '+', '1', 'true']
  • Falsy: ['n', 'no', '-', '0', 'false']

This converter is case insensitive.

Implementation

const Converter<bool> boolConverter = Converter<bool>(
  convertBool,
  type: CommandOptionType.boolean,
);