generate method

  1. @override
Widget generate(
  1. Context context
)
override

Implementation

@override
Widget generate(Context context) {
  if (context.version < 19.4) {
    throw "Damage requires at least version 19.4";
  }

  return CommandBuilder('damage $target $amount')
      .string(damageType)
      .when(
        location != null,
        then: 'at $location',
        otherwise: by != null ? 'by $by' : null,
      )
      .string(cause?.toString(), prefix: 'from ');
}