generate method
Implementation
@override
Widget generate(Context context) {
String getMode() {
if (mode == null) return '';
if (mode == ScheduleMode.append) return ' append';
return ' replace';
}
final time = ticks.toString(reduce: context.version > 19.4);
if (_file != null) {
return Group(
prefix: 'schedule',
children: [_file!],
suffix: ' $time${getMode()}',
);
}
if (mode == ScheduleMode.clear) {
return Command('schedule clear ${context.packId}:$_name');
}
return Command(
'schedule function ${context.packId}:$_name $time${getMode()}',
);
}