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 baseUrl = getConsoleBaseUrl();
if (exception.message.contains('no valid payment method')) {
final setupUrl = '$baseUrl/project/create';
return TextErrorOutputWidget(
exception,
message: 'You need a payment method!',
hint: 'To set up your account, visit: $setupUrl\n',
newParagraph: true,
);
}
if (exception.reason == ProcurementDeniedReason.productNotAvailable &&
exception.message.toLowerCase().contains('backup')) {
final projectsUrl = '$baseUrl/project';
return TextErrorOutputWidget(
exception,
message: exception.message,
hint:
'Database backups are available on the Growth plan. '
'To upgrade the plan, visit: $projectsUrl\n',
newParagraph: true,
);
}
final projectsUrl = '$baseUrl/project';
return TextErrorOutputWidget(
exception,
message: exception.message,
hint: 'To see your account, visit: $projectsUrl\n',
newParagraph: true,
);
}