build method
Builds this widget using the output context.
The build method is responsbile for building the tree of widgets below this one. It must never invoke the build or render methods of other widgets.
Implementation
@override
OutputWidget build(final OutputContext context) {
final view = context.get<BackupScheduleView>();
final schedule = view.schedule;
if (schedule == null) {
if (view.planType == PlanType.starter) {
return PlanUpgradeHintWidget(
feature: PlanFeature.databaseBackups,
projectId: view.projectId,
);
}
return OutputWidgetList([
InfoTextWidget(
'No backup schedule is configured for project "${view.projectId}".',
),
CommandHintTextWidget(
'Set a schedule with:',
command:
'$baseCommand db schedule set --project ${view.projectId} '
'--frequency daily',
),
]);
}
return _BackupScheduleTable(
frequency: schedule.frequency,
day: schedule.day,
hour: schedule.hour,
retention: schedule.retention,
);
}