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 result = context.get<Map<String, Object?>>();
final unassigned = result['unassigned'];
final names = unassigned is List<String>
? unassigned
: unassigned is List
? [for (final name in unassigned) '$name']
: const <String>[];
final unassignAllRoles = result['unassignAllRoles'] == true;
if (names.isEmpty) {
return InfoTextWidget(
unassignAllRoles
? 'The user has no access roles to revoke on the project.'
: 'The user does not have any of the specified project roles.',
);
}
return SuccessTextWidget(
unassignAllRoles
? 'Revoked all access roles of the user from the project: ${names.join(', ')}'
: 'Revoked access roles of the user from the project: ${names.join(', ')}',
newParagraph: true,
);
}