FriendRequestItem constructor

FriendRequestItem({
  1. required String requestId,
  2. required String name,
  3. Widget? avatar,
  4. String? subtitle,
  5. int mutualFriendsCount = 0,
})

Implementation

FriendRequestItem({
  required this.requestId,
  required this.name,
  this.avatar,
  this.subtitle,
  this.mutualFriendsCount = 0,
}) {
  if (requestId.trim().isEmpty) {
    throw ArgumentError.value(requestId, 'requestId', 'must not be blank');
  }
  if (name.trim().isEmpty) {
    throw ArgumentError.value(name, 'name', 'must not be blank');
  }
  if (mutualFriendsCount < 0) {
    throw ArgumentError.value(
      mutualFriendsCount,
      'mutualFriendsCount',
      'must be >= 0',
    );
  }
}