getSelectableRationale abstract method

String? getSelectableRationale(
  1. T item, [
  2. bool isSelectable = false
])

Returns a string describing why item on why isSelectable.

This may be used in the UI to for example, show a tooltip explaining that the current user lacks privileges to select an item: @override String getSelectableRationale(T item, bool isSelectable = false) { if (!isSelectable && (item as FooItem).lacksPrivileges) { return 'You lack privileges to select this item.'; } }

Or to explain why you are able to access certain items: @override String getSelectableRationale(T item, bool isSelectable = false) { if (isSelectable && CURRENT_USER.isManager) { return 'As a manager, you may select this option.'; } }

Implementation

String? getSelectableRationale(T item, [bool isSelectable = false]);