string method

CommandBuilder string(
  1. String? str, {
  2. List<String>? also,
  3. String? prefix,
  4. String? suffix,
})

Implementation

CommandBuilder string(
  String? str, {
  List<String>? also,
  String? prefix,
  String? suffix,
}) {
  if (str == null || str.isEmpty) return this;

  if (prefix != null) str = prefix + str;
  if (suffix != null) str = suffix + str;
  if (also != null && also.isNotEmpty) str += ' ${also.join(' ')}';

  return copyWith(command: '$command $str');
}