generate method

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

Implementation

@override
Widget generate(Context context) {
  var command = Command('trigger $objective $_mode');

  if (enableScore != null && _mode == 'enable') {
    command = Command(
        'scoreboard players enable ${enableScore!.entity} ${enableScore!.score}');
  }

  if (addNew) {
    return For.of([Scoreboard.trigger(objective), command]);
  }
  return command;
}