2020-05-16 11:41:11 +00:00
|
|
|
import 'package:comunic/enums/likes_type.dart';
|
2019-06-10 12:24:34 +00:00
|
|
|
import 'package:comunic/enums/user_page_visibility.dart';
|
2020-04-28 16:47:47 +00:00
|
|
|
import 'package:comunic/lists/custom_emojies_list.dart';
|
2020-05-16 11:41:11 +00:00
|
|
|
import 'package:comunic/models/like_element.dart';
|
2019-06-10 12:24:34 +00:00
|
|
|
import 'package:comunic/models/user.dart';
|
|
|
|
|
|
|
|
/// Advanced user information
|
|
|
|
///
|
|
|
|
/// @author Pierre HUBERT
|
|
|
|
|
2020-05-16 11:41:11 +00:00
|
|
|
class AdvancedUserInfo extends User implements LikeElement {
|
2022-03-10 18:39:57 +00:00
|
|
|
final String? emailAddress;
|
|
|
|
final String publicNote;
|
|
|
|
final bool canPostTexts;
|
|
|
|
final bool isFriendsListPublic;
|
|
|
|
final int numberFriends;
|
|
|
|
final int accountCreationTime;
|
|
|
|
final String personalWebsite;
|
|
|
|
final String? location;
|
|
|
|
bool userLike;
|
|
|
|
int likes;
|
2019-06-10 12:24:34 +00:00
|
|
|
|
2020-05-16 11:41:11 +00:00
|
|
|
AdvancedUserInfo({
|
2022-03-10 18:39:57 +00:00
|
|
|
required int id,
|
|
|
|
required String firstName,
|
|
|
|
required String lastName,
|
|
|
|
required UserPageVisibility pageVisibility,
|
|
|
|
required String? virtualDirectory,
|
|
|
|
required String accountImageURL,
|
|
|
|
required CustomEmojiesList customEmojies,
|
|
|
|
required this.emailAddress,
|
|
|
|
required this.publicNote,
|
|
|
|
required this.canPostTexts,
|
|
|
|
required this.isFriendsListPublic,
|
|
|
|
required this.numberFriends,
|
|
|
|
required this.accountCreationTime,
|
|
|
|
required this.personalWebsite,
|
|
|
|
required this.location,
|
|
|
|
required this.userLike,
|
|
|
|
required this.likes,
|
2022-03-10 19:36:55 +00:00
|
|
|
}) : super(
|
2019-06-10 12:24:34 +00:00
|
|
|
id: id,
|
|
|
|
firstName: firstName,
|
|
|
|
lastName: lastName,
|
|
|
|
pageVisibility: pageVisibility,
|
|
|
|
virtualDirectory: virtualDirectory,
|
2020-04-28 16:47:47 +00:00
|
|
|
accountImageURL: accountImageURL,
|
|
|
|
customEmojies: customEmojies);
|
2020-05-16 11:41:11 +00:00
|
|
|
|
2020-05-17 12:26:52 +00:00
|
|
|
bool get hasPublicNote => publicNote.isNotEmpty;
|
|
|
|
|
2020-05-17 12:53:26 +00:00
|
|
|
bool get hasPersonalWebsite => personalWebsite.isNotEmpty;
|
|
|
|
|
2022-03-10 18:39:57 +00:00
|
|
|
bool get hasEmailAddress => emailAddress != null && emailAddress!.isNotEmpty;
|
2021-04-26 07:33:54 +00:00
|
|
|
|
2022-03-10 18:39:57 +00:00
|
|
|
bool get hasLocation => location != null && location!.isNotEmpty;
|
2021-04-26 07:33:54 +00:00
|
|
|
|
2020-05-16 11:41:11 +00:00
|
|
|
@override
|
|
|
|
LikesType get likeType => LikesType.USER;
|
2019-06-10 12:24:34 +00:00
|
|
|
}
|