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

61 lines
1.8 KiB
Dart
Raw Normal View History

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 {
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({
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;
bool get hasEmailAddress => emailAddress != null && emailAddress!.isNotEmpty;
2021-04-26 07:33:54 +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
}