1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-29 16:26:27 +00:00
comunicmobile/lib/models/advanced_user_info.dart

62 lines
1.9 KiB
Dart

import 'package:comunic/enums/likes_type.dart';
import 'package:comunic/enums/user_page_visibility.dart';
import 'package:comunic/lists/custom_emojies_list.dart';
import 'package:comunic/models/like_element.dart';
import 'package:comunic/models/user.dart';
import 'package:meta/meta.dart';
/// Advanced user information
///
/// @author Pierre HUBERT
class AdvancedUserInfo extends User implements LikeElement {
final String publicNote;
final bool canPostTexts;
final bool isFriendsListPublic;
final int numberFriends;
final int accountCreationTime;
final String personalWebsite;
bool userLike;
int likes;
AdvancedUserInfo({
@required int id,
@required String firstName,
@required String lastName,
@required UserPageVisibility pageVisibility,
@required String virtualDirectory,
@required String accountImageURL,
@required CustomEmojiesList customEmojies,
@required this.publicNote,
@required this.canPostTexts,
@required this.isFriendsListPublic,
@required this.numberFriends,
@required this.accountCreationTime,
@required this.personalWebsite,
@required this.userLike,
@required this.likes,
}) : assert(publicNote != null),
assert(canPostTexts != null),
assert(isFriendsListPublic != null),
assert(numberFriends != null),
assert(accountCreationTime != null),
assert(personalWebsite != null),
assert(userLike != null),
assert(likes != null),
super(
id: id,
firstName: firstName,
lastName: lastName,
pageVisibility: pageVisibility,
virtualDirectory: virtualDirectory,
accountImageURL: accountImageURL,
customEmojies: customEmojies);
bool get hasPublicNote => publicNote.isNotEmpty;
bool get hasPersonalWebsite => personalWebsite.isNotEmpty;
@override
LikesType get likeType => LikesType.USER;
}